/* nevabase desk: black and gold trading-desk look shared by the hub and every market. */
@font-face { font-family: "Space Grotesk"; src: url("/static/fonts/SpaceGrotesk.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("/static/fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  color-scheme: dark;
  --night: #060606;
  --page: #060606;
  --fg-rgb: 239, 230, 210; --gold-rgb: 232, 201, 122; --glow-rgb: 201, 168, 76;
  --bg-rgb: 14, 12, 9; --bg2-rgb: 24, 21, 16; --shadow-rgb: 0, 0, 0; --chip-rgb: 143, 180, 242;
  --chip-fg: #b9cdf2; --opt-bg: #14120e; --flow: #fff6dc; --vignette: rgba(0, 0, 0, .7);
  --gild-btn: linear-gradient(180deg, #fff6dc 0%, #e8c97a 48%, #b8903a 100%);
  --ink: #0b0a08;
  --gold: #c9a84c;
  --gold-light: #e8c97a;
  --gold-deep: #5a4009;
  --ivory: #f3efe5;
  --text: #efe6d2;
  --muted: rgba(var(--fg-rgb), .58);
  --faint: rgba(var(--fg-rgb), .34);
  --line: rgba(var(--gold-rgb), .16);
  --line-strong: rgba(var(--gold-rgb), .42);
  --hair: rgba(var(--fg-rgb), .075);
  --hair-2: rgba(var(--fg-rgb), .12);
  --sans: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --code: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --gutter: clamp(14px, 2.4vw, 40px);
  --top: 72px;
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px;
  --lift: inset 0 1px 0 rgba(255, 244, 214, .06), 0 1px 2px rgba(var(--shadow-rgb), .4), 0 24px 60px -18px rgba(var(--shadow-rgb), .7);
  --gild: linear-gradient(180deg, #fff6dc 0%, var(--gold-light) 48%, #b8903a 100%);
  --up: #f2806c; --down: #4fc489;
  --ok: #9fd28a; --warn: #e8c97a; --no: #f0a088; --na: rgba(var(--fg-rgb), .42);
  /* charts: validated on #0c0b08 (lightness band, chroma, CVD all-pairs, contrast) */
  --viz-surface: #0c0b08; --series-1: #b8882a; --series-2: #3987e5; --series-3: #d55181;
  --viz-grid: rgba(var(--fg-rgb), .07); --viz-base: rgba(var(--fg-rgb), .22); --viz-muted: rgba(var(--fg-rgb), .42); --viz-ink: rgba(var(--fg-rgb), .78);
}
html[data-lang="en"] { --up: #4fc489; --down: #f2806c; }

/* light: ivory paper, ink text, deeper gold (charts validated on #fbf8f1) */
html[data-theme="light"] {
  color-scheme: light;
  --page: #f4efe4;
  --fg-rgb: 46, 36, 18; --gold-rgb: 150, 110, 30; --glow-rgb: 166, 124, 31;
  --bg-rgb: 255, 252, 246; --bg2-rgb: 255, 255, 255; --shadow-rgb: 90, 70, 30; --chip-rgb: 42, 120, 214;
  --chip-fg: #255da3; --opt-bg: #ffffff; --flow: #ffffff; --vignette: rgba(120, 90, 30, .10);
  --gold: #a67c1f; --gold-light: #8a6312; --gold-deep: #5a4009;
  --ivory: #17120a; --text: #2b2418;
  --muted: rgba(var(--fg-rgb), .68); --faint: rgba(var(--fg-rgb), .48);
  --line: rgba(var(--gold-rgb), .24); --line-strong: rgba(var(--gold-rgb), .52);
  --hair: rgba(var(--fg-rgb), .08); --hair-2: rgba(var(--fg-rgb), .13);
  --lift: inset 0 1px 0 rgba(255, 255, 255, .9), 0 1px 2px rgba(90, 70, 30, .08), 0 18px 44px -20px rgba(90, 70, 30, .28);
  --gild: linear-gradient(180deg, #c79a33 0%, #9a6f15 55%, #6f4f0d 100%);
  --gild-btn: linear-gradient(180deg, #f6e2a8 0%, #e2bf68 50%, #c49a3c 100%);
  --up: #c8402a; --down: #13824c;
  --ok: #2e7d32; --warn: #946200; --no: #b8432c; --na: rgba(var(--fg-rgb), .48);
  --viz-surface: #fbf8f1; --series-1: #a67c1f; --series-2: #2a78d6; --series-3: #d55181;
  --viz-grid: rgba(var(--fg-rgb), .08); --viz-base: rgba(var(--fg-rgb), .26); --viz-muted: rgba(var(--fg-rgb), .5); --viz-ink: rgba(var(--fg-rgb), .8);
}
html[data-theme="light"][data-lang="en"] { --up: #13824c; --down: #c8402a; }
html[data-theme="light"] .atmosphere { opacity: .7; }
html[data-theme="light"] .atmosphere::after { opacity: .05; }
html[data-theme="light"] .topbar { background: linear-gradient(180deg, rgba(244, 239, 228, .95), rgba(244, 239, 228, 0)); }
html[data-theme="light"] .edge.predict .ln, html[data-theme="light"] .node:hover rect.bg, html[data-theme="light"] .node.sel rect.bg { filter: none; }
html[data-theme="light"] .btn.buy { color: #fff; } html[data-theme="light"] .btn.sell { color: #fff; }
.theme-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--page); }
body { min-height: 100svh; font-family: var(--sans); color: var(--text); font-size: 14px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
::selection { background: var(--gold); color: var(--night); }
:focus-visible { outline: 1px solid var(--gold-light); outline-offset: 3px; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { border: 3px solid transparent; border-radius: 10px; background: rgba(var(--gold-rgb), .18) padding-box; }
.mono { font-family: var(--code); font-variant-numeric: tabular-nums; }
.small { font-size: 12px; } .muted { color: var(--muted); } .dim { color: var(--faint); }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--muted); }
.gild { background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* atmosphere: glow, grid, grain, vignette, particles, frame */
.atmosphere { position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 70% at 72% 40%, rgba(var(--glow-rgb), .10), transparent 60%),
    radial-gradient(ellipse 50% 40% at 10% 100%, rgba(90, 64, 9, .22), transparent 70%),
    linear-gradient(rgba(var(--gold-rgb), .035) 1px, transparent 1px) 0 0 / 100% 96px,
    linear-gradient(90deg, rgba(var(--gold-rgb), .035) 1px, transparent 1px) 0 0 / 96px 100%;
  mask-image: radial-gradient(ellipse 90% 90% at 50% 50%, #000 40%, transparent 100%); }
.atmosphere::after { content: ""; position: absolute; inset: 0; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
body::after { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; background: radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, var(--vignette)); }
#dust { position: fixed; inset: 0; z-index: 0; pointer-events: none; width: 100%; height: 100%; }
.frame { position: fixed; inset: 12px; z-index: 5; pointer-events: none; }
.frame i { position: absolute; width: 18px; height: 18px; border: 1px solid var(--line-strong); }
.frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; } .frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; } .frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }

/* top bar */
.topbar { position: fixed; inset: 0 0 auto; z-index: 20; height: var(--top); display: flex; align-items: center; gap: 16px; padding: 0 calc(var(--gutter) + 10px);
  background: linear-gradient(180deg, rgba(6, 6, 6, .92), rgba(6, 6, 6, 0)); }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand img { width: 26px; height: auto; filter: drop-shadow(0 0 10px rgba(var(--gold-rgb), .35)); transition: transform .8s var(--ease); }
.brand:hover img { transform: rotate(-12deg); }
.brand strong { font-size: 12px; font-weight: 700; letter-spacing: .32em; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand em { font-style: normal; font: 10px var(--code); letter-spacing: .2em; color: var(--faint); padding-left: 10px; border-left: 1px solid var(--line); }
.topbar .grow { flex: 1; }
.tb-tools { display: flex; align-items: center; gap: 14px; }
.sync { display: inline-flex; align-items: center; gap: 8px; font: 11px var(--code); letter-spacing: .06em; color: var(--faint); white-space: nowrap; }
.sync i { width: 6px; height: 6px; border-radius: 50%; background: #9fd28a; box-shadow: 0 0 8px #9fd28a; animation: blink 2.4s ease-in-out infinite; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(var(--bg-rgb), .6); backdrop-filter: blur(14px); font: 11.5px var(--code); color: var(--muted); white-space: nowrap; }
.chip b { font-weight: 600; }
.ask-pill { cursor: pointer; color: var(--muted); transition: color .2s, border-color .2s; } .ask-pill:hover { color: var(--ivory); border-color: var(--line-strong); }
.ask-pill kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; border-radius: 5px; font: 10px var(--code); border: 1px solid var(--line); background: rgba(var(--gold-rgb),.06); }
.icon-btn { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(var(--bg-rgb), .6); color: var(--muted); cursor: pointer; font: 11px var(--code); letter-spacing: .08em; transition: color .2s, border-color .2s; }
.icon-btn:hover { color: var(--gold-light); border-color: var(--line-strong); }
.me { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 0; cursor: pointer; overflow: hidden; font-size: 12px; font-weight: 700; color: var(--night);
  background: linear-gradient(135deg, #fff1c8, var(--gold-light) 40%, var(--gold) 100%); box-shadow: 0 0 0 2px var(--night), 0 0 0 3px rgba(var(--gold-rgb), .45), 0 0 22px rgba(var(--gold-rgb), .3); }
.me img { width: 100%; height: 100%; object-fit: cover; }
.acct { position: relative; }
.acct .menu { position: absolute; right: 0; top: 44px; min-width: 220px; padding: 6px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(var(--bg-rgb), .96); box-shadow: var(--lift); display: none; z-index: 40; }
.acct .menu.open { display: block; }
.acct .menu .who { padding: 8px 10px; border-bottom: 1px solid var(--hair-2); margin-bottom: 4px; display: grid; }
.acct .menu a, .acct .menu button { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: 13px; cursor: pointer; }
.acct .menu a:hover, .acct .menu button:hover { background: rgba(var(--gold-rgb), .08); color: var(--ivory); }

/* shell */
.shell { position: relative; z-index: 10; min-height: 100svh; display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 12px; padding: calc(var(--top) - 4px) var(--gutter) 24px; }
.side { position: sticky; top: calc(var(--top) - 4px); align-self: start; max-height: calc(100svh - var(--top) - 16px); display: flex; flex-direction: column; gap: 16px; padding: 12px 8px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(180deg, rgba(var(--bg-rgb), .66), rgba(var(--bg-rgb), .56)); backdrop-filter: blur(18px) saturate(125%); overflow-y: auto; animation: rise .8s var(--ease) both; }
.side-label { padding: 0 10px; margin-bottom: 4px; font: 10px var(--code); letter-spacing: .2em; color: var(--faint); }
.mkts { display: grid; gap: 6px; }
.mkt { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .03); transition: border-color .2s, background .2s; }
.mkt:hover { border-color: var(--line-strong); }
.mkt.on { border-color: var(--gold); background: linear-gradient(90deg, rgba(var(--gold-rgb), .14), rgba(var(--gold-rgb), .03)); box-shadow: 0 0 22px -10px rgba(var(--gold-rgb), .7); }
.mkt b { font-size: 14px; font-weight: 600; color: var(--ivory); }
.mkt small { grid-column: 1 / -1; font: 10px var(--code); letter-spacing: .06em; color: var(--faint); }
.mkt .chg { font: 12px var(--code); }
.mkt.soon { opacity: .55; border-style: dashed; }
.modes { display: grid; gap: 1px; }
.mode { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; align-items: center; gap: 10px; height: 42px; padding: 0 10px; border-radius: var(--r-sm); color: var(--muted); transition: color .2s, background .2s; position: relative; }
.mode:hover { color: var(--ivory); background: rgba(var(--gold-rgb), .06); }
.mode i { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 7px; color: var(--gold); }
.mode i svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.mode span { display: grid; font-size: 13.5px; line-height: 1.2; }
.mode span small { font: 9px var(--code); letter-spacing: .18em; color: var(--faint); }
.mode b { min-width: 20px; padding: 1px 6px; border-radius: 999px; font: 600 10.5px var(--code); text-align: center; color: var(--gold-light); background: rgba(var(--gold-rgb), .1); }
.mode.on { color: var(--ivory); background: linear-gradient(90deg, rgba(var(--gold-rgb), .16), rgba(var(--gold-rgb), .03)); box-shadow: inset 0 0 0 1px rgba(var(--gold-rgb), .28); }
.mode.on::before { content: ""; position: absolute; left: -9px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--gold-light); box-shadow: 0 0 10px var(--gold-light); }
.mode.on i { border-color: var(--gold); color: var(--night); background: var(--gild-btn); }
.side-foot { margin-top: auto; padding: 10px 10px 2px; border-top: 1px solid var(--hair-2); display: grid; gap: 6px; font-size: 11.5px; color: var(--faint); }
.side-foot a:hover { color: var(--gold-light); }
.main { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.main > section { display: flex; flex-direction: column; gap: 12px; animation: rise .7s var(--ease) both; }

/* page head */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 8px 4px 2px; }
.ph .kick { display: inline-flex; align-items: center; gap: 10px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font: 10.5px var(--code); letter-spacing: .14em; color: var(--gold); background: rgba(var(--gold-rgb), .05); }
.ph .kick i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 8px var(--gold-light); }
.ph h1 { margin-top: 10px; font-size: clamp(24px, 2.6vw, 36px); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.ph h1 em { font-style: normal; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ph p { margin-top: 8px; max-width: 820px; color: var(--muted); font-size: 13.5px; }

/* KPI strip */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); border: 1px solid var(--line); background: rgba(var(--bg-rgb), .55); backdrop-filter: blur(14px); }
.kpis > div { position: relative; padding: 12px 16px; min-width: 0; }
.kpis > div + div { border-left: 1px solid var(--line); }
.kpis dt, .k { font: 10px var(--code); letter-spacing: .16em; color: var(--faint); text-transform: uppercase; }
.kpis dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kpis dd small { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--faint); letter-spacing: 0; }
.kpis .hot dd { color: var(--gold-light); text-shadow: 0 0 18px rgba(var(--gold-rgb), .45); }
.kpis .hot::after { content: ""; position: absolute; left: 16px; right: 16px; bottom: -1px; height: 1px; background: linear-gradient(90deg, var(--gold-light), transparent); }
.kpis .spark { display: block; margin-top: 6px; width: 100%; height: 28px; }

/* panel */
.panel { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--line); background: linear-gradient(180deg, rgba(var(--bg-rgb), .62), rgba(var(--bg-rgb), .5)); backdrop-filter: blur(18px) saturate(125%); animation: unfold .9s .1s var(--ease) both; }
.panel > .c { position: absolute; width: 14px; height: 14px; border: 1px solid var(--gold-light); pointer-events: none; }
.panel > .c:nth-of-type(1) { left: -1px; top: -1px; border-right: 0; border-bottom: 0; } .panel > .c:nth-of-type(2) { right: -1px; top: -1px; border-left: 0; border-bottom: 0; }
.panel > .c:nth-of-type(3) { left: -1px; bottom: -1px; border-right: 0; border-top: 0; } .panel > .c:nth-of-type(4) { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.ph-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); font: 10px var(--code); letter-spacing: .2em; color: var(--muted); text-transform: uppercase; flex-wrap: wrap; }
.ph-row > span:first-child { color: var(--gold); }
.ph-row .r { display: flex; gap: 10px; align-items: center; letter-spacing: .06em; text-transform: none; }
.pb { padding: 14px 16px; min-width: 0; overflow-x: auto; }
.pb.flush { padding: 0; }
.pf { padding: 8px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--faint); }
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); align-items: start; }
.sticky-story { position: sticky; top: calc(var(--top) + 4px); max-height: calc(100svh - var(--top) - 20px); overflow-y: auto; scrollbar-width: thin; }
.g-side { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); }
.empty { padding: 28px 16px; text-align: center; color: var(--faint); font-size: 13px; }
.note { font-size: 12px; color: var(--faint); line-height: 1.6; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .05); color: var(--text); font-size: 13px; cursor: pointer; white-space: nowrap; transition: border-color .2s, background .2s, color .2s; }
.btn:hover { border-color: var(--line-strong); background: rgba(var(--gold-rgb), .1); }
.btn.gold { border: 0; color: var(--night); font-weight: 600; background: var(--gild-btn); box-shadow: 0 0 22px -6px rgba(var(--gold-rgb), .6); }
.btn.gold:hover { filter: brightness(1.06); }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.buy { border: 0; background: var(--up); color: #1a0c08; font-weight: 600; } .btn.sell { border: 0; background: var(--down); color: #06180e; font-weight: 600; }
.input { width: 100%; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--bg-rgb), .5); color: var(--text); font-size: 13px; outline: 0; }
.input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(var(--gold-rgb), .12); }
select.input { appearance: none; padding-right: 28px; background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%), linear-gradient(135deg, var(--gold) 50%, transparent 50%); background-position: calc(100% - 14px) 15px, calc(100% - 10px) 15px; background-size: 4px 4px; background-repeat: no-repeat; }
select.input option { background: var(--opt-bg); color: var(--text); }
.input.sm { width: 64px; height: 28px; padding: 0 6px; font-size: 12px; }
select.input.sm { width: auto; }
label.f { display: grid; gap: 4px; font: 10px var(--code); letter-spacing: .14em; color: var(--faint); }
label.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
label.chk input { accent-color: var(--gold); }
.seg { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: rgba(var(--bg-rgb), .4); }
.seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 11px var(--code); letter-spacing: .06em; cursor: pointer; }
.seg button.on { color: var(--night); background: var(--gild-btn); }

/* tags */
.pill { display: inline-block; padding: 1px 7px; border-radius: 5px; font: 10.5px var(--code); letter-spacing: .04em; color: var(--muted); background: rgba(var(--fg-rgb), .06); white-space: nowrap; margin-right: 6px; vertical-align: 1px; }
.pill.gold { color: var(--night); background: var(--gild-btn); font-weight: 600; }
.pill.line { background: none; border: 1px solid var(--line); color: var(--gold); }
.vb { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; white-space: nowrap; border: 1px solid currentColor; }
.vb::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; }
.vb.ok { color: var(--ok); } .vb.warn { color: var(--warn); } .vb.no { color: var(--no); } .vb.na { color: var(--na); border-color: var(--hair-2); }
.view { font: 12px var(--code); white-space: nowrap; } .view.up::before { content: "▲ "; } .view.down::before { content: "▼ "; }
.op { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; margin-right: 4px; background: rgba(var(--fg-rgb), .06); }
.op.up { background: rgba(242, 128, 108, .12); } .op.down { background: rgba(79, 196, 137, .12); }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); font: 10px var(--code); letter-spacing: .14em; color: var(--faint); font-weight: 400; white-space: nowrap; text-transform: uppercase; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--hair); vertical-align: top; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr[data-r], .tbl tbody tr[data-s] { cursor: pointer; }
.tbl tbody tr[data-r]:hover, .tbl tbody tr[data-s]:hover { background: rgba(var(--gold-rgb), .05); }
.tbl tbody tr.sel { background: linear-gradient(90deg, rgba(var(--gold-rgb), .12), transparent); box-shadow: inset 2px 0 0 var(--gold-light); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--code); font-variant-numeric: tabular-nums; }
.tbl tr.grp td { padding-top: 14px; font: 10px var(--code); letter-spacing: .18em; color: var(--gold); border-bottom-color: var(--line); }
.tbl .rn { font-weight: 500; color: var(--ivory); }
.tbl .why { font-size: 12px; color: var(--faint); margin-top: 2px; }
.scroll-x { overflow-x: auto; }

/* gauge: −1..1 view as a centred bar */
.gauge { position: relative; height: 8px; border-radius: 999px; background: linear-gradient(90deg, rgba(79, 196, 137, .18), rgba(var(--fg-rgb), .06) 50%, rgba(242, 128, 108, .18)); }
html[data-lang="en"] .gauge { background: linear-gradient(90deg, rgba(242, 128, 108, .18), rgba(var(--fg-rgb), .06) 50%, rgba(79, 196, 137, .18)); }
.gauge::after { content: ""; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--viz-base); }
.gauge b { position: absolute; top: 0; bottom: 0; border-radius: 999px; }
.gauge b.up { background: var(--up); box-shadow: 0 0 12px var(--up); } .gauge b.down { background: var(--down); box-shadow: 0 0 12px var(--down); }

/* overview */
.views { display: grid; gap: 2px; }
.vrow { display: grid; grid-template-columns: 110px minmax(0, 1fr) 96px; gap: 14px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--hair); }
.vrow:last-child { border-bottom: 0; }
.vrow .nm b { display: block; font-size: 15px; color: var(--ivory); } .vrow .nm small { font: 11px var(--code); color: var(--faint); }
.vrow .drv { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 8px; font-size: 11.5px; color: var(--muted); }
.vrow .drv span::before { content: "· "; color: var(--gold); }
.vrow .val { text-align: right; }
.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li { padding: 11px 16px; border-bottom: 1px solid var(--hair); }
.news-list li:last-child { border-bottom: 0; }
.news-list .t { display: flex; gap: 8px; align-items: baseline; font-size: 11px; color: var(--faint); font-family: var(--code); }
.news-list .h { margin: 4px 0 6px; font-size: 13.5px; color: var(--ivory); line-height: 1.45; }
.news-list details summary { cursor: pointer; font-size: 11.5px; color: var(--gold); margin-top: 4px; }
.news-list details p { margin-top: 6px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

/* logic graph */
.graph-wrap { position: relative; overflow-x: auto; }
.graph-wrap svg { display: block; width: 100%; min-width: 760px; height: auto; }
.g-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--hair); font-size: 11.5px; color: var(--muted); }
.g-legend i { display: inline-block; width: 24px; height: 0; border-top: 2px solid; vertical-align: middle; margin-right: 6px; }
.g-legend i.predict { border-color: var(--gold-light); box-shadow: 0 0 8px var(--gold-light); }
.g-legend i.explain { border-color: var(--series-2); border-top-style: dashed; }
.g-legend i.none { border-color: rgba(var(--fg-rgb), .18); border-top-width: 1px; }
.node { cursor: pointer; }
.node rect.bg { fill: rgba(var(--bg-rgb), .92); stroke: var(--line-strong); transition: stroke .2s; }
.node.inst rect.bg { fill: url(#nodeGold); stroke: var(--gold); }
.node:hover rect.bg, .node.sel rect.bg { stroke: var(--gold-light); filter: url(#glow); }
.node .nm { font-size: 13px; font-weight: 600; fill: var(--ivory); }
.node .val { font: 11px var(--code); fill: var(--muted); }
.node .zbar { fill: rgba(var(--fg-rgb), .08); } .node .zfill.up { fill: var(--up); } .node .zfill.down { fill: var(--down); }
.node .chg { font: 11px var(--code); } .node .chg.up { fill: var(--up); } .node .chg.down { fill: var(--down); } .node .chg.flat { fill: var(--faint); }
.node .ring { fill: none; stroke: var(--gold-light); stroke-width: 1; opacity: 0; }
.node.inst .ring { animation: ring 3.2s ease-out infinite; }
.edge { cursor: pointer; }
.edge .hit { fill: none; stroke: transparent; stroke-width: 18; }
.edge .ln { fill: none; stroke-linecap: round; transition: stroke-width .2s; }
.edge.predict .ln { stroke: var(--gold-light); stroke-width: 2.2; filter: url(#glow); }
.edge.predict .flow { fill: none; stroke: var(--flow); stroke-width: 2.2; stroke-dasharray: 3 22; stroke-linecap: round; animation: flow 1.6s linear infinite; opacity: .9; }
.edge.explain .ln { stroke: var(--series-2); stroke-width: 1.5; stroke-dasharray: 6 5; animation: flow 3s linear infinite; }
.edge.none .ln { stroke: rgba(var(--fg-rgb), .16); stroke-width: 1; }
.edge.dim { opacity: .18; }
.edge:hover .ln, .edge.sel .ln { stroke-width: 3.5; }
.edge.sel.none .ln { stroke: rgba(var(--fg-rgb), .5); }
.ah-predict { fill: var(--gold-light); } .ah-explain { fill: var(--series-2); } .ah-none { fill: rgba(var(--fg-rgb), .25); }
.tier { font: 10px var(--code); letter-spacing: .24em; fill: var(--faint); }

/* the logic card: mechanism → measure → evidence → today */
.story { display: grid; gap: 0; }
.step { position: relative; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--hair); }
.step:last-child { border-bottom: 0; }
.step > i { display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--line-strong); border-radius: 50%; font: normal 11px var(--code); color: var(--gold-light); background: rgba(var(--gold-rgb), .06); }
.step h4 { font: 10px var(--code); letter-spacing: .18em; color: var(--gold); margin-bottom: 6px; text-transform: uppercase; }
.step p { font-size: 13px; color: var(--text); line-height: 1.65; }
.step .sub { margin-top: 6px; font-size: 12px; color: var(--faint); }
.evi { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.evi > div { padding: 10px; border: 1px solid var(--hair-2); border-radius: var(--r-sm); background: rgba(var(--fg-rgb), .02); display: grid; gap: 6px; align-content: start; }
.evi .k { font-size: 9.5px; }
.evi .n { font: 11px var(--code); color: var(--muted); }
.verdict-line { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-top: 8px; border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .06); font-size: 12.5px; }

/* review */
.heat { display: grid; gap: 2px; }
.heat .hr { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 10px; align-items: center; }
.heat .hl { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .hl.used { color: var(--gold-light); }
.heat .cells { display: grid; gap: 2px; }
.heat .cells i { height: 16px; border-radius: 2px; }
.heat .axis { font: 10px var(--code); color: var(--faint); display: flex; justify-content: space-between; }
.rv-insts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* backtest */
.bt-form { display: grid; gap: 12px; }
.bt-form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.bt-rels { display: grid; gap: 6px; }
.bt-rel { padding: 8px 10px; border: 1px solid var(--hair-2); border-radius: var(--r-sm); display: grid; gap: 6px; }
.bt-rel.on { border-color: var(--line-strong); background: rgba(var(--gold-rgb), .05); }
.bt-rel .top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.bt-rel .params { display: flex; gap: 5px; align-items: center; font: 10px var(--code); color: var(--faint); flex-wrap: wrap; }
.bt-rel .params .input.sm { width: 50px; padding: 0 5px; }
.months { display: grid; grid-template-columns: 44px repeat(12, minmax(0, 1fr)); gap: 2px; font: 10px var(--code); }
.months span { color: var(--faint); display: grid; place-items: center; }
.months i { height: 22px; border-radius: 2px; display: grid; place-items: center; font-style: normal; font-size: 9.5px; color: rgba(255, 255, 255, .85); cursor: default; }
.explain { font-size: 13px; line-height: 1.75; color: var(--text); }
.explain b { color: var(--gold-light); font-weight: 600; }

/* paper */
.accts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
.acct-card { text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .03); cursor: pointer; display: grid; gap: 4px; }
.acct-card.on { border-color: var(--gold); box-shadow: 0 0 22px -10px rgba(var(--gold-rgb), .8); }
.acct-card .px { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.ticket { display: grid; gap: 10px; }
.ticket .q { font-size: 13px; }
.tk { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cta { display: grid; justify-items: center; gap: 14px; padding: 48px 20px; text-align: center; }
.cta h2 { font-size: 26px; }
.cta p { max-width: 560px; color: var(--muted); }

/* charts */
.viz { position: relative; }
.viz svg { display: block; width: 100%; height: auto; overflow: visible; }
.viz-grid { stroke: var(--viz-grid); stroke-width: 1; } .viz-base { stroke: var(--viz-base); stroke-width: 1; }
.viz-tick, .viz-val { font: 10px var(--code); fill: var(--viz-muted); } .viz-val { fill: var(--viz-ink); }
.viz-cross { stroke: var(--viz-base); stroke-width: 1; } .viz-marker { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 3; }
.viz-bar.hover { filter: brightness(1.25); }
.viz-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-bottom: 6px; }
.viz-legend i { display: inline-block; width: 14px; height: 2px; vertical-align: middle; margin-right: 6px; border-radius: 1px; }
.viz-tip { position: absolute; z-index: 6; pointer-events: none; padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: rgba(var(--bg-rgb), .96); box-shadow: var(--lift); font-size: 12px; min-width: 120px; max-width: 280px; }
.viz-tip-date { font: 10.5px var(--code); color: var(--faint); margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 6px; white-space: nowrap; } .viz-tip-row i { width: 10px; height: 2px; border-radius: 1px; }
.viz-tip-row strong { color: var(--ivory); font-family: var(--code); } .viz-tip-row span { color: var(--muted); }
.viz-empty { color: var(--faint); font-size: 12.5px; padding: 24px 0; text-align: center; }

/* dialog + toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 90; padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(var(--bg-rgb), .96); color: var(--ivory); font-size: 13px; box-shadow: var(--lift); opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; }
.dlg-back { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(var(--bg-rgb), .62); backdrop-filter: blur(6px); opacity: 0; transition: opacity .16s; }
.dlg-back.show { opacity: 1; }
.dlg { width: 100%; max-width: 420px; padding: 20px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(var(--bg2-rgb), .96), rgba(var(--bg-rgb), .98)); box-shadow: var(--lift), 0 0 80px rgba(var(--glow-rgb), .1); }
.dlg-title { font-size: 15px; font-weight: 600; color: var(--ivory); margin-bottom: 6px; }
.dlg-body { font-size: 13px; color: var(--muted); white-space: pre-line; }
.dlg-input { margin-top: 12px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.btn.primary { border: 0; color: var(--night); font-weight: 600; background: var(--gild-btn); }
.btn.danger { border-color: var(--no); color: var(--no); }

/* hub */
.hub { position: relative; z-index: 10; padding: calc(var(--top) + 30px) var(--gutter) 40px; max-width: 1320px; margin: 0 auto; }
.hero { display: grid; justify-items: center; text-align: center; gap: 18px; padding: 40px 0 56px; }
.hero .mark { position: relative; width: 92px; height: 92px; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: radial-gradient(circle, rgba(var(--gold-rgb), .18), transparent 70%); box-shadow: 0 0 60px rgba(var(--gold-rgb), .25); animation: mark-in 1.4s var(--ease) both; }
.hero .mark img { width: 44px; }
.hero .mark::after { content: ""; position: absolute; inset: -12px; border: 1px solid var(--line); border-radius: 50%; animation: ring 3.6s ease-out infinite; }
.hero .eyebrow { font: 11px var(--code); letter-spacing: .4em; color: var(--gold); }
.hero h1 { font-size: clamp(32px, 5vw, 64px); font-weight: 600; letter-spacing: -.03em; line-height: 1.12; max-width: 980px; }
.hero h1 em { font-style: normal; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { max-width: 720px; color: var(--muted); font-size: 15px; }
.hero .ctas { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.hub-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 12px; }
.hub-card { display: grid; gap: 10px; padding: 18px; transition: border-color .2s, transform .3s var(--ease); }
.hub-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.hub-card h3 { font-size: 26px; font-weight: 600; }
.hub-card .r { display: grid; grid-template-columns: 1fr auto 64px 70px; gap: 10px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--hair); font-size: 13px; }
.hub-card .stats { display: flex; gap: 14px; font: 11px var(--code); color: var(--faint); }
.hub-card .stats b { color: var(--gold-light); }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.steps .pb h3 { font-size: 16px; margin: 8px 0 6px; } .steps .pb p { font-size: 13px; color: var(--muted); }
.steps .n { font: 11px var(--code); letter-spacing: .2em; color: var(--gold); }
.hub-foot { position: relative; z-index: 10; padding: 24px var(--gutter) 32px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--faint); border-top: 1px solid var(--hair); max-width: 1320px; margin: 0 auto; }
.hub-foot a:hover { color: var(--gold-light); }
.sec-title { display: flex; align-items: baseline; gap: 12px; margin: 36px 4px 12px; }
.sec-title span { font: 10.5px var(--code); letter-spacing: .3em; color: var(--gold); }
.sec-title h2 { font-size: 22px; font-weight: 600; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes unfold { from { opacity: 0; clip-path: inset(50% 0 50% 0); } to { opacity: 1; clip-path: inset(0); } }
@keyframes mark-in { from { opacity: 0; transform: scale(.82) rotate(-30deg); filter: blur(8px); } }
@keyframes blink { 50% { opacity: .35; } }
@keyframes flow { to { stroke-dashoffset: -50; } }
@keyframes ring { 0% { opacity: .6; transform: scale(.96); } 100% { opacity: 0; transform: scale(1.18); } }
.node .ring { transform-box: fill-box; transform-origin: center; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 1180px) {
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
  .sticky-story { position: static; max-height: none; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; max-height: none; flex-direction: column; overflow: visible; padding: 8px; gap: 8px; }
  .side .mkts, .side .modes { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
  .side .mkt { min-width: 140px; flex: none; }
  .side .mode { grid-template-columns: 22px auto; height: 36px; white-space: nowrap; flex: none; border: 1px solid var(--hair-2); }
  .side .mode i { width: 22px; height: 22px; }
  .side .mode b, .side .mode span small, .side-label, .side-foot, .mode.on::before { display: none; }
  .g2, .g3, .evi { grid-template-columns: minmax(0, 1fr); }
  .brand em, .sync .t, .ask-pill { display: none; }
}
@media (max-width: 600px) {
  :root { --top: 60px; }
  .topbar { padding: 0 16px; gap: 8px; }
  .shell, .hub { padding-left: 12px; padding-right: 12px; }
  .chip.view-chip { display: none; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .kpis > div:nth-child(2n+1) { border-left: 0; } .kpis > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .kpis dd { font-size: 19px; }
  .vrow { grid-template-columns: 80px minmax(0, 1fr) 70px; gap: 8px; padding: 10px 12px; }
  .heat .hr { grid-template-columns: 110px minmax(0, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .hub-cards { grid-template-columns: 1fr; }
  .frame { display: none; }
  .pb .tbl { min-width: 560px; }
  .tbl td:first-child { min-width: 64px; }
}

/* light-built pages (login, legal) on the dark theme */
body.lite { background: var(--page); }
body.lite .legal, body.lite .login-wrap { position: relative; z-index: 10; }
body.lite .legal { max-width: 860px; margin: 0 auto; padding: calc(var(--top) + 32px) 20px 60px; color: var(--text); }
body.lite .legal h1 { font-size: 34px; margin: 8px 0; } body.lite .legal h2 { font-size: 19px; margin: 28px 0 8px; color: var(--gold-light); }
body.lite .legal h3 { font-size: 15px; margin: 18px 0 6px; } body.lite .legal p, body.lite .legal li { color: var(--muted); line-height: 1.75; font-size: 14px; }
body.lite .legal a { color: var(--gold-light); } body.lite .legal .label { font: 10.5px var(--code); letter-spacing: .3em; color: var(--gold); }
body.lite .legal .toc { padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--r-md); margin: 18px 0; }
body.lite .legal code { font-family: var(--code); color: var(--gold-light); }
body.lite .login-wrap { min-height: 100svh; display: grid; place-items: center; padding: calc(var(--top) + 20px) 16px 40px; }
body.lite .login-card { width: min(440px, 100%); padding: 28px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(var(--bg2-rgb), .9), rgba(var(--bg-rgb), .94)); box-shadow: var(--lift), 0 0 80px rgba(var(--glow-rgb), .08); display: grid; gap: 14px; }
body.lite .login-card h1 { font-size: 24px; } body.lite .login-card a { color: var(--gold-light); }
body.lite .login-card .stack { display: grid; gap: 8px; }
body.lite .login-card .btn.wide { width: 100%; height: 40px; }
body.lite .login-card .oauth svg { width: 16px; height: 16px; }
body.lite .login-card .or { text-align: center; font: 10.5px var(--code); letter-spacing: .2em; color: var(--faint); }
body.lite .login-card input.input { height: 40px; }
body.lite .login-msg { font-size: 12.5px; min-height: 18px; color: var(--muted); } body.lite .login-msg.err { color: var(--no); } body.lite .login-msg.ok { color: var(--ok); }
body.lite .login-links { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--gold-light); } body.lite .login-links a { cursor: pointer; }
body.lite .login-legal { font-size: 11.5px; color: var(--faint); }

/* ───────── Ask AI ───────── */
.ai-fab { position: fixed; right: 28px; bottom: 28px; z-index: 40; display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 10px 0 8px; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, rgba(var(--bg2-rgb), .92), rgba(var(--bg-rgb), .96)); color: var(--ivory); font-size: 13.5px; box-shadow: var(--lift), 0 0 40px -6px rgba(var(--gold-rgb), .45); backdrop-filter: blur(16px); transition: transform .3s var(--ease), opacity .2s; }
.ai-fab:hover { transform: translateY(-2px); border-color: var(--gold); }
.ai-fab.hide { opacity: 0; pointer-events: none; transform: translateY(10px); }
.ai-fab i { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gild-btn); box-shadow: 0 0 18px rgba(var(--gold-rgb), .6); }
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(var(--bg2-rgb), .97), rgba(var(--bg-rgb), .98)); backdrop-filter: blur(24px) saturate(140%);
  box-shadow: var(--lift), 0 40px 120px rgba(var(--shadow-rgb), .7), 0 0 80px rgba(var(--glow-rgb), .08); transform: translateX(calc(100% + 40px)); transition: transform .45s var(--ease); }
.ai-card { border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .03); padding: 10px 12px; display: grid; gap: 6px; }
.ai-card-h { display: flex; justify-content: space-between; font: 10px var(--code); letter-spacing: .14em; color: var(--gold); }
.ai-card-h a { color: var(--gold-light); letter-spacing: .04em; }
.ai-card-m { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ai-card-m div { display: grid; } .ai-card-m span { font: 9.5px var(--code); color: var(--faint); letter-spacing: .1em; } .ai-card-m b { font-size: 15px; font-variant-numeric: tabular-nums; }
.ai-card-t { font-size: 13.5px; color: var(--ivory); font-weight: 500; }
.ai-card-b { display: flex; gap: 8px; flex-wrap: wrap; font-size: 11px; color: var(--faint); align-items: center; }
.ai-card-f { font-size: 11px; color: var(--faint); }
.ai-text { font-size: 13.5px; line-height: 1.75; color: var(--text); }
.ai-text p { margin: 0 0 8px; } .ai-text h5 { margin: 12px 0 6px; font-size: 13px; color: var(--gold-light); letter-spacing: .02em; }
.ai-text ul, .ai-text ol { margin: 0 0 8px; padding-left: 18px; } .ai-text li { margin: 3px 0; } .ai-text li::marker { color: var(--gold); }
.ai-text b { color: var(--ivory); } .ai-text a { color: var(--gold-light); border-bottom: 1px solid var(--line-strong); }
.ai-text code { font-family: var(--code); font-size: 12px; padding: 1px 5px; border-radius: 4px; background: rgba(var(--gold-rgb), .08); color: var(--gold-light); }
.ai-text hr { border: 0; border-top: 1px solid var(--hair-2); margin: 10px 0; }
.caret { display: inline-block; width: 7px; height: 14px; margin-left: 2px; vertical-align: -2px; border-radius: 2px; background: var(--gold-light); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: .9; } 50% { opacity: .3; } }
.la-cards { display: grid; gap: 10px; } .la-cards:empty, .la-steps-slot:empty, .la-err-slot:empty { display: none; }
.ai-err { font-size: 12.5px; color: var(--no); padding: 8px 10px; border: 1px solid rgba(240, 160, 136, .3); border-radius: var(--r-sm); }
.ask-btn { display: inline-flex; align-items: center; gap: 6px; }
.ask-btn::before { content: "✦"; color: var(--gold-light); font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ───────── polish: skeletons, glossary, transitions ───────── */
.sk { position: relative; overflow: hidden; border-radius: 6px; background: rgba(var(--fg-rgb), .05); }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(var(--gold-rgb), .10), transparent); animation: scan 1.4s ease-in-out infinite; }
.sk-page { display: grid; gap: 12px; }
.sk-page .sk.h { height: 34px; width: 52%; } .sk-page .sk.p { height: 14px; width: 70%; } .sk-page .sk.k { height: 92px; } .sk-page .sk.b { height: 300px; }
@keyframes scan { to { transform: translateX(100%); } }
.term { border-bottom: 1px dotted rgba(var(--gold-rgb), .6); cursor: pointer; border-radius: 2px; transition: background .15s, border-color .15s; }
.term:hover, .term:focus-visible { background: rgba(var(--gold-rgb), .12); border-bottom-color: var(--gold); outline: none; }
.tip-pop { position: fixed; z-index: 95; max-width: 360px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: rgba(var(--bg-rgb), .97); box-shadow: var(--lift); font-size: 12.5px; line-height: 1.6; color: var(--text); pointer-events: none; opacity: 0; transition: opacity .15s; }
.tip-pop.show { opacity: 1; } .tip-pop.pinned { pointer-events: auto; border-color: rgba(var(--gold-rgb), .5); }
.tip-pop b { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 5px; font: 600 13px var(--sans); letter-spacing: 0; color: var(--ivory); text-transform: none; }
.tip-pop b em { font: 9.5px var(--code); font-style: normal; letter-spacing: .16em; color: var(--gold); text-transform: uppercase; align-self: center; white-space: nowrap; }
.tip-more { display: block; margin-top: 8px; padding: 0; border: 0; background: none; color: var(--gold); font: 11.5px var(--sans); cursor: pointer; }
.tip-more:hover { text-decoration: underline; }
.main > section.enter { animation: rise .5s var(--ease) both; }
.more-btn { width: 100%; padding: 8px; border: 1px dashed var(--line); border-radius: var(--r-sm); background: none; color: var(--muted); font-size: 12px; cursor: pointer; }
.more-btn:hover { color: var(--gold-light); border-color: var(--line-strong); }
.kbd-hint { font: 10px var(--code); color: var(--faint); letter-spacing: .06em; }
@media (max-width: 1180px) { body.ai-open .shell { padding-right: var(--gutter); } }
@media (max-width: 600px) {
  .ai-fab { right: 16px; bottom: 16px; } .ai-fab kbd { display: none; }
}
.kpis dd { white-space: normal; line-height: 1.15; } .kpis dd small { display: inline-block; }
@media (max-width: 1560px) {
}

.ai-fab i svg { width: 15px; height: 15px; fill: var(--night); }
.ai-fab kbd, .cx-new kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; font: 500 10px var(--code); color: var(--muted); border: 1px solid var(--line); border-bottom-width: 2px; background: rgba(var(--gold-rgb), .06); }
@media (max-width: 600px) { .ai-fab { right: 16px; bottom: 16px; } .ai-fab kbd { display: none; } }

/* ───────── AI 研究 page (showcase codex layout) ───────── */
.side-top { display: flex; gap: 6px; }
.cx-new { flex: 1; display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .07); color: var(--ivory); font-size: 13.5px; transition: background .2s, border-color .2s, box-shadow .2s; }
.cx-new span { color: var(--gold-light); } .cx-new kbd { margin-left: auto; }
.cx-new:hover, .cx-new.on { border-color: var(--gold); background: rgba(var(--gold-rgb), .13); }
.cx-new.on { box-shadow: 0 0 22px -8px rgba(var(--gold-rgb), .8); }
.cx-plus { width: 40px; height: 40px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: none; color: var(--gold-light); font-size: 18px; cursor: pointer; }
.cx-plus:hover { border-color: var(--gold); background: rgba(var(--gold-rgb), .1); }
.cx-threads ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.cx-threads li { position: relative; }
.cx-threads a { display: block; height: 32px; line-height: 32px; padding: 0 28px 0 10px; border-radius: var(--r-sm); color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-threads a:hover { color: var(--text); background: rgba(var(--fg-rgb), .04); }
.cx-threads a.is-on { color: var(--ivory); background: rgba(var(--gold-rgb), .1); }
.cx-del { position: absolute; right: 4px; top: 6px; width: 20px; height: 20px; border: 0; border-radius: 5px; background: none; color: var(--faint); font-size: 10px; cursor: pointer; opacity: 0; }
.cx-threads li:hover .cx-del { opacity: 1; } .cx-del:hover { color: var(--no); }
.cx-none { padding: 4px 10px; font-size: 12px; color: var(--faint); line-height: 1.6; }

.main > section.chat-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: 12px; height: calc(100svh - var(--top) - 20px); min-height: 560px; }
body.on-chat .shell { padding-bottom: 12px; }
:is(.cx-thread, .cx-mat) { position: relative; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: linear-gradient(180deg, rgba(var(--bg-rgb), .66), rgba(var(--bg-rgb), .56)); backdrop-filter: blur(18px) saturate(125%); animation: rise .7s var(--ease) both; }
.cx-mat { animation-delay: .08s; }
.cx-bar { display: flex; align-items: baseline; gap: 12px; padding: 13px clamp(18px, 3vw, 36px); border-bottom: 1px solid var(--hair-2); }
.cx-bar span { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13.5px; color: var(--ivory); }
.cx-bar small { flex: none; font: 11px var(--code); color: var(--faint); }
.cx-mat-toggle { display: none; }
.la-log { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 30px; padding: 26px clamp(18px, 4vw, 56px) 24px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.la-turn { display: grid; gap: 14px; max-width: 820px; width: 100%; margin: 0 auto; animation: rise .5s var(--ease) both; }
.la-q { display: flex; gap: 10px; margin: 0; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: rgba(var(--gold-rgb), .05); font-size: 14.5px; line-height: 1.7; color: var(--ivory); }
.la-q span, .la-prompt { font: 600 16px/1.6 var(--code); color: var(--gold-light); }
.la-steps { padding-left: 14px; border-left: 1px solid var(--line); }
.la-steps > p { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font: 11.5px var(--code); letter-spacing: .04em; color: var(--faint); }
.la-steps > p i { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.la-steps > p.is-run i { background: var(--gold-light); box-shadow: 0 0 8px var(--gold-light); animation: blink 1s ease-in-out infinite; }
.la-steps ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.la-steps li { }
.la-steps button { display: flex; align-items: center; gap: 8px; max-width: 100%; padding: 2px 0; border: 0; background: none; color: var(--muted); font-size: 12.5px; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.la-steps button:hover { color: var(--gold-light); }
.la-steps em { flex: none; font: normal 10.5px var(--code); color: var(--faint); }
.la-glyph { display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 5px; font: normal 10px/1 var(--sans); color: var(--gold-light); background: rgba(var(--gold-rgb), .1); }
.la-spin { width: 10px; height: 10px; border: 1.5px solid var(--line-strong); border-top-color: var(--gold-light); border-radius: 50%; animation: spin .8s linear infinite; }
.la-a { font-size: 14.5px; line-height: 1.9; color: rgba(var(--fg-rgb), .88); }
.cx-dock { padding: 10px clamp(14px, 3vw, 36px) 14px; border-top: 1px solid var(--hair); background: linear-gradient(180deg, transparent, rgba(var(--bg-rgb), .4)); }
.cx-chips { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 auto 10px; max-width: 860px; }
.cx-chips .k { flex: none; }
.cx-chips button { flex: none; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: rgba(var(--chip-rgb), .04); color: var(--chip-fg); font-size: 12.5px; cursor: pointer; transition: color .2s, border-color .2s; }
.cx-chips button:hover { color: var(--gold-light); border-color: var(--line-strong); }
.prompt { position: relative; display: flex; align-items: flex-end; gap: 10px; max-width: 860px; margin: 0 auto; padding: 8px 8px 8px 18px; border: 1px solid var(--line-strong); border-radius: 22px; background: linear-gradient(180deg, rgba(var(--bg2-rgb), .94), rgba(var(--bg-rgb), .94)); box-shadow: var(--lift), 0 30px 70px -20px rgba(var(--shadow-rgb), .6); transition: box-shadow .3s, border-color .3s; }
.prompt:focus-within { border-color: rgba(245, 220, 160, .7); box-shadow: var(--lift), 0 0 0 4px rgba(var(--gold-rgb), .08), 0 0 50px -10px rgba(var(--gold-rgb), .3); }
.prompt.is-busy { border-color: transparent; background: linear-gradient(180deg, rgba(var(--bg2-rgb), .94), rgba(var(--bg-rgb), .94)) padding-box, linear-gradient(90deg, rgba(var(--gold-rgb), .15), rgba(245, 220, 160, .8), rgba(var(--gold-rgb), .15)) border-box; background-size: 100% 100%, 200% 100%; animation: sheen 2s linear infinite; }
.prompt .la-prompt { padding: 9px 0; }
.prompt textarea { flex: 1; min-height: 40px; max-height: 180px; padding: 9px 0; border: 0; outline: 0; resize: none; background: none; color: var(--text); font: 15px/1.6 var(--sans); }
.prompt textarea::placeholder { color: var(--faint); }
.prompt-send { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: linear-gradient(180deg, #fff3cf, var(--gold-light) 55%, var(--gold)); color: var(--night); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 18px -4px rgba(var(--gold-rgb), .55); transition: transform .2s; }
.prompt-send:hover { transform: scale(1.06); }
.prompt-send svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.prompt.is-busy .prompt-send { background: var(--ivory); } .prompt.is-busy .prompt-send svg { display: none; } .prompt.is-busy .prompt-send::after { content: ""; width: 11px; height: 11px; border-radius: 2px; background: var(--night); }
.cx-hint { display: flex; justify-content: space-between; gap: 12px; max-width: 860px; margin: 8px auto 0; font: 10.5px var(--code); color: var(--faint); letter-spacing: .04em; }
@keyframes sheen { to { background-position: 0 0, -200% 0; } }
.cx-empty { display: grid; justify-items: center; gap: 12px; text-align: center; max-width: 760px; margin: 0 auto; padding: 2vh 0 10px; }
.orb-wrap { position: relative; width: 220px; height: 220px; display: grid; place-items: center; }
.orb-dust { position: absolute; inset: 0; width: 100%; height: 100%; }
.orb-wrap img { position: relative; width: 64px; filter: drop-shadow(0 0 22px rgba(var(--gold-rgb), .6)); animation: mark-in 1.2s var(--ease) both; }
.cx-empty h2 { font-size: clamp(24px, 2.4vw, 32px); font-weight: 600; letter-spacing: -.01em; color: var(--ivory); }
.cx-empty p { max-width: 560px; font-size: 13.5px; line-height: 1.8; color: var(--muted); }
.cx-today { display: grid; gap: 8px; width: 100%; margin-top: 10px; text-align: left; }
.cx-today > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cx-card { display: flex; flex-direction: column; gap: 6px; min-height: 108px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .03); color: var(--text); text-align: left; cursor: pointer; transition: border-color .2s, background .2s; }
.cx-card:hover { border-color: var(--line-strong); background: rgba(var(--gold-rgb), .07); }
.cx-card small { font: 10px var(--code); letter-spacing: .16em; color: var(--gold); }
.cx-card span { flex: 1; font-size: 13px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cx-card i { font-style: normal; font-size: 11.5px; color: var(--gold); opacity: 0; transition: opacity .2s; }
.cx-card:hover i { opacity: 1; }
.cx-mat-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--hair-2); font: 10.5px var(--code); letter-spacing: .2em; color: var(--gold); }
.cx-mat-head small { margin-left: auto; letter-spacing: .04em; color: var(--faint); }
.cx-mats { flex: 1; min-height: 0; display: grid; align-content: start; gap: 6px; margin: 0; padding: 8px; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.mat-item { border: 1px solid transparent; border-radius: var(--r-sm); transition: border-color .25s, background .25s; }
.mat-item.fresh, .la-cards > .fresh { animation: rise .4s var(--ease) both; }
.mat-item.is-cited { border-color: var(--line); background: rgba(var(--gold-rgb), .04); }
.mat-item.is-open { border-color: var(--gold-light); background: rgba(var(--gold-rgb), .07); }
.mat-item > button { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: start; gap: 10px; width: 100%; padding: 10px; border: 0; background: none; color: var(--text); text-align: left; cursor: pointer; }
.mat-item > button > span:nth-child(2) { display: grid; gap: 2px; min-width: 0; }
.mat-item b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 12.5px; font-weight: 500; }
.mat-item small { font-size: 11px; color: var(--faint); line-height: 1.5; }
.mat-item em { font: normal 10px var(--code); color: var(--faint); }
.mat-body { padding: 0 10px 10px; }
@media (max-width: 1180px) {
  .main > section.chat-page { grid-template-columns: minmax(0, 1fr); }
  .cx-mat { display: none; } .chat-page.mat-open .cx-mat { display: flex; position: fixed; inset: auto 12px 12px 12px; max-height: 60svh; z-index: 30; }
  .cx-mat-toggle { display: inline-flex; }
}
@media (max-width: 900px) {
  .side-top { order: -1; } .side-threads { display: none; }
  .main > section.chat-page { height: calc(100svh - 190px); }
  .cx-today > div { grid-template-columns: 1fr; }
  .orb-wrap { width: 160px; height: 160px; } .cx-hint span:last-child { display: none; }
}
.side > * { min-width: 0; }
.orb-wrap { width: 250px; height: 250px; }

html[data-theme="light"] :is(.brand img, .hero .mark img, .orb-wrap img) { filter: brightness(.78) saturate(1.25) drop-shadow(0 0 10px rgba(166, 124, 31, .25)); }

/* ───────── decisions ───────── */
.mode b.hot { color: var(--night); background: var(--gild-btn); box-shadow: 0 0 12px rgba(var(--gold-rgb), .5); }
.banner { padding: 10px 14px; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .05); font-size: 13px; color: var(--muted); }
.banner a { color: var(--gold-light); font-weight: 600; }
.calls { display: grid; gap: 12px; align-content: start; }
.dc { padding: 16px 18px; gap: 12px; }
.dc.done { opacity: .82; }
.dc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.dc-head b { font-size: 15px; color: var(--ivory); }
.dc-head .grow { flex: 1; }
.dc-no { font-size: 13px; color: var(--gold); }
.pill.hot { color: #fff; background: var(--up); }
.conv, .grade { padding: 2px 8px; border-radius: 999px; font: 11px var(--code); border: 1px solid var(--line); color: var(--muted); }
.conv.c-高 { color: var(--night); background: var(--gild-btn); border-color: transparent; } .conv.c-中 { color: var(--gold-light); border-color: var(--line-strong); }
.grade.g-A { color: var(--ok); border-color: currentColor; } .grade.g-B { color: var(--gold-light); border-color: currentColor; } .grade.g-C { color: var(--warn); } .grade.g-D { color: var(--no); border-color: currentColor; }
.dc-q { font-size: clamp(17px, 1.6vw, 21px); font-weight: 600; line-height: 1.4; color: var(--ivory); }
.dc-why { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.reason { padding: 2px 8px; border-radius: 5px; font-size: 12px; background: rgba(var(--fg-rgb), .06); color: var(--text); }
.reason.r-flip, .reason.r-against { background: rgba(242, 128, 108, .14); } .reason.r-news { background: rgba(var(--chip-rgb), .12); }
.dc-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
.dc-ev, .dc-hist { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--hair-2); border-radius: var(--r-sm); background: rgba(var(--fg-rgb), .02); }
.dc-hist p { font-size: 13px; line-height: 1.7; } .dc-hist b { color: var(--ivory); }
.chip-ev { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; padding: 7px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .04); font-size: 12.5px; transition: border-color .2s; }
.chip-ev:hover { border-color: var(--line-strong); } .chip-ev small { grid-column: 1 / -1; font-size: 11px; color: var(--faint); }
.chip-ctx { display: inline-flex; gap: 6px; align-items: center; margin: 0 8px 4px 0; font-size: 12px; color: var(--muted); }
.dc-news { font-size: 12.5px; line-height: 1.5; color: var(--text); }
.dc-opts { margin-top: 2px; } .dc-opts tr[data-o] { cursor: pointer; } .dc-opts tr.rec { background: rgba(var(--gold-rgb), .07); box-shadow: inset 2px 0 0 var(--gold-light); }
.dc-opts input { accent-color: var(--gold); } .dc-opts td { padding: 8px 10px; } .down-ish { color: var(--muted); }
.dc-rec { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .07); font-size: 13px; }
.dc-rec b { color: var(--gold-light); } .dc-rec span:last-child { color: var(--muted); }
.dc-act { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-done { padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); color: var(--ok); font-size: 13px; }
.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { position: relative; padding: 10px 16px 10px 30px; border-bottom: 1px solid var(--hair); font-size: 13px; line-height: 1.55; }
.alerts li::before { content: ""; position: absolute; left: 14px; top: 16px; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.alerts li.high::before { background: var(--no); box-shadow: 0 0 8px var(--no); }
.xbar { position: relative; display: inline-block; vertical-align: middle; width: 120px; height: 6px; margin-right: 8px; border-radius: 999px; background: rgba(var(--fg-rgb), .07); }
.xbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--viz-base); }
.xbar b { position: absolute; top: 0; bottom: 0; border-radius: 999px; } .xbar b.up { background: var(--up); } .xbar b.down { background: var(--down); }
.corr { display: grid; gap: 2px; font: 10.5px var(--code); }
.corr .h { color: var(--faint); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .corr .h.l { text-align: left; }
.corr i { display: grid; place-items: center; height: 30px; border-radius: 3px; font-style: normal; color: var(--ivory); }
@media (max-width: 900px) { .dc-grid { grid-template-columns: minmax(0, 1fr); } }

/* ───────── onboarding ───────── */
.tour { position: fixed; inset: 0; z-index: 100; }
.tour-hole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(var(--shadow-rgb), .62), 0 0 0 2px var(--gold-light), 0 0 30px rgba(var(--gold-rgb), .5); transition: all .35s var(--ease); pointer-events: none; }
html[data-theme="light"] .tour-hole { box-shadow: 0 0 0 9999px rgba(30, 22, 8, .45), 0 0 0 2px var(--gold), 0 0 30px rgba(var(--gold-rgb), .45); }
.tour-pop { position: fixed; z-index: 101; padding: 16px 18px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: linear-gradient(180deg, rgba(var(--bg2-rgb), .98), rgba(var(--bg-rgb), .99)); box-shadow: var(--lift), 0 30px 80px rgba(var(--shadow-rgb), .5); transition: left .35s var(--ease), top .35s var(--ease); }
.tour-k { font: 10.5px var(--code); letter-spacing: .16em; color: var(--gold); }
.tour-pop h4 { margin: 6px 0 6px; font-size: 16px; color: var(--ivory); }
.tour-pop p { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.tour-pop p b { color: var(--gold-light); }
.tour-nav { display: flex; gap: 6px; align-items: center; margin-top: 12px; } .tour-nav .grow { flex: 1; }
.ob-back { position: fixed; inset: 0; z-index: 99; display: grid; place-items: center; padding: 16px; background: rgba(var(--shadow-rgb), .55); backdrop-filter: blur(6px); opacity: 0; transition: opacity .18s; }
html[data-theme="light"] .ob-back { background: rgba(40, 30, 10, .35); }
.ob-back.show { opacity: 1; }
.ob { width: min(560px, 100%); max-height: calc(100svh - 32px); overflow-y: auto; padding: 22px; border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: linear-gradient(180deg, rgba(var(--bg2-rgb), .98), rgba(var(--bg-rgb), .99)); box-shadow: var(--lift), 0 0 80px rgba(var(--glow-rgb), .12); transform: translateY(8px); transition: transform .25s var(--ease); }
.ob-back.show .ob { transform: none; }
.ob.wide { width: min(980px, 100%); }
.ob-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.ob-head img { width: 40px; filter: drop-shadow(0 0 14px rgba(var(--gold-rgb), .5)); }
.ob-head h2 { font-size: 24px; color: var(--ivory); margin-top: 2px; }
.ob-head .ob-search { margin-left: auto; width: 240px; }
.ob-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ob-card { padding: 14px; border: 1px solid var(--line); border-radius: var(--r-sm); background: rgba(var(--gold-rgb), .03); }
.ob-card .n { font: 11px var(--code); color: var(--gold); letter-spacing: .2em; }
.ob-card h4 { margin: 6px 0; font-size: 15px; color: var(--ivory); }
.ob-card p { font-size: 13px; line-height: 1.7; color: var(--muted); } .ob-card p b { color: var(--gold-light); font-weight: 600; }
.ob-act { display: flex; gap: 8px; align-items: center; margin-top: 16px; flex-wrap: wrap; } .ob-act .grow { flex: 1; }
.ob-gloss { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 22px; }
.ob-gloss section { display: grid; gap: 4px; align-content: start; }
.ob-gloss h5 { margin: 10px 0 4px; font: 10.5px var(--code); letter-spacing: .2em; color: var(--gold); }
.ob-gloss dl { margin: 0; padding: 8px 0; border-bottom: 1px solid var(--hair); }
.ob-gloss dt { font-weight: 600; color: var(--ivory); font-size: 13.5px; } .ob-gloss dd { margin: 3px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.help .menu { right: 0; }
@media (max-width: 800px) { .ob-grid, .ob-gloss { grid-template-columns: minmax(0, 1fr); } .ob-head .ob-search { width: 100%; margin: 0; } }

/* ───────── backtest: one screen + replay ───────── */
.main > section.bt-page { display: grid; grid-template-columns: 300px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; height: calc(100svh - var(--top) - 16px); min-height: 620px; }
body[data-page="backtest"] .shell { padding-bottom: 10px; }
.bt-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 2px 4px 0; min-width: 0; }
.bt-head > div:first-child { min-width: 0; }
.bt-head h1 { margin: 6px 0 4px; font-size: clamp(20px, 1.9vw, 26px); font-weight: 600; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-head h1 em { font-style: normal; background: var(--gild); -webkit-background-clip: text; background-clip: text; color: transparent; }
.bt-head .note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; } .bt-head .note b { color: var(--ivory); }
.bt-head .kick { display: inline-flex; align-items: center; gap: 10px; padding: 3px 12px; border: 1px solid var(--line); border-radius: 999px; font: 10.5px var(--code); letter-spacing: .14em; color: var(--gold); }
.bt-head .kick i { width: 5px; height: 5px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 8px var(--gold-light); }
.bt-setup { min-height: 0; } .bt-setup > .pb { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; }
.bt-setup .pf { padding: 10px 12px; }
.bt-targets { display: flex; flex-wrap: wrap; border-radius: 12px; } .bt-targets button { flex: 1; }
.bt-main { display: grid; grid-template-rows: minmax(0, 1fr) clamp(130px, 19vh, 180px); gap: 12px; min-height: 0; min-width: 0; }
.bt-stage { min-height: 0; padding: 0; } .bt-replay { height: 100%; min-height: 0; }
.bt-mini { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 12px; min-height: 0; }
.bt-mini .panel > .pb { flex: 1; min-height: 0; padding: 8px 12px; overflow: hidden; }
.mini-chart { height: 100%; min-height: 0; }
.rp { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; min-height: 0; }
.rp-kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin: 0; border-bottom: 1px solid var(--line); }
.rp-kpis > div { padding: 9px 14px; min-width: 0; } .rp-kpis > div + div { border-left: 1px solid var(--line); }
.rp-kpis dt { font: 9.5px var(--code); letter-spacing: .16em; color: var(--faint); }
.rp-kpis dd { margin: 3px 0 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rp-kpis dd small { margin-left: 6px; font-size: 11.5px; font-weight: 500; }
.rp-kpis .hot dd { color: var(--gold-light); text-shadow: 0 0 18px rgba(var(--gold-rgb), .4); }
.rp-stage { position: relative; min-height: 0; padding: 6px 10px 0; }
.rp-svg { display: block; width: 100%; height: 100%; }
.rp-pane { font: 10px var(--code); letter-spacing: .14em; fill: var(--gold); }
.band-up { fill: var(--up); } .band-down { fill: var(--down); }
.rp-price { fill: none; stroke: var(--series-2); stroke-width: 1.5; stroke-linejoin: round; }
.rp-eq { fill: none; stroke: var(--series-1); stroke-width: 2.2; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(var(--gold-rgb), .45)); }
.rp-eq-area { fill: var(--series-1); fill-opacity: .12; stroke: none; }
.rp-bh { fill: none; stroke: var(--viz-muted); stroke-width: 1.3; stroke-dasharray: 3 3; }
.mk-up { fill: var(--up); } .mk-down { fill: var(--down); }
.rp-head { stroke: var(--gold-light); stroke-width: 1; filter: drop-shadow(0 0 6px var(--gold-light)); }
.rp-dot-e { fill: var(--series-1); stroke: var(--viz-surface); stroke-width: 2; filter: drop-shadow(0 0 8px rgba(var(--gold-rgb), .8)); }
.rp-dot-p { fill: var(--series-2); stroke: var(--viz-surface); stroke-width: 2; }
.rp-oos { fill: rgba(var(--gold-rgb), .05); stroke: rgba(var(--gold-rgb), .25); stroke-dasharray: 3 4; }
.rp-oos-t { font: 10px var(--code); letter-spacing: .12em; fill: var(--gold); }
.rp-bar { display: flex; align-items: center; gap: 12px; padding: 8px 14px 10px; border-top: 1px solid var(--hair); }
.rp-play { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: var(--gild-btn); cursor: pointer; box-shadow: 0 0 18px -4px rgba(var(--gold-rgb), .7); }
.rp-play::before { content: ""; margin-left: 3px; border-left: 11px solid var(--night); border-top: 7px solid transparent; border-bottom: 7px solid transparent; }
.rp-play.on::before { margin: 0; width: 10px; height: 12px; border: 0; border-left: 3px solid var(--night); border-right: 3px solid var(--night); box-sizing: border-box; }
.rp-range { flex: 1; min-width: 80px; accent-color: var(--gold); }
.rp-legend { display: flex; gap: 6px; align-items: center; font-size: 11px; color: var(--muted); white-space: nowrap; }
.rp-legend i { display: inline-block; width: 12px; height: 10px; margin-left: 8px; border-radius: 2px; }
.rp-legend .b-up { background: var(--up); opacity: .5; } .rp-legend .b-down { background: var(--down); opacity: .5; }
.rp-legend .l-eq { height: 2px; background: var(--series-1); } .rp-legend .l-bh { height: 0; border-top: 1.5px dashed var(--viz-muted); }
.months.compact { grid-template-columns: 26px repeat(12, minmax(0, 1fr)); height: 100%; gap: 1px; font-size: 9px; }
.months.compact i { height: auto; min-height: 6px; border-radius: 1px; }
@media (max-width: 1280px) { .rp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .rp-kpis > div:nth-child(n+5) { display: none; } .rp-legend { display: none; } }
@media (max-width: 900px) {
  .main > section.bt-page { display: flex; flex-direction: column; height: auto; }
  .bt-setup > .pb { max-height: 46svh; }
  .bt-main { grid-template-rows: 460px auto; }
  .bt-mini { grid-template-columns: minmax(0, 1fr); } .bt-mini .panel { height: 160px; }
  .bt-head h1 { white-space: normal; } .bt-head { flex-direction: column; align-items: flex-start; }
}
.main > section.bt-page { grid-template-columns: 330px minmax(0, 1fr); }
.bt-setup .row2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.bt-setup .input { min-width: 0; } .bt-setup input[type="date"].input { font-size: 12px; padding: 0 6px; }
.bt-setup .bt-rel .params { gap: 4px; flex-wrap: nowrap; }
.bt-setup .bt-rel .params .input.sm { width: 42px; padding: 0 4px; } .bt-setup .bt-rel .params select.input.sm { width: 40px; padding: 0 4px; background-position: calc(100% - 9px) 12px, calc(100% - 5px) 12px; }
body[data-page="backtest"] .ai-fab { display: none; }
.bt-mini > .panel { min-height: 0; overflow: hidden; }
.bt-setup .bt-rel .params .input.sm[data-f="window"] { width: 48px; }

/* ───────── data: one screen ───────── */
.main > section.ds-page { display: grid; grid-template-columns: 320px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 12px; height: calc(100svh - var(--top) - 16px); min-height: 600px; }
body[data-page="data"] .shell { padding-bottom: 10px; }
body[data-page="data"] .ai-fab { display: none; }
.ds-side { min-height: 0; } .ds-side > .pb { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.ds-groups { display: flex; flex-wrap: wrap; gap: 4px; }
.ds-groups button { padding: 3px 9px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.ds-groups button.on { color: var(--night); background: var(--gild-btn); border-color: transparent; }
.ds-list { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: 2px; margin: 0 -6px; padding: 0 6px; scrollbar-width: thin; }
.ds-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid transparent; border-radius: var(--r-sm); background: none; color: var(--text); text-align: left; cursor: pointer; }
.ds-row:hover { background: rgba(var(--fg-rgb), .04); }
.ds-row.on { border-color: var(--line-strong); background: rgba(var(--gold-rgb), .08); box-shadow: inset 2px 0 0 var(--gold-light); }
.ds-row span { display: grid; min-width: 0; } .ds-row b { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-row small { font-size: 10.5px; color: var(--faint); } .ds-row em { font-style: normal; font-size: 12.5px; text-align: right; } .ds-row em small { display: block; }
.ds-main { grid-template-rows: minmax(0, 1fr) clamp(130px, 20vh, 190px); }
.ds-chart { min-height: 0; } .ds-chart .rp-kpis { flex: none; }
.ds-plot { flex: 1; min-height: 0; padding: 8px 12px 6px; overflow: hidden; }
.ds-mini { grid-template-columns: 1fr 1.3fr; }
.ds-info dl { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 6px 10px; margin: 0; font-size: 12.5px; }
.ds-info dt { color: var(--faint); font-size: 11.5px; } .ds-info dd { margin: 0; color: var(--text); line-height: 1.5; }
.ds-rels { display: grid; gap: 6px; max-height: 100%; overflow-y: auto; scrollbar-width: thin; }
.ds-mini .panel > .pb { overflow-y: auto; }
@media (max-width: 1280px) { .ds-chart .rp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ds-chart .rp-kpis > div:nth-child(n+5) { display: none; } }
@media (max-width: 900px) {
  .main > section.ds-page { display: flex; flex-direction: column; height: auto; }
  .ds-side > .pb { max-height: 42svh; } .ds-main { grid-template-rows: 420px auto; } .ds-mini { grid-template-columns: minmax(0, 1fr); }
}
.vt-ok { color: var(--ok); } .vt-warn { color: var(--warn); } .vt-no { color: var(--no); } .vt-na { color: var(--na); }

/* ---- how to read: popover bands, glossary bands, cheat sheet, tour ask ---- */
.rd { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--hair); display: grid; gap: 3px; }
.rd-k { font: 9.5px var(--code); letter-spacing: .16em; color: var(--gold); margin-bottom: 2px; }
.rd p { margin: 0; font-size: 12px; line-height: 1.5; color: var(--text); display: flex; gap: 6px; }
.rd p i { flex: none; font-style: normal; font-size: 10.5px; padding: 0 5px; border-radius: 3px; line-height: 17px; height: 17px; }
.rd .rd-ok i { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.rd .rd-mid i { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.rd .rd-no i { color: var(--no); background: color-mix(in srgb, var(--no) 14%, transparent); }
.rd .rd-act { margin-top: 3px; color: var(--muted); font-size: 11.5px; }
.tip-acts { display: flex; gap: 12px; align-items: center; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--hair); }
.tip-acts .tip-more { margin: 0 0 0 auto; }
.tip-ask { padding: 4px 9px; border: 1px solid rgba(var(--gold-rgb), .45); border-radius: 999px; background: rgba(var(--gold-rgb), .1); color: var(--gold-light); font: 12px var(--sans); cursor: pointer; }
html[data-theme="light"] .tip-ask { color: var(--gold-deep); }
.tip-ask:hover { background: rgba(var(--gold-rgb), .2); }
.ob-rd { display: grid; gap: 1px; margin-top: 5px; }
.ob-rd i { font-style: normal; font-size: 11.5px; padding-left: 10px; position: relative; color: var(--muted); }
.ob-rd i::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; border-radius: 50%; }
.ob-rd .rd-ok::before { background: var(--ok); } .ob-rd .rd-mid::before { background: var(--warn); } .ob-rd .rd-no::before { background: var(--no); }
.ob.wide.sheet { width: min(1180px, 100%); }
.ob-sheet { display: grid; gap: 14px; max-height: min(62vh, 640px); overflow: auto; padding-right: 4px; }
.ob-sheet h5 { margin: 0 0 4px; font: 10.5px var(--code); letter-spacing: .2em; color: var(--gold); }
.ob-sheet table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 12.5px; line-height: 1.5; }
.ob-sheet thead th { font: 10px var(--code); letter-spacing: .12em; text-align: left; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.ob-sheet thead th:first-child { width: 150px; } .ob-sheet thead th:last-child { width: 30%; }
.ob-sheet thead .rd-ok { color: var(--ok); } .ob-sheet thead .rd-mid { color: var(--warn); } .ob-sheet thead .rd-no { color: var(--no); }
.ob-sheet tbody th, .ob-sheet td { padding: 7px 8px; border-bottom: 1px solid var(--hair); vertical-align: top; text-align: left; color: var(--text); font-weight: 400; }
.ob-sheet tbody th b { display: block; color: var(--ivory); font-size: 13px; }
.ob-sheet td.rd-ok { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--ok) 60%, transparent); }
.ob-sheet td.rd-mid { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--warn) 60%, transparent); }
.ob-sheet td.rd-no { box-shadow: inset 2px 0 0 color-mix(in srgb, var(--no) 60%, transparent); }
.ob-sheet .ob-act-c { color: var(--muted); }
.ob-ask { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--gold); font: 11px var(--sans); cursor: pointer; text-align: left; }
.ob-ask:hover { text-decoration: underline; }
.tour-ask { color: var(--gold) !important; }

@media (max-width: 800px) {
  .ob-sheet table, .ob-sheet tbody, .ob-sheet tr, .ob-sheet tbody th, .ob-sheet td { display: block; width: auto; }
  .ob-sheet thead { display: none; } .ob-sheet tr { padding: 8px 0; border-bottom: 1px solid var(--line); } .ob-sheet tbody th, .ob-sheet td { border: 0; padding: 2px 0 2px 10px; }
}
