/* ==========================================================================
   Chan Structure Workbench
   Dark, restrained terminal aesthetic.  No external font or CSS dependency.
   ========================================================================== */

:root {
  color-scheme: dark;
  --bg: #06090f;
  --bg-soft: #080d15;
  --panel: #0c131e;
  --panel-raised: #101927;
  --panel-deep: #080e17;
  --line: #1a2637;
  --line-soft: rgba(139, 166, 201, 0.11);
  --line-strong: rgba(139, 166, 201, 0.2);
  --text: #e9eff8;
  --text-soft: #bcc9da;
  --muted: #7d8ca2;
  --faint: #526178;
  --gold: #eeb35b;
  --gold-soft: rgba(238, 179, 91, 0.12);
  --gold-line: rgba(238, 179, 91, 0.32);
  --red: #ff6070;
  --red-soft: rgba(255, 96, 112, 0.12);
  --green: #2bd4a1;
  --green-soft: rgba(43, 212, 161, 0.11);
  --blue: #6da8ff;
  --blue-soft: rgba(109, 168, 255, 0.12);
  --cyan: #59c8f5;
  --cyan-soft: rgba(89, 200, 245, 0.11);
  --violet: #b79cff;
  --violet-soft: rgba(183, 156, 255, 0.12);
  --amber: #f5b94f;
  --radius-xl: 18px;
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 8px;
  --sans: "SF Pro Display", "SF Pro Text", -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Code", Menlo, Consolas,
    monospace;
  --shadow-card: 0 20px 50px rgba(0, 0, 0, 0.24), 0 2px 8px rgba(0, 0, 0, 0.2);
  --topbar-h: 76px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(1100px 600px at 8% -10%, rgba(238, 179, 91, 0.055), transparent 64%),
    radial-gradient(1000px 650px at 105% 0%, rgba(70, 125, 214, 0.07), transparent 62%),
    linear-gradient(180deg, #070b12 0%, #06090f 48%, #05080d 100%);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(137, 163, 197, 0.021) 1px, transparent 1px),
    linear-gradient(90deg, rgba(137, 163, 197, 0.021) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.75), transparent 82%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  border: 0;
  cursor: pointer;
  background: none;
}

button:disabled {
  cursor: default;
  opacity: 0.45;
}

::selection {
  color: #0a0e15;
  background: var(--gold);
}

[hidden] {
  display: none !important;
}

svg {
  display: block;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 520px;
  height: 520px;
  pointer-events: none;
  filter: blur(120px);
  opacity: 0.18;
  border-radius: 50%;
}

.ambient-a {
  top: -280px;
  left: 8%;
  background: #b07819;
}

.ambient-b {
  top: 80px;
  right: -260px;
  background: #24518f;
}

.noise {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.17'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

/* --------------------------------------------------------------------------
   Top navigation
   -------------------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(300px, 560px) auto;
  gap: 22px;
  align-items: center;
  height: var(--topbar-h);
  padding: 0 24px;
  border-bottom: 1px solid rgba(139, 166, 201, 0.1);
  background: rgba(6, 10, 16, 0.8);
  backdrop-filter: blur(20px) saturate(1.25);
  -webkit-backdrop-filter: blur(20px) saturate(1.25);
}

.brand {
  display: flex;
  gap: 11px;
  align-items: center;
  min-width: 156px;
  user-select: none;
}

.brand-mark {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  color: #f7d7a1;
  font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  font-size: 25px;
  font-weight: 700;
  border: 1px solid rgba(238, 179, 91, 0.42);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgba(238, 179, 91, 0.2), rgba(238, 179, 91, 0.035)),
    #10141a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 7px 24px rgba(196, 135, 38, 0.12);
}

.brand-mark::after {
  content: "";
  position: absolute;
  right: -13px;
  bottom: -13px;
  width: 27px;
  height: 27px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  color: #f1f5fb;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: 0.07em;
}

.brand-name em {
  margin-left: 3px;
  color: var(--gold);
  font-family: var(--mono);
  font-size: 10.5px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: 0.16em;
  vertical-align: middle;
  opacity: 0.72;
}

.brand-sub {
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.22em;
}

/* Search ------------------------------------------------------------------ */

.search-area {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 560px;
}

.search-field {
  display: flex;
  align-items: center;
  height: 44px;
  padding: 0 6px 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(13, 20, 31, 0.82);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.search-area.is-focused .search-field {
  border-color: rgba(238, 179, 91, 0.48);
  background: rgba(15, 23, 35, 0.96);
  box-shadow: 0 0 0 3px rgba(238, 179, 91, 0.075), inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.search-icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin-right: 9px;
  color: var(--faint);
}

.search-field input {
  min-width: 0;
  flex: 1;
  height: 100%;
  padding: 0;
  color: var(--text);
  font-size: 15px;
  letter-spacing: 0.01em;
  border: 0;
  outline: 0;
  background: transparent;
}

.search-field input::placeholder {
  color: #5c6a7e;
}

.search-kbd {
  flex: 0 0 auto;
  min-width: 19px;
  height: 19px;
  padding: 0 4px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 18px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
  transition: opacity 140ms ease;
}

.search-area.is-focused .search-kbd,
.search-field input:not(:placeholder-shown) ~ .search-kbd {
  opacity: 0;
}

.search-submit {
  flex: 0 0 auto;
  height: 33px;
  margin-left: 8px;
  padding: 0 17px;
  color: #171107;
  font-size: 14.5px;
  font-weight: 650;
  border-radius: 7px;
  background: linear-gradient(180deg, #f4c477, #e5a948);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 4px 12px rgba(187, 127, 31, 0.14);
  transition: filter 140ms ease, transform 140ms ease;
}

.search-submit:hover {
  filter: brightness(1.06);
}

.search-submit:active {
  transform: translateY(1px);
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  z-index: 20;
  overflow: hidden;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(11, 17, 27, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.035);
  backdrop-filter: blur(20px);
  animation: dropdown-in 150ms ease both;
}

@keyframes dropdown-in {
  from { opacity: 0; transform: translateY(-5px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
  border-radius: 7px;
  transition: background 120ms ease;
}

.search-result:hover,
.search-result.is-active {
  background: rgba(238, 179, 91, 0.075);
}

.result-main {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: baseline;
  min-width: 0;
}

.result-name {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-code {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12.5px;
}

.result-type {
  justify-self: end;
  padding: 2px 6px;
  color: var(--muted);
  font-size: 11.5px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.search-message {
  padding: 14px 10px;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

.search-loading {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: center;
  padding: 15px;
  color: var(--muted);
  font-size: 13.5px;
}

.mini-spinner {
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(238, 179, 91, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.top-actions {
  display: flex;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
}

.source-pill {
  display: flex;
  gap: 7px;
  align-items: center;
  height: 32px;
  padding: 0 11px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.018);
}

.dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(43, 212, 161, 0.09);
}

.dot.is-waiting {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 185, 79, 0.09);
  animation: dot-breathe 1.3s ease-in-out infinite;
}

.dot.is-warn {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(245, 185, 79, 0.09);
}

.dot.is-offline {
  background: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 96, 112, 0.09);
}

@keyframes dot-breathe {
  50% { opacity: 0.4; }
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.icon-button svg {
  width: 15px;
  height: 15px;
}

.icon-button:hover {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.045);
}

.icon-button.small {
  width: 30px;
  height: 30px;
  border-color: transparent;
  background: transparent;
}

.icon-button.small:hover {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.icon-button.is-loading svg {
  animation: spin 0.9s linear infinite;
}

/* Quick strip ------------------------------------------------------------- */

.quick-row {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 1800px;
  margin: 0 auto;
  padding: 12px 24px 0;
}

.quick-label {
  display: flex;
  gap: 7px;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 2px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(238, 179, 91, 0.06);
}

.quick-list {
  display: flex;
  gap: 5px;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-list::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color 130ms ease, background 130ms ease, border-color 130ms ease;
}

.quick-chip:hover {
  color: var(--text-soft);
  background: rgba(255, 255, 255, 0.035);
}

.quick-chip.active {
  color: #f2ce94;
  border-color: rgba(238, 179, 91, 0.2);
  background: rgba(238, 179, 91, 0.07);
}

.quick-spacer {
  flex: 1;
}

.local-note {
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
}

.local-dot {
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: #6587b3;
}

.clock {
  min-width: 58px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: right;
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Data notice + layout
   -------------------------------------------------------------------------- */

.data-notice {
  max-width: 1752px;
  margin: 10px auto 0;
  padding: 8px 14px;
  color: #e7c68e;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid rgba(238, 179, 91, 0.18);
  border-radius: 8px;
  background: rgba(238, 179, 91, 0.055);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 16px;
  align-items: start;
  max-width: 1800px;
  margin: 0 auto;
  padding: 13px 24px 8px;
}

.terminal {
  min-width: 0;
}

.chart-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.017), transparent 120px),
    linear-gradient(180deg, #0b131e 0%, #090f18 100%);
  box-shadow: var(--shadow-card);
}

.chart-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 15%;
  left: 15%;
  z-index: 2;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(238, 179, 91, 0.2), transparent);
}

/* Instrument header ------------------------------------------------------- */

.instrument-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1.2fr) minmax(320px, 1.55fr) auto;
  gap: 22px;
  align-items: center;
  padding: 20px 22px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.instrument-primary {
  min-width: 0;
}

.name-row {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.name-row h1 {
  overflow: hidden;
  margin: 0;
  color: #f2f6fc;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: 0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-code {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
}

.type-chip {
  flex: 0 0 auto;
  padding: 2px 5px;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.35;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.price-row {
  display: flex;
  gap: 10px;
  align-items: baseline;
  margin-top: 3px;
  min-width: 0;
}

.last-price {
  color: #f5f8fd;
  font-family: var(--mono);
  font-size: 35px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
}

.change-pill {
  padding: 2px 7px;
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.45;
  white-space: nowrap;
  border-radius: 5px;
  font-variant-numeric: tabular-nums;
}

.change-pill.up {
  color: var(--red);
  background: var(--red-soft);
}

.change-pill.down {
  color: var(--green);
  background: var(--green-soft);
}

.change-pill.neutral {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
}

.quote-time {
  overflow: hidden;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
  gap: 0;
  min-width: 0;
}

.quote-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 0 12px;
  border-left: 1px solid var(--line-soft);
}

.quote-cell span {
  overflow: hidden;
  color: var(--faint);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quote-cell b {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.instrument-side {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  min-width: 88px;
}

.period-eyebrow {
  color: var(--faint);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.13em;
  white-space: nowrap;
}

.trend-badge {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 5px 9px;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 6px;
}

.trend-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.trend-badge.up {
  color: #ff8e99;
  border-color: rgba(255, 96, 112, 0.18);
  background: rgba(255, 96, 112, 0.075);
}

.trend-badge.down {
  color: #65e7bd;
  border-color: rgba(43, 212, 161, 0.18);
  background: rgba(43, 212, 161, 0.07);
}

.trend-badge.side {
  color: #e2bf86;
  border-color: rgba(238, 179, 91, 0.16);
  background: rgba(238, 179, 91, 0.065);
}

/* Chart toolbar ----------------------------------------------------------- */

.chart-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  min-height: 54px;
  padding: 8px 16px 8px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(7, 12, 19, 0.34);
}

.period-tabs {
  display: flex;
  gap: 2px;
  flex: 0 0 auto;
  padding: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(5, 9, 15, 0.46);
}

.period-tabs button {
  position: relative;
  height: 30px;
  padding: 0 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  border-radius: 5px;
  transition: color 140ms ease, background 140ms ease;
}

.period-tabs button:hover {
  color: var(--text-soft);
}

.period-tabs button.active {
  color: #f2d09a;
  background: rgba(238, 179, 91, 0.11);
  box-shadow: inset 0 0 0 1px rgba(238, 179, 91, 0.12);
}

.toolbar-divider {
  width: 1px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--line);
}

.overlay-toggles {
  display: flex;
  gap: 2px;
  align-items: center;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.overlay-toggles::-webkit-scrollbar {
  display: none;
}

.layer-toggle {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  height: 30px;
  flex: 0 0 auto;
  padding: 0 6px;
  color: #65758b;
  font-size: 12px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 5px;
  transition: color 140ms ease, background 140ms ease, border-color 140ms ease;
}

.layer-toggle:hover {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.layer-toggle.active {
  color: var(--text-soft);
  border-color: rgba(139, 166, 201, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.layer-dot {
  width: 5px;
  height: 5px;
  flex: 0 0 auto;
  border: 1px solid currentColor;
  border-radius: 50%;
  opacity: 0.55;
}

.layer-toggle.active .layer-dot {
  opacity: 1;
  background: currentColor;
  box-shadow: 0 0 6px currentColor;
}

.layer-dot.chan { color: var(--gold); }
.layer-dot.signals { color: var(--red); }
.layer-dot.rule123 { color: var(--cyan); }
.layer-dot.rule2b { color: var(--violet); }
.layer-dot.levels { color: var(--blue); }
.layer-dot.volume { color: #8090a7; }
.layer-dot.macd { color: #53c9c2; }

.chart-tools {
  display: flex;
  gap: 1px;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
  padding-left: 4px;
}

/* Chart stage ------------------------------------------------------------- */

.chart-stage {
  position: relative;
  height: clamp(500px, calc(100vh - 330px), 700px);
  overflow: hidden;
  outline: none;
  background:
    radial-gradient(600px 240px at 50% 0%, rgba(47, 74, 112, 0.07), transparent 70%),
    #080d15;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.chart-stage.is-dragging {
  cursor: grabbing;
}

.chart-stage:focus-visible {
  box-shadow: inset 0 0 0 1px rgba(238, 179, 91, 0.38);
}

#chartCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.stage-watermark {
  position: absolute;
  right: 24px;
  bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-end;
  color: rgba(160, 184, 216, 0.045);
  font-family: var(--mono);
  font-size: 44px;
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  pointer-events: none;
}

.chart-float-legend {
  position: absolute;
  top: 12px;
  left: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  color: #5d6c81;
  font-size: 11px;
  letter-spacing: 0.03em;
  pointer-events: none;
}

.chart-float-legend span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.legend-candle {
  display: inline-block;
  width: 4px;
  height: 8px;
  border-radius: 1px;
}

.legend-candle.up { background: var(--red); }
.legend-candle.down { background: var(--green); }

.legend-line {
  display: inline-block;
  width: 10px;
  height: 1px;
  background: currentColor;
}

.legend-line.chan { color: var(--gold); }
.legend-line.chan-down { color: #6ebeff; }
.legend-line.level { color: var(--blue); }

.legend-box {
  display: inline-block;
  width: 8px;
  height: 7px;
  border: 1px solid currentColor;
  border-radius: 1px;
  background: rgba(238, 179, 91, 0.08);
}

.legend-box.chan { color: rgba(255, 205, 122, 0.9); background: rgba(238, 179, 91, 0.14); }

.legend-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.legend-dot.buy { color: var(--red); }
.legend-dot.sell { color: var(--green); }

.legend-marker {
  display: inline-flex;
  min-width: 13px;
  height: 10px;
  padding: 0 2px;
  align-items: center;
  justify-content: center;
  color: currentColor;
  font-family: var(--mono);
  font-size: 8.5px;
  line-height: 1;
  border: 1px solid currentColor;
  border-radius: 2px;
}

.legend-marker.rule123 { color: var(--cyan); }
.legend-marker.rule2b { color: var(--violet); }

/* Overlays ---------------------------------------------------------------- */

.stage-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(7, 11, 18, 0.84);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.loader-rings {
  position: relative;
  width: 44px;
  height: 44px;
  margin-bottom: 9px;
}

.loader-rings span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(238, 179, 91, 0.16);
  border-radius: 50%;
}

.loader-rings span:nth-child(2) {
  inset: 7px;
  border-color: rgba(238, 179, 91, 0.28);
  border-top-color: var(--gold);
  animation: spin 1s linear infinite;
}

.loader-rings span:nth-child(3) {
  inset: 16px;
  border: 0;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(238, 179, 91, 0.45);
  animation: dot-breathe 1.2s ease-in-out infinite;
}

.loading-title {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.loading-sub {
  max-width: 440px;
  color: var(--faint);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

.error-overlay {
  background: rgba(9, 13, 20, 0.93);
}

.error-mark {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 5px;
  place-items: center;
  color: var(--red);
  font-family: var(--mono);
  font-size: 24px;
  border: 1px solid rgba(255, 96, 112, 0.23);
  border-radius: 50%;
  background: var(--red-soft);
}

.solid-button {
  height: 32px;
  margin-top: 8px;
  padding: 0 16px;
  color: #13100a;
  font-size: 13.5px;
  font-weight: 600;
  border-radius: 7px;
  background: linear-gradient(180deg, #f2c476, #dfa646);
}

.solid-button:hover {
  filter: brightness(1.06);
}

.chart-tooltip {
  position: absolute;
  z-index: 9;
  width: 268px;
  padding: 13px 14px;
  pointer-events: none;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(9, 14, 22, 0.965);
  box-shadow: 0 15px 38px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  animation: tooltip-in 80ms ease both;
}

@keyframes tooltip-in {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

.tooltip-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 7px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.tooltip-period {
  color: var(--faint);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.05em;
}

.tooltip-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px 12px;
}

.tooltip-cell {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  min-width: 0;
}

.tooltip-cell span {
  color: var(--faint);
  font-size: 11px;
}

.tooltip-cell b {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.tooltip-cell b.up { color: var(--red); }
.tooltip-cell b.down { color: var(--green); }

.tooltip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
}

.tooltip-tag {
  padding: 2px 5px;
  color: var(--gold);
  font-size: 10.5px;
  border: 1px solid rgba(238, 179, 91, 0.17);
  border-radius: 3px;
  background: rgba(238, 179, 91, 0.055);
}

/* Chart footer ------------------------------------------------------------ */

.chart-footer {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  padding: 9px 18px;
  border-top: 1px solid var(--line-soft);
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  color: var(--faint);
  font-size: 11px;
}

.legend-item {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.chart-source {
  margin-left: auto;
  color: #435167;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.interaction-hint {
  display: flex;
  gap: 9px;
  align-items: center;
  color: #445167;
  font-size: 10.5px;
  white-space: nowrap;
}

.interaction-hint span + span::before {
  content: "·";
  margin-right: 9px;
  color: #2d394c;
}

/* --------------------------------------------------------------------------
   Analysis rail
   -------------------------------------------------------------------------- */

.analysis-rail {
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: calc(100vh - var(--topbar-h) - 20px);
  padding-right: 3px;
  padding-bottom: 10px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #253348 transparent;
}

.analysis-rail::-webkit-scrollbar {
  width: 4px;
}

.analysis-rail::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #253348;
}

.rail-card {
  position: relative;
  flex: 0 0 auto;
  padding: 16px;
  scroll-margin-top: 136px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent 90px),
    rgba(11, 18, 28, 0.88);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.022);
}

.rail-head {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.rail-head.compact {
  align-items: center;
  margin-bottom: 9px;
}

.rail-head > div {
  min-width: 0;
}

.kicker {
  display: block;
  margin-bottom: 3px;
  color: #526179;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.16em;
}

.rail-head h2 {
  display: flex;
  gap: 7px;
  align-items: baseline;
  margin: 0;
  color: #dfe7f2;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.head-period {
  color: var(--gold);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.mini-badge,
.count-pill,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 999px;
}

.mini-badge {
  min-height: 19px;
  padding: 2px 7px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid rgba(238, 179, 91, 0.16);
  background: rgba(238, 179, 91, 0.065);
}

.mini-badge.quiet {
  color: var(--faint);
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.02);
}

.mini-badge.up {
  color: #ff8b97;
  border-color: rgba(255, 96, 112, 0.18);
  background: var(--red-soft);
}

.mini-badge.down {
  color: #5be0b7;
  border-color: rgba(43, 212, 161, 0.18);
  background: var(--green-soft);
}

.mini-badge.cyan {
  color: var(--cyan);
  border-color: rgba(89, 200, 245, 0.17);
  background: var(--cyan-soft);
}

.mini-badge.violet {
  color: var(--violet);
  border-color: rgba(183, 156, 255, 0.17);
  background: var(--violet-soft);
}

.count-pill {
  min-width: 21px;
  height: 20px;
  padding: 0 6px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.022);
}

.tag {
  min-height: 20px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 550;
}

.tag.up {
  color: #ff8b97;
  border: 1px solid rgba(255, 96, 112, 0.18);
  background: var(--red-soft);
}

.tag.down {
  color: #5be0b7;
  border: 1px solid rgba(43, 212, 161, 0.18);
  background: var(--green-soft);
}

.tag.side {
  color: #d8b67f;
  border: 1px solid rgba(238, 179, 91, 0.15);
  background: var(--gold-soft);
}

.rail-note {
  margin: 9px 0 0;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.65;
}

.strong-note {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 12px;
}

/* Multi timeframe --------------------------------------------------------- */

.multi-card {
  background:
    linear-gradient(140deg, rgba(238, 179, 91, 0.028), transparent 55%),
    rgba(11, 18, 28, 0.9);
}

.multi-period {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.multi-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  min-width: 0;
  padding: 8px 9px;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.017);
  transition: border-color 130ms ease, background 130ms ease;
}

.multi-item:hover {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.033);
}

.multi-item.active {
  border-color: rgba(238, 179, 91, 0.23);
  background: rgba(238, 179, 91, 0.055);
}

.multi-period-label {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
}

.multi-trend {
  display: flex;
  gap: 5px;
  align-items: center;
  max-width: 100%;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.multi-trend i {
  width: 4px;
  height: 4px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.multi-trend.up { color: #ff8995; }
.multi-trend.down { color: #56dfb6; }
.multi-trend.side { color: #dcba84; }

.multi-stage {
  max-width: 100%;
  overflow: hidden;
  color: #526179;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.multi-skeleton {
  height: 60px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.015) 30%, rgba(255, 255, 255, 0.045) 50%, rgba(255, 255, 255, 0.015) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.35s ease infinite;
}

@keyframes shimmer {
  to { background-position: -220% 0; }
}

/* Verdict ----------------------------------------------------------------- */

.verdict-card {
  overflow: hidden;
}

.verdict-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 179, 91, 0.35), transparent);
}

.verdict-card.is-down::before {
  background: linear-gradient(90deg, transparent, rgba(43, 212, 161, 0.32), transparent);
}

.verdict-card.is-side::before {
  background: linear-gradient(90deg, transparent, rgba(238, 179, 91, 0.25), transparent);
}

.verdict-hero {
  margin-bottom: 12px;
}

.verdict-title {
  color: #f0f5fc;
  font-size: 19px;
  font-weight: 650;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.verdict-title .accent-up { color: #ff7f8c; }
.verdict-title .accent-down { color: #51ddb2; }
.verdict-title .accent-side { color: #e4bf83; }

.verdict-hero p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.struct-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin-bottom: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--line-soft);
}

.struct-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  padding: 8px 9px;
  background: rgba(10, 17, 26, 0.96);
}

.struct-cell span {
  color: var(--faint);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.struct-cell b {
  overflow: hidden;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.analysis-points {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 10px 0 11px;
  border-top: 1px solid var(--line-soft);
}

.analysis-point {
  position: relative;
  padding-left: 11px;
  color: #8f9eb2;
  font-size: 12px;
  line-height: 1.72;
}

.analysis-point::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 0;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #5d708a;
}

.analysis-point strong {
  color: #c4d0df;
  font-weight: 550;
}

.skeleton-line {
  height: 7px;
  border-radius: 3px;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0.025) 30%, rgba(255, 255, 255, 0.06) 50%, rgba(255, 255, 255, 0.025) 70%);
  background-size: 220% 100%;
  animation: shimmer 1.35s ease infinite;
}

.skeleton-line.wide { width: 92%; }
.skeleton-line.medium { width: 70%; }

.watch-box {
  padding: 9px 10px;
  border: 1px solid rgba(238, 179, 91, 0.11);
  border-radius: 7px;
  background: rgba(238, 179, 91, 0.038);
}

.watch-label {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-bottom: 4px;
  color: #c3a16b;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.eye-icon {
  display: inline-block;
  width: 8px;
  height: 5px;
  border: 1px solid currentColor;
  border-radius: 50% / 60%;
}

.watch-box p {
  margin: 0;
  color: #a6967c;
  font-size: 11.5px;
  line-height: 1.65;
}

/* Buy/sell signals -------------------------------------------------------- */

.signal-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.signal-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  width: 100%;
  padding: 8px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
  transition: background 130ms ease, border-color 130ms ease, transform 130ms ease;
}

.signal-row:hover {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.035);
}

.signal-row:active {
  transform: translateY(1px);
}

.signal-badge {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 7px;
}

.signal-badge.buy {
  color: #ffbdc4;
  border: 1px solid rgba(255, 96, 112, 0.23);
  background: linear-gradient(145deg, rgba(255, 96, 112, 0.2), rgba(255, 96, 112, 0.06));
}

.signal-badge.sell {
  color: #aaf2dc;
  border: 1px solid rgba(43, 212, 161, 0.21);
  background: linear-gradient(145deg, rgba(43, 212, 161, 0.19), rgba(43, 212, 161, 0.05));
}

.signal-main {
  min-width: 0;
}

.signal-title {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.signal-title b {
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}

.signal-title span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  white-space: nowrap;
}

.signal-reason {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 3px;
  color: #65758a;
  font-size: 11px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.signal-price {
  text-align: right;
  white-space: nowrap;
}

.signal-price b {
  display: block;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.confidence {
  display: inline-flex;
  gap: 3px;
  align-items: center;
  margin-top: 3px;
  color: #526179;
  font-family: var(--mono);
  font-size: 9.5px;
}

.confidence i {
  display: inline-block;
  width: 16px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #1d2a3c;
}

.confidence i::after {
  content: "";
  display: block;
  width: var(--confidence, 70%);
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
}

.signal-row.is-buy .confidence i::after { background: #d77984; }
.signal-row.is-sell .confidence i::after { background: #46bfa0; }

/* Rules ------------------------------------------------------------------- */

.rule-summary {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.rule-direction {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
  color: #b9c7d9;
  font-size: 12px;
  font-weight: 550;
}

.direction-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 3px rgba(89, 200, 245, 0.08);
}

.direction-dot.bearish { background: var(--red); box-shadow: 0 0 0 3px rgba(255, 96, 112, 0.08); }
.direction-dot.bullish { background: var(--green); box-shadow: 0 0 0 3px rgba(43, 212, 161, 0.08); }

.rule-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.rule-step {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: start;
  width: 100%;
  padding: 5px 4px 5px 0;
  text-align: left;
  border-radius: 5px;
  transition: background 120ms ease;
}

button.rule-step:hover {
  background: rgba(255, 255, 255, 0.027);
}

.rule-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 26px;
  bottom: -3px;
  left: 10px;
  width: 1px;
  background: #1c293b;
}

.step-num {
  position: relative;
  z-index: 1;
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  border: 1px solid #253247;
  border-radius: 50%;
  background: #0d1520;
}

.rule-step.done .step-num {
  color: #bfeafb;
  border-color: rgba(89, 200, 245, 0.35);
  background: rgba(89, 200, 245, 0.11);
}

.rule-step.pending .step-num {
  color: #6e7d91;
  border-style: dashed;
}

.step-main {
  min-width: 0;
  padding-top: 1px;
}

.step-main b {
  display: block;
  color: #aebccd;
  font-size: 11.5px;
  font-weight: 550;
}

.step-main span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #58687d;
  font-size: 10.5px;
  line-height: 1.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-meta {
  padding-top: 1px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.rule-confidence {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
  padding-top: 8px;
  color: var(--faint);
  font-size: 10px;
  border-top: 1px solid var(--line-soft);
}

.rule-confidence .bar {
  flex: 1;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: #1b2839;
}

.rule-confidence .bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--cyan);
}

.rule-confidence b {
  color: #8fa1b7;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
}

/* 2B list ---------------------------------------------------------------- */

.twob-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.twob-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  align-items: center;
  width: 100%;
  padding: 7px 8px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.025);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.017);
  transition: background 130ms ease, border-color 130ms ease;
}

.twob-row:hover {
  border-color: rgba(183, 156, 255, 0.14);
  background: rgba(183, 156, 255, 0.045);
}

.twob-kind {
  padding: 2px 5px;
  color: #c8b9ef;
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
  border: 1px solid rgba(183, 156, 255, 0.18);
  border-radius: 4px;
  background: rgba(183, 156, 255, 0.07);
}

.twob-kind.sell {
  color: #e7a9c2;
  border-color: rgba(231, 121, 169, 0.18);
  background: rgba(231, 121, 169, 0.065);
}

.twob-main {
  min-width: 0;
}

.twob-main b {
  display: block;
  overflow: hidden;
  color: #96a7bb;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twob-main span {
  display: block;
  overflow: hidden;
  margin-top: 1px;
  color: #526178;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.twob-price {
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 500;
  text-align: right;
  white-space: nowrap;
}

/* Levels ----------------------------------------------------------------- */

.level-groups {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.level-group-title {
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 5px;
  color: #66768c;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
}

.level-group-title i {
  width: 4px;
  height: 4px;
  border-radius: 1px;
  background: var(--blue);
}

.level-group-title.support i { background: var(--gold); }
.level-group-title.resistance i { background: var(--blue); }

.level-group-title span {
  margin-left: auto;
  color: #435168;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 400;
  letter-spacing: 0;
}

.level-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 66px;
  gap: 8px;
  align-items: center;
  width: 100%;
  padding: 6px 7px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: background 120ms ease, border-color 120ms ease;
}

.level-row:hover {
  border-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.028);
}

.level-row + .level-row {
  margin-top: 1px;
}

.level-price-line {
  display: flex;
  gap: 6px;
  align-items: baseline;
  min-width: 0;
}

.level-price {
  color: #d9e2ee;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.level-distance {
  font-family: var(--mono);
  font-size: 10px;
}

.level-distance.support { color: #b79d70; }
.level-distance.resistance { color: #769cd4; }

.level-meta {
  display: flex;
  gap: 5px;
  align-items: center;
  margin-top: 2px;
  overflow: hidden;
  color: #526176;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.level-meta em {
  padding: 0 3px;
  color: #7a6b53;
  font-style: normal;
  border: 1px solid rgba(238, 179, 91, 0.12);
  border-radius: 2px;
}

.level-strength {
  text-align: right;
}

.strength-dots {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  margin-bottom: 3px;
}

.strength-dots i {
  width: 9px;
  height: 2px;
  border-radius: 1px;
  background: #1d2a3c;
}

.strength-dots i.on {
  background: var(--gold);
}

.level-row.resistance .strength-dots i.on { background: var(--blue); }

.level-strength span {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 9.5px;
}

/* Empty / disclaimer ------------------------------------------------------ */

.empty-state {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 20px 12px;
  color: var(--faint);
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
  border: 1px dashed rgba(139, 166, 201, 0.12);
  border-radius: 7px;
}

.empty-state.small {
  padding: 13px 8px;
  font-size: 11px;
}

.empty-state b {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.rail-disclaimer {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  flex: 0 0 auto;
  padding: 3px 4px 8px;
  color: #47556a;
  font-size: 10.5px;
  line-height: 1.65;
}

.disclaimer-mark {
  display: grid;
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  place-items: center;
  color: #6d5a3b;
  font-family: "Songti SC", serif;
  font-size: 11.5px;
  border: 1px solid rgba(238, 179, 91, 0.12);
  border-radius: 4px;
}

.rail-disclaimer p {
  margin: 1px 0 0;
}

/* Page footer ------------------------------------------------------------- */

.page-footer {
  display: flex;
  gap: 10px;
  align-items: center;
  max-width: 1800px;
  margin: 0 auto;
  padding: 11px 24px 18px;
  color: #3f4d61;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}

.footer-sep {
  width: 1px;
  height: 9px;
  background: #243044;
}

.footer-spacer {
  flex: 1;
}

.footer-shortcut {
  display: flex;
  gap: 5px;
  align-items: center;
}

.page-footer kbd {
  padding: 1px 4px;
  color: #6b7a8e;
  font-family: var(--mono);
  font-size: 10.5px;
  border: 1px solid #263348;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.024);
}

/* Toast ------------------------------------------------------------------- */

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 300;
  max-width: 360px;
  padding: 10px 14px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: rgba(13, 20, 31, 0.97);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  animation: toast-in 180ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: grid;
  place-items: center;
  color: var(--text);
  background: var(--bg);
}

/* --------------------------------------------------------------------------
   Focus + motion preferences
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 1px solid rgba(238, 179, 91, 0.75);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1420px) {
  .instrument-bar {
    grid-template-columns: minmax(215px, 1.05fr) minmax(290px, 1.45fr) auto;
    gap: 14px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .quote-cell {
    padding: 0 9px;
  }

  .local-note {
    display: none;
  }
}

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .quick-row {
    padding-right: 18px;
    padding-left: 18px;
  }

  .screen-hide {
    display: none;
  }

  .quote-grid {
    grid-template-columns: repeat(4, minmax(50px, 1fr));
  }

  .quote-cell.optional {
    display: none;
  }

  .layer-toggle {
    padding: 0 6px;
  }

  .chart-float-legend {
    display: none;
  }
}

@media (max-width: 1180px) {
  .topbar {
    grid-template-columns: auto minmax(260px, 1fr) auto;
    gap: 14px;
    padding: 0 18px;
  }

  .source-pill {
    display: none;
  }

  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .analysis-rail {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    max-height: none;
    padding-right: 0;
    overflow: visible;
  }

  .multi-card,
  .verdict-card,
  .rail-disclaimer {
    grid-column: span 2;
  }

  .rail-disclaimer {
    padding-top: 6px;
  }

  .chart-stage {
    height: clamp(500px, 60vh, 650px);
  }
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: auto minmax(200px, 1fr) auto;
  }

  .brand {
    min-width: auto;
  }

  .brand-copy {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 24px;
  }

  .search-submit {
    padding: 0 12px;
  }

  .instrument-bar {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    padding: 15px 16px 13px;
  }

  .quote-grid {
    display: none;
  }

  .instrument-side {
    min-width: 80px;
  }

  .chart-toolbar {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
  }

  .toolbar-divider {
    display: none;
  }

  .overlay-toggles {
    order: 3;
    width: calc(100% + 4px);
    padding-top: 2px;
  }

  .chart-tools {
    margin-left: auto;
  }

  .chart-stage {
    height: clamp(470px, 58vh, 600px);
  }

  .chart-footer {
    padding: 7px 13px;
  }

  .interaction-hint {
    display: none;
  }

  .chart-legend {
    gap: 9px;
  }

  .chart-source {
    max-width: 42%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-footer {
    padding-right: 18px;
    padding-left: 18px;
  }
}

@media (max-width: 700px) {
  :root {
    --topbar-h: 64px;
  }

  .topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
    padding: 9px 13px 10px;
  }

  .brand {
    order: 1;
    flex: 1;
  }

  .top-actions {
    order: 2;
  }

  .source-pill {
    display: none;
  }

  .search-area {
    order: 3;
    width: 100%;
    max-width: none;
  }

  .search-field {
    height: 44px;
  }

  .search-submit {
    height: 34px;
  }

  .quick-row {
    gap: 7px;
    padding: 9px 13px 0;
  }

  .quick-label {
    font-size: 11px;
  }

  .clock {
    display: none;
  }

  .data-notice {
    margin: 8px 13px 0;
    font-size: 12.5px;
  }

  .layout {
    padding: 10px 12px 8px;
  }

  .chart-card {
    border-radius: 14px;
  }

  .instrument-bar {
    padding: 13px 13px 12px;
  }

  .name-row h1 {
    font-size: 21px;
  }

  .stock-code {
    font-size: 11.5px;
  }

  .last-price {
    font-size: 31px;
  }

  .quote-time {
    display: none;
  }

  .trend-badge {
    padding: 4px 7px;
    font-size: 11.5px;
  }

  .period-eyebrow {
    font-size: 10px;
  }

  .chart-toolbar {
    padding: 7px 9px;
  }

  .period-tabs button {
    height: 29px;
    padding: 0 12px;
    font-size: 13px;
  }

  .overlay-toggles {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2px 0;
    overflow: visible;
  }

  .layer-toggle {
    justify-content: center;
    padding: 0 3px;
    font-size: 11.5px;
  }

  .type-chip {
    display: none;
  }

  .name-row h1 {
    max-width: 100%;
  }

  .analysis-point {
    font-size: 13px;
    line-height: 1.7;
  }

  .rail-note {
    font-size: 12px;
  }

  .rule-summary {
    font-size: 12px;
  }

  .step-main b {
    font-size: 12.5px;
  }

  .step-main span {
    font-size: 11px;
  }

  .step-meta {
    font-size: 10.5px;
  }

  .twob-main b {
    font-size: 11.5px;
  }

  .twob-main span {
    font-size: 10.5px;
  }

  .level-price {
    font-size: 13.5px;
  }

  .level-meta {
    font-size: 10.5px;
  }

  .signal-title b {
    font-size: 12.5px;
  }

  .signal-reason {
    font-size: 11.5px;
  }

  .chart-stage {
    height: 490px;
  }

  .stage-watermark {
    display: none;
  }

  .chart-legend {
    gap: 8px;
    font-size: 10.5px;
  }

  .legend-item:nth-child(n + 5) {
    display: none;
  }

  .analysis-rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  .multi-card,
  .verdict-card,
  .rail-disclaimer {
    grid-column: span 1;
  }

  .rail-card {
    padding: 15px;
  }

  .page-footer {
    flex-wrap: wrap;
    gap: 7px;
    padding: 9px 13px 16px;
    font-size: 10px;
  }

  .footer-shortcut {
    display: none;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }

  .chart-tooltip {
    width: 245px;
  }
}

@media (max-width: 430px) {
  .last-price {
    font-size: 29px;
  }

  .change-pill {
    font-size: 12.5px;
  }

  .chart-stage {
    height: 470px;
  }

  .instrument-side {
    min-width: 68px;
  }

  .period-tabs {
    flex: 1;
  }

  .period-tabs button {
    flex: 1;
  }

  .multi-stage {
    font-size: 9.5px;
  }

  .multi-item {
    padding: 7px 7px;
  }
}

/* ==========================================================================
   Readability pass — larger type, stronger contrast, roomier analysis cards
   ========================================================================== */

:root {
  --muted: #a5b3c6;
  --faint: #7c8da3;
  --text-soft: #ced9e6;
}

.kicker {
  color: #7e90a6;
  font-size: 10.5px;
  letter-spacing: 0.13em;
}

.rail-head h2 {
  font-size: 16px;
}

.rail-note {
  color: #8fa0b5;
  font-size: 12px;
}

.verdict-hero p {
  color: #aab9cb;
  font-size: 13.5px;
  line-height: 1.7;
}

.analysis-point {
  color: #b5c2d3;
  font-size: 13.5px;
  line-height: 1.75;
}

.analysis-point strong {
  color: #e0e9f4;
}

.struct-cell span {
  color: #8798ad;
  font-size: 10.5px;
}

.struct-cell b {
  color: #d4deea;
  font-size: 12.5px;
}

.watch-label {
  color: #d1b27f;
  font-size: 11px;
}

.watch-box p {
  color: #c2b298;
  font-size: 12.5px;
  line-height: 1.7;
}

.signal-badge {
  width: 35px;
  height: 35px;
  font-size: 13px;
}

.signal-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 9px;
  padding: 9px;
}

.signal-title b {
  font-size: 13px;
}

.signal-title span {
  color: #8798ad;
  font-size: 11px;
}

.signal-reason {
  color: #9bacc0;
  font-size: 12.5px;
  line-height: 1.6;
  -webkit-line-clamp: 3;
}

.signal-price b {
  font-size: 13px;
}

.confidence {
  color: #8394a9;
  font-size: 9.5px;
}

.rule-direction {
  font-size: 12.5px;
}

.rule-summary {
  color: #a7b6c9;
  font-size: 12.5px;
  line-height: 1.65;
}

.step-main b {
  color: #c1cddb;
  font-size: 12.5px;
}

.step-main span {
  color: #95a6ba;
  font-size: 11.5px;
  line-height: 1.5;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.step-meta {
  color: #8a9bb0;
  font-size: 10.5px;
}

.step-num {
  color: #899bb1;
  font-size: 10.5px;
}

.rule-confidence {
  color: #899bb0;
  font-size: 10px;
}

.twob-kind {
  font-size: 10.5px;
}

.twob-main b {
  color: #b4c2d3;
  font-size: 12px;
}

.twob-main span {
  color: #8899ae;
  font-size: 10.5px;
}

.twob-price {
  font-size: 12px;
}

.level-group-title {
  color: #8a9bb0;
  font-size: 10.5px;
}

.level-row {
  grid-template-columns: minmax(0, 1fr) 78px;
  padding: 8px;
}

.level-price {
  font-size: 13.5px;
}

.level-distance {
  font-size: 10.5px;
}

.level-meta {
  color: #8fa0b5;
  font-size: 10.5px;
}

.level-strength span {
  color: #8495aa;
  font-size: 9.5px;
}

.rail-disclaimer {
  color: #7b8ba0;
  font-size: 11px;
  line-height: 1.7;
}

.empty-state {
  color: #8fa0b5;
  font-size: 12px;
}

.empty-state b {
  color: #b5c2d3;
  font-size: 12.5px;
}

.chart-source {
  color: #7d8ea4;
  font-size: 10px;
}

.chart-legend {
  color: #8495aa;
  font-size: 11px;
}

.interaction-hint {
  color: #718399;
  font-size: 10px;
}

.layer-toggle {
  color: #8a9bb0;
  font-size: 12.5px;
}

.layer-toggle.active {
  color: #d4deea;
}

.period-eyebrow {
  color: #8697ac;
  font-size: 10.5px;
}

.chart-float-legend {
  color: #8495aa;
  font-size: 10.5px;
}

.page-footer {
  color: #74859a;
  font-size: 10.5px;
}

.multi-stage {
  color: #8495aa;
  font-size: 10.5px;
}

.tooltip-date {
  font-size: 12px;
}

.tooltip-period {
  color: #8495aa;
  font-size: 10.5px;
}

.tooltip-cell span {
  color: #8c9db3;
  font-size: 11px;
}

.tooltip-cell b {
  font-size: 12.5px;
}

.quote-time {
  color: #8798ad;
  font-size: 10.5px;
}

.quote-cell span {
  color: #8a9bb0;
  font-size: 10.5px;
}

.quote-cell b {
  color: #d1dbe7;
  font-size: 13px;
}

@media (max-width: 1240px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  .period-eyebrow {
    font-size: 10px;
  }

  .chart-stage {
    height: clamp(500px, 60vh, 620px);
  }

  .chart-footer {
    padding: 9px 13px;
  }
}

@media (max-width: 700px) {
  .analysis-rail {
    gap: 12px;
  }

  .rail-card {
    padding: 15px;
  }

  .rail-head h2 {
    font-size: 16px;
  }

  .verdict-title {
    font-size: 20px;
  }

  .verdict-hero p,
  .analysis-point {
    font-size: 14px;
  }

  .watch-box p {
    font-size: 13px;
  }

  .signal-title b {
    font-size: 13px;
  }

  .signal-title span {
    font-size: 11.5px;
  }

  .signal-reason {
    font-size: 12.5px;
  }

  .step-main b {
    font-size: 13px;
  }

  .step-main span {
    font-size: 12px;
  }

  .step-meta {
    font-size: 11px;
  }

  .twob-main b {
    font-size: 12.5px;
  }

  .twob-main span {
    font-size: 11px;
  }

  .level-price {
    font-size: 14px;
  }

  .level-meta {
    font-size: 11px;
  }

  .level-strength span {
    font-size: 10px;
  }

  .rail-note,
  .rule-summary {
    font-size: 12.5px;
  }

  .multi-stage {
    font-size: 10.5px;
  }

  .layer-toggle {
    font-size: 12px;
  }

  .chart-legend {
    font-size: 11px;
  }

  .chart-stage {
    height: 500px;
  }

  .chart-tooltip {
    width: 250px;
  }

  .page-footer {
    font-size: 11px;
  }
}

@media (max-width: 430px) {
  .last-price {
    font-size: 32px;
  }

  .name-row h1 {
    font-size: 22px;
  }

  .period-tabs button {
    font-size: 12.5px;
  }

  .chart-stage {
    height: 475px;
  }

  .chart-legend {
    font-size: 10.5px;
  }

  .chart-source {
    max-width: 38%;
    font-size: 9.5px;
  }

  .multi-stage {
    font-size: 10px;
  }

  .rail-card {
    padding: 14px;
  }
}

/* Readability pass 2 — wider description text, fewer cramped quote cells */
.quote-grid {
  grid-template-columns: repeat(4, minmax(62px, 1fr));
}

.quote-cell.optional {
  display: none;
}

.quote-cell {
  padding: 0 14px;
}

.verdict-hero p,
.analysis-point {
  font-size: 14px;
}

.watch-box p {
  font-size: 13px;
}

.signal-title b {
  font-size: 13.5px;
}

.signal-reason {
  font-size: 13px;
  line-height: 1.62;
}

.signal-price b {
  font-size: 13.5px;
}

.rule-summary {
  font-size: 13px;
}

.step-main b {
  font-size: 13px;
}

.step-main span {
  font-size: 12px;
}

.rule-direction {
  font-size: 13px;
}

.twob-main b {
  font-size: 12.5px;
}

.twob-main span,
.level-meta {
  font-size: 11px;
}

.level-price {
  font-size: 14px;
}

.multi-stage {
  font-size: 11px;
}

.rail-note {
  font-size: 12.5px;
}

.verdict-title {
  font-size: 20px;
}

.chart-stage {
  height: clamp(500px, calc(100vh - 350px), 680px);
}

@media (min-width: 1081px) {
  .analysis-rail {
    max-height: calc(100vh - var(--topbar-h) - 60px);
    scrollbar-width: thin;
    scrollbar-color: #3b4f6c transparent;
  }

  .analysis-rail::-webkit-scrollbar {
    width: 6px;
  }

  .analysis-rail::-webkit-scrollbar-thumb {
    background: #344760;
  }
}

@media (max-width: 1600px) {
  .quote-time {
    display: none;
  }
}

@media (max-width: 700px) {
  .period-eyebrow {
    display: none;
  }

  .instrument-side {
    min-width: 0;
  }

  .name-row h1 {
    font-size: 21px;
  }

  .stock-code {
    font-size: 10.5px;
  }

  .verdict-hero p,
  .analysis-point {
    font-size: 14px;
  }

  .verdict-title {
    font-size: 21px;
  }

  .signal-title b,
  .signal-price b {
    font-size: 13px;
  }

  .signal-reason,
  .rule-summary {
    font-size: 13px;
  }

  .step-main b {
    font-size: 13px;
  }

  .step-main span {
    font-size: 12px;
  }

  .rail-note {
    font-size: 12.5px;
  }

  .level-price {
    font-size: 14px;
  }

  .level-meta {
    font-size: 11px;
  }
}

/* Final readability trim: no microscopic labels, full chart on phones */
.chart-source,
.page-footer,
.interaction-hint {
  font-size: 11px;
}

.confidence,
.level-strength span {
  font-size: 10.5px;
}

.twob-kind,
.quote-cell span,
.tooltip-period {
  font-size: 11px;
}

@media (max-width: 700px) {
  .chart-stage {
    height: 460px;
  }
}

@media (max-width: 430px) {
  .chart-stage {
    height: 420px;
  }
}

@media (max-width: 700px) {
  .legend-item:nth-child(n + 4) {
    display: none;
  }

  .chart-source {
    max-width: none;
  }
}

.stage-watermark {
  color: rgba(160, 184, 216, 0.028);
}


@media (max-width: 1240px) {
  .quote-cell {
    padding: 0 8px;
  }
}

/* Container-aware toolbar: no hidden indicators when the chart panel narrows */
.chart-card {
  container-type: inline-size;
}

@container (max-width: 960px) {
  .chart-toolbar {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 7px;
  }

  .toolbar-divider {
    display: none;
  }

  .overlay-toggles {
    order: 3;
    width: 100%;
    padding-top: 2px;
  }

  .chart-tools {
    margin-left: auto;
  }
}

.struct-cell b {
  overflow: visible;
  white-space: normal;
  text-overflow: clip;
  line-height: 1.4;
}

/* 走势终完美 + 分型/背驰 layer ------------------------------------------------ */

.layer-dot.fractals {
  color: #dfa6ff;
}

.legend-triangle {
  display: inline-block;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-bottom: 6px solid #dfa6ff;
  border-left: 4px solid transparent;
}

.legend-box.fractals {
  border-color: rgba(223, 166, 255, 0.75);
  background: rgba(223, 166, 255, 0.12);
}

.legend-fractal {
  display: inline-block;
  width: 0;
  height: 0;
  border-right: 3.5px solid transparent;
  border-bottom: 6px solid var(--gold);
  border-left: 3.5px solid transparent;
}

.legend-divergence {
  display: inline-flex;
  width: 13px;
  height: 12px;
  align-items: center;
  justify-content: center;
  color: #d9b7ff;
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  line-height: 1;
  border: 1px solid rgba(211, 168, 255, 0.55);
  border-radius: 2px;
  background: rgba(211, 168, 255, 0.08);
}

.mini-badge.ok {
  color: #6ee8c1;
  border-color: rgba(43, 212, 161, 0.22);
  background: rgba(43, 212, 161, 0.09);
}

.mini-badge.warn {
  color: #f0c779;
  border-color: rgba(238, 179, 91, 0.24);
  background: rgba(238, 179, 91, 0.09);
}

.mini-badge.danger {
  color: #ff9aa5;
  border-color: rgba(255, 96, 112, 0.24);
  background: rgba(255, 96, 112, 0.09);
}

.perfection-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(223, 166, 255, 0.36), transparent);
}

.perfection-hero {
  margin-bottom: 10px;
}

.perfection-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  color: #a4b3c7;
  font-size: 11px;
}

.condition-dots {
  display: inline-flex;
  gap: 3px;
  align-items: center;
}

.condition-dots i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: #27364b;
}

.condition-dots i.done {
  background: #d9a8ff;
  box-shadow: 0 0 7px rgba(217, 168, 255, 0.28);
}

.perfection-structure {
  margin-left: auto;
  color: #7e90a6;
  font-size: 10px;
}

.perfection-summary {
  margin: 8px 0 0;
  color: #bdc9d8;
  font-size: 13px;
  line-height: 1.7;
}

.perfection-centre {
  padding: 9px 10px;
  border: 1px solid rgba(211, 168, 255, 0.13);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(211, 168, 255, 0.04), transparent 55%),
    rgba(255, 255, 255, 0.017);
}

.perfection-centre-row,
.perfection-verdict-row {
  display: flex;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.perfection-centre-row > span:first-child,
.perfection-verdict-row > span:first-child {
  flex: 0 0 auto;
  color: #8495aa;
  font-size: 10.5px;
}

.perfection-range {
  overflow: hidden;
  color: #d7e1ed;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perfection-state {
  margin-left: auto;
  color: #d9b7ff;
  font-size: 10px;
  white-space: nowrap;
}

.perfection-verdict-row {
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px dashed rgba(139, 166, 201, 0.1);
}

.perfection-verdict {
  font-size: 13.5px;
  font-weight: 600;
}

.perfection-verdict.is-neutral { color: #c8d4e3; }
.perfection-verdict.is-top { color: #ff9aa5; }
.perfection-verdict.is-bottom { color: #72e4c2; }

.perfection-position {
  margin-left: auto;
  color: #8495aa;
  font-size: 9.5px;
  white-space: nowrap;
}

.perfection-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(139, 166, 201, 0.09);
}

.perfection-metrics span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #7f90a6;
  font-size: 9.5px;
}

.perfection-metrics b {
  overflow: hidden;
  color: #c4d0df;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perfection-departure {
  overflow: hidden;
  margin-top: 6px;
  color: #7c8da3;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perfection-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 7px;
}

.perfection-step {
  position: relative;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  width: 100%;
  padding: 6px 0;
  text-align: left;
  border-radius: 5px;
}

button.perfection-step:hover {
  background: rgba(255, 255, 255, 0.025);
}

.perfection-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 30px;
  bottom: -2px;
  left: 11px;
  width: 1px;
  background: #1e2c3f;
}

.perfection-step-num {
  position: relative;
  z-index: 1;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  color: #8294aa;
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid #28374b;
  border-radius: 50%;
  background: #0d1520;
}

.perfection-step.done .perfection-step-num {
  color: #82e7c8;
  border-color: rgba(43, 212, 161, 0.3);
  background: rgba(43, 212, 161, 0.1);
}

.perfection-step.pending .perfection-step-num {
  border-style: dashed;
}

.perfection-step-main {
  min-width: 0;
  padding-top: 1px;
}

.perfection-step-main b {
  display: block;
  color: #c5d1df;
  font-size: 12px;
  font-weight: 550;
}

.perfection-step-main span {
  display: block;
  margin-top: 2px;
  color: #8fa0b5;
  font-size: 11px;
  line-height: 1.55;
}

.perfection-subhead {
  display: flex;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 9px;
  color: #a3b3c6;
  font-size: 10.5px;
  border-top: 1px solid rgba(139, 166, 201, 0.1);
}

.perfection-subhead span:last-child {
  color: #7b8ca2;
  font-size: 9.5px;
}

.divergence-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
}

.perfection-divergence {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px;
  align-items: start;
  width: 100%;
  padding: 7px 7px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  transition: background 120ms ease, border-color 120ms ease;
}

.perfection-divergence:hover {
  border-color: rgba(211, 168, 255, 0.16);
  background: rgba(211, 168, 255, 0.04);
}

.divergence-kind {
  padding: 2px 5px;
  color: #ff9da6;
  font-size: 9.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid rgba(255, 96, 112, 0.2);
  border-radius: 4px;
  background: rgba(255, 96, 112, 0.07);
}

.perfection-divergence.bottom .divergence-kind {
  color: #72e4c2;
  border-color: rgba(43, 212, 161, 0.2);
  background: rgba(43, 212, 161, 0.07);
}

.divergence-main {
  min-width: 0;
}

.divergence-main b {
  display: block;
  overflow: hidden;
  color: #b6c3d3;
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divergence-main > span {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: #7f90a6;
  font-size: 9.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divergence-outcome {
  color: #d9b7ff;
  font-style: normal;
}

.divergence-outcome.done { color: #6ee8c1; }
.divergence-outcome.failed { color: #ff9aa5; }

.fractal-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 6px;
}

.fractal-card {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start;
  min-width: 0;
  padding: 8px;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 120ms ease, background 120ms ease;
}

.fractal-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.fractal-card.top { border-color: rgba(255, 96, 112, 0.14); }
.fractal-card.bottom { border-color: rgba(43, 212, 161, 0.14); }

.fractal-kind {
  display: flex;
  gap: 5px;
  align-items: center;
  color: #93a4b9;
  font-size: 9.5px;
}

.fractal-kind i {
  display: inline-block;
  width: 0;
  height: 0;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
}

.fractal-card.top .fractal-kind i {
  border-top: 6px solid #ff6c7b;
}

.fractal-card.bottom .fractal-kind i {
  border-bottom: 6px solid #36d9aa;
}

.fractal-card b {
  overflow: hidden;
  max-width: 100%;
  color: #d9e3ee;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fractal-meta {
  overflow: hidden;
  max-width: 100%;
  color: #78899f;
  font-family: var(--mono);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fractal-card em {
  margin-top: 2px;
  padding: 0 4px;
  color: #8a9bb0;
  font-size: 8.5px;
  font-style: normal;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
}

.fractal-card em.confirmed {
  color: #a9b8ca;
  border-color: rgba(139, 166, 201, 0.16);
}

.fractal-card.empty {
  justify-content: center;
  min-height: 73px;
  color: #65768c;
  font-size: 10px;
}

.fractal-card.empty b {
  color: #718399;
  font-size: 11px;
}

.perfection-note {
  margin: 9px 0 0;
  color: #72839a;
  font-size: 9.5px;
  line-height: 1.65;
}

@media (max-width: 700px) {
  .perfection-summary {
    font-size: 13.5px;
  }

  .perfection-step-main b {
    font-size: 13px;
  }

  .perfection-step-main span {
    font-size: 12px;
  }

  .perfection-metrics span,
  .perfection-metrics b {
    font-size: 11px;
  }

  .divergence-main b {
    font-size: 11.5px;
  }

  .divergence-main > span {
    font-size: 10.5px;
  }

  .fractal-card b {
    font-size: 15px;
  }

  .perfection-note {
    font-size: 10.5px;
  }
}

/* New perfection card: readable secondary telemetry */
.perfection-metrics span {
  font-size: 10.5px;
}

.perfection-metrics b {
  font-size: 11.5px;
}

.perfection-departure {
  font-size: 10.5px;
}

.perfection-step-main b {
  font-size: 12.5px;
}

.perfection-step-main span {
  font-size: 11px;
}

.perfection-subhead {
  font-size: 11.5px;
}

.perfection-subhead span:last-child {
  font-size: 10.5px;
}

.divergence-kind {
  font-size: 10.5px;
}

.divergence-main b {
  font-size: 11.5px;
}

.divergence-main > span {
  font-size: 10.5px;
}

.fractal-kind {
  font-size: 10.5px;
}

.fractal-meta {
  font-size: 10px;
}

.fractal-card em {
  font-size: 9.5px;
}

.perfection-note {
  font-size: 10.5px;
}

@media (max-width: 700px) {
  .perfection-step-main b {
    font-size: 13.5px;
  }

  .perfection-step-main span {
    font-size: 12.5px;
  }

  .divergence-main b {
    font-size: 12px;
  }

  .divergence-main > span {
    font-size: 11px;
  }

  .perfection-subhead {
    font-size: 12px;
  }

  .fractal-meta {
    font-size: 10.5px;
  }

  .fractal-card em {
    font-size: 10px;
  }
}

/* ==========================================================================
   Left-side screener
   ========================================================================== */

.screener-trigger {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  color: #f2cf95;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
  border: 1px solid rgba(238, 179, 91, 0.28);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(238, 179, 91, 0.13), rgba(238, 179, 91, 0.045));
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.screener-trigger svg {
  width: 15px;
  height: 15px;
}

.screener-trigger:hover {
  border-color: rgba(238, 179, 91, 0.5);
  background: rgba(238, 179, 91, 0.16);
}

.screener-trigger:active {
  transform: translateY(1px);
}

body.modal-open {
  overflow: hidden;
}

.screener-backdrop {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(3, 7, 12, 0.76);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: screen-fade 160ms ease both;
}

@keyframes screen-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.screener-panel {
  display: flex;
  width: min(1040px, 100%);
  max-height: min(90vh, 920px);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #2a374b;
  border-radius: 18px;
  background:
    radial-gradient(800px 320px at 5% -10%, rgba(238, 179, 91, 0.065), transparent 60%),
    linear-gradient(180deg, #0e1724 0%, #090f17 100%);
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  animation: screen-rise 190ms ease both;
}

@keyframes screen-rise {
  from { opacity: 0; transform: translateY(10px) scale(0.992); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.screener-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 19px 22px 16px;
  border-bottom: 1px solid rgba(139, 166, 201, 0.11);
}

.screener-header .kicker {
  margin-bottom: 4px;
}

.screener-header h2 {
  margin: 0;
  color: #f1f6fc;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.screener-header p {
  margin: 5px 0 0;
  color: #91a2b7;
  font-size: 12.5px;
}

.screener-close {
  flex: 0 0 auto;
  margin-top: 1px;
}

.screener-body {
  flex: 1;
  min-height: 0;
  padding: 16px 22px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #3b4f6c transparent;
}

.screener-body::-webkit-scrollbar {
  width: 6px;
}

.screener-body::-webkit-scrollbar-thumb {
  border-radius: 6px;
  background: #354862;
}

.screener-intro {
  padding: 13px 14px;
  border: 1px solid rgba(139, 166, 201, 0.12);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.018);
}

.screener-pattern {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  color: #b6c3d4;
  font-size: 12px;
}

.screener-pattern > span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

.screener-pattern > span i {
  color: #7f90a6;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
}

.screener-pattern > span.accent {
  color: #f1cd91;
  border-color: rgba(238, 179, 91, 0.19);
  background: rgba(238, 179, 91, 0.06);
}

.screener-pattern > b {
  color: #52647d;
  font-size: 11px;
  font-weight: 400;
}

.screener-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
}

.run-screener {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  height: 39px;
  padding: 0 16px;
  color: #171107;
  font-size: 13px;
  font-weight: 650;
  border-radius: 8px;
  background: linear-gradient(180deg, #f3c678, #e3a647);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.38), 0 6px 18px rgba(190, 130, 31, 0.14);
  transition: filter 140ms ease, opacity 140ms ease;
}

.run-screener:hover:not(:disabled) {
  filter: brightness(1.07);
}

.run-screener:disabled {
  cursor: wait;
  opacity: 0.72;
}

.run-icon {
  font-family: var(--mono);
  font-size: 17px;
  line-height: 1;
}

.param-toggle {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 34px;
  padding: 0 10px;
  color: #9cacc0;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.022);
}

.param-toggle svg {
  width: 12px;
  height: 12px;
  transition: transform 150ms ease;
}

.param-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.screener-universe {
  margin-left: auto;
  color: #7e90a6;
  font-size: 11px;
  white-space: nowrap;
}

.screener-params {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
  padding-top: 13px;
  border-top: 1px dashed rgba(139, 166, 201, 0.12);
  animation: params-in 160ms ease both;
}

@keyframes params-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.param-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.param-field > span {
  color: #899bb0;
  font-size: 10.5px;
}

.input-unit {
  display: flex;
  align-items: center;
  height: 33px;
  padding-right: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(5, 10, 16, 0.44);
}

.input-unit:focus-within {
  border-color: rgba(238, 179, 91, 0.4);
}

.input-unit input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 5px 0 9px;
  color: #d2deeb;
  font-family: var(--mono);
  font-size: 12px;
  border: 0;
  outline: 0;
  background: transparent;
}

.input-unit em {
  flex: 0 0 auto;
  color: #687a91;
  font-size: 9.5px;
  font-style: normal;
}

.param-check {
  display: flex;
  gap: 7px;
  align-items: center;
  min-height: 33px;
  color: #a1b1c4;
  font-size: 11.5px;
  cursor: pointer;
}

.param-check input {
  width: 14px;
  height: 14px;
  accent-color: #e6aa4b;
}

.param-reset {
  justify-self: start;
  align-self: end;
  height: 30px;
  padding: 0 10px;
  color: #8fa0b5;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.02);
}

.param-reset:hover {
  color: #ccd7e5;
  border-color: var(--line-strong);
}

.screener-progress {
  margin-top: 15px;
  padding: 12px 14px;
  border: 1px solid rgba(238, 179, 91, 0.15);
  border-radius: 9px;
  background: rgba(238, 179, 91, 0.04);
}

.progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  color: #d6c19d;
  font-size: 12px;
}

.progress-row b {
  color: #ecc985;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.progress-track {
  height: 4px;
  margin-top: 7px;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c38931, #f3ca82);
  box-shadow: 0 0 12px rgba(238, 179, 91, 0.35);
  transition: width 350ms ease;
}

.screener-progress p {
  margin: 6px 0 0;
  color: #8fa0b5;
  font-size: 10.5px;
}

.screener-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  margin-top: 13px;
  padding: 10px 12px;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  color: #8fa0b5;
  font-size: 11px;
}

.summary-stat {
  display: flex;
  gap: 5px;
  align-items: baseline;
}

.summary-stat b {
  color: #e4edf7;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
}

.summary-stat span {
  color: #7f90a6;
}

.summary-spacer {
  flex: 1;
}

.screener-results {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 14px;
}

.screener-empty {
  display: flex;
  min-height: 290px;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  border: 1px dashed rgba(139, 166, 201, 0.15);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.012);
}

.screener-empty h3 {
  margin: 5px 0 0;
  color: #bdcad9;
  font-size: 15px;
  font-weight: 550;
}

.screener-empty p {
  max-width: 590px;
  margin: 0;
  color: #8192a8;
  font-size: 12px;
  line-height: 1.75;
}

.scan-estimate {
  margin-top: 6px;
  padding: 3px 8px;
  color: #8e7b5f;
  font-family: var(--mono);
  font-size: 10px;
  border: 1px solid rgba(238, 179, 91, 0.13);
  border-radius: 4px;
}

.empty-radar {
  position: relative;
  width: 66px;
  height: 66px;
  margin-bottom: 6px;
  border: 1px solid rgba(238, 179, 91, 0.22);
  border-radius: 50%;
}

.empty-radar::before,
.empty-radar::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(238, 179, 91, 0.13);
  border-radius: 50%;
}

.empty-radar::before { inset: 10px; }
.empty-radar::after { inset: 22px; }

.empty-radar span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(238, 179, 91, 0.8);
}

.empty-radar span:nth-child(1) { transform: translate(-20px, -12px); opacity: 0.45; }
.empty-radar span:nth-child(2) { transform: translate(16px, -18px); opacity: 0.7; }
.empty-radar span:nth-child(3) { transform: translate(8px, 17px); opacity: 0.55; }

.empty-radar i {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(238, 179, 91, 0.18), transparent 24%);
  animation: radar-sweep 3.2s linear infinite;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

.screener-result {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 11px;
  width: 100%;
  padding: 12px;
  text-align: left;
  border: 1px solid rgba(139, 166, 201, 0.12);
  border-radius: 10px;
  background:
    linear-gradient(100deg, rgba(255, 255, 255, 0.022), transparent 60%),
    rgba(255, 255, 255, 0.008);
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.screener-result:hover {
  border-color: rgba(238, 179, 91, 0.26);
  background-color: rgba(238, 179, 91, 0.032);
}

.screener-result:active {
  transform: translateY(1px);
}

.result-score {
  --score: 70;
  position: relative;
  display: flex;
  width: 54px;
  height: 54px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(closest-side, #0b131e 76%, transparent 77% 99%),
    conic-gradient(#e8b35e calc(var(--score) * 1%), #1d2b3d 0);
}

.result-score b {
  color: #f0d09c;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.result-score span {
  margin-top: 2px;
  color: #7f90a6;
  font-size: 8px;
  letter-spacing: 0.03em;
}

.result-main {
  min-width: 0;
}

.result-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
}

.result-identity {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
  min-width: 0;
}

.result-name {
  color: #e3ebf5;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
}

.result-code {
  color: #7f90a6;
  font-family: var(--mono);
  font-size: 10px;
}

.result-industry {
  padding: 1px 5px;
  color: #8294aa;
  font-size: 9px;
  border: 1px solid var(--line-soft);
  border-radius: 3px;
  white-space: nowrap;
}

.result-price {
  flex: 0 0 auto;
  color: #dbe5f0;
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.result-price em {
  margin-left: 3px;
  font-size: 10px;
  font-style: normal;
}

.result-price em.up { color: var(--red); }
.result-price em.down { color: var(--green); }

.result-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed rgba(139, 166, 201, 0.1);
}

.result-metric {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.result-metric span {
  color: #77899f;
  font-size: 9.5px;
}

.result-metric b {
  overflow: hidden;
  color: #c4d0df;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-metric b.accent {
  color: #e0b975;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.result-tag {
  padding: 1px 5px;
  color: #8fa0b5;
  font-size: 9px;
  line-height: 1.55;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
}

.result-tag.ready {
  color: #7ee5c5;
  border-color: rgba(43, 212, 161, 0.17);
  background: rgba(43, 212, 161, 0.055);
}

.result-tag.caution {
  color: #e4bd7c;
  border-color: rgba(238, 179, 91, 0.15);
  background: rgba(238, 179, 91, 0.045);
}

.result-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

.result-hold {
  color: #8495aa;
  font-size: 10px;
}

.result-hold b {
  color: #d8c099;
  font-family: var(--mono);
  font-weight: 500;
}

.result-cta {
  color: #e5be7e;
  font-size: 10.5px;
  white-space: nowrap;
}

.screener-result:hover .result-cta {
  color: #f4d6a1;
}

.screener-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  justify-content: space-between;
  padding: 10px 22px;
  color: #687a90;
  font-size: 10px;
  border-top: 1px solid rgba(139, 166, 201, 0.1);
  background: rgba(5, 9, 15, 0.3);
}

.screener-error {
  padding: 16px;
  color: #f0aab3;
  font-size: 12px;
  line-height: 1.7;
  border: 1px solid rgba(255, 96, 112, 0.17);
  border-radius: 8px;
  background: rgba(255, 96, 112, 0.05);
}

@media (max-width: 860px) {
  .screener-trigger {
    width: 34px;
    padding: 0;
    justify-content: center;
  }

  .screener-trigger span {
    display: none;
  }

  .screener-panel {
    max-height: 94vh;
  }

  .screener-params {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .screener-pattern {
    font-size: 11.5px;
  }
}

@media (max-width: 700px) {
  .screener-backdrop {
    padding: 0;
  }

  .screener-panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
  }

  .screener-header {
    padding: 16px 14px 13px;
  }

  .screener-header h2 {
    font-size: 22px;
  }

  .screener-header p {
    font-size: 12px;
  }

  .screener-body {
    padding: 13px 14px 20px;
  }

  .screener-intro {
    padding: 12px;
  }

  .screener-pattern > b {
    display: none;
  }

  .screener-pattern {
    gap: 5px;
  }

  .screener-pattern > span {
    font-size: 11px;
  }

  .screener-toolbar {
    align-items: stretch;
  }

  .run-screener {
    flex: 1;
    justify-content: center;
  }

  .screener-universe {
    width: 100%;
    margin-left: 0;
    white-space: normal;
  }

  .screener-result {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
  }

  .result-score {
    width: 44px;
    height: 44px;
  }

  .result-score b {
    font-size: 13px;
  }

  .result-name {
    font-size: 14px;
  }

  .result-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-price {
    font-size: 12px;
  }

  .screener-footer {
    padding: 9px 14px;
    font-size: 9.5px;
  }

  .screener-empty {
    min-height: 240px;
    padding: 20px 14px;
  }
}

.result-industry.quality-strong {
  color: #7fe6c6;
  border-color: rgba(43, 212, 161, 0.18);
  background: rgba(43, 212, 161, 0.055);
}

.result-industry.quality-mid {
  color: #e0bd83;
  border-color: rgba(238, 179, 91, 0.16);
  background: rgba(238, 179, 91, 0.045);
}

@media (max-width: 700px) {
  .result-score {
    width: 42px;
    height: 42px;
  }

  .result-name {
    font-size: 14.5px;
  }

  .result-metrics {
    gap: 8px 6px;
  }

  .result-tag {
    font-size: 10px;
  }
}

/* Screener legibility + reliable result-card flow */
.screener-header p {
  font-size: 14px;
}

.screener-pattern {
  font-size: 13px;
}

.screener-pattern > span {
  padding: 5px 8px;
}

.screener-pattern > span i {
  font-size: 10px;
}

.run-screener {
  height: 42px;
  font-size: 14.5px;
}

.param-toggle {
  height: 37px;
  font-size: 13px;
}

.screener-universe {
  font-size: 12px;
}

.param-field > span {
  font-size: 12px;
}

.input-unit {
  height: 36px;
}

.input-unit input {
  font-size: 13.5px;
}

.input-unit em {
  font-size: 10.5px;
}

.param-check {
  font-size: 12.5px;
}

.param-reset {
  font-size: 12px;
}

.screener-empty h3 {
  font-size: 18px;
}

.screener-empty p {
  max-width: 650px;
  font-size: 13.5px;
}

.scan-estimate {
  font-size: 11.5px;
}

.screener-progress .progress-row {
  font-size: 13px;
}

.screener-progress p {
  font-size: 11.5px;
}

.screener-summary {
  font-size: 12px;
}

.summary-stat b {
  font-size: 18px;
}

.screener-result {
  align-items: start;
}

.result-main {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
  min-width: 0;
}

.result-score {
  align-self: start;
}

.result-name {
  font-size: 16.5px;
}

.result-code {
  font-size: 11px;
}

.result-industry {
  font-size: 10px;
  padding: 2px 6px;
}

.result-price {
  font-size: 14.5px;
}

.result-price em {
  font-size: 11px;
}

.result-metrics {
  margin-top: 1px;
  padding-top: 10px;
  gap: 9px;
}

.result-metric span {
  font-size: 11px;
}

.result-metric b {
  font-size: 12px;
}

.result-tags {
  margin-top: 1px;
}

.result-tag {
  font-size: 10.5px;
  padding: 2px 6px;
}

.result-footer {
  margin-top: 1px;
}

.result-hold {
  font-size: 11.5px;
}

.result-cta {
  font-size: 12px;
}

.screener-footer {
  font-size: 11px;
}

@media (max-width: 700px) {
  .screener-pattern {
    font-size: 12px;
  }

  .screener-header p {
    font-size: 13px;
  }

  .screener-empty p {
    font-size: 13px;
  }

  .run-screener {
    font-size: 14px;
  }

  .result-name {
    font-size: 15.5px;
  }

  .result-price {
    font-size: 13.5px;
  }

  .result-metric span {
    font-size: 11px;
  }

  .result-metric b {
    font-size: 12px;
  }

  .result-hold {
    font-size: 11px;
  }

  .result-cta {
    font-size: 11.5px;
  }
}

/* Reset the search-result flex rules that also match .result-main */
.result-main {
  align-items: stretch;
  flex-wrap: nowrap;
  text-align: left;
}

.screener-method {
  width: 100%;
  padding-top: 8px;
  border-top: 1px dashed rgba(139, 166, 201, 0.1);
}

.screener-method summary {
  color: #8fa0b5;
  font-size: 11px;
  cursor: pointer;
}

.screener-method p {
  margin: 6px 0 0;
  color: #7f90a6;
  font-size: 11px;
  line-height: 1.7;
}

.screener-method .screener-param-line {
  color: #8b9bb0;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.7;
}

.result-score span {
  font-size: 9px;
}

.summary-note {
  color: #8fa0b5;
  font-size: 11px;
}

.summary-note.warn {
  color: #e3b46d;
}

.screener-filter-note {
  margin-top: 9px;
  padding: 6px 8px;
  color: #aa9a80;
  font-size: 11px;
  line-height: 1.6;
  border-left: 2px solid rgba(238, 179, 91, 0.32);
  border-radius: 0 4px 4px 0;
  background: rgba(238, 179, 91, 0.035);
}

.result-cap {
  padding: 2px 6px;
  color: #d8bd91;
  font-family: var(--mono);
  font-size: 9.5px;
  border: 1px solid rgba(238, 179, 91, 0.12);
  border-radius: 3px;
  background: rgba(238, 179, 91, 0.035);
  white-space: nowrap;
}

@media (max-width: 700px) {
  .screener-filter-note {
    font-size: 11px;
  }

  .result-cap {
    font-size: 10px;
  }
}

.progress-track i {
  background-image: linear-gradient(90deg, #c38931, #f3ca82, #e2ab55, #c38931);
  background-size: 180% 100%;
  animation: progress-flow 1.8s linear infinite;
}

@keyframes progress-flow {
  to { background-position: -180% 0; }
}

/* Key level prices live outside the canvas so they never cover price action */
.key-levels-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 35px;
  padding: 5px 18px;
  overflow: hidden;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(5, 10, 16, 0.3);
}

.key-levels-caption {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  flex: 0 0 auto;
  color: #7f90a6;
  font-size: 10px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.key-levels-caption i {
  width: 5px;
  height: 5px;
  border: 1px solid var(--gold);
  border-radius: 1px;
  background: rgba(238, 179, 91, 0.18);
}

.key-levels-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  min-width: 0;
}

.key-level-chip {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  font-size: 10.5px;
  white-space: nowrap;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 130ms ease, background 130ms ease;
}

.key-level-chip span {
  color: #7c8da3;
  font-size: 9.5px;
}

.key-level-chip b {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.key-level-chip.support {
  color: #e6bd7f;
  border-color: rgba(238, 179, 91, 0.15);
  background: rgba(238, 179, 91, 0.045);
}

.key-level-chip.resistance {
  color: #8bb8ef;
  border-color: rgba(109, 168, 255, 0.14);
  background: rgba(109, 168, 255, 0.04);
}

.key-level-chip:hover {
  border-color: rgba(238, 179, 91, 0.3);
  background: rgba(238, 179, 91, 0.085);
}

.key-level-chip.resistance:hover {
  border-color: rgba(109, 168, 255, 0.3);
  background: rgba(109, 168, 255, 0.08);
}

.key-levels-hint {
  margin-left: auto;
  color: #64758b;
  font-size: 9.5px;
  white-space: nowrap;
}

.chart-stage {
  height: clamp(500px, calc(100vh - 388px), 680px);
}

@media (max-width: 1180px) {
  .chart-stage {
    height: clamp(480px, 60vh, 630px);
  }
}

@media (max-width: 700px) {
  .key-levels-bar {
    gap: 7px;
    min-height: 34px;
    padding: 5px 12px;
  }

  .key-levels-caption {
    font-size: 9.5px;
  }

  .key-levels-hint {
    display: none;
  }

  .key-level-chip {
    height: 23px;
    padding: 0 7px;
    font-size: 10px;
  }

  .key-level-chip.secondary {
    display: none;
  }

  .chart-stage {
    height: 438px;
  }
}

@media (max-width: 430px) {
  .chart-stage {
    height: 405px;
  }
}

/* Screener capital / disclosure intelligence */
.screener-intel-note {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  align-items: baseline;
  margin-top: 7px;
  color: #8293a9;
  font-size: 10.5px;
  line-height: 1.6;
}

.screener-intel-note b {
  color: #d7b67f;
  font-size: 10.5px;
  font-weight: 550;
}

.screener-intel-note span {
  position: relative;
  padding-left: 9px;
}

.screener-intel-note span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(238, 179, 91, 0.42);
}

.screener-summary .highlight-stat b {
  color: #f2cb8c;
}

.screener-summary .intel-legend {
  flex-basis: 100%;
  width: 100%;
  padding-top: 6px;
  color: #71839a;
  font-size: 10px;
  line-height: 1.65;
  border-top: 1px dashed rgba(139, 166, 201, 0.09);
}

.screener-result.is-highlighted {
  position: relative;
  border-color: rgba(238, 179, 91, 0.24);
}

.screener-result.is-highlighted.strong {
  border-color: rgba(238, 179, 91, 0.52);
  background:
    linear-gradient(100deg, rgba(238, 179, 91, 0.085), transparent 58%),
    rgba(255, 255, 255, 0.012);
  box-shadow:
    inset 3px 0 0 rgba(232, 179, 94, 0.85),
    0 8px 26px rgba(0, 0, 0, 0.26),
    0 0 24px rgba(198, 137, 43, 0.08);
}

.screener-result.is-highlighted.watch {
  border-color: rgba(238, 179, 91, 0.34);
  background:
    linear-gradient(100deg, rgba(238, 179, 91, 0.045), transparent 55%),
    rgba(255, 255, 255, 0.01);
  box-shadow: inset 3px 0 0 rgba(232, 179, 94, 0.42);
}

.screener-result.is-highlighted.strong:hover {
  border-color: rgba(238, 179, 91, 0.72);
  background-color: rgba(238, 179, 91, 0.045);
}

.screener-result.is-highlighted.watch:hover {
  border-color: rgba(238, 179, 91, 0.54);
}

.result-hot-badge {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  padding: 2px 7px;
  font-size: 9.5px;
  font-weight: 550;
  line-height: 1.5;
  border-radius: 999px;
  white-space: nowrap;
}

.result-hot-badge::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.result-hot-badge.strong {
  color: #201607;
  border: 1px solid rgba(255, 224, 170, 0.55);
  background: linear-gradient(180deg, #f2c779, #dda347);
  box-shadow: 0 0 12px rgba(238, 179, 91, 0.24);
}

.result-hot-badge.watch {
  color: #e9c78e;
  border: 1px solid rgba(238, 179, 91, 0.3);
  background: rgba(238, 179, 91, 0.08);
}

.result-intel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px 18px;
  margin-top: 2px;
  padding-top: 9px;
  border-top: 1px dashed rgba(139, 166, 201, 0.1);
}

.intel-col {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
}

.intel-title {
  display: flex;
  gap: 5px;
  align-items: baseline;
}

.intel-title b {
  font-size: 11px;
  font-weight: 600;
}

.intel-col.bullish .intel-title b {
  color: #ff9ba5;
}

.intel-col.bearish .intel-title b {
  color: #79e3c5;
}

.intel-title em {
  color: #8596ab;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
}

.intel-more {
  color: #71839a;
  font-size: 9px;
}

.intel-item {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
  padding-left: 7px;
  border-left: 1px solid rgba(139, 166, 201, 0.12);
}

.intel-item.bullish {
  border-left-color: rgba(255, 122, 135, 0.25);
}

.intel-item.bearish {
  border-left-color: rgba(77, 207, 168, 0.22);
}

.intel-item-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
  min-width: 0;
}

.intel-item-head i {
  flex: 0 0 auto;
  padding: 0 4px;
  color: #8395aa;
  font-size: 8.5px;
  font-style: normal;
  line-height: 1.45;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.018);
}

.intel-item-head b {
  color: #bcc9d8;
  font-size: 10.5px;
  font-weight: 500;
  line-height: 1.45;
}

.intel-detail {
  color: #7b8da3;
  font-size: 9.5px;
  line-height: 1.55;
}

.intel-empty {
  color: #65778d;
  font-size: 9.5px;
  line-height: 1.55;
}

.intel-partial {
  grid-column: 1 / -1;
  color: #c89f62;
  font-size: 9.5px;
}

@media (max-width: 700px) {
  .screener-intel-note {
    font-size: 10px;
  }

  .result-hot-badge {
    font-size: 9.5px;
  }

  .result-intel {
    grid-template-columns: 1fr;
    gap: 8px;
    padding-top: 8px;
  }

  .intel-item-head b {
    font-size: 10.5px;
  }

  .intel-detail {
    font-size: 10px;
  }
}

/* Slightly larger factor text for readability */
.result-hot-badge {
  font-size: 10px;
}

.intel-title b {
  font-size: 12px;
}

.intel-title em,
.intel-more {
  font-size: 9.5px;
}

.intel-item-head i {
  font-size: 9.5px;
}

.intel-item-head b {
  font-size: 11.5px;
}

.intel-detail,
.intel-empty {
  font-size: 10.5px;
}

.screener-summary .intel-legend {
  font-size: 10.5px;
}

.screener-intel-note {
  font-size: 11px;
}

@media (max-width: 700px) {
  .intel-item-head b {
    font-size: 11.5px;
  }

  .intel-detail,
  .intel-empty {
    font-size: 10.5px;
  }
}

.lowbase-trigger {
  color: #a9c8ef;
  border-color: rgba(109, 168, 255, 0.24);
  background: linear-gradient(180deg, rgba(109, 168, 255, 0.11), rgba(109, 168, 255, 0.035));
}

.lowbase-trigger:hover {
  border-color: rgba(109, 168, 255, 0.45);
  background: rgba(109, 168, 255, 0.14);
}

.lowbase-trigger svg {
  width: 15px;
  height: 15px;
}

.lowbase-run {
  background: linear-gradient(180deg, #cfe3fb, #9bbfe9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 18px rgba(70, 112, 166, 0.12);
}

.lowbase-run:hover:not(:disabled) {
  filter: brightness(1.06);
}

/* Current-day trade plan */
.trade-plan-card {
  border-color: rgba(238, 179, 91, 0.18);
  background:
    radial-gradient(340px 180px at 100% 0%, rgba(238, 179, 91, 0.05), transparent 65%),
    var(--panel-2);
}

.trade-plan-hero {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 11px;
  border: 1px solid rgba(238, 179, 91, 0.14);
  border-radius: 8px;
  background: rgba(238, 179, 91, 0.035);
}

.trade-plan-hero > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 4px;
}

.trade-plan-hero b {
  color: #f0d19d;
  font-size: 16px;
  font-weight: 600;
}

.trade-plan-hero span {
  color: #8698ae;
  font-size: 10.5px;
  line-height: 1.55;
}

.trade-confidence {
  flex: 0 0 auto;
  color: #e4bd7c;
  font-family: var(--mono);
  font-size: 18px;
  line-height: 1;
  text-align: right;
}

.trade-confidence em {
  display: block;
  margin-top: 3px;
  color: #73859b;
  font-family: var(--sans);
  font-size: 8.5px;
  font-style: normal;
}

.trade-reasons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.trade-reason {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 6px 8px;
  border-left: 2px solid rgba(238, 179, 91, 0.28);
  border-radius: 0 5px 5px 0;
  background: rgba(255, 255, 255, 0.018);
}

.trade-reason-kind {
  flex: 0 0 auto;
  padding: 1px 5px;
  color: #e1bd85;
  font-size: 9px;
  line-height: 1.55;
  border: 1px solid rgba(238, 179, 91, 0.14);
  border-radius: 3px;
  background: rgba(238, 179, 91, 0.045);
  white-space: nowrap;
}

.trade-reason-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.trade-reason-main b {
  color: #b8c6d7;
  font-size: 10.5px;
  font-weight: 450;
  line-height: 1.55;
}

.trade-reason-main em {
  color: #6f8198;
  font-family: var(--mono);
  font-size: 8.5px;
  font-style: normal;
}

.trade-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin-top: 10px;
  overflow: hidden;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 7px;
  background: rgba(139, 166, 201, 0.1);
}

.trade-level {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
  padding: 8px 9px;
  background: #0d1622;
}

.trade-level span {
  color: #74869c;
  font-size: 9px;
}

.trade-level b {
  color: #d6e1ee;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.trade-level.stop b {
  color: #ff9ba5;
}

.trade-invalidation {
  margin: 9px 0 0;
  color: #c89c67;
  font-size: 10px;
  line-height: 1.6;
}

.trade-plan-empty {
  padding: 8px 2px 2px;
}

@media (max-width: 700px) {
  .trade-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .trade-plan-hero b {
    font-size: 17px;
  }
}

.universe-explain {
  flex-basis: 100%;
  width: 100%;
  color: #7c8da3;
  font-size: 10.5px;
  line-height: 1.65;
  padding-top: 5px;
  border-top: 1px dashed rgba(139, 166, 201, 0.08);
}

/* Strong-candidate recommendation panel */
.recommendation-panel {
  overflow: hidden;
  padding: 12px;
  border: 1px solid rgba(238, 179, 91, 0.28);
  border-radius: 11px;
  background:
    radial-gradient(520px 160px at 0% 0%, rgba(238, 179, 91, 0.09), transparent 65%),
    linear-gradient(180deg, rgba(238, 179, 91, 0.045), rgba(255, 255, 255, 0.008));
  box-shadow: 0 7px 24px rgba(0, 0, 0, 0.18);
}

.recommendation-head {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 16px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 9px;
  border-bottom: 1px dashed rgba(238, 179, 91, 0.16);
}

.recommendation-head h3 {
  margin: 2px 0 0;
  color: #f0d29f;
  font-size: 17px;
  font-weight: 600;
}

.recommendation-head .kicker {
  color: #b8925a;
}

.rec-method {
  color: #8b9bb0;
  font-size: 10px;
  line-height: 1.55;
}

.recommendation-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 8px;
}

.recommendation-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  width: 100%;
  padding: 8px 9px;
  text-align: left;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.018);
  transition: border-color 130ms ease, background 130ms ease;
}

.recommendation-item:hover {
  border-color: rgba(238, 179, 91, 0.36);
  background: rgba(238, 179, 91, 0.055);
}

.rec-rank {
  color: #e8bc74;
  font-family: var(--mono);
  font-size: 16px;
  text-align: center;
}

.rec-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.rec-title {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

.rec-title b {
  color: #e6eef8;
  font-size: 14px;
  font-weight: 600;
}

.rec-title > span:not(.rec-hot) {
  color: #75879d;
  font-family: var(--mono);
  font-size: 9.5px;
}

.rec-title em {
  color: #e3bf87;
  font-family: var(--mono);
  font-size: 10px;
  font-style: normal;
}

.rec-hot {
  padding: 1px 5px;
  color: #f0ce95;
  font-size: 9px;
  border: 1px solid rgba(238, 179, 91, 0.23);
  border-radius: 999px;
}

.rec-reason {
  display: -webkit-box;
  overflow: hidden;
  color: #aab8c9;
  font-size: 10.5px;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rec-risk {
  overflow: hidden;
  color: #8e9db0;
  font-size: 9.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rec-cta {
  color: #d9b576;
  font-size: 10px;
  white-space: nowrap;
}

.rec-note {
  margin: 7px 0 0;
  color: #6f8196;
  font-size: 9.5px;
  line-height: 1.55;
}

.recommendation-empty {
  padding: 9px 11px;
  color: #9d8969;
  font-size: 10.5px;
  line-height: 1.6;
  border: 1px dashed rgba(238, 179, 91, 0.16);
  border-radius: 7px;
  background: rgba(238, 179, 91, 0.025);
}

.summary-stat.recommendation-stat b {
  color: #e8b867;
}

.result-pick-badge {
  padding: 2px 7px;
  color: #f4d49b;
  font-size: 9.5px;
  font-weight: 550;
  line-height: 1.5;
  border: 1px solid rgba(238, 179, 91, 0.32);
  border-radius: 999px;
  background: rgba(238, 179, 91, 0.09);
  box-shadow: 0 0 10px rgba(238, 179, 91, 0.08);
  white-space: nowrap;
}

.screener-result.is-top-pick {
  border-color: rgba(238, 179, 91, 0.46);
}

.screener-result.is-top-pick:not(.is-highlighted) {
  box-shadow: inset 0 0 0 1px rgba(238, 179, 91, 0.12);
}

@media (max-width: 700px) {
  .recommendation-panel {
    padding: 10px;
  }

  .recommendation-head h3 {
    font-size: 16px;
  }

  .rec-method {
    width: 100%;
    font-size: 9.5px;
  }

  .recommendation-item {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
  }

  .rec-rank {
    font-size: 14px;
  }

  .rec-cta {
    display: none;
  }

  .rec-reason {
    font-size: 10.5px;
  }

  .rec-risk {
    font-size: 10px;
    white-space: normal;
  }
}

.rec-prob {
  color: #f0c47b !important;
  font-family: var(--mono);
  font-size: 11px !important;
  font-style: normal;
  font-weight: 600;
}

.rec-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 7px;
  align-items: center;
  color: #75879d;
  font-size: 9px;
  line-height: 1.5;
}

.rec-dims > span {
  display: inline-flex;
  gap: 2px;
  align-items: baseline;
  white-space: nowrap;
}

.rec-dims b {
  color: #acbdd0;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
}

.rec-dims .rec-target {
  color: #8b9bb0;
  padding-left: 5px;
  border-left: 1px solid rgba(139, 166, 201, 0.14);
}

.market-context {
  flex-basis: 100%;
  width: 100%;
  color: #8b9bb0;
  font-size: 10.5px;
  line-height: 1.65;
  padding-top: 5px;
  border-top: 1px dashed rgba(139, 166, 201, 0.08);
}

.market-context b {
  color: #e2bd83;
  font-weight: 550;
}

@media (max-width: 700px) {
  .rec-dims {
    gap: 3px 6px;
    font-size: 9.5px;
  }

  .rec-dims b {
    font-size: 10px;
  }

  .market-context {
    font-size: 10px;
  }
}

/* Recommendation metrics need to be readable, not fine print */
.rec-dims {
  font-size: 10px;
}

.rec-dims b {
  font-size: 10.5px;
}

.rec-reason {
  font-size: 11.5px;
}

.rec-risk {
  font-size: 10.5px;
}

.rec-prob {
  font-size: 12.5px !important;
}

.rec-method {
  font-size: 10.5px;
}

.rec-note {
  font-size: 10px;
}

@media (max-width: 700px) {
  .rec-reason {
    font-size: 11px;
  }

  .rec-risk {
    font-size: 10.5px;
  }

  .rec-dims {
    font-size: 10px;
  }
}

.source-select {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  height: 34px;
  width: 82px;
  padding: 0 7px 0 8px;
  color: #8fa1b6;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
}

.source-select select {
  height: 26px;
  width: 100%;
  padding: 0 2px;
  color: #c3d1e1;
  font-size: 11px;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
}

.source-select select option {
  color: #d9e4f1;
  background: #101a27;
}

.source-select:focus-within {
  border-color: rgba(238, 179, 91, 0.35);
}

@media (max-width: 860px) {
  .source-select {
    width: 73px;
    padding: 0 4px;
  }

  .source-select > span {
    display: none;
  }

  .source-select select {
    width: 100%;
    font-size: 10px;
  }
}

.layer-dot.ma {
  color: #f2c66d;
}

.legend-line.ma5 {
  background: #f2c66d;
}

.legend-line.ma12 {
  background: #6da8ff;
}

.legend-line.ma250 {
  background: #c18cff;
}

.ma-legend-item b {
  color: #b9c8d9;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  margin-left: 2px;
}

@media (max-width: 700px) {
  .ma-legend-item b {
    font-size: 9px;
  }
}

/* 龙头战法 / 游资买点 */
.leader-trigger {
  color: #e6c2ff;
  border-color: rgba(193, 140, 255, 0.3);
  background: linear-gradient(180deg, rgba(193, 140, 255, 0.14), rgba(193, 140, 255, 0.04));
}

.leader-trigger:hover {
  border-color: rgba(193, 140, 255, 0.55);
  background: rgba(193, 140, 255, 0.17);
}

.leader-run {
  border-color: rgba(193, 140, 255, 0.38);
  background: linear-gradient(180deg, rgba(193, 140, 255, 0.2), rgba(193, 140, 255, 0.08));
  color: #e9d5ff;
}

.leader-type-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 13px;
  align-items: center;
  margin: 9px 0 2px;
  padding: 8px 11px;
  color: #8394aa;
  font-size: 10px;
  border: 1px dashed rgba(193, 140, 255, 0.13);
  border-radius: 7px;
  background: rgba(193, 140, 255, 0.025);
}

.leader-type-legend > span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  white-space: nowrap;
}

.leader-mark-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.leader-mark-dot.divergence { color: #62d9ff; }
.leader-mark-dot.kb { color: #e0b8ff; }
.leader-mark-dot.weak { color: #ffb86b; }
.leader-mark-dot.first-yin { color: #7ee0b8; }
.leader-mark-dot.consensus { color: #f28a9b; }
.leader-mark-dot.second { color: #d6c06b; }

.leader-disclaimer {
  margin: 8px 0 0;
  color: #6f8197;
  font-size: 10px;
  line-height: 1.6;
}

.leader-result {
  border-color: rgba(193, 140, 255, 0.13);
}

.leader-result.is-top-pick {
  border-color: rgba(193, 140, 255, 0.42);
  box-shadow: inset 2px 0 0 rgba(193, 140, 255, 0.75), 0 0 22px rgba(193, 140, 255, 0.07);
}

.leader-marker {
  color: #d9b9ff;
  font-size: 10px;
  font-weight: 550;
  padding: 2px 6px;
  border: 1px solid rgba(193, 140, 255, 0.3);
  border-radius: 4px;
  background: rgba(193, 140, 255, 0.08);
}

.leader-buy-strip {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 9px 0 6px;
  padding: 9px 11px;
  border: 1px solid rgba(193, 140, 255, 0.17);
  border-radius: 7px;
  background: linear-gradient(100deg, rgba(193, 140, 255, 0.07), rgba(109, 168, 255, 0.025));
}

.leader-buy-strip.waiting {
  border-color: rgba(139, 166, 201, 0.1);
  background: rgba(255, 255, 255, 0.015);
}

.leader-buy-head {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: baseline;
}

.leader-buy-type {
  color: #ebd3ff;
  font-size: 13px;
  font-weight: 600;
}

.leader-buy-score {
  color: #c7a5ee;
  font-family: var(--mono);
  font-size: 11px;
}

.leader-buy-92 {
  color: #e8c98d;
  font-size: 10px;
  padding: 2px 6px;
  border: 1px solid rgba(232, 201, 141, 0.28);
  border-radius: 4px;
  background: rgba(232, 201, 141, 0.06);
}

.leader-buy-reason {
  color: #93a5ba;
  font-size: 10.5px;
  line-height: 1.65;
}

.leader-buy-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  color: #7f91a7;
  font-family: var(--mono);
  font-size: 9.5px;
}

.leader-buy-levels b {
  color: #b9c9da;
  font-weight: 500;
}

.leader-dims {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: #77899f;
  font-size: 9.5px;
}

.leader-dims b {
  color: #b8c8da;
  font-family: var(--mono);
  font-weight: 500;
}

.leader-warning {
  color: #e2b36f;
  font-size: 9.5px;
}

.leader-confidence {
  color: #d8b7ff;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 550;
}

.leader-role {
  color: #d6b4ff;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(193, 140, 255, 0.22);
  background: rgba(193, 140, 255, 0.06);
}

.leader-empty-mark {
  color: #6c7d92;
  font-size: 10.5px;
}

@media (max-width: 700px) {
  .leader-type-legend {
    gap: 5px 9px;
    font-size: 9.5px;
  }

  .leader-buy-type {
    font-size: 12px;
  }

  .leader-buy-reason {
    font-size: 10px;
  }

  .leader-dims {
    gap: 4px 8px;
  }
}

.leader-mark-dot.first-board { color: #ffd07d; }

.leader-profile-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 9px;
  align-items: baseline;
  margin: 4px 0 1px;
  color: #7d8da3;
  font-size: 9.5px;
}

.leader-profile-legend > span {
  color: #a68ec9;
  letter-spacing: 0.08em;
}

.leader-profile-legend b {
  color: #d7c3ef;
  font-weight: 550;
}

.leader-profile-legend em {
  color: #697b91;
  font-style: normal;
}

.trader-match-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 7px 0 5px;
  padding: 7px 10px;
  border-left: 2px solid rgba(193, 140, 255, 0.42);
  border-radius: 0 6px 6px 0;
  background: rgba(193, 140, 255, 0.035);
}

.trader-match-block.none {
  border-left-color: rgba(139, 166, 201, 0.14);
  color: #6f8197;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.012);
}

.trader-match-block.none b {
  margin-right: 7px;
  color: #8798ad;
  font-weight: 500;
}

.trader-match-block.none em {
  font-style: normal;
}

.trader-match-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 7px;
  align-items: center;
}

.trader-match-row > b {
  color: #b79cff;
  font-size: 10px;
  font-weight: 550;
}

.trader-chip {
  color: #d7c3ef;
  font-size: 9.5px;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(193, 140, 255, 0.24);
  background: rgba(193, 140, 255, 0.07);
}

.trader-chip.seat {
  color: #f0cf94;
  border-color: rgba(238, 179, 91, 0.28);
  background: rgba(238, 179, 91, 0.06);
}

.trader-sell {
  color: #d9a8a8;
  font-size: 9.5px;
  line-height: 1.55;
}

.trader-evidence {
  color: #7c8da3;
  font-size: 9px;
  line-height: 1.55;
}

.rec-trader-name {
  color: #b79cff;
  font-family: var(--mono);
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  background: rgba(193, 140, 255, 0.07);
}

.rec-trader {
  color: #a98bc5;
  font-size: 9.5px;
  line-height: 1.55;
}

@media (max-width: 700px) {
  .leader-profile-legend {
    font-size: 9px;
  }

  .trader-match-block {
    padding: 6px 8px;
  }

  .trader-sell,
  .trader-evidence {
    font-size: 9px;
  }
}

.leader-profile-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  align-items: baseline;
  margin: 7px 0 0;
  padding: 7px 1px 0;
  color: #7f91a7;
  font-size: 9.5px;
  line-height: 1.6;
  border-top: 1px dashed rgba(139, 166, 201, 0.1);
}

.leader-profile-summary-title {
  color: #b79cff;
  letter-spacing: 0.08em;
}

.leader-profile-summary b {
  color: #cbb7e8;
  font-weight: 550;
}

@media (max-width: 700px) {
  .leader-profile-summary {
    font-size: 9px;
  }
}

.leader-profile-extended {
  margin: 5px 0 1px;
  color: #697b91;
  font-size: 9.5px;
  line-height: 1.55;
}

.leader-profile-extended em {
  color: #57697f;
  font-style: normal;
}

.support-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 7px 0 4px;
  padding: 8px 10px;
  border: 1px solid rgba(109, 168, 255, 0.12);
  border-radius: 6px;
  background: rgba(109, 168, 255, 0.025);
}

.support-block.strong {
  border-color: rgba(40, 206, 160, 0.25);
  background: rgba(40, 206, 160, 0.035);
}

.support-block.good {
  border-color: rgba(109, 168, 255, 0.22);
}

.support-block.weak {
  border-color: rgba(255, 93, 108, 0.2);
  background: rgba(255, 93, 108, 0.025);
}

.support-head {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: baseline;
  color: #9fb0c5;
  font-size: 10px;
}

.support-head b {
  color: #8fa6c0;
  font-weight: 550;
}

.support-head em {
  color: #dce9f7;
  font-family: var(--mono);
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
}

.support-head i {
  color: #8fd7c0;
  font-size: 10px;
  font-style: normal;
}

.support-block.weak .support-head i {
  color: #f0929f;
}

.support-head small {
  color: #657a92;
  font-size: 9px;
}

.support-reasons {
  color: #8799ae;
  font-size: 9.5px;
  line-height: 1.6;
}

.leader-thesis {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 7px 0 4px;
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
  color: #8c9fb4;
  font-size: 9.5px;
  line-height: 1.6;
}

.leader-thesis > b {
  color: #b7c8da;
  font-size: 10px;
  font-weight: 550;
}

.leader-thesis > span {
  display: flex;
  gap: 6px;
  align-items: baseline;
}

.leader-thesis i {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9d86bb;
  font-family: var(--mono);
  font-size: 8px;
  font-style: normal;
  border: 1px solid rgba(193, 140, 255, 0.25);
  border-radius: 50%;
}

@media (max-width: 700px) {
  .support-reasons,
  .leader-thesis {
    font-size: 9px;
  }
}

.param-select-wrap {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.022);
}

.param-select-wrap select {
  width: 100%;
  height: 30px;
  color: #c3d1e1;
  font-size: 11px;
  border: 0;
  outline: 0;
  background: transparent;
  cursor: pointer;
}

.param-select-wrap select option {
  color: #d9e4f1;
  background: #101a27;
}

.entry-plan-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 7px 0 4px;
  padding: 8px 10px;
  border: 1px solid rgba(238, 179, 91, 0.14);
  border-radius: 6px;
  background: rgba(238, 179, 91, 0.025);
}

.entry-plan-block.actionable {
  border-color: rgba(238, 179, 91, 0.32);
  background: linear-gradient(100deg, rgba(238, 179, 91, 0.08), rgba(238, 179, 91, 0.02));
}

.entry-plan-block.waiting {
  border-color: rgba(139, 166, 201, 0.1);
  background: rgba(255, 255, 255, 0.012);
}

.entry-plan-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 9px;
  align-items: baseline;
}

.entry-plan-head b {
  color: #c9a36e;
  font-size: 10px;
  font-weight: 550;
}

.entry-plan-head em {
  color: #f0cf94;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 550;
}

.entry-plan-block.waiting .entry-plan-head em {
  color: #96a8bd;
}

.entry-plan-head i {
  color: #8a9bb0;
  font-size: 9.5px;
  font-style: normal;
}

.entry-plan-meta {
  color: #93a5ba;
  font-size: 9.5px;
}

.entry-plan-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: #7e91a7;
  font-family: var(--mono);
  font-size: 9.5px;
}

.entry-plan-levels b {
  color: #c5d3e2;
  font-weight: 500;
}

.entry-plan-conditions,
.entry-plan-reason {
  color: #75879d;
  font-size: 9px;
  line-height: 1.55;
}

.entry-plan-reason {
  color: #8f80a2;
}

.rec-entry {
  color: #e2bd83;
  font-size: 9px;
  padding: 2px 5px;
  border: 1px solid rgba(238, 179, 91, 0.24);
  border-radius: 3px;
  background: rgba(238, 179, 91, 0.06);
}

.rec-entry.waiting {
  color: #8fa1b6;
  border-color: rgba(139, 166, 201, 0.18);
  background: transparent;
}

@media (max-width: 700px) {
  .entry-plan-block {
    padding: 7px 8px;
  }

  .entry-plan-head em {
    font-size: 11px;
  }
}

.decision-strip {
  display: grid;
  grid-template-columns: 1.25fr 1.25fr 0.85fr 0.85fr;
  gap: 5px;
  margin: 5px 0 3px;
  width: 100%;
}

.decision-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.016);
}

.decision-tile b {
  color: #708298;
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.decision-tile em {
  color: #c7d5e4;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 550;
  line-height: 1.35;
}

.decision-tile small {
  overflow: hidden;
  color: #687b91;
  font-size: 8.5px;
  line-height: 1.45;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.decision-tile.window {
  border-color: rgba(109, 168, 255, 0.2);
  background: rgba(109, 168, 255, 0.035);
}

.decision-tile.window em {
  color: #9ec4ff;
}

.decision-tile.action.closed,
.decision-tile.action.no_trade,
.decision-tile.action.too_late,
.decision-tile.action.wait {
  border-color: rgba(255, 93, 108, 0.16);
  background: rgba(255, 93, 108, 0.025);
}

.decision-tile.action.closed em,
.decision-tile.action.no_trade em,
.decision-tile.action.too_late em,
.decision-tile.action.wait em {
  color: #efa0aa;
}

.decision-tile.action.light,
.decision-tile.action.standard {
  border-color: rgba(40, 206, 160, 0.22);
  background: rgba(40, 206, 160, 0.03);
}

.decision-tile.action.light em,
.decision-tile.action.standard em {
  color: #8ce0c2;
}

.decision-tile.support em {
  color: #f0cf94;
}

.decision-tile.health em {
  color: #c7b9e8;
}

.decision-session {
  width: 100%;
  color: #c7a66f !important;
}

@media (max-width: 700px) {
  .decision-strip {
    grid-template-columns: 1fr 1fr;
  }

  .decision-tile small {
    -webkit-line-clamp: 2;
  }
}

/* 自选缓存池 */
.watchlist-trigger {
  color: #b9d4ee;
  border-color: rgba(109, 168, 255, 0.28);
  background: linear-gradient(180deg, rgba(109, 168, 255, 0.11), rgba(109, 168, 255, 0.03));
}

.watchlist-trigger:hover {
  border-color: rgba(109, 168, 255, 0.5);
  background: rgba(109, 168, 255, 0.14);
}

.watchlist-count {
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cfe7ff;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  border: 1px solid rgba(109, 168, 255, 0.26);
  border-radius: 8px;
  background: rgba(109, 168, 255, 0.12);
}

.watchlist-count.is-empty {
  color: #71849b;
  border-color: rgba(139, 166, 201, 0.14);
  background: transparent;
}

.watchlist-panel {
  width: min(1120px, calc(100vw - 48px));
}

.watchlist-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 11px;
}

.watchlist-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.watchlist-tabs button {
  height: 30px;
  padding: 0 10px;
  color: #75879d;
  font-size: 10.5px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
}

.watchlist-tabs button b {
  color: #8fa3b9;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
}

.watchlist-tabs button:hover,
.watchlist-tabs button.active {
  color: #cfe7ff;
  border-color: rgba(109, 168, 255, 0.2);
  background: rgba(109, 168, 255, 0.06);
}

.watchlist-tabs button.active b {
  color: #9ec4ff;
}

.watchlist-refresh-all {
  min-height: 34px;
  padding: 0 13px;
  border-color: rgba(109, 168, 255, 0.3);
  background: rgba(109, 168, 255, 0.08);
  color: #bcdcff;
  font-size: 11px;
}

.watchlist-refresh-all:disabled {
  opacity: 0.55;
  cursor: wait;
}

.watchlist-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(109, 168, 255, 0.11);
  border-radius: 8px;
  background: rgba(109, 168, 255, 0.025);
}

.watchlist-summary .summary-stat {
  min-width: 90px;
}

.watchlist-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.watchlist-entry {
  padding: 11px 12px;
  border: 1px solid rgba(139, 166, 201, 0.12);
  border-left: 3px solid rgba(109, 168, 255, 0.3);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.watchlist-entry.matched {
  border-left-color: rgba(40, 206, 160, 0.7);
}

.watchlist-entry.not_matched,
.watchlist-entry.market_gate {
  border-left-color: rgba(255, 93, 108, 0.55);
}

.watchlist-entry.error {
  border-left-color: rgba(255, 93, 108, 0.8);
}

.watchlist-entry-head {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: center;
  justify-content: space-between;
}

.watchlist-entry-title {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  align-items: baseline;
}

.watchlist-entry-title b {
  color: #edf4ff;
  font-size: 15px;
  font-weight: 600;
}

.watchlist-entry-title > span {
  color: #71849a;
  font-family: var(--mono);
  font-size: 10px;
}

.watchlist-mode {
  color: #b9d4ee;
  font-size: 9px;
  font-style: normal;
  padding: 2px 6px;
  border: 1px solid rgba(109, 168, 255, 0.2);
  border-radius: 4px;
  background: rgba(109, 168, 255, 0.06);
}

.watchlist-date {
  font-family: inherit !important;
  font-size: 9.5px !important;
}

.watchlist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.watch-action {
  height: 25px;
  padding: 0 8px;
  color: #a9c3dd;
  font-size: 9.5px;
  border: 1px solid rgba(139, 166, 201, 0.17);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
}

.watch-action:hover {
  color: #e1efff;
  border-color: rgba(109, 168, 255, 0.4);
  background: rgba(109, 168, 255, 0.08);
}

.watch-action.danger:hover {
  color: #ffc3c9;
  border-color: rgba(255, 93, 108, 0.35);
  background: rgba(255, 93, 108, 0.06);
}

.watchlist-entry-body {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 8px;
  margin-top: 8px;
}

.watchlist-snapshot {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  padding: 7px 9px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
}

.watchlist-snapshot.selected {
  border: 1px solid rgba(139, 166, 201, 0.1);
}

.watchlist-snapshot.refresh {
  border: 1px solid rgba(109, 168, 255, 0.12);
}

.watchlist-snapshot.refresh.matched {
  border-color: rgba(40, 206, 160, 0.18);
  background: rgba(40, 206, 160, 0.025);
}

.watchlist-snapshot.refresh.not_matched,
.watchlist-snapshot.refresh.market_gate,
.watchlist-snapshot.refresh.error {
  border-color: rgba(255, 93, 108, 0.17);
  background: rgba(255, 93, 108, 0.02);
}

.watchlist-col-title {
  color: #72869c;
  font-size: 9px;
  line-height: 1.5;
}

.watchlist-col-title em {
  color: #9fb4ca;
  font-style: normal;
  margin-left: 5px;
}

.watchlist-snapshot.refresh.matched .watchlist-col-title em {
  color: #8ce0c2;
}

.watchlist-snapshot.refresh.not_matched .watchlist-col-title em,
.watchlist-snapshot.refresh.market_gate .watchlist-col-title em,
.watchlist-snapshot.refresh.error .watchlist-col-title em {
  color: #efa0aa;
}

.watchlist-snapshot b {
  color: #c5d5e5;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.55;
}

.watchlist-snapshot > span:not(.watchlist-col-title) {
  color: #7d90a5;
  font-size: 9px;
  line-height: 1.55;
}

.watchlist-snapshot.refresh b {
  color: #b7d7f4;
}

@media (max-width: 860px) {
  .watchlist-entry-body {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .watchlist-panel {
    width: 100%;
  }

  .watchlist-toolbar {
    align-items: stretch;
  }

  .watchlist-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    max-width: 100%;
    padding-bottom: 2px;
  }

  .watchlist-tabs button {
    white-space: nowrap;
  }

  .watchlist-refresh-all {
    width: 100%;
    justify-content: center;
  }

  .watchlist-entry-head {
    align-items: flex-start;
  }

  .watchlist-actions {
    width: 100%;
  }

  .watch-action {
    flex: 1;
    justify-content: center;
  }

  .watchlist-summary .summary-stat {
    min-width: 70px;
  }
}

/* Manual add to watchlist */
.watch-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 22px;
  padding: 0 7px;
  color: #9fc8ea;
  font-size: 9.5px;
  white-space: nowrap;
  border: 1px solid rgba(109, 168, 255, 0.26);
  border-radius: 4px;
  background: rgba(109, 168, 255, 0.06);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}

.watch-add:hover {
  color: #d7ecff;
  border-color: rgba(109, 168, 255, 0.55);
  background: rgba(109, 168, 255, 0.14);
}

.watch-add.added {
  color: #83d9bc;
  border-color: rgba(40, 206, 160, 0.25);
  background: rgba(40, 206, 160, 0.06);
  cursor: default;
}

.watch-add[data-loading="1"] {
  opacity: 0.65;
  cursor: wait;
}

.rec-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 700px) {
  .watch-add {
    height: 24px;
    font-size: 10px;
  }
}

/* Intraday T+0 strategy card */
.intraday-card {
  position: relative;
  margin-top: 14px;
  padding: 2px 0 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.016), transparent 110px),
    linear-gradient(180deg, #0b131e 0%, #090f18 100%);
  box-shadow: var(--shadow-card);
}

.intraday-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 15px 18px 10px;
  border-bottom: 1px solid var(--line-soft);
}

.intraday-head h2 {
  margin: 4px 0 3px;
  color: #edf4ff;
  font-size: 20px;
  font-weight: 580;
  letter-spacing: 0.02em;
}

.intraday-head p {
  margin: 0;
  color: #75899f;
  font-family: var(--mono);
  font-size: 9.5px;
}

.intraday-head-right {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.intraday-badge {
  color: #f0cf94;
  font-size: 10px;
  padding: 3px 8px;
  border: 1px solid rgba(238, 179, 91, 0.28);
  border-radius: 5px;
  background: rgba(238, 179, 91, 0.07);
}

.intraday-badge.is-ok {
  color: #9fe6cd;
  border-color: rgba(40, 206, 160, 0.26);
  background: rgba(40, 206, 160, 0.06);
}

.intraday-badge.is-off {
  color: #e1a5ad;
  border-color: rgba(255, 93, 108, 0.22);
  background: rgba(255, 93, 108, 0.05);
}

.intraday-window {
  color: #788ca2;
  font-size: 9.5px;
}

.intraday-summary {
  margin: 10px 18px 0;
  padding: 8px 11px;
  color: #afc3d8;
  font-size: 11px;
  line-height: 1.65;
  border-left: 2px solid rgba(89, 200, 245, 0.4);
  border-radius: 0 5px 5px 0;
  background: rgba(89, 200, 245, 0.035);
}

.intraday-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  padding: 9px 18px 4px;
}

.intraday-stat {
  display: inline-flex;
  flex-direction: column;
  gap: 1px;
  min-width: 82px;
}

.intraday-stat > span {
  color: #71859b;
  font-size: 8.5px;
}

.intraday-stat > b {
  color: #c4d5e6;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
}

.intraday-stage {
  position: relative;
  height: 270px;
  margin: 5px 12px 0;
}

.intraday-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.intraday-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8194aa;
  font-size: 11px;
  background: rgba(8, 13, 21, 0.76);
}

.intraday-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 15px;
  align-items: center;
  padding: 7px 18px 0;
  color: #75899f;
  font-size: 9px;
}

.intraday-legend > span {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.intraday-swatch {
  width: 10px;
  height: 2px;
  border-radius: 1px;
}

.intraday-swatch.price { background: #e7f1ff; }
.intraday-swatch.vwap { background: #59c8f5; }
.intraday-swatch.prev { background: rgba(156, 171, 189, 0.55); }
.intraday-swatch.sell { background: #ffad72; }
.intraday-swatch.buy { background: #5fe0b0; }

.intraday-legend-hint {
  margin-left: auto;
  color: #a7845c;
}

.intraday-signals {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 18px 2px;
}

.intraday-no-signal {
  padding: 8px 10px;
  color: #7f91a7;
  font-size: 10px;
  border: 1px dashed rgba(139, 166, 201, 0.12);
  border-radius: 5px;
}

.intraday-signal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  padding: 7px 9px;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-left: 2px solid rgba(255, 173, 114, 0.55);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.014);
}

.intraday-signal.buy {
  border-left-color: rgba(95, 224, 176, 0.58);
}

.intraday-signal-time {
  color: #8095ab;
  font-family: var(--mono);
  font-size: 9.5px;
}

.intraday-signal-kind {
  color: #ffc08a;
  font-size: 11px;
  font-weight: 600;
}

.intraday-signal.buy .intraday-signal-kind {
  color: #8de3c4;
}

.intraday-signal-price {
  color: #edf4ff;
  font-family: var(--mono);
  font-size: 11px;
}

.intraday-signal-score,
.intraday-signal-levels,
.intraday-signal-reasons {
  color: #7e91a7;
  font-size: 9px;
}

.intraday-signal-levels {
  font-family: var(--mono);
}

.intraday-signal-reasons {
  flex-basis: 100%;
  color: #71859b;
  line-height: 1.55;
}

.intraday-rules {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 8px 18px 0;
}

.intraday-rules > span {
  padding: 7px 9px;
  color: #7d91a7;
  font-size: 9px;
  line-height: 1.6;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.012);
}

.intraday-rules > span.sell {
  border-left: 2px solid rgba(255, 173, 114, 0.5);
}

.intraday-rules > span.buy {
  border-left: 2px solid rgba(95, 224, 176, 0.5);
}

.intraday-rules b {
  display: block;
  margin-bottom: 2px;
  color: #c5d6e6;
  font-size: 9.5px;
  font-weight: 600;
}

.intraday-note {
  margin: 8px 18px 14px;
  color: #6d8096;
  font-size: 9px;
  line-height: 1.6;
}

@media (max-width: 700px) {
  .intraday-head {
    padding: 13px 14px 9px;
  }

  .intraday-head h2 {
    font-size: 18px;
  }

  .intraday-summary,
  .intraday-stats,
  .intraday-legend,
  .intraday-signals {
    margin-right: 14px;
    margin-left: 14px;
    padding-right: 0;
    padding-left: 0;
  }

  .intraday-stage {
    height: 230px;
    margin-right: 6px;
    margin-left: 6px;
  }

  .intraday-head-right {
    align-items: flex-start;
    width: 100%;
  }

  .intraday-legend-hint {
    width: 100%;
    margin-left: 0;
  }

  .intraday-stat {
    min-width: 74px;
  }

  .intraday-rules {
    grid-template-columns: 1fr;
    margin-right: 14px;
    margin-left: 14px;
  }

  .intraday-note {
    margin-right: 14px;
    margin-left: 14px;
  }
}


/* Merged intraday view inside the main chart card */
.intraday-view[hidden] { display: none !important; }

.chart-card.is-intraday .chart-stage,
.chart-card.is-intraday .chart-footer,
.chart-card.is-intraday .key-levels-bar,
.chart-card.is-intraday .overlay-toggles,
.chart-card.is-intraday .chart-tools,
.chart-card.is-intraday .toolbar-divider {
  display: none !important;
}

.chart-card.is-intraday .intraday-view {
  display: block;
  border-top: 1px solid var(--line-soft);
}

.chart-card.is-intraday .chart-toolbar {
  justify-content: flex-start;
}

.chart-card.is-intraday .intraday-card {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.chart-card.is-intraday .intraday-head {
  padding-top: 12px;
}


/* Strict structure audit */
.strict-audit {
  margin-top: 8px;
  padding: 6px 8px;
  color: #7f93a9;
  font-size: 9px;
  line-height: 1.55;
  border: 1px solid rgba(139, 166, 201, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.012);
}

.strict-audit.pass {
  color: #83cbb3;
  border-color: rgba(40, 206, 160, 0.16);
  background: rgba(40, 206, 160, 0.025);
}

.strict-audit.warn {
  color: #d3ab7d;
  border-color: rgba(238, 179, 91, 0.18);
  background: rgba(238, 179, 91, 0.03);
}

/* Login gate ------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 0%, rgba(238, 179, 91, 0.06), transparent 38%),
    radial-gradient(circle at 85% 80%, rgba(89, 200, 245, 0.035), transparent 30%),
    #080e16;
}

.login-shell {
  width: min(430px, 100%);
}

.login-card {
  position: relative;
  overflow: hidden;
  padding: 28px 28px 22px;
  border: 1px solid rgba(139, 166, 201, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 130px),
    linear-gradient(180deg, #0b141f 0%, #090f18 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
}

.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 18%;
  left: 18%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 179, 91, 0.45), transparent);
}

.login-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 25px;
}

.login-brand .brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: #f1d9aa;
  font-family: "Songti SC", SimSun, serif;
  font-size: 22px;
  border: 1px solid rgba(238, 179, 91, 0.42);
  border-radius: 9px;
  background: rgba(238, 179, 91, 0.07);
}

.login-brand .brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.login-brand .brand-copy b {
  color: #edf4ff;
  font-size: 16px;
  letter-spacing: 0.08em;
}

.login-brand .brand-copy em {
  color: #677b90;
  font-family: var(--mono);
  font-size: 7.5px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.login-card .kicker {
  color: #b9935c;
}

.login-card h1 {
  margin: 6px 0 7px;
  color: #f2f6fc;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.login-hint {
  margin: 0 0 21px;
  color: #8599ae;
  font-size: 11px;
  line-height: 1.7;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.login-field > span {
  color: #8296ab;
  font-size: 10px;
}

.login-field input {
  width: 100%;
  height: 39px;
  padding: 0 11px;
  color: #e9f2ff;
  font-family: var(--mono);
  font-size: 12px;
  border: 1px solid rgba(139, 166, 201, 0.19);
  border-radius: 6px;
  outline: none;
  background: rgba(255, 255, 255, 0.025);
  transition: border-color 120ms ease, background 120ms ease;
}

.login-field input:focus {
  border-color: rgba(238, 179, 91, 0.6);
  background: rgba(238, 179, 91, 0.035);
}

.login-submit {
  height: 41px;
  margin-top: 4px;
  color: #181108;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 220, 160, 0.5);
  border-radius: 6px;
  background: linear-gradient(180deg, #efd29b, #d9b477);
}

.login-submit:hover { filter: brightness(1.04); }
.login-submit:disabled { opacity: 0.55; cursor: wait; }

.login-error {
  margin: 12px 0 0;
  padding: 8px 10px;
  color: #ffadb7;
  font-size: 10.5px;
  line-height: 1.55;
  border: 1px solid rgba(255, 93, 108, 0.2);
  border-radius: 5px;
  background: rgba(255, 93, 108, 0.05);
}

.login-note {
  margin-top: 13px;
  color: #71859a;
  font-size: 9px;
  line-height: 1.65;
}

.login-security {
  margin: 17px 0 0;
  padding-top: 12px;
  color: #596c80;
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1.6;
  border-top: 1px solid rgba(139, 166, 201, 0.09);
}

/* Signed-in user chip in the main topbar */
.auth-chip {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  height: 31px;
  padding: 0 9px;
  color: #a9bdd2;
  font-size: 10px;
  border: 1px solid rgba(139, 166, 201, 0.15);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.018);
}

.auth-chip:hover {
  color: #e7f1ff;
  border-color: rgba(238, 179, 91, 0.28);
  background: rgba(238, 179, 91, 0.05);
}

.auth-chip .auth-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4fd2a7;
  box-shadow: 0 0 0 3px rgba(79, 210, 167, 0.08);
}

.auth-chip b {
  max-width: 88px;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-chip em {
  color: #70849a;
  font-size: 8.5px;
  font-style: normal;
}

@media (max-width: 700px) {
  .login-page { padding: 14px; }
  .login-card { padding: 23px 20px 18px; }
  .login-card h1 { font-size: 23px; }
  .auth-chip { padding: 0 7px; }
  .auth-chip b { display: none; }
  .auth-chip em { display: none; }
}

/* Account admin ---------------------------------------------------------- */
.admin-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(238, 179, 91, 0.055), transparent 28%),
    radial-gradient(circle at 88% 8%, rgba(89, 200, 245, 0.035), transparent 24%),
    #080e16;
}

.admin-topbar {
  display: flex;
  gap: 14px;
  align-items: center;
  height: 58px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(139, 166, 201, 0.12);
  background: rgba(8, 13, 21, 0.92);
  backdrop-filter: blur(10px);
}

.admin-brand {
  display: inline-flex;
  gap: 9px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.admin-brand .brand-mark {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  color: #f1d9aa;
  font-family: "Songti SC", SimSun, serif;
  font-size: 17px;
  border: 1px solid rgba(238, 179, 91, 0.4);
  border-radius: 7px;
  background: rgba(238, 179, 91, 0.06);
}

.admin-brand span:last-child {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.admin-brand b {
  color: #edf4ff;
  font-size: 13px;
  letter-spacing: 0.08em;
}

.admin-brand em {
  color: #697d92;
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
  letter-spacing: 0.08em;
}

.admin-top-sep {
  width: 1px;
  height: 22px;
  background: rgba(139, 166, 201, 0.14);
}

.admin-back {
  color: #8195aa;
  font-size: 10px;
  text-decoration: none;
}

.admin-back:hover { color: #e1edf9; }
.admin-top-spacer { flex: 1; }

.admin-self {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  color: #a8bccf;
  font-size: 10px;
}

.admin-self i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4fd2a7;
}

.admin-self em {
  color: #6d8196;
  font-family: var(--mono);
  font-size: 7px;
  font-style: normal;
}

.admin-logout,
.admin-ghost {
  height: 29px;
  padding: 0 9px;
  color: #8ea2b7;
  font-size: 9.5px;
  border: 1px solid rgba(139, 166, 201, 0.16);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.018);
}

.admin-logout:hover,
.admin-ghost:hover {
  color: #e6f0fb;
  border-color: rgba(238, 179, 91, 0.3);
}

.admin-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 28px 24px 46px;
}

.admin-hero {
  display: flex;
  gap: 20px;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 18px;
}

.admin-hero h1 {
  margin: 5px 0 6px;
  color: #f1f6fd;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.admin-hero p {
  margin: 0;
  color: #7e93a8;
  font-size: 11px;
}

.admin-primary {
  height: 36px;
  padding: 0 15px;
  color: #1a1207;
  font-size: 11px;
  font-weight: 650;
  border: 1px solid rgba(255, 220, 160, 0.48);
  border-radius: 6px;
  background: linear-gradient(180deg, #efd29b, #d9b477);
}

.admin-primary:disabled { opacity: 0.55; cursor: wait; }
.admin-primary:hover { filter: brightness(1.04); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 13px;
  border: 1px solid rgba(139, 166, 201, 0.11);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.016);
}

.admin-stat span {
  color: #6f8398;
  font-size: 9px;
}

.admin-stat b {
  color: #d9e6f4;
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 500;
}

.admin-card {
  overflow: hidden;
  border: 1px solid rgba(139, 166, 201, 0.12);
  border-radius: 9px;
  background: rgba(9, 15, 24, 0.7);
}

.admin-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 13px;
  border-bottom: 1px solid rgba(139, 166, 201, 0.1);
}

.admin-search input {
  width: min(280px, 100%);
  height: 30px;
  padding: 0 9px;
  color: #dbe8f6;
  font-size: 10px;
  border: 1px solid rgba(139, 166, 201, 0.15);
  border-radius: 5px;
  outline: none;
  background: rgba(255, 255, 255, 0.02);
}

.admin-search input:focus { border-color: rgba(238, 179, 91, 0.45); }

.admin-toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-updated {
  color: #5f7388;
  font-family: var(--mono);
  font-size: 8px;
}

.admin-table-wrap { overflow-x: auto; }

.admin-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  font-size: 10px;
}

.admin-table th {
  padding: 9px 12px;
  color: #61758a;
  font-size: 8px;
  font-weight: 500;
  text-align: left;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(139, 166, 201, 0.1);
}

.admin-table td {
  padding: 11px 12px;
  color: #a9bdcf;
  vertical-align: middle;
  border-bottom: 1px solid rgba(139, 166, 201, 0.06);
}

.admin-table tbody tr:hover { background: rgba(238, 179, 91, 0.025); }
.admin-table tbody tr.is-muted { opacity: 0.62; }
.admin-actions-col { text-align: right !important; }

.admin-user-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 7px;
  align-items: baseline;
}

.admin-user-cell b {
  color: #e2edf9;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
}

.admin-user-cell em {
  width: 100%;
  color: #677b90;
  font-size: 8.5px;
  font-style: normal;
}

.admin-you {
  color: #e0b879;
  font-size: 8px;
  padding: 1px 5px;
  border: 1px solid rgba(238, 179, 91, 0.22);
  border-radius: 3px;
}

.admin-role,
.admin-status {
  display: inline-block;
  padding: 2px 6px;
  font-size: 8.5px;
  border-radius: 3px;
}

.admin-role.admin {
  color: #e5c48f;
  border: 1px solid rgba(238, 179, 91, 0.24);
  background: rgba(238, 179, 91, 0.055);
}

.admin-role.user {
  color: #8fa9c1;
  border: 1px solid rgba(139, 166, 201, 0.15);
}

.admin-status.active { color: #8ce0c2; background: rgba(40, 206, 160, 0.055); }
.admin-status.disabled { color: #e4a1aa; background: rgba(255, 93, 108, 0.055); }

.admin-expiry { color: #bacddf; font-family: var(--mono); font-size: 9.5px; }
.admin-expiry.warn { color: #e6bd7f; }
.admin-expiry.bad { color: #f08f9a; }

.admin-table td small {
  display: block;
  margin-top: 2px;
  color: #677b90;
  font-size: 8px;
}

.admin-mono { color: #7f94a9 !important; font-family: var(--mono); font-size: 9px; }

.admin-sessions {
  color: #8fa6bc;
  font-family: var(--mono);
  font-size: 10px;
}

.admin-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
}

.admin-row-action {
  height: 23px;
  padding: 0 6px;
  color: #8fa5bb;
  font-size: 8.5px;
  border: 1px solid rgba(139, 166, 201, 0.15);
  border-radius: 3px;
  background: transparent;
}

.admin-row-action:hover { color: #e2eefb; border-color: rgba(238, 179, 91, 0.32); }
.admin-row-action.good { color: #86d9bb; }
.admin-row-action.warn { color: #d8b17c; }
.admin-row-action.bad { color: #de959e; }

.admin-empty {
  padding: 28px !important;
  color: #6c8095 !important;
  text-align: center;
}

.admin-footnote {
  margin: 11px 2px 0;
  color: #5e7287;
  font-size: 8.5px;
  line-height: 1.7;
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 700;
  display: grid;
  place-items: center;
  padding: 20px;
}

.admin-modal[hidden] { display: none !important; }

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 7, 12, 0.78);
  backdrop-filter: blur(4px);
}

.admin-modal-panel {
  position: relative;
  width: min(460px, 100%);
  padding: 18px 19px 16px;
  border: 1px solid rgba(139, 166, 201, 0.19);
  border-radius: 9px;
  background: linear-gradient(180deg, #0c1621, #090f18);
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
}

.admin-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.admin-modal-head h2 {
  margin: 4px 0 0;
  color: #edf4ff;
  font-size: 19px;
  font-weight: 550;
}

.admin-modal-close {
  width: 27px;
  height: 27px;
  color: #8195aa;
  font-size: 19px;
  line-height: 1;
  border: 0;
  background: transparent;
}

.admin-form { display: flex; flex-direction: column; gap: 10px; }

.admin-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-field > span {
  color: #7c91a6;
  font-size: 9px;
}

.admin-field > span em {
  color: #5f7388;
  font-size: 8px;
  font-style: normal;
}

.admin-field input,
.admin-field select {
  height: 32px;
  padding: 0 8px;
  color: #dae8f7;
  font-size: 10px;
  border: 1px solid rgba(139, 166, 201, 0.17);
  border-radius: 4px;
  outline: none;
  background: rgba(255, 255, 255, 0.022);
}

.admin-field input:focus,
.admin-field select:focus { border-color: rgba(238, 179, 91, 0.5); }
.admin-field input:disabled,
.admin-field select:disabled { opacity: 0.55; }

.admin-form-error {
  margin: 0;
  padding: 7px 8px;
  color: #f0a1aa;
  font-size: 9px;
  border: 1px solid rgba(255, 93, 108, 0.18);
  border-radius: 4px;
  background: rgba(255, 93, 108, 0.04);
}

.admin-form-actions {
  display: flex;
  gap: 7px;
  justify-content: flex-end;
  margin-top: 4px;
}

.admin-toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 800;
  padding: 9px 13px;
  color: #c8e9dc;
  font-size: 10px;
  border: 1px solid rgba(40, 206, 160, 0.25);
  border-radius: 5px;
  background: rgba(8, 22, 18, 0.95);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.admin-toast.error {
  color: #f0b0b8;
  border-color: rgba(255, 93, 108, 0.28);
  background: rgba(28, 10, 14, 0.95);
}

@media (max-width: 900px) {
  .admin-stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 700px) {
  .admin-topbar { height: auto; min-height: 54px; flex-wrap: wrap; padding: 9px 13px; gap: 8px; }
  .admin-back { order: 4; width: 100%; }
  .admin-top-spacer, .admin-self, .admin-top-sep { display: none; }
  .admin-shell { padding: 18px 13px 34px; }
  .admin-hero { align-items: flex-start; flex-direction: column; }
  .admin-hero h1 { font-size: 25px; }
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-toolbar { align-items: stretch; flex-direction: column; }
  .admin-search input { width: 100%; }
  .admin-toolbar-right { justify-content: space-between; }
  .admin-form-grid { grid-template-columns: 1fr; }
  .admin-toast { right: 13px; bottom: 13px; left: 13px; }
}


.admin-entry {
  color: #e4c28d;
  text-decoration: none;
  border-color: rgba(238, 179, 91, 0.25);
  background: rgba(238, 179, 91, 0.055);
}

.admin-entry:hover {
  color: #ffe0a8;
  border-color: rgba(238, 179, 91, 0.5);
  background: rgba(238, 179, 91, 0.1);
}

@media (max-width: 700px) {
  .admin-entry { padding: 0 7px; font-size: 9px; }
}
.auth-chip[hidden] { display: none !important; }


.screener-trigger[hidden] { display: none !important; }

/* Per-account screener permissions */
.admin-perm-badge {
  display: inline-block;
  padding: 2px 6px;
  font-size: 8.5px;
  white-space: nowrap;
  border-radius: 3px;
}

.admin-perm-badge.all {
  color: #d9bd8b;
  border: 1px solid rgba(238, 179, 91, 0.2);
  background: rgba(238, 179, 91, 0.045);
}

.admin-perm-badge.partial {
  color: #9cc9e9;
  border: 1px solid rgba(89, 200, 245, 0.18);
  background: rgba(89, 200, 245, 0.045);
}

.admin-perm-badge.none {
  color: #8b9daf;
  border: 1px solid rgba(139, 166, 201, 0.12);
}

.admin-permissions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border: 1px solid rgba(139, 166, 201, 0.12);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.012);
}

.admin-perm-label {
  color: #7c91a6;
  font-size: 9px;
}

.admin-perm-label em {
  color: #5f7388;
  font-size: 8px;
  font-style: normal;
}

.admin-perm-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.admin-perm-options label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  color: #b5c7d8;
  font-size: 9.5px;
  cursor: pointer;
}

.admin-perm-options input {
  width: 13px;
  height: 13px;
  accent-color: #d9b477;
}

/* Admin readability and audit ------------------------------------------- */
.admin-page { font-size: 14px; }
.admin-topbar { height: 64px; padding: 0 28px; }
.admin-brand b { font-size: 15px; }
.admin-brand em { font-size: 8px; }
.admin-back { font-size: 12px; }
.admin-self { font-size: 12px; }
.admin-self em { font-size: 8px; }
.admin-logout, .admin-ghost { height: 33px; padding: 0 12px; font-size: 11.5px; }
.admin-shell { max-width: 1380px; padding: 32px 28px 48px; }
.admin-hero h1 { font-size: 34px; }
.admin-hero p { font-size: 13px; line-height: 1.6; }
.admin-primary { height: 40px; padding: 0 18px; font-size: 12.5px; }
.admin-stat { padding: 14px 15px; }
.admin-stat span { font-size: 11px; }
.admin-stat b { font-size: 24px; }
.admin-toolbar { padding: 13px 15px; }
.admin-search input { width: min(340px, 100%); height: 35px; padding: 0 11px; font-size: 12.5px; }
.admin-updated { font-size: 10px; }
.admin-table { min-width: 1040px; font-size: 12px; }
.admin-table th { padding: 11px 13px; font-size: 10.5px; }
.admin-table td { padding: 13px; }
.admin-user-cell b { font-size: 13px; }
.admin-user-cell em { font-size: 10.5px; }
.admin-you { font-size: 9px; }
.admin-role, .admin-status { font-size: 10px; }
.admin-expiry { font-size: 11px; }
.admin-table td small { font-size: 9.5px; }
.admin-mono { font-size: 10.5px; }
.admin-ip { font-size: 10.5px !important; color: #9ab1c7 !important; }
.admin-sessions { font-size: 12px; }
.admin-row-action { height: 28px; padding: 0 8px; font-size: 10.5px; }
.admin-footnote { font-size: 10.5px; line-height: 1.7; }
.admin-modal-panel { width: min(520px, 100%); padding: 22px 23px 19px; }
.admin-modal-head h2 { font-size: 22px; }
.admin-modal-close { width: 32px; height: 32px; font-size: 22px; }
.admin-form { gap: 12px; }
.admin-field > span { font-size: 11px; }
.admin-field > span em { font-size: 9.5px; }
.admin-field input, .admin-field select { height: 37px; padding: 0 10px; font-size: 12.5px; }
.admin-form-error { font-size: 11px; }
.admin-form-actions { margin-top: 7px; }
.admin-perm-label { font-size: 11px; }
.admin-perm-label em { font-size: 9.5px; }
.admin-perm-options label { font-size: 11px; }
.admin-perm-options input { width: 15px; height: 15px; }
.admin-audit-card { margin-top: 18px; }
.admin-subtitle { margin: 0; color: #e4eef9; font-size: 19px; font-weight: 550; }
.admin-audit-card .admin-toolbar > div:first-child { display: flex; flex-direction: column; gap: 4px; }
.admin-audit-search { width: min(330px, 48vw); height: 34px; padding: 0 10px; color: #dce9f7; font-size: 12px; border: 1px solid rgba(139,166,201,.17); border-radius: 5px; outline: none; background: rgba(255,255,255,.022); }
.admin-audit-search:focus { border-color: rgba(238,179,91,.5); }
.admin-audit-table { min-width: 980px; }
.admin-audit-table .admin-audit-detail { max-width: 420px; color: #9eb2c6; line-height: 1.55; }
.admin-action { color: #cfdfef; font-size: 11px; }
@media (max-width: 700px) {
  .admin-page { font-size: 13px; }
  .admin-hero h1 { font-size: 28px; }
  .admin-hero p { font-size: 12px; }
  .admin-audit-search { width: 100%; }
  .admin-audit-card .admin-toolbar-right { width: 100%; }
  .admin-table { min-width: 900px; }
  .admin-table th { font-size: 10px; }
  .admin-table td { font-size: 11.5px; padding: 11px; }
}
