/* Paradise Bulls — trading desk UI
   Palette: night-ink navy, emerald (bull), crimson (bear), brand gold.
   Type: Bahnschrift (DIN-style display, ships with Windows) for numbers & headings,
         Segoe UI for body, Consolas/Cascadia for prices. All offline. */

:root {
  --ink-0: #060a12;
  --ink-1: #0a1120;
  --ink-2: #0e1626;
  --ink-3: #142036;
  --ink-4: #1a2842;
  --line: #1c2940;
  --line-2: #2a3b5a;
  --text: #e6ebf3;
  --text-2: #a1aec4;
  --text-3: #6f7d96;
  --bull: #1bc98e;
  --bull-ink: #0d7a56;
  --bull-soft: rgba(27, 201, 142, 0.12);
  --bear: #ef4562;
  --bear-soft: rgba(239, 69, 98, 0.12);
  --gold: #e8b54a;
  --gold-2: #b9882d;
  --gold-hi: #fbe3a1;
  --gold-soft: rgba(232, 181, 74, 0.12);
  --info: #6ea8fe;
  --info-soft: rgba(110, 168, 254, 0.12);
  --warn: #f2a33a;

  --font-display: "Bahnschrift", "DIN Alternate", "Barlow Semi Condensed", "Arial Narrow", "Segoe UI", sans-serif;
  --font-body: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", "Cascadia Code", Consolas, "SF Mono", ui-monospace, Menlo, monospace;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset, 0 12px 32px -18px rgba(0, 0, 0, 0.8);
  --sidebar-w: 224px;
  --topbar-h: 56px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--ink-0);
  color: var(--text);
  font: 14px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
::selection { background: rgba(232, 181, 74, 0.35); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
svg.ico { width: 16px; height: 16px; flex: none; vertical-align: -3px; }
.mh svg.ico { width: 13px; height: 13px; }
.headline a svg.ico { width: 12px; height: 12px; vertical-align: -1px; opacity: .6; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* scrollbars */
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 10px; border: 2px solid var(--ink-0); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ shell */
.skip-link { position: absolute; left: 12px; top: -40px; z-index: 100; background: var(--gold); color: #1a1205; padding: 6px 12px; border-radius: 6px; font-weight: 600; }
.skip-link:focus { top: 8px; }

.shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) minmax(0, 1fr);
  grid-template-areas: "side top" "side main";
  height: 100vh;
}
.sidebar {
  grid-area: side;
  background: linear-gradient(180deg, #0b1324 0%, var(--ink-1) 40%, #080e1a 100%);
  border-right: 1px solid var(--line);
  display: flex; flex-direction: column;
  min-height: 0;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px 12px; height: var(--topbar-h); text-decoration: none; color: inherit; }
.brand img { width: 32px; height: 32px; flex: none; filter: drop-shadow(0 4px 10px rgba(232, 181, 74, 0.18)); }
.brand-name { font-family: var(--font-display); font-weight: 700; font-stretch: semi-condensed; font-size: 15px; letter-spacing: 0.16em; text-transform: uppercase; line-height: 1.05; color: var(--gold); }
.brand-name span { display: block; color: var(--text); letter-spacing: 0.32em; font-weight: 400; font-size: 11px; }

.nav { list-style: none; margin: 8px 0 0; padding: 0 10px; display: flex; flex-direction: column; gap: 2px; flex: 1; overflow-y: auto; }
.nav a, .nav button {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 12px; border-radius: 8px;
  color: var(--text-2); text-decoration: none; background: none; border: 0; cursor: pointer; text-align: left;
  font-weight: 500; position: relative;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav button:hover { background: var(--ink-3); color: var(--text); }
.nav a[aria-current="page"] { background: linear-gradient(90deg, var(--gold-soft), transparent 90%); color: var(--gold-hi); }
.nav a[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold); }
.nav svg { width: 19px; height: 19px; flex: none; }
.nav .nav-kbd { margin-left: auto; font: 11px var(--font-mono); color: var(--text-3); opacity: 0; transition: opacity .15s; }
.nav a:hover .nav-kbd { opacity: 1; }
.side-foot { padding: 10px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.side-note { display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: var(--text-3); padding: 4px 12px 2px; line-height: 1.35; }
.side-note svg { width: 14px; height: 14px; flex: none; margin-top: 1px; color: var(--gold); }
.nav-quit { color: var(--text-3) !important; }
.nav-quit:hover { color: var(--bear) !important; background: var(--bear-soft) !important; }

.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(10, 17, 32, 0.92);
  backdrop-filter: blur(8px);
  min-width: 0;
}
.topbar h1 { font-family: var(--font-display); font-weight: 600; font-size: 18px; letter-spacing: 0.04em; margin: 0 auto 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-pills { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; padding: 0 11px; border-radius: 999px;
  background: var(--ink-2); border: 1px solid var(--line);
  color: var(--text-2); font-size: 12.5px; white-space: nowrap; text-decoration: none; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.pill:hover { border-color: var(--line-2); color: var(--text); background: var(--ink-3); }
.pill svg { width: 15px; height: 15px; flex: none; }
.pill strong { color: var(--text); font-weight: 600; }
.pill .muted { color: var(--text-3); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.dot.on { background: var(--bull); box-shadow: 0 0 0 3px var(--bull-soft); }
.dot.off { background: var(--bear); box-shadow: 0 0 0 3px var(--bear-soft); }
.dot.warn { background: var(--warn); }
.dot.pulse { animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(27, 201, 142, .55); } 70% { box-shadow: 0 0 0 7px rgba(27, 201, 142, 0); } 100% { box-shadow: 0 0 0 0 rgba(27, 201, 142, 0); } }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 4px; font: 600 10.5px/1.6 var(--font-display);
  letter-spacing: 0.1em; text-transform: uppercase; white-space: nowrap;
  background: var(--ink-4); color: var(--text-2);
}
.badge.demo { background: var(--gold); color: #251a04; }
.badge.bull { background: var(--bull-soft); color: var(--bull); }
.badge.bear { background: var(--bear-soft); color: var(--bear); }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.warn { background: rgba(242, 163, 58, 0.14); color: var(--warn); }
.badge.mute { background: var(--ink-3); color: var(--text-3); }

.level-pill { gap: 10px; padding-right: 13px; }
.level-pill .lvl { font: 700 13px var(--font-display); color: var(--gold); letter-spacing: .04em; }
.xp-mini { width: 74px; height: 5px; border-radius: 3px; background: var(--ink-4); overflow: hidden; }
.xp-mini i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold-hi)); border-radius: 3px; }

.mock-flag { text-decoration: none; padding: 4px 9px; border: 1px dashed rgba(232, 181, 74, .6); white-space: nowrap; }
.mock-flag:hover { color: var(--gold-hi); }
input::placeholder, textarea::placeholder { text-transform: none; }

#main { grid-area: main; overflow-y: auto; overflow-x: hidden; min-width: 0; outline: none; }
.page { padding: 22px 24px 48px; max-width: 1560px; margin: 0 auto; animation: page-in .28s var(--ease); }
@keyframes page-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.offline-banner { grid-column: 1 / -1; }
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 16px; margin: 14px 24px 0; border-radius: var(--radius);
  background: var(--bear-soft); border: 1px solid rgba(239, 69, 98, .35); color: #ffd4dc; font-size: 13px;
}
.banner.warn { background: rgba(242, 163, 58, .1); border-color: rgba(242, 163, 58, .35); color: #ffe2b8; }
.banner .grow { flex: 1; min-width: 200px; }

/* ------------------------------------------------------------------ layout helpers */
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.split-main { grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr); }
.split-even { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.tight { gap: 6px; }
.spacer { flex: 1; }
.mt { margin-top: 16px; }
.mt-s { margin-top: 8px; }
.muted { color: var(--text-3); }
.dim { color: var(--text-2); }
.nowrap { white-space: nowrap; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12.5px; }
.up { color: var(--bull); }
.down { color: var(--bear); }
.goldtxt { color: var(--gold); }
.prewrap { white-space: pre-wrap; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  min-width: 0;
}
.card-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; flex-wrap: wrap; }
.card-h h2, .card-h h3 { margin: 0; font: 600 13px/1.3 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.card-h .sub { color: var(--text-3); font-size: 12px; }
.card-b { padding: 14px 16px 16px; }
.card-b.flush { padding: 10px 0 4px; }
.card.pad { padding: 16px; }
.section-title { font: 600 12px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); margin: 0 0 8px; }
.section-title.mt { margin-top: 18px; }
.section-title.mt-s { margin-top: 10px; }
.tbl.checks td { padding-top: 6px; padding-bottom: 6px; }
.tbl.checks td svg { width: 17px; height: 17px; display: block; }
.tbl.checks tr.failed { background: rgba(239, 69, 98, .06); }
.eyebrow { font: 600 11px var(--font-display); letter-spacing: .18em; text-transform: uppercase; color: var(--text-3); }

.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 2px 0 0; color: var(--text-2); max-width: 720px; }
.page-head h2 { margin: 0; font: 600 26px/1.15 var(--font-display); letter-spacing: 0.02em; }

/* ------------------------------------------------------------------ buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--ink-3); color: var(--text); font-weight: 600; font-size: 13px;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
}
.btn:hover:not(:disabled) { background: var(--ink-4); border-color: #3a4f75; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: linear-gradient(180deg, #f2c661, var(--gold) 55%, #cf9a35); border-color: #f5d17e; color: #241803; }
.btn.primary:hover:not(:disabled) { background: linear-gradient(180deg, #f8d57d, #edc05e 55%, #d9a63f); border-color: #fbe3a1; }
.btn.bull { background: var(--bull); border-color: #4fe0ad; color: #04281b; }
.btn.bull:hover:not(:disabled) { background: #2bd99c; border-color: #7ef0c6; }
.btn.danger { background: transparent; border-color: rgba(239, 69, 98, .5); color: #ff8fa2; }
.btn.danger:hover:not(:disabled) { background: var(--bear-soft); border-color: var(--bear); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover:not(:disabled) { background: var(--ink-3); color: var(--text); border-color: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.btn.lg { height: 46px; padding: 0 22px; font-size: 15px; border-radius: 10px; }
.btn.icon { width: 32px; padding: 0; height: 32px; }
.btn.icon.sm { width: 28px; height: 28px; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label, .field > .label { font-size: 12px; font-weight: 600; color: var(--text-2); }
.field .help { font-size: 11.5px; color: var(--text-3); line-height: 1.4; }
.input, .select, .textarea {
  width: 100%; height: 36px; padding: 0 11px; border-radius: 8px;
  background: var(--ink-1); border: 1px solid var(--line-2); color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:hover, .select:hover, .textarea:hover { border-color: #3a4f75; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input.num-in { font-family: var(--font-mono); }
.select { appearance: none; padding-right: 30px; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 15px) 15px, calc(100% - 10px) 15px; background-size: 5px 5px; background-repeat: no-repeat; }
.select option, .select optgroup { background: var(--ink-2); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 16px; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-weight: 500; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { position: relative; width: 38px; height: 22px; border-radius: 22px; background: var(--ink-4); border: 1px solid var(--line-2); transition: background .2s, border-color .2s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .2s var(--ease), background .2s; }
.switch input:checked + .track { background: var(--bull-ink); border-color: var(--bull); }
.switch input:checked + .track::after { transform: translateX(16px); background: #eafff6; }
.switch input:focus-visible + .track { outline: 2px solid var(--gold); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .45; }
.switch.disabled { cursor: not-allowed; color: var(--text-3); }

/* segmented / chips */
.seg { display: inline-flex; background: var(--ink-1); border: 1px solid var(--line-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: none; color: var(--text-2); height: 28px; min-width: 38px; padding: 0 10px; border-radius: 6px; cursor: pointer; font: 600 12.5px var(--font-display); letter-spacing: .06em; }
.seg button:hover { color: var(--text); background: var(--ink-3); }
.seg button[aria-pressed="true"] { background: var(--gold); color: #241803; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 11px; border-radius: 999px;
  background: var(--ink-1); border: 1px solid var(--line-2); color: var(--text-2);
  font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: #3a4f75; }
.chip[aria-pressed="true"], .chip.on { background: var(--gold-soft); border-color: rgba(232, 181, 74, .6); color: var(--gold-hi); }
.chip .x { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0; display: inline-flex; }
.chip .x:hover { color: var(--bear); }
.chip .x svg { width: 13px; height: 13px; }
.chip.static { cursor: default; }
.cond-chip { font-family: var(--font-mono); font-size: 11.5px; height: 24px; border-radius: 5px; padding: 0 8px; background: var(--ink-3); border-color: var(--line); color: var(--text-2); cursor: default; }
.cond-chip b { color: var(--gold); font-weight: 600; }

.check-chip { position: relative; display: inline-flex; }
.check-chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.check-chip span { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line-2); background: var(--ink-1); color: var(--text-3); font-size: 12px; transition: all .15s; }
.check-chip span i { width: 10px; height: 10px; border-radius: 2px; background: currentColor; opacity: .35; }
.check-chip input:checked + span { color: var(--text); border-color: #3a4f75; background: var(--ink-3); }
.check-chip input:checked + span i { opacity: 1; }
.check-chip input:focus-visible + span { outline: 2px solid var(--gold); outline-offset: 2px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 6px; overflow-x: auto; }
.tabs button { position: relative; border: 0; background: none; color: var(--text-3); padding: 11px 12px; cursor: pointer; font: 600 13px var(--font-display); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected="true"] { color: var(--gold-hi); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--gold); border-radius: 2px; }
.tabs .count { margin-left: 6px; color: var(--text-3); font-weight: 400; }

/* ------------------------------------------------------------------ tables */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 600 11px var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--ink-2); z-index: 1; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid rgba(28, 41, 64, .6); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: rgba(20, 32, 54, .65); }
.tbl tr.clickable { cursor: pointer; }
.tbl tr.clickable:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.tbl .r { text-align: right; }
.tbl .c { text-align: center; }
.tbl td.wrap { white-space: normal; min-width: 220px; color: var(--text-2); font-size: 12.5px; }
.tbl.compact td { padding: 7px 10px; }
.tbl.compact th { padding: 7px 10px; }
.side-tag { font: 700 11.5px var(--font-display); letter-spacing: .1em; }
.side-tag.buy { color: var(--bull); }
.side-tag.sell { color: var(--bear); }

.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.hbar { flex: 1; height: 6px; border-radius: 3px; background: var(--ink-4); position: relative; overflow: hidden; min-width: 60px; }
.hbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--bull); }
.hbar i.lb { background: rgba(232, 181, 74, .55); }
.hbar .mark { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--text-2); }

/* ------------------------------------------------------------------ states */
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; padding: 34px 20px; color: var(--text-2); }
.empty svg { width: 34px; height: 34px; color: var(--text-3); }
.empty h4 { margin: 4px 0 0; font: 600 15px var(--font-display); letter-spacing: .04em; color: var(--text); }
.empty p { margin: 0; max-width: 420px; font-size: 13px; color: var(--text-3); }
.empty .btn { margin-top: 6px; }
.skel { background: linear-gradient(90deg, var(--ink-3) 0%, var(--ink-4) 50%, var(--ink-3) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: 6px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.skel-line { height: 12px; margin: 8px 0; }
.skel-block { height: 120px; }
.err-box { padding: 14px 16px; border-radius: 8px; background: var(--bear-soft); color: #ffc2cd; border: 1px solid rgba(239,69,98,.3); font-size: 13px; }
.note { padding: 10px 12px; border-radius: 8px; background: var(--ink-1); border: 1px solid var(--line); color: var(--text-2); font-size: 12.5px; line-height: 1.45; }
.note.gold { border-color: rgba(232, 181, 74, .35); background: rgba(232, 181, 74, .06); color: #f3dca6; }
.note.bear { border-color: rgba(239, 69, 98, .35); background: rgba(239, 69, 98, .06); color: #ffc2cd; }
.note svg { width: 15px; height: 15px; vertical-align: -3px; margin-right: 6px; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.18); border-top-color: currentColor; animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ toasts / dialogs */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(420px, calc(100vw - 36px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 11px 12px 11px 14px; border-radius: 10px;
  background: #111b2e; border: 1px solid var(--line-2); border-left: 3px solid var(--info);
  box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .8);
  font-size: 13px; animation: toast-in .25s var(--ease);
}
.toast.success { border-left-color: var(--bull); }
.toast.error { border-left-color: var(--bear); }
.toast.warning { border-left-color: var(--warn); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-title { font-weight: 600; }
.toast .t-msg { color: var(--text-2); margin-top: 2px; word-break: break-word; }
.toast .btn { margin: -3px -4px 0 0; }
.toast.out { opacity: 0; transform: translateX(16px); transition: all .2s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

dialog { color: var(--text); padding: 0; border: 0; background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(3, 6, 12, .78); }
.modal {
  width: min(520px, calc(100vw - 32px));
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .9);
  animation: modal-in .22s var(--ease);
}
.modal.wide { width: min(720px, calc(100vw - 32px)); }
@keyframes modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
.modal-h { display: flex; align-items: center; gap: 12px; padding: 18px 20px 4px; }
.modal-h h3 { margin: 0; font: 600 18px var(--font-display); letter-spacing: .03em; }
.modal-b { padding: 10px 20px 4px; color: var(--text-2); }
.modal-f { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 20px 18px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; margin: 10px 0; }
.kv dt { color: var(--text-3); font-size: 12.5px; }
.kv dd { margin: 0; color: var(--text); font-family: var(--font-mono); font-size: 13px; }

.drawer-dlg { margin: 0 0 0 auto; height: 100vh; }
.drawer {
  width: min(560px, 100vw); height: 100vh; overflow-y: auto;
  background: var(--ink-1); border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 60px -20px rgba(0,0,0,.8);
  animation: drawer-in .25s var(--ease);
}
@keyframes drawer-in { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-h { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 16px 18px; background: rgba(10, 17, 32, .96); border-bottom: 1px solid var(--line); }
.drawer-h h3 { margin: 0; font: 600 18px var(--font-display); letter-spacing: .03em; }
.drawer-b { padding: 16px 18px 40px; display: flex; flex-direction: column; gap: 16px; }

/* disclaimer / closed screen */
.disclaimer .modal-b p { margin: 0 0 10px; line-height: 1.55; }
.disclaimer-mark { display: flex; justify-content: center; padding: 22px 0 0; }
.disclaimer-mark img { width: 64px; height: 64px; }
.fullscreen-msg { position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at 50% 35%, #10203a 0%, var(--ink-0) 60%); text-align: center; padding: 24px; }
.fullscreen-msg img { width: 88px; height: 88px; }
.fullscreen-msg h2 { margin: 0; font: 600 26px var(--font-display); letter-spacing: .04em; }
.fullscreen-msg p { margin: 0; color: var(--text-2); max-width: 460px; }

/* ------------------------------------------------------------------ dashboard: rank plate (signature) */
.rank-plate {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(260px, 340px); gap: 22px 28px; align-items: center;
  padding: 22px 24px;
  border-radius: 14px;
  background:
    radial-gradient(ellipse 60% 120% at 0% 0%, rgba(15, 107, 80, .32), transparent 60%),
    radial-gradient(ellipse 50% 90% at 100% 100%, rgba(232, 181, 74, .08), transparent 70%),
    linear-gradient(180deg, #0f1a2d, #0b1322);
  border: 1px solid rgba(232, 181, 74, .28);
  box-shadow: 0 0 0 1px rgba(0,0,0,.4) inset, 0 20px 50px -30px rgba(232, 181, 74, .35);
}
.rank-plate::after { content: ""; position: absolute; inset: 6px; border-radius: 10px; border: 1px solid rgba(232, 181, 74, .08); pointer-events: none; }
.medallion { width: 104px; height: 104px; position: relative; flex: none; }
.medallion img { width: 100%; height: 100%; filter: drop-shadow(0 10px 24px rgba(232, 181, 74, .25)); }
.rank-id .eyebrow { color: var(--gold-2); }
.rank-title { margin: 2px 0 2px; font: 700 34px/1.05 var(--font-display); font-stretch: semi-condensed; letter-spacing: .02em; text-transform: uppercase; color: var(--text); }
.rank-title em { font-style: normal; color: var(--gold); }
.rank-xp { display: flex; align-items: baseline; gap: 10px; margin-top: 8px; color: var(--text-2); font-size: 12.5px; }
.rank-xp strong { font: 600 16px var(--font-display); color: var(--gold-hi); letter-spacing: .03em; }
.xp-bar { margin-top: 6px; height: 8px; border-radius: 4px; background: rgba(0,0,0,.35); border: 1px solid rgba(232, 181, 74, .18); overflow: hidden; }
.xp-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold), var(--gold-hi)); box-shadow: 0 0 12px rgba(232, 181, 74, .6); transition: width .8s var(--ease); }

.ladder { grid-column: 1 / 3; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; align-items: end; margin-top: 4px; }
.rung { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rung .bar { height: calc(8px + var(--h) * 3px); border-radius: 3px 3px 1px 1px; background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .05); }
.rung.done .bar { background: linear-gradient(180deg, var(--gold), var(--gold-2)); border-color: rgba(251, 227, 161, .4); }
.rung.current .bar { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border-color: var(--gold-hi); box-shadow: 0 0 18px rgba(232, 181, 74, .55); }
.rung .nm { font: 600 10.5px/1.25 var(--font-display); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); min-height: 2.5em; overflow-wrap: anywhere; }
.rung .nm b { display: block; color: var(--text-3); font-weight: 400; font-size: 10px; }
.rung.done .nm, .rung.current .nm { color: var(--gold-hi); }
.rung.current .nm b { color: var(--gold); }

.plate-side { grid-row: 1 / 3; grid-column: 3; align-self: stretch; display: flex; flex-direction: column; gap: 12px; padding-left: 22px; border-left: 1px solid rgba(232, 181, 74, .14); }
.gates { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.gates li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.gates li .val { margin-left: auto; font: 12px var(--font-mono); color: var(--text-3); white-space: nowrap; }
.gates li svg { width: 15px; height: 15px; flex: none; }
.gates li.met svg { color: var(--bull); }
.gates li.unmet svg { color: var(--text-3); }
.limits { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.limit { background: rgba(0, 0, 0, .25); border: 1px solid rgba(255,255,255,.05); border-radius: 8px; padding: 7px 9px; }
.limit b { display: block; font: 600 18px var(--font-display); color: var(--text); }
.limit span { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; }
.kpi { padding: 13px 14px 12px; border-radius: var(--radius); background: var(--ink-2); border: 1px solid var(--line); min-width: 0; }
.kpi .k { font: 600 10.5px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.kpi .v { margin-top: 4px; font: 600 25px/1.1 var(--font-display); letter-spacing: .01em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { margin-top: 4px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .mini-bar { margin-top: 7px; height: 4px; background: var(--ink-4); border-radius: 2px; position: relative; }
.kpi .mini-bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; }

.chart-box { position: relative; height: 280px; }
.chart-box.tall { height: min(62vh, 600px); min-height: 420px; }
.chart-utc { position: absolute; left: 10px; top: 8px; z-index: 3; font: 600 10px var(--font-display); letter-spacing: .14em; color: var(--text-3); pointer-events: none; }

.feed { list-style: none; margin: 0; padding: 0 6px; max-height: 420px; overflow-y: auto; }
/* the side column takes the height of the equity card; the activity feed scrolls inside it */
.dash-side { contain: size; }
.dash-side .activity { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.dash-side .activity .card-b { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; }
.dash-side .activity .card-b > * { flex: 1 1 0; min-height: 0; }
.dash-side .feed { max-height: none; }
.feed li { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 10px; padding: 8px 10px; border-radius: 8px; align-items: start; }
.feed li.fresh { animation: fresh 2.5s var(--ease); }
@keyframes fresh { from { background: var(--gold-soft); } to { background: transparent; } }
.feed .dot { margin-top: 6px; }
.feed .dot.info { background: var(--info); }
.feed .dot.success { background: var(--bull); }
.feed .dot.warning { background: var(--warn); }
.feed .dot.error { background: var(--bear); }
.feed .ev-msg { font-size: 13px; color: var(--text); line-height: 1.4; overflow-wrap: anywhere; }
.feed .ev-meta { font-size: 11px; color: var(--text-3); margin-top: 2px; text-transform: uppercase; letter-spacing: .08em; }
.feed time { font-size: 11px; color: var(--text-3); white-space: nowrap; }

/* ------------------------------------------------------------------ analyze */
.analyze-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; }
.combo { position: relative; width: 250px; }
.combo .input { padding-left: 34px; font-weight: 600; letter-spacing: .02em; }
.combo .combo-ico { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.combo-list {
  position: absolute; z-index: 30; left: 0; top: calc(100% + 6px); width: 320px; max-height: 380px; overflow-y: auto;
  background: #0d1526; border: 1px solid var(--line-2); border-radius: 10px; box-shadow: 0 24px 50px -16px rgba(0,0,0,.85);
  padding: 6px;
}
.combo-group { font: 600 10.5px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); padding: 8px 10px 4px; }
.combo-opt { display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; border-radius: 6px; cursor: pointer; }
.combo-opt b { font: 600 13px var(--font-display); letter-spacing: .04em; min-width: 76px; }
.combo-opt span { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt[aria-selected="true"], .combo-opt:hover { background: var(--ink-3); }
.combo-opt.custom b { color: var(--gold); }
.analyze-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.overlay-toggles { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chart-meta { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 12px 14px 10px; }
.chart-meta .sym { font: 700 22px var(--font-display); letter-spacing: .04em; }
.chart-meta .px { font: 600 18px var(--font-mono); color: var(--text); }

.working { padding: 44px 24px; display: grid; grid-template-columns: auto 1fr; gap: 24px 32px; align-items: center; max-width: 760px; margin: 0 auto; }
.working .medallion { width: 86px; height: 86px; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); filter: brightness(1.15); } }
.working h3 { margin: 0; font: 600 22px var(--font-display); letter-spacing: .03em; }
.working .elapsed { font: 13px var(--font-mono); color: var(--text-3); }
.progress { height: 4px; border-radius: 2px; background: var(--ink-4); overflow: hidden; position: relative; margin-top: 12px; }
.progress i { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, var(--gold-2), var(--gold-hi)); border-radius: 2px; transition: width .4s var(--ease); }
.progress.indet i { width: 35%; animation: indet 1.4s ease-in-out infinite; }
@keyframes indet { from { left: -35%; } to { left: 100%; } }
.steps { grid-column: 1 / -1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 14px; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); }
.steps li i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); flex: none; }
.steps li.done { color: var(--text-2); }
.steps li.done i { background: var(--bull); }
.steps li.active { color: var(--gold-hi); }
.steps li.active i { background: var(--gold); box-shadow: 0 0 0 3px var(--gold-soft); }

/* decision card */
.decision { overflow: hidden; }
.verdict { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); position: relative; }
.verdict::before { content: ""; position: absolute; inset: 0; opacity: .9; pointer-events: none; }
.verdict.buy::before { background: radial-gradient(ellipse 80% 120% at 0% 0%, rgba(27, 201, 142, .18), transparent 60%); }
.verdict.sell::before { background: radial-gradient(ellipse 80% 120% at 0% 0%, rgba(239, 69, 98, .18), transparent 60%); }
.verdict.wait::before { background: radial-gradient(ellipse 80% 120% at 0% 0%, rgba(232, 181, 74, .12), transparent 60%); }
.stamp { position: relative; font: 700 52px/0.95 var(--font-display); font-stretch: condensed; letter-spacing: .04em; }
.stamp.buy { color: var(--bull); }
.stamp.sell { color: var(--bear); }
.stamp.wait { color: var(--gold); }
.verdict .setup { position: relative; color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.verdict .tags { position: relative; display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.gauge { position: relative; width: 128px; height: 78px; }
.gauge svg { width: 100%; height: 100%; overflow: visible; }
.gauge .g-val { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; font: 700 28px/1 var(--font-display); }
.gauge .g-lbl { position: absolute; left: 0; right: 0; bottom: -14px; text-align: center; font: 600 9.5px var(--font-display); letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); }
.levels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.levels > div { background: var(--ink-2); padding: 10px 16px; }
.levels .lk { font: 600 10.5px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.levels .lk i { width: 8px; height: 2px; border-radius: 1px; }
.levels .lv { font: 600 15px var(--font-mono); margin-top: 2px; font-variant-numeric: tabular-nums; }
.dec-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fact .fk { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.fact .fv { font: 600 14px var(--font-display); letter-spacing: .02em; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 6px 16px 0; }
.rr-bar .risk { background: var(--bear); }
.rr-bar .rew { background: var(--bull); }
.exec-zone { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; }
.exec-zone .btn { width: 100%; }
.exec-why { font-size: 12px; color: var(--text-3); text-align: center; }
.engine-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.engine-tag svg { width: 13px; height: 13px; }

.detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.bullets li { position: relative; padding-left: 16px; font-size: 13px; color: var(--text); line-height: 1.45; }
.bullets li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; border-radius: 1px; transform: rotate(45deg); background: var(--gold); }
.bullets.risk li::before { background: var(--bear); }
.bullets.good li::before { background: var(--bull); }
.reasoning { font-size: 13.5px; line-height: 1.65; color: var(--text); white-space: pre-wrap; max-height: 420px; overflow-y: auto; }

.mtf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.mtf-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--ink-1); }
.mtf-card .tf { font: 700 20px var(--font-display); letter-spacing: .04em; }
.mtf-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 10px 0 0; font-size: 12.5px; }
.mtf-card dt { color: var(--text-3); }
.mtf-card dd { margin: 0; text-align: right; }
.align-meter { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--bear), var(--ink-4) 50%, var(--bull)); margin: 8px 0 4px; }
.align-meter i { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; background: var(--text); border-radius: 2px; box-shadow: 0 0 0 2px var(--ink-2); }

.impact { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.impact.high { background: var(--bear); }
.impact.medium { background: var(--warn); }
.impact.low { background: #e8d34a; opacity: .7; }
.impact.holiday { background: var(--text-3); }
.headline { padding: 10px 0; border-bottom: 1px solid var(--line); }
.headline:last-child { border-bottom: 0; }
.headline a, .headline .ht { font-weight: 600; color: var(--text); text-decoration: none; }
.headline a:hover { color: var(--gold-hi); text-decoration: underline; }
.headline .hm { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.headline p { margin: 4px 0 0; font-size: 12.5px; color: var(--text-2); }
.fg { display: flex; align-items: center; gap: 14px; }
.fg-num { font: 700 38px/1 var(--font-display); }

.mem-item { padding: 10px 12px; border-radius: 8px; background: var(--ink-1); border: 1px solid var(--line); }
.mem-item + .mem-item { margin-top: 8px; }
.mem-item p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; }
.mem-item .mh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); }
.stars { color: var(--gold); letter-spacing: 1px; font-size: 12px; white-space: nowrap; }
.stars .off { color: var(--ink-4); }

/* ------------------------------------------------------------------ brain */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center;
  padding: 26px 16px; border: 1.5px dashed var(--line-2); border-radius: 12px; background: var(--ink-1);
  color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--gold); background: rgba(232, 181, 74, .05); }
.dropzone svg { width: 30px; height: 30px; color: var(--gold); }
.dropzone strong { color: var(--text); }
.dropzone .muted { font-size: 12px; }
.file-list { display: flex; flex-wrap: wrap; gap: 6px; }
.rule { padding: 12px 14px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; }
.rule:last-child { border-bottom: 0; }
.rule h4 { margin: 0; font-size: 14px; font-weight: 600; }
.rule p { margin: 2px 0 0; color: var(--text-2); font-size: 12.5px; }
.rule .conds { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 5px; }
.lesson-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.lesson-row:last-child { border-bottom: 0; }
.lesson-row p { margin: 0; font-size: 13px; line-height: 1.5; }
.lesson-row .mh { grid-column: 1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 11.5px; color: var(--text-3); }
.lesson-row .act { grid-row: 1 / 3; grid-column: 2; align-self: center; }
.scroll-y { max-height: 520px; overflow-y: auto; }
.grade { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 4px; font: 700 12px var(--font-display); background: var(--ink-4); color: var(--text); }
.grade.A, .grade.B { background: var(--bull-soft); color: var(--bull); }
.grade.C { background: var(--gold-soft); color: var(--gold); }
.grade.D, .grade.F { background: var(--bear-soft); color: var(--bear); }
.imp-pick { display: flex; gap: 2px; }
.imp-pick button { border: 0; background: none; padding: 2px; cursor: pointer; color: var(--ink-4); font-size: 18px; line-height: 1; }
.imp-pick button.on { color: var(--gold); }
.imp-pick button:focus-visible { outline: 2px solid var(--gold); }

/* ------------------------------------------------------------------ training */
.job { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--ink-1); }
.job + .job { margin-top: 8px; }
.job .jh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job .jmsg { font-size: 12.5px; color: var(--text-2); margin-top: 6px; }
.res-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.res-chips span { font-size: 12px; padding: 3px 8px; border-radius: 5px; background: var(--ink-3); color: var(--text-2); }
.res-chips b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.range-row { display: flex; align-items: center; gap: 12px; }
input[type="range"] { flex: 1; accent-color: var(--gold); height: 22px; }
.sym-pick { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--ink-1); display: flex; flex-direction: column; gap: 8px; }
.sym-pick .grp { display: flex; flex-wrap: wrap; gap: 5px; }
.sym-pick .grp-name { font: 600 10.5px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); width: 100%; }
.calib { width: 100%; height: 260px; }

/* ------------------------------------------------------------------ autopilot */
.ap-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 22px 24px; }
.big-switch { position: relative; width: 112px; height: 58px; border-radius: 58px; border: 1px solid var(--line-2); background: var(--ink-1); cursor: pointer; transition: background .25s, border-color .25s; padding: 0; }
.big-switch::after { content: ""; position: absolute; left: 5px; top: 5px; width: 46px; height: 46px; border-radius: 50%; background: var(--text-3); transition: transform .3s var(--ease), background .3s; box-shadow: 0 6px 16px rgba(0,0,0,.5); }
.big-switch[aria-checked="true"] { background: var(--bull-ink); border-color: var(--bull); box-shadow: 0 0 30px -6px rgba(27, 201, 142, .6); }
.big-switch[aria-checked="true"]::after { transform: translateX(54px); background: #eafff6; }
.big-switch:disabled { opacity: .5; cursor: wait; }
.ap-state { font: 700 30px/1 var(--font-display); letter-spacing: .03em; text-transform: uppercase; }
.ap-state.on { color: var(--bull); }
.demo-only { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(232, 181, 74, .4); background: rgba(232, 181, 74, .07); }
.demo-only strong { font: 700 15px var(--font-display); letter-spacing: .14em; color: var(--gold); white-space: nowrap; }
.demo-only span { font-size: 12.5px; color: #f3dca6; }
.stat-row { display: flex; flex-wrap: wrap; border-top: 1px solid var(--line); overflow: hidden; }
.stat-row > div { flex: 1 1 150px; padding: 12px 16px; box-shadow: 1px 0 0 var(--line), 0 1px 0 var(--line); }
.stat-row .k { font: 600 10.5px var(--font-display); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.stat-row .v { font: 600 17px var(--font-display); margin-top: 2px; letter-spacing: .02em; }
.saved-flag { font-size: 12px; color: var(--bull); opacity: 0; transition: opacity .3s; }
.saved-flag.show { opacity: 1; }
.add-sym { display: flex; gap: 8px; max-width: 360px; }

/* ------------------------------------------------------------------ chat */
.chat { display: grid; grid-template-rows: minmax(0, 1fr) auto; height: calc(100vh - var(--topbar-h) - 200px); min-height: 400px; }
.chat-log { overflow-y: auto; padding: 18px 18px 8px; display: flex; flex-direction: column; gap: 14px; }
.chat-log .msg { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; max-width: 900px; }
.chat-log .msg .av { width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: center; background: var(--ink-3); color: var(--text-2); font: 700 11px var(--font-display); }
.chat-log .msg .av img { width: 32px; height: 32px; }
.chat-log .msg .bubble { padding: 10px 14px; border-radius: 4px 12px 12px 12px; background: var(--ink-1); border: 1px solid var(--line); line-height: 1.6; font-size: 13.5px; min-width: 0; overflow-wrap: anywhere; }
.chat-log .msg.user { margin-left: auto; grid-template-columns: minmax(0, 1fr) 32px; }
.chat-log .msg.user .av { order: 2; }
.chat-log .msg.user .bubble { background: rgba(232, 181, 74, .08); border-color: rgba(232, 181, 74, .25); border-radius: 12px 4px 12px 12px; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child, .bubble ul:last-child, .bubble ol:last-child, .bubble pre:last-child { margin-bottom: 0; }
.bubble ul, .bubble ol { margin: 0 0 8px; padding-left: 20px; }
.bubble li { margin: 2px 0; }
.bubble code { font-family: var(--font-mono); font-size: 12px; background: var(--ink-3); padding: 1px 5px; border-radius: 4px; color: var(--gold-hi); }
.bubble pre { margin: 0 0 8px; padding: 10px 12px; background: #070c16; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; }
.bubble pre code { background: none; padding: 0; color: var(--text); }
.bubble h4 { margin: 4px 0 6px; font: 600 14px var(--font-display); letter-spacing: .04em; color: var(--gold-hi); }
.bubble strong { color: #fff; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; }
.typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; background: var(--gold); } }
.chat-input { border-top: 1px solid var(--line); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.chat-input .row { flex-wrap: nowrap; align-items: flex-end; }
.chat-input .textarea { min-height: 44px; max-height: 180px; }

/* ------------------------------------------------------------------ settings */
.settings-layout { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; align-items: start; }
.settings-nav { position: sticky; top: 0; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-weight: 500; }
.settings-nav a:hover { background: var(--ink-3); color: var(--text); }
.settings-nav a.on { color: var(--gold-hi); background: var(--gold-soft); }
.settings-sec { scroll-margin-top: 16px; }
.settings-sec + .settings-sec { margin-top: 16px; }
.broker-opts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.broker-opt { position: relative; }
.broker-opt input { position: absolute; opacity: 0; }
.broker-opt label { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--ink-1); cursor: pointer; height: 100%; transition: border-color .15s, background .15s; }
.broker-opt label b { font-weight: 600; font-size: 13.5px; }
.broker-opt label span { font-size: 11.5px; color: var(--text-3); line-height: 1.35; }
.broker-opt input:checked + label { border-color: var(--gold); background: rgba(232, 181, 74, .07); box-shadow: 0 0 0 1px var(--gold) inset; }
.broker-opt input:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 2px; }
.save-bar { position: sticky; bottom: 0; margin-top: 18px; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: rgba(14, 22, 38, .96); border: 1px solid var(--line-2); box-shadow: 0 -12px 30px -16px rgba(0,0,0,.9); backdrop-filter: blur(6px); z-index: 5; }
.save-bar.dirty { border-color: rgba(232, 181, 74, .55); }
.test-result { font-size: 12.5px; }

/* ------------------------------------------------------------------ accounts: auth screens, user menu, users page */
.auth-screen {
  position: fixed; inset: 0; z-index: 150; overflow-y: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px 16px;
  background:
    radial-gradient(ellipse 70% 55% at 50% 0%, rgba(15, 107, 80, .28), transparent 70%),
    radial-gradient(ellipse 60% 50% at 50% 100%, rgba(232, 181, 74, .08), transparent 70%),
    var(--ink-0);
}
.auth-wrap { width: min(420px, 100%); }
.auth-card {
  background: linear-gradient(180deg, #0f1a2d, #0b1322); border: 1px solid rgba(232, 181, 74, .28); border-radius: 16px;
  padding: 26px 28px 22px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9), 0 20px 50px -34px rgba(232, 181, 74, .45);
  position: relative;
}
.auth-card::after { content: ""; position: absolute; inset: 6px; border-radius: 12px; border: 1px solid rgba(232, 181, 74, .07); pointer-events: none; }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.auth-brand img { width: 72px; height: 72px; filter: drop-shadow(0 10px 24px rgba(232, 181, 74, .25)); }
.auth-brand .brand-name { font-size: 20px; }
.auth-brand .brand-name span { font-size: 13px; }
.auth-card h1 { margin: 0; font: 600 24px/1.2 var(--font-display); letter-spacing: .02em; }
.auth-sub { margin: 6px 0 16px; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.auth-card .note { margin-bottom: 14px; }
.auth-card .note code, .auth-mock code { font-family: var(--font-mono); color: var(--gold-hi); }
.auth-card .btn.lg { width: 100%; }
.auth-err { display: flex; gap: 8px; align-items: flex-start; padding: 9px 12px; border-radius: 8px; background: var(--bear-soft); border: 1px solid rgba(239, 69, 98, .35); color: #ffc2cd; font-size: 13px; line-height: 1.45; }
.auth-err svg { width: 16px; height: 16px; flex: none; margin-top: 1px; }
.auth-foot { margin: 16px 0 0; font-size: 12.5px; color: var(--text-3); text-align: center; }
.auth-mock { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line-2); display: flex; flex-direction: column; gap: 8px; align-items: center; font-size: 12px; text-align: center; }
.auth-legal { margin: 0; font-size: 11.5px; color: var(--text-3); text-align: center; letter-spacing: .02em; }
.check-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--gold); margin: 0; }
.pw-wrap { position: relative; flex: 1; min-width: 0; }
.pw-wrap .input { padding-right: 40px; }
.pw-eye { position: absolute; right: 4px; top: 4px; width: 30px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--text-3); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.pw-eye:hover { color: var(--text); background: var(--ink-3); }
.pw-eye svg { width: 17px; height: 17px; }
.pw-row { display: flex; gap: 6px; align-items: center; }
.pw-row .btn { flex: none; }

#user-slot:empty { display: none; }
.user-menu { position: relative; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--ink-2); color: var(--text); cursor: pointer; }
.user-btn:hover { border-color: var(--line-2); background: var(--ink-3); }
.user-btn > svg { width: 14px; height: 14px; color: var(--text-3); }
.user-btn .who { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; white-space: nowrap; max-width: 220px; }
.user-btn .who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; background: linear-gradient(180deg, #f2c661, var(--gold-2)); color: #241803; font: 700 11.5px var(--font-display); letter-spacing: .04em; }
.avatar.lg { width: 38px; height: 38px; font-size: 14px; }
.user-pop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 260px; padding: 6px; border-radius: 12px; background: #0d1526; border: 1px solid var(--line-2); box-shadow: 0 24px 50px -16px rgba(0, 0, 0, .85); }
.user-pop-h { display: flex; gap: 10px; align-items: center; padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-pop-h .muted { font-size: 12px; }
.user-pop-usage { padding: 6px 10px 8px; font-size: 12px; color: var(--text-3); line-height: 1.7; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-pop-usage b { color: var(--text); font-family: var(--font-mono); font-weight: 600; }
.user-pop [role="menuitem"] { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 7px; background: none; color: var(--text-2); cursor: pointer; text-align: left; font-size: 13px; }
.user-pop [role="menuitem"]:hover, .user-pop [role="menuitem"]:focus-visible { background: var(--ink-3); color: var(--text); outline: none; }
.user-pop [role="menuitem"] svg { width: 16px; height: 16px; }
.pill.static { cursor: default; }
.pill.static:hover { border-color: var(--line); background: var(--ink-2); color: var(--text-2); }

.users-tbl .u-cell { display: flex; align-items: center; gap: 10px; }
.users-tbl .avatar { width: 30px; height: 30px; }
.usage { display: grid; grid-template-columns: 34px minmax(50px, 1fr) auto; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-3); }
.usage + .usage { margin-top: 4px; }
.usage .num { font-size: 11.5px; color: var(--text-2); }
.ai-toggle { display: flex; flex-direction: column; gap: 2px; }
.ai-quota, .chat-quota { font-size: 11.5px; color: var(--text-3); padding-left: 48px; }
.chat-quota { padding-left: 2px; }
.ai-quota.out, .chat-quota.out { color: var(--warn); }
.dec-note { font-size: 12.5px; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1440px) {
  .status-pills .pill .hide-lg, .chart-meta .hide-lg { display: none; }
  .user-btn .who b { display: none; }
  .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi.hero { grid-row: span 2; display: flex; flex-direction: column; }
  .kpi.hero .v { font-size: 38px; margin-top: 10px; }
  .kpi.hero .mini-bar { margin-top: auto; height: 6px; }
}
@media (max-width: 1280px) {
  .analyze-grid { grid-template-columns: minmax(0, 1fr) 330px; }
  .detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1200px) {
  :root { --sidebar-w: 68px; }
  .brand-name, .nav .nav-label, .side-note span, .nav-kbd { display: none; }
  .brand { justify-content: center; padding: 12px 0; }
  .nav a, .nav button { justify-content: center; padding: 10px 0; }
  .side-note { justify-content: center; padding: 4px 0; }
  .status-pills .pill .hide-md, .user-btn .hide-md { display: none; }
  .rank-plate { grid-template-columns: auto minmax(0, 1fr); }
  .plate-side { grid-row: auto; grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid rgba(232, 181, 74, .14); padding-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
  .broker-opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1060px) {
  .analyze-grid, .split-main, .split-even, .cols-2 { grid-template-columns: minmax(0, 1fr); }
  .dash-side { contain: none; }
  .dash-side .activity, .dash-side .activity .card-b, .dash-side .activity .card-b > * { flex: none; }
  .dash-side .feed { max-height: 420px; }
  .cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
  .topbar h1 { display: none; }
  .status-pills { margin-left: auto; }
}
@media (max-width: 760px) {
  body { overflow: auto; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr); grid-template-areas: "side" "top" "main"; height: auto; min-height: 100vh; }
  .sidebar { flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
  .nav { flex-direction: row; margin: 0; padding: 6px; }
  .nav a[aria-current="page"]::before { display: none; }
  .nav a, .nav button { padding: 8px 10px; }
  .side-foot { flex-direction: row; border-top: 0; padding: 6px; }
  .side-note { display: none; }
  .brand { height: auto; }
  .topbar { overflow-x: auto; padding: 0 12px; }
  #main { overflow: visible; }
  .page { padding: 16px 16px 40px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cols-3, .detail-grid, .dec-facts { grid-template-columns: minmax(0, 1fr); }
  .rank-plate { grid-template-columns: minmax(0, 1fr); }
  .plate-side { grid-template-columns: minmax(0, 1fr); }
  .ladder { grid-column: 1; }
  .rung .nm { display: none; }
  .ap-hero { grid-template-columns: minmax(0, 1fr); }
  .combo, .combo-list { width: 100%; }
  .working { grid-template-columns: minmax(0, 1fr); }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .chat { height: 70vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
