/* PropLens — liquid-glass theme, 3 variants (dark/light/classic), switched via
   data-theme on <html>. Data palette validated (dataviz): #3987e5 #199e70
   #c98500 #e66767 — these stay CONSTANT across every theme on purpose (chart
   colors must mean the same thing regardless of appearance, per the dataviz
   skill's consistency rule); only surface/chrome tokens vary per theme. */
:root {
  --page: #0a0b10;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-2: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-highlight: rgba(255, 255, 255, 0.10);
  --ink: #ffffff;
  --ink-2: #c6c6cf;
  --muted: #9a9aa8;  /* lifted from #8b8b96 for WCAG AA contrast on glass surfaces */
  --grid: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.14);
  --overlay-rgb: 255, 255, 255;  /* base of every ad-hoc rgba(255,255,255,X) hover/tint below — flips per theme */
  --aurora-opacity: 0.4;
  --well: rgba(0, 0, 0, 0.28);  /* sunken surface — inputs, chips, adjustment items */
  --ring-hole: rgba(20, 21, 30, 0.92);  /* the "donut hole" behind a gauge ring's center label */
  --blue: #3987e5;
  --violet: #9085e9;
  --aqua: #199e70;
  --amber: #c98500;
  --red: #e66767;
  --good: #0ca30c;
  --brand-grad: linear-gradient(135deg, #3987e5, #9085e9);
  --radius: 16px;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", system-ui, -apple-system, sans-serif;
}

/* ---- Light theme: bright glass on a soft backdrop, dark ink ---- */
:root[data-theme="light"] {
  --page: #eef1f7;
  --glass: rgba(255, 255, 255, 0.6);
  --glass-2: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(20, 22, 34, 0.10);
  --glass-highlight: rgba(255, 255, 255, 0.9);
  --ink: #14161f;
  --ink-2: #43465a;
  --muted: #666a80;
  --grid: rgba(20, 22, 34, 0.08);
  --line: rgba(20, 22, 34, 0.14);
  --overlay-rgb: 20, 22, 34;
  --aurora-opacity: 0.22;
  --well: rgba(20, 22, 34, 0.05);
  --ring-hole: rgba(255, 255, 255, 0.92);
}

/* ---- Classic theme: deep navy, calmer backdrop, same glass mechanics as
   dark — a quieter, more institutional mood rather than a different palette. ---- */
:root[data-theme="classic"] {
  --page: #0a0e1c;
  --aurora-opacity: 0.16;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--ink-2);
  font: 14px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1 { color: var(--ink); font: 700 24px/1.2 var(--display); margin: 0 0 6px; letter-spacing: -0.015em; }
p { margin: 0; }
b { color: var(--ink); }

/* ---------- aurora backdrop (gives the glass something to refract) ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.aurora i {
  position: absolute; display: block; border-radius: 50%;
  filter: blur(90px); opacity: var(--aurora-opacity);
  animation: drift 26s ease-in-out infinite alternate;
}
.aurora .a1 { width: 640px; height: 640px; left: -160px; top: -220px;
  background: radial-gradient(circle, rgba(57, 135, 229, 0.55), transparent 65%); }
.aurora .a2 { width: 560px; height: 560px; right: -140px; top: 12%;
  background: radial-gradient(circle, rgba(144, 133, 233, 0.42), transparent 65%);
  animation-delay: -9s; }
.aurora .a3 { width: 700px; height: 700px; left: 28%; bottom: -320px;
  background: radial-gradient(circle, rgba(25, 158, 112, 0.30), transparent 65%);
  animation-delay: -17s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(60px, 40px, 0) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora i { animation: none; }
  * { animation-duration: 0.001s !important; transition: none !important; }
}

.shell { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ---------- the glass material ---------- */
.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    0 8px 28px rgba(0, 0, 0, 0.35);
}

/* ---------- sidebar ---------- */
.side {
  width: 224px; flex: 0 0 224px;
  border-right: 1px solid var(--glass-border);
  border-top: none; border-left: none; border-bottom: none;
  border-radius: 0;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  padding: 20px 12px;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 20px; }
.brand-mark { filter: drop-shadow(0 2px 10px rgba(57, 135, 229, 0.45)); flex: 0 0 auto; }
.brand-name { color: var(--ink); font: 700 18px var(--display); letter-spacing: -0.02em; }
.brand-name span {
  background: var(--brand-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { color: var(--muted); font-size: 10.5px; letter-spacing: 0.02em; }
#nav { display: flex; flex-direction: column; gap: 3px; }
.nav-btn {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid transparent; color: var(--ink-2);
  font: 500 13.5px var(--sans); text-align: left;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.nav-btn span { color: var(--muted); width: 16px; text-align: center; transition: color 0.15s; }
.nav-btn:hover { background: var(--glass-2); }
.nav-btn.active {
  background: linear-gradient(135deg, rgba(57, 135, 229, 0.22), rgba(144, 133, 233, 0.16));
  border-color: rgba(57, 135, 229, 0.35);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(var(--overlay-rgb), 0.10);
}
.nav-btn.active span { color: var(--blue); }
.nav-btn .tag {
  margin-left: auto; font: 600 9px var(--sans); font-style: normal; letter-spacing: 0.06em;
  background: var(--brand-grad); color: #fff; border-radius: 99px; padding: 2px 6px;
}
.side-foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--glass-border); }
.side-meta { color: var(--muted); font-size: 11px; margin-top: 6px; }
.side-meta .ok { color: var(--good); }
.side-meta .warn { color: var(--amber); }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; padding: 28px 32px 44px; max-width: 1220px; }
.page-head { margin-bottom: 20px; max-width: 780px; }
.page-head p { color: var(--muted); }
.tab { display: none; }
.tab.active { display: block; animation: fadeUp 0.35s cubic-bezier(0.2, 0.7, 0.3, 1); }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.banner {
  background: rgba(230, 103, 103, 0.12); border: 1px solid rgba(230, 103, 103, 0.5);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  color: #f2cccc; padding: 10px 14px; border-radius: 12px; margin-bottom: 16px;
  animation: fadeUp 0.25s ease;
}
.banner.good { background: rgba(12, 163, 12, 0.12); border-color: rgba(12, 163, 12, 0.5); color: #c4e8c4; }

/* ---------- cards & forms ---------- */
.card { border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s; }
.card:hover { border-color: rgba(var(--overlay-rgb), 0.14); }
.card-title { color: var(--ink); font: 600 13.5px var(--display); margin-bottom: 12px; letter-spacing: 0.01em; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 980px) {
  .grid2 { grid-template-columns: 1fr; }
  /* Scoped to :not(top/bottom) so a user-docked top/bottom sidebar (below)
     isn't fought over by this narrow-viewport auto-collapse — the two are
     independent triggers for similar-but-different layouts. */
  :root:not([data-nav-pos="top"]):not([data-nav-pos="bottom"]) .side {
    width: 64px; flex-basis: 64px; padding: 20px 8px; overflow: hidden; }
  /* Collapse to an icon rail: fully HIDE the brand text block (font-size:0 doesn't
     work here — .brand-name sets its own explicit font size, which overrides the
     inherited 0, so "PropLens" would stay 18px and spill over the page content). */
  :root:not([data-nav-pos="top"]):not([data-nav-pos="bottom"]) .brand { justify-content: center; padding: 0 0 20px; gap: 0; }
  :root:not([data-nav-pos="top"]):not([data-nav-pos="bottom"]) .brand > div { display: none; }
  :root:not([data-nav-pos="top"]):not([data-nav-pos="bottom"]) .nav-btn { font-size: 0; justify-content: center; }
  :root:not([data-nav-pos="top"]):not([data-nav-pos="bottom"]) .nav-btn span { font-size: 15px; }
  :root:not([data-nav-pos="top"]):not([data-nav-pos="bottom"]) .nav-btn .tag { display: none; }
  :root:not([data-nav-pos="top"]):not([data-nav-pos="bottom"]) .side-foot { display: none; }
}

/* ---------- sidebar: user-toggleable collapse + dockable position ----------
   Position (left/top/bottom) and collapsed-to-icons are user prefs
   (Appearance -> Sidebar), applied via data-nav-pos on <html> (not .shell —
   it has to exist before <body> parses for the FOUC-prevention script to set
   it, same reasoning as data-theme) and a .collapsed class on .side.
   Independent of the narrow-viewport auto-collapse
   above — same visual idea, separate trigger, kept that way on purpose so
   fixing/changing one never risks the other. */
.side-toggle {
  width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; margin-left: auto;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--glass-border); color: var(--muted);
  cursor: pointer; transition: color 0.15s, border-color 0.15s;
}
.side-toggle:hover { color: var(--ink); border-color: var(--glass-highlight); }
/* .collapsed class = instant JS toggle; :root[data-sidebar-collapsed] = applied
   by the same FOUC-prevention script as the theme, so a collapsed sidebar
   doesn't "snap" narrow after the page has already painted wide. Both drive
   the identical rules below. */
.side.collapsed, :root[data-sidebar-collapsed="1"] .side { width: 64px; flex-basis: 64px; padding: 20px 8px; overflow: hidden; }
.side.collapsed .brand, :root[data-sidebar-collapsed="1"] .side .brand { flex-direction: column; padding: 0 0 14px; gap: 8px; }
.side.collapsed .brand > div, :root[data-sidebar-collapsed="1"] .side .brand > div { display: none; }
.side.collapsed .nav-btn, :root[data-sidebar-collapsed="1"] .side .nav-btn { font-size: 0; justify-content: center; }
.side.collapsed .nav-btn span, :root[data-sidebar-collapsed="1"] .side .nav-btn span { font-size: 15px; }
.side.collapsed .nav-btn .tag, :root[data-sidebar-collapsed="1"] .side .nav-btn .tag { display: none; }
.side.collapsed .side-foot, :root[data-sidebar-collapsed="1"] .side .side-foot { display: none; }
/* .main's max-width (below) is a deliberate reading-width cap when the
   224px-wide left sidebar is already eating horizontal space — but that
   same fixed cap leaves a big dead gap on the right whenever the sidebar
   ISN'T taking its normal width: collapsed to a 64px rail, or moved
   entirely off to the side (top/bottom docking). Lift the cap in exactly
   those cases so content actually fills the reclaimed width instead of
   leaving it empty. */
.side.collapsed ~ .main, :root[data-sidebar-collapsed="1"] .main { max-width: none; }

:root[data-nav-pos="top"] .shell, :root[data-nav-pos="bottom"] .shell { flex-direction: column; }
:root[data-nav-pos="top"] .side, :root[data-nav-pos="bottom"] .side {
  width: auto; flex: 0 0 auto; height: auto; max-height: none;
  flex-direction: row; align-items: center; gap: 16px;
  border-right: none; padding: 12px 20px; z-index: 10;
}
:root[data-nav-pos="top"] .side { position: sticky; top: 0; border-bottom: 1px solid var(--glass-border); }
:root[data-nav-pos="bottom"] .side { position: sticky; bottom: 0; border-top: 1px solid var(--glass-border); order: 2; }
:root[data-nav-pos="bottom"] .main { order: 1; }
:root[data-nav-pos="top"] .main, :root[data-nav-pos="bottom"] .main { max-width: none; }
:root[data-nav-pos="top"] .brand, :root[data-nav-pos="bottom"] .brand { padding: 0; flex: 0 0 auto; }
:root[data-nav-pos="top"] #nav, :root[data-nav-pos="bottom"] #nav {
  flex-direction: row; overflow-x: auto; flex: 1 1 auto; gap: 4px; padding-bottom: 2px; scrollbar-width: thin;
}
:root[data-nav-pos="top"] .nav-btn, :root[data-nav-pos="bottom"] .nav-btn { white-space: nowrap; }
:root[data-nav-pos="top"] .edge-ring, :root[data-nav-pos="bottom"] .edge-ring,
:root[data-nav-pos="top"] .side-foot, :root[data-nav-pos="bottom"] .side-foot,
:root[data-nav-pos="top"] .side-toggle, :root[data-nav-pos="bottom"] .side-toggle { display: none; }
:root[data-nav-pos="top"] .topbar-app { top: 74px; }
:root[data-nav-pos="bottom"] .dl-toast { bottom: 78px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin-bottom: 10px; flex: 1; min-width: 0; }
label.check { flex-direction: row; align-items: center; gap: 7px; color: var(--ink-2); font-size: 13px; flex: 0 0 auto; }
input, select, textarea {
  background: var(--well); color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 11px; font: 13.5px var(--sans);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--blue); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(57, 135, 229, 0.22);
}
/* WCAG 2.4.7 Focus Visible — a clear keyboard-focus ring on every interactive
   element (mouse clicks stay clean via :focus-visible). */
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
.nav-btn:focus-visible, .acct-chip:focus-visible, [tabindex]:focus-visible,
summary:focus-visible {
  outline: 2px solid #7cb0f5;
  outline-offset: 2px;
  border-radius: 6px;
}
/* Skip-to-content link: hidden until keyboard-focused. */
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 999;
  background: var(--blue); color: #fff; padding: 8px 14px; border-radius: 8px;
  transition: top 0.15s;
}
.skip-link:focus { top: 8px; }
textarea { resize: vertical; line-height: 1.5; }
.row { display: flex; align-items: flex-end; }
.row.gap { gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.controls label { margin-bottom: 0; max-width: 190px; }
.controls { align-items: flex-end; }
.dow label { margin-bottom: 6px; }

.btn {
  position: relative;
  background: var(--glass-2); color: var(--ink);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: 1px solid var(--line); border-radius: 11px;
  padding: 9px 17px; font: 600 13.5px var(--sans);
  cursor: pointer; white-space: nowrap;
  transition: transform 0.12s, box-shadow 0.2s, border-color 0.15s;
}
.btn:hover { border-color: rgba(var(--overlay-rgb), 0.3); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--brand-grad); border-color: transparent; color: #fff;
  box-shadow: 0 4px 18px rgba(57, 135, 229, 0.35), inset 0 1px 0 rgba(var(--overlay-rgb), 0.25);
}
.btn.primary:hover { box-shadow: 0 6px 24px rgba(57, 135, 229, 0.5), inset 0 1px 0 rgba(var(--overlay-rgb), 0.25); }
.btn.big { padding: 12px 28px; font-size: 15px; border-radius: 13px; }
.btn[disabled] { opacity: 0.6; cursor: wait; transform: none; }
.btn.loading { padding-left: 38px; }
.btn.loading::before {
  content: ""; position: absolute; left: 14px; top: 50%;
  width: 14px; height: 14px; margin-top: -8px;
  border: 2px solid rgba(var(--overlay-rgb), 0.35); border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.hint { color: var(--muted); font-size: 12px; }
.sticky-actions { margin-top: 4px; align-items: center; }

.ai-card { border-color: rgba(57, 135, 229, 0.35); }
.ai-note {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: rgba(57, 135, 229, 0.12); border: 1px solid rgba(57, 135, 229, 0.35);
  color: #bcd6f5; font-size: 13px;
  animation: fadeUp 0.3s ease;
}
.ai-chip {
  font: 600 11px var(--sans); font-style: normal; vertical-align: middle;
  background: var(--brand-grad); color: #fff; border-radius: 99px; padding: 3px 9px;
  margin-left: 8px; letter-spacing: 0.04em;
}
.placeholder { color: var(--muted); padding: 46px 0; text-align: center; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border); border-radius: 13px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  padding: 13px 15px;
  animation: fadeUp 0.4s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
  transition: transform 0.18s, border-color 0.18s;
}
.tile:hover { transform: translateY(-2px); border-color: rgba(var(--overlay-rgb), 0.16); }
.tile:nth-child(1) { animation-delay: 0.02s; } .tile:nth-child(2) { animation-delay: 0.06s; }
.tile:nth-child(3) { animation-delay: 0.10s; } .tile:nth-child(4) { animation-delay: 0.14s; }
.tile:nth-child(5) { animation-delay: 0.18s; } .tile:nth-child(6) { animation-delay: 0.22s; }
.tile .t-label { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.07em; }
.tile .t-value { color: var(--ink); font: 650 22px var(--display); margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.tile .t-sub { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.tile.pos .t-value { color: #74c778; }
.tile.neg .t-value { color: var(--red); }

/* ---------- charts ---------- */
.chart-host { position: relative; }
.chart-card { animation: fadeUp 0.45s cubic-bezier(0.2, 0.7, 0.3, 1) backwards; animation-delay: 0.1s; }
.chart-card h3 { color: var(--ink); font: 600 13.5px var(--display); margin: 0 0 4px; }
.chart-card .sub { color: var(--muted); font-size: 12px; margin-bottom: 10px; }
.ct-lab { fill: var(--muted); font: 10.5px var(--sans); font-variant-numeric: tabular-nums; }
.ct-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; z-index: 5;
  background: rgba(24, 25, 34, 0.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border: 1px solid var(--line); border-radius: 9px;
  padding: 7px 10px; font-size: 12px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}
.ct-tip b { color: var(--ink); }
.ct-empty { color: var(--muted); text-align: center; padding: 30px; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th { color: var(--muted); text-align: right; font-weight: 500; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { color: var(--ink-2); text-align: right; padding: 5.5px 10px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: rgba(var(--overlay-rgb), 0.03); }
td.pos { color: #74c778; }
td.neg { color: var(--red); }

/* ---------- prop firm browser ---------- */
.firm-search {
  display: flex; align-items: center; gap: 10px;
  border-radius: 13px; padding: 4px 14px; margin-bottom: 14px;
}
.firm-search .fs-icon { color: var(--muted); font-size: 17px; }
.firm-search input {
  background: none; border: none; box-shadow: none; padding: 10px 0;
  font-size: 14px;
}
.firm-search input:focus { box-shadow: none; }
.firm-groups { margin-bottom: 14px; }
.firm-group {
  background: var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(150%); backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid var(--glass-border); border-radius: 14px;
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  padding: 12px 14px; margin-bottom: 10px;
  animation: fadeUp 0.3s ease backwards;
}
.firm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.firm-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font: 700 12.5px var(--display); color: #fff;
  box-shadow: inset 0 1px 0 rgba(var(--overlay-rgb), 0.25), 0 2px 8px rgba(0, 0, 0, 0.35);
}
.firm-head .fh-name { color: var(--ink); font: 600 14px var(--display); }
.firm-head .fh-n { color: var(--muted); font-size: 11.5px; }
.acct-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.acct-chip {
  background: var(--well); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: 99px;
  padding: 6px 13px; font: 500 12.5px var(--sans); cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
}
.acct-chip:hover { border-color: rgba(var(--overlay-rgb), 0.35); transform: translateY(-1px); }
.acct-chip.sel {
  background: linear-gradient(135deg, rgba(57, 135, 229, 0.3), rgba(144, 133, 233, 0.22));
  border-color: var(--blue); color: var(--ink);
}
.acct-chip small { color: var(--muted); margin-left: 5px; }
.acct-chip.sel small { color: #bcd6f5; }

/* ---------- research ---------- */
.rs-status { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--ink-2); font-size: 13px; }
.orbit { position: relative; width: 26px; height: 26px; flex: 0 0 auto; display: inline-block; }
.orbit i {
  position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px;
  border-radius: 50%; background: var(--brand-grad);
  animation: orbit 1.3s linear infinite;
}
.orbit i:nth-child(2) { animation-delay: -0.43s; opacity: 0.75; }
.orbit i:nth-child(3) { animation-delay: -0.86s; opacity: 0.5; }
@keyframes orbit {
  from { transform: rotate(0deg) translateX(11px); }
  to   { transform: rotate(360deg) translateX(11px); }
}
#rsStatusText { animation: pulseText 1.6s ease-in-out infinite; }
@keyframes pulseText { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.report { line-height: 1.65; max-width: 860px; animation: fadeUp 0.4s ease; }
.report h2 { color: var(--ink); font: 600 16px var(--display); margin: 20px 0 8px; }
.report h3 { color: var(--ink); font: 600 14px var(--display); margin: 16px 0 6px; }
.report p { margin: 0 0 10px; }
.report ul, .report ol { margin: 0 0 10px; padding-left: 22px; }
.report li { margin-bottom: 3px; }
.report a { color: #7ab3f0; text-decoration: none; }
.report a:hover { text-decoration: underline; }
.report table { margin: 10px 0 14px; }
.report code { background: rgba(var(--overlay-rgb), 0.07); border-radius: 5px; padding: 1px 5px; font-size: 12px; }
.rs-meta { margin-top: 10px; max-width: 860px; }
.rs-meta a { color: #7ab3f0; text-decoration: none; }

/* ---------- code ---------- */
.code {
  border-radius: var(--radius);
  padding: 18px; overflow-x: auto; font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--ink-2); white-space: pre;
}
.kv div { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid var(--grid); }
.kv div span:first-child { color: var(--muted); }
.kv div span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }

.foot {
  margin-top: 36px; padding-top: 14px; border-top: 1px solid var(--glass-border);
  color: var(--muted); font-size: 11.5px; max-width: 880px;
}

/* ---------- fix: [hidden] must always win (orbit loader was spinning while hidden) ---------- */
[hidden] { display: none !important; }

/* ---------- beginner tooltips ---------- */
.lt { display: inline-flex; align-items: center; gap: 5px; }
.info {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%;
  border: 1px solid var(--line); color: var(--muted);
  font: 600 9.5px var(--sans); font-style: normal;
  cursor: help; position: relative; flex: 0 0 auto;
}
.info:hover { color: var(--ink); border-color: var(--muted); }
.info::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(3px);
  width: 240px; padding: 9px 11px; border-radius: 10px;
  background: rgba(24, 25, 34, 0.97);
  border: 1px solid var(--line);
  color: var(--ink-2); font: 400 11.5px/1.5 var(--sans); white-space: normal;
  text-align: left; letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.5);
  opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s;
  z-index: 30;
}
.info:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- research adjustments & variants ---------- */
.adj-item {
  display: flex; gap: 11px; align-items: flex-start;
  background: var(--well); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px;
  cursor: pointer; transition: border-color 0.15s;
}
.adj-item:hover { border-color: rgba(var(--overlay-rgb), 0.3); }
.adj-item input { width: 15px; height: 15px; margin-top: 2px; accent-color: var(--blue); flex: 0 0 auto; }
.adj-body { display: flex; flex-direction: column; gap: 3px; }
.adj-title { color: var(--ink); font: 600 13.5px var(--display); }
.adj-why { color: var(--ink-2); font-size: 12.5px; }
.adj-patch { color: var(--muted); font: 11.5px ui-monospace, Menlo, monospace; }
.best-row td { background: rgba(57, 135, 229, 0.10); }
.btn.mini { padding: 4px 12px; font-size: 12px; border-radius: 8px; }

/* ---------- help center ---------- */
.help-card { max-width: 760px; }
.help-chat {
  display: flex; flex-direction: column; gap: 10px;
  max-height: 420px; min-height: 160px; overflow-y: auto; padding: 4px 2px;
}
.help-msg {
  max-width: 85%; padding: 10px 13px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.55; white-space: pre-wrap;
  animation: fadeUp 0.25s ease;
}
.help-msg.bot {
  align-self: flex-start; background: rgba(var(--overlay-rgb), 0.06);
  border: 1px solid var(--glass-border); color: var(--ink-2);
  border-bottom-left-radius: 5px;
}
.help-msg.user {
  align-self: flex-end; background: linear-gradient(135deg, rgba(57,135,229,0.4), rgba(144,133,233,0.3));
  border: 1px solid rgba(57, 135, 229, 0.4); color: var(--ink);
  border-bottom-right-radius: 5px;
}
.help-card a.btn { text-decoration: none; display: inline-flex; align-items: center; }

/* ---------- account chip ---------- */
.plan-chip {
  display: inline-block; background: var(--brand-grad); color: #fff;
  font: 600 9.5px var(--sans); border-radius: 99px; padding: 2px 8px;
  letter-spacing: 0.04em; margin-right: 4px;
}
#acctBox a { color: var(--muted); }
#acctBox b { font-weight: 500; color: var(--ink-2); word-break: break-all; }

/* ---------- app top bar ---------- */
.topbar-app {
  position: fixed; top: 18px; right: 22px; z-index: 40;
  display: flex; gap: 9px;
}
.tb-btn {
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-2); cursor: pointer; font: 500 14px var(--sans);
  border-radius: 50%;
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.tb-btn:hover { transform: translateY(-1px); border-color: rgba(var(--overlay-rgb),0.3); color: var(--ink); }

/* ---------- "improving daily" feedback pill + modal ---------- */
.fb-pill {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 14px;
  border-radius: 99px; color: var(--ink-2); cursor: pointer; font: 600 12px var(--sans);
  transition: transform 0.15s, border-color 0.15s, color 0.15s;
}
.fb-pill:hover { transform: translateY(-1px); border-color: rgba(144,133,233,0.5); color: var(--ink); }
.fb-dot { width: 8px; height: 8px; border-radius: 50%; background: #3ecb96; box-shadow: 0 0 8px #3ecb96; animation: fbPulse 2s ease-in-out infinite; }
@keyframes fbPulse { 0%,100% { opacity: 0.5; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1); } }
@media (max-width: 620px) { .fb-txt { display: none; } .fb-pill { padding: 0 11px; } }
.fb-back {
  position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: rgba(5,6,10,0.6); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.fb-modal { width: 460px; max-width: 100%; border-radius: 20px; padding: 24px; position: relative;
  animation: fadeUp 0.3s cubic-bezier(0.2,0.7,0.3,1); }
.fb-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; }
.fb-badge { display: inline-block; font: 600 10.5px var(--sans); letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--violet); margin-bottom: 8px; }
.fb-modal h3 { font: 700 19px var(--display); color: var(--ink); margin: 0 0 6px; }
.fb-sub { color: var(--ink-2); font-size: 13px; margin: 0 0 16px; line-height: 1.5; }
.fb-kinds { display: flex; gap: 8px; margin-bottom: 12px; }
.fb-kind { background: var(--well); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 99px; padding: 6px 14px; font: 600 12px var(--sans); cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.fb-kind.on { background: linear-gradient(135deg, rgba(57,135,229,0.3), rgba(144,133,233,0.22)); border-color: var(--blue); color: var(--ink); }
.fb-modal textarea { width: 100%; resize: vertical; min-height: 96px; }
.fb-status.ok { color: #3ecb96; }

/* ---------- info popover ---------- */
.info-pop {
  position: fixed; top: 64px; right: 22px; z-index: 45;
  width: 340px; border-radius: 16px; padding: 18px;
  animation: fadeUp 0.22s ease;
}
.info-pop h4 { font: 600 15px var(--display); color: var(--ink); margin: 0 0 8px; }
.info-pop p { color: var(--ink-2); font-size: 12.5px; margin-bottom: 8px; }

/* ---------- account drawer ---------- */
.drawer-back {
  position: fixed; inset: 0; z-index: 44;
  background: rgba(5, 6, 10, 0.45);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 46;
  width: 470px; max-width: calc(100vw - 24px);
  border-radius: 20px; padding: 20px;
  display: flex; flex-direction: column;
  animation: slideIn 0.3s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes slideIn { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.drawer-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 700 19px var(--display);
  box-shadow: 0 4px 14px rgba(57,135,229,0.45), inset 0 1px 0 rgba(var(--overlay-rgb),0.3);
}
.d-email { color: var(--ink); font: 600 14px var(--display); word-break: break-all; }
.d-meta { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.drawer-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.d-tab {
  background: var(--well); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 99px; padding: 6px 13px; font: 600 12px var(--sans); cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.d-tab:hover { border-color: rgba(var(--overlay-rgb),0.3); }
.d-tab.on {
  background: linear-gradient(135deg, rgba(57,135,229,0.3), rgba(144,133,233,0.22));
  border-color: var(--blue); color: var(--ink);
}
.theme-swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 480px) { .theme-swatches { grid-template-columns: 1fr; } }
.theme-swatch {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  background: var(--glass-2); border: 1.5px solid var(--glass-border); border-radius: 12px;
  padding: 10px 12px 12px; cursor: pointer; text-align: left; font-family: var(--sans);
  transition: border-color 0.15s, transform 0.15s;
}
.theme-swatch:hover { transform: translateY(-1px); border-color: var(--glass-highlight); }
.theme-swatch.sel { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.ts-preview {
  width: 100%; height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(135deg, var(--pv-a), var(--pv-b));
}
.theme-swatch.dark .ts-preview { --pv-a: #0a0b10; --pv-b: #1b2038; }
.theme-swatch.light .ts-preview { --pv-a: #eef1f7; --pv-b: #ffffff; }
.theme-swatch.classic .ts-preview { --pv-a: #0a0e1c; --pv-b: #14203a; }
.ts-label { font: 700 12.5px var(--display); color: var(--ink); margin-top: 2px; }
.ts-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.theme-swatch.sel .ts-label::after { content: " ✓"; color: var(--blue); }

.sb-preview { position: relative; background: rgba(var(--overlay-rgb), 0.08); overflow: hidden; }
.sb-preview i { position: absolute; background: var(--blue); border-radius: 2px; }
.pos-left .sb-preview i { left: 3px; top: 3px; bottom: 3px; width: 8px; }
.pos-top .sb-preview i { left: 3px; right: 3px; top: 3px; height: 8px; }
.pos-bottom .sb-preview i { left: 3px; right: 3px; bottom: 3px; height: 8px; }

.widget-toggles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; }
@media (max-width: 480px) { .widget-toggles { grid-template-columns: 1fr; } }
.widget-toggle {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2);
  cursor: pointer; padding: 4px 0;
}
.widget-toggle input { width: 15px; height: 15px; accent-color: var(--blue); flex: 0 0 auto; }

.drawer-body { overflow-y: auto; flex: 1; padding-right: 2px; }
.drawer-foot {
  display: flex; gap: 8px; align-items: center; justify-content: flex-end;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--glass-border);
}
.drawer-foot .btn { flex: 0 0 auto; }
#drawerLogout { border-color: rgba(230,103,103,0.4); color: #f0a2a2; }
#drawerLogout:hover { border-color: rgba(230,103,103,0.7); background: rgba(230,103,103,0.08); }
.tiles.two { grid-template-columns: 1fr 1fr; }
.glass2 {
  background: var(--well); border: 1px solid var(--line); border-radius: 12px;
}
.plan-row, .strat-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; margin-bottom: 8px;
}
.plan-row.cur { border-color: rgba(57,135,229,0.55); background: rgba(57,135,229,0.08); }

/* "Days left / next charge" panel at the top of the Plan tab */
.bill-sum { padding: 13px 15px; margin-bottom: 14px; border-left: 3px solid var(--brand, #3987e5); }
.bill-sum .bs-head { font-size: 15px; }
.bill-sum .bs-head b { font-size: 19px; }
.bill-sum.bs-gift { border-left-color: #d7a13b; background: rgba(215,161,59,0.07); }
.bill-sum.bs-warn { border-left-color: var(--red, #e66767); background: rgba(230,103,103,0.07); }

/* Prorated-upgrade invoice preview (figures come from Stripe, not from us) */
.up-invoice { margin-top: 12px; padding: 12px 14px; background: var(--well); border: 1px solid var(--line); border-radius: 12px; }
.up-line { display: flex; justify-content: space-between; gap: 14px; font-size: 13px; padding: 4px 0; color: var(--muted); }
.up-line span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-line.up-total { margin-top: 7px; padding-top: 9px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 15px; }
.quota { margin: 14px 2px 6px; }
.q-label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 6px; }
.q-bar { height: 8px; border-radius: 99px; background: var(--well); border: 1px solid var(--line); overflow: hidden; margin-bottom: 4px; }
.q-bar i { display: block; height: 100%; background: var(--brand-grad); border-radius: 99px; }
.q-bar.q-full i { background: var(--red); }
.q-refill-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.q-refill-note { color: var(--muted); font-size: 11px; }
.act-list { display: flex; flex-direction: column; }
.act-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid var(--grid); font-size: 12.5px;
}
.act-ico { width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  background: rgba(57,135,229,0.15); border: 1px solid rgba(57,135,229,0.3); font-size: 12px; }
.act-lab { flex: 1; color: var(--ink-2); min-width: 0; }
.act-lab .hint { margin-left: 4px; }
.act-ts { color: var(--muted); font-size: 11px; white-space: nowrap; }

/* ---------- automation tab ---------- */
.steps-mini { margin: 0; padding-left: 20px; color: var(--ink-2); }
.steps-mini li { margin-bottom: 7px; font-size: 13px; }
.auto-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.a-step { border-radius: 14px; padding: 16px; position: relative; }
.a-step .a-num {
  position: absolute; top: -10px; left: 14px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font: 700 12.5px var(--display);
  box-shadow: 0 3px 10px rgba(57,135,229,0.5);
}
.a-step h3 { font: 600 14px var(--display); color: var(--ink); margin: 6px 0 6px; }
.a-step p { color: var(--ink-2); font-size: 12.5px; }
.warn-list { margin: 0; padding-left: 20px; color: var(--ink-2); }
.warn-list li { margin-bottom: 8px; font-size: 13px; }

/* ---------- eval copilot ---------- */
.light-card {
  display: flex; align-items: center; gap: 16px;
  border-radius: 16px; padding: 18px 20px; margin-bottom: 14px;
  animation: fadeUp 0.35s ease;
}
.light-card .l-dot {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  animation: pulseDot 2s ease-in-out infinite;
}
@keyframes pulseDot { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.light-card .l-title { color: var(--ink); font: 700 17px var(--display); margin-bottom: 3px; }
.light-card .l-advice { color: var(--ink-2); font-size: 13px; max-width: 640px; }
/* Multi-account dashboard */
/* "your own data is active" panel on the Data tab */
.pd-card { border-color: rgba(25,158,112,0.45); }
.pd-head { display: flex; align-items: center; gap: 8px; font-size: 14.5px; color: var(--ink); margin-bottom: 6px; }
.pd-dot { width: 8px; height: 8px; border-radius: 50%; background: #199e70; box-shadow: 0 0 8px #199e70; flex: 0 0 auto; }
.pd-files { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 10px 0 12px; }
.pd-file {
  font: 500 11.5px var(--mono, ui-monospace, monospace); color: var(--ink-2);
  background: var(--well); border: 1px solid var(--line); border-radius: 7px;
  padding: 3px 8px; max-width: 100%; overflow-wrap: anywhere;
}
.pro-pill { font: 700 11px var(--sans); background: var(--brand-grad); color: #fff;
  border-radius: 99px; padding: 2px 8px; vertical-align: middle; letter-spacing: .3px; }
.acct-agg { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.acct-agg .agg-tile { flex: 1; min-width: 120px; background: var(--glass); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 14px 16px; }
.agg-val { font: 700 24px var(--display); color: var(--ink); }
.agg-lab { font-size: 12px; color: var(--muted); margin-top: 2px; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 16px; }
.acct-card { padding: 16px 18px; }
.acct-card.failed { border-color: rgba(230,103,103,0.5); }
.acct-card.passed { border-color: rgba(12,163,12,0.45); }
.acct-card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.acct-badge { font: 700 11px var(--sans); border-radius: 99px; padding: 3px 10px; white-space: nowrap; }
.acct-badge.st-active { background: rgba(57,135,229,0.16); color: #9cc4f7; }
.acct-badge.st-pass { background: rgba(12,163,12,0.16); color: #7ede7e; }
.acct-badge.st-fail { background: rgba(230,103,103,0.16); color: #f2a3a3; }
.acct-bar-lab { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; color: var(--ink-2); }
.acct-bar-lab b { color: var(--ink); }
.acct-bar { height: 8px; border-radius: 99px; background: rgba(var(--overlay-rgb),0.08); overflow: hidden; margin-top: 5px; }
.acct-bar i { display: block; height: 100%; border-radius: 99px; }
.acct-flags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.acct-flag { font-size: 11px; color: var(--ink-2); background: rgba(var(--overlay-rgb),0.06);
  border-radius: 99px; padding: 3px 9px; }
.acct-flag.warn { background: rgba(250,178,25,0.14); color: #f4cd78; }
.acct-log { margin-top: 14px; align-items: center; flex-wrap: wrap; }
.acct-log input[type=date] { max-width: 128px; }
.acct-log input[type=number] { max-width: 96px; min-width: 80px; }
.lock-panel { text-align: center; padding: 40px 24px; }
.lock-panel .lock-ico { font-size: 34px; }
.lock-panel h3 { color: var(--ink); font: 700 18px var(--display); margin: 8px 0 0; }
/* Edge-retention widget (backtest→live gap) */
.gap-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.gap-ring { flex: 0 0 auto; width: 78px; height: 78px; border-radius: 50%;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--pct) * 1%), rgba(var(--overlay-rgb),0.08) 0); }
.gap-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%;
  background: var(--ring-hole); }
.gap-ring span { position: relative; font: 700 22px var(--display); color: var(--ink); }
.gap-ring span small { font-size: 12px; color: var(--muted); }
.gap-empty-ring { background: rgba(var(--overlay-rgb),0.08); color: var(--muted); }
.gap-verdict { margin: 0; font-size: 13px; color: var(--ink-2); }
.gap-leak { margin-top: 12px; font-size: 12.5px; color: var(--ink-2);
  background: rgba(230,103,103,0.1); border: 1px solid rgba(230,103,103,0.3);
  border-radius: 9px; padding: 8px 11px; }
.gap-leak b { color: var(--ink); }
.gap-comps { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
/* Strategy Verdict (A-F letter grade) — reuses .gap-ring's exact circular-
   gauge mechanism for visual consistency across the app. */
.verdict-head { display: flex; align-items: center; gap: 18px; }
.verdict-body { flex: 1 1 auto; min-width: 0; }
.verdict-reasons { margin: 0; padding-left: 18px; list-style-position: outside; color: var(--ink-2); font-size: 13px; line-height: 1.6; text-align: left; }
.verdict-reasons li { margin-bottom: 2px; }
.verdict-comps { margin-top: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 16px; }
@media (max-width: 560px) { .verdict-comps { grid-template-columns: 1fr; } .verdict-head { flex-direction: column; text-align: center; } }
.verdict-comp-lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.verdict-comp-lab b { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.verdict-comp-bar { height: 6px; border-radius: 99px; background: rgba(var(--overlay-rgb),0.08); overflow: hidden; }
.verdict-comp-bar i { display: block; height: 100%; border-radius: 99px; }
.gap-comp-top { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }
.gap-comp-top b { color: var(--ink); }
.gap-empty { text-align: center; }
.gap-empty .gap-ring { margin: 0 auto; }
/* ---------- Home: high-impact news (Forex Factory calendar) ---------- */
.fx-list { display: flex; flex-direction: column; gap: 2px; max-height: 320px; overflow-y: auto; }
.fx-row {
  display: flex; align-items: center; gap: 10px; padding: 7px 4px;
  border-bottom: 1px solid var(--grid); font-size: 12.5px;
}
.fx-row:last-child { border-bottom: none; }
.fx-impact { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.fx-when { color: var(--muted); flex: 0 0 auto; min-width: 92px; font-variant-numeric: tabular-nums; }
.fx-ccy { color: var(--ink-2); font-weight: 700; flex: 0 0 auto; min-width: 34px; }
.fx-title { color: var(--ink); flex: 1 1 auto; }
.fx-fc { flex: 0 0 auto; white-space: nowrap; }
/* Payout-gate rows (consistency rule + min days) */
.gate-row { display: flex; justify-content: space-between; align-items: baseline;
  font-size: 13px; color: var(--ink-2); }
.gate-bar { position: relative; height: 8px; margin-top: 8px; border-radius: 99px;
  background: rgba(var(--overlay-rgb),0.08); overflow: visible; }
.gate-bar i { display: block; height: 100%; border-radius: 99px; }
.gate-bar .gate-cap { position: absolute; top: -3px; width: 2px; height: 14px;
  background: var(--ink); border-radius: 2px; transform: translateX(-1px); }
.light-green { border-color: rgba(12,163,12,0.5); }
.light-green .l-dot { background: #0ca30c; box-shadow: 0 0 18px rgba(12,163,12,0.7); }
.light-yellow { border-color: rgba(250,178,25,0.5); }
.light-yellow .l-dot { background: #fab219; box-shadow: 0 0 18px rgba(250,178,25,0.7); }
.light-red { border-color: rgba(208,59,59,0.6); }
.light-red .l-dot { background: #d03b3b; box-shadow: 0 0 18px rgba(208,59,59,0.7); }
.firm-logo.sm { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; display: inline-flex; vertical-align: middle; margin-right: 4px; }

/* ---------- replay trainer ---------- */
/* ---- Replay start screen: an animated candlestick "replay" hero, no emoji ---- */
.rp-intro { text-align: center; padding: 44px 24px 40px; position: relative; overflow: hidden; }
.rp-intro .rp-glow {
  position: absolute; inset: -40% 0 auto 0; height: 340px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, rgba(57,135,229,0.16), transparent 62%);
}
.rp-anim {
  position: relative; width: 260px; height: 96px; margin: 0 auto 22px;
  display: flex; align-items: flex-end; justify-content: center; gap: 9px;
}
.rp-anim .rc { width: 12px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  opacity: 0; animation: rcIn 4.2s ease-in-out infinite; }
.rp-anim .rc i { width: 2px; background: currentColor; border-radius: 2px; }
.rp-anim .rc b { width: 100%; border-radius: 2px; background: currentColor; display: block; }
.rp-anim .rc.up { color: #26a69a; }
.rp-anim .rc.dn { color: #ef5350; }
.rp-anim .rc:nth-child(1) { animation-delay: 0s; }
.rp-anim .rc:nth-child(2) { animation-delay: 0.28s; }
.rp-anim .rc:nth-child(3) { animation-delay: 0.56s; }
.rp-anim .rc:nth-child(4) { animation-delay: 0.84s; }
.rp-anim .rc:nth-child(5) { animation-delay: 1.12s; }
.rp-anim .rc:nth-child(6) { animation-delay: 1.40s; }
.rp-anim .rc:nth-child(7) { animation-delay: 1.68s; }
.rp-anim .rc:nth-child(8) { animation-delay: 1.96s; }
@keyframes rcIn {
  0% { opacity: 0; transform: translateY(8px) scaleY(0.4); }
  10%, 74% { opacity: 1; transform: translateY(0) scaleY(1); }
  92%, 100% { opacity: 0; transform: translateY(0) scaleY(1); }
}
.rp-anim .rp-head {
  position: absolute; top: -4px; bottom: -4px; width: 2px; left: 0;
  background: linear-gradient(to bottom, transparent, var(--violet), transparent);
  box-shadow: 0 0 10px rgba(144,133,233,0.8); border-radius: 2px;
  animation: rpHead 4.2s ease-in-out infinite;
}
@keyframes rpHead {
  0% { left: 4%; opacity: 0; } 8% { opacity: 1; }
  70% { left: 96%; opacity: 1; } 82%, 100% { left: 96%; opacity: 0; }
}
.rp-intro h3 { font: 700 22px var(--display); color: var(--ink); margin: 0 0 8px; letter-spacing: -0.02em; }
.rp-intro .rp-sub { color: var(--ink-2); font-size: 14px; max-width: 520px; margin: 0 auto 26px; line-height: 1.5; }
.rp-steps { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0 auto 26px; max-width: 640px; }
.rp-step {
  flex: 1 1 170px; max-width: 200px; text-align: left; padding: 14px 16px; border-radius: 14px;
  background: var(--glass); border: 1px solid var(--glass-border);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
}
.rp-step .rp-n {
  width: 22px; height: 22px; border-radius: 50%; background: var(--brand-grad); color: #fff;
  font: 700 11px var(--display); display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.rp-step b { display: block; font: 600 13px var(--display); color: var(--ink); margin-bottom: 3px; }
.rp-step span { color: var(--muted); font-size: 11.5px; line-height: 1.4; }
.rp-intro .rp-picker { display: flex; gap: 10px; justify-content: center; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.rp-intro .rp-keys { color: var(--muted); font-size: 11.5px; margin-top: 16px; }
.rp-intro .rp-keys kbd {
  display: inline-block; padding: 1px 6px; border-radius: 5px; margin: 0 1px;
  background: rgba(var(--overlay-rgb),0.06); border: 1px solid var(--glass-border); font: 600 10.5px var(--sans); color: var(--ink-2);
}
@media (prefers-reduced-motion: reduce) {
  .rp-anim .rc { opacity: 1; animation: none; }
  .rp-anim .rp-head { animation: none; opacity: 0; }
}

.rp-controls {
  display: flex; align-items: center; gap: 9px;
  border-radius: 14px; padding: 10px 12px; margin-top: 12px;
  flex-wrap: wrap;
}
.rp-spacer { flex: 1; }
.rp-controls .btn { padding: 8px 14px; }
.rp-bracket {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border-radius: 14px; padding: 9px 13px; margin-top: 10px;
}
.rp-bracket-lab { font: 600 12.5px var(--display); color: var(--ink); }
.rp-bracket label { display: inline-flex; align-items: center; gap: 6px; margin: 0;
  font-size: 12px; color: var(--ink-2); }
.rp-bracket input[type=number] { width: 74px; padding: 5px 8px; }
.rp-bracket .hint { flex: 1 1 240px; min-width: 200px; }
.btn.rp-buy { border-color: rgba(25,158,112,0.6); color: #7fd6b4; }
.btn.rp-buy:hover { background: rgba(25,158,112,0.15); }
.btn.rp-sell { border-color: rgba(230,103,103,0.6); color: #f0a2a2; }
.btn.rp-sell:hover { background: rgba(230,103,103,0.15); }
.rp-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.rp-badge {
  background: var(--well); border: 1px solid var(--line); border-radius: 99px;
  padding: 5px 13px; font: 600 12px var(--sans); color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.rp-badge.pos-b { border-color: rgba(25,158,112,0.6); color: #7fd6b4; }
.rp-badge.neg-b { border-color: rgba(230,103,103,0.6); color: #f0a2a2; }

/* ---------- shimmer for standout results ---------- */
@keyframes shimmerSweep {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.shimmer {
  position: relative; overflow: hidden;
}
.shimmer::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(105deg, transparent 40%, rgba(var(--overlay-rgb),0.09) 50%, transparent 60%);
  background-size: 200% 100%;
  animation: shimmerSweep 2.6s ease-in-out 2;
}
tr.best-row td:first-child { position: relative; }

/* ---------- edge milestones ---------- */
.edge-ring {
  display: flex; align-items: center; gap: 10px;
  background: none; border: 1px solid transparent; border-radius: 12px;
  padding: 8px 10px; margin: 10px 2px 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
  transition: background 0.15s;
}
.edge-ring:hover { background: var(--glass-2); }
.edge-ring svg { flex: 0 0 auto; }
#ringArc { transition: stroke-dashoffset 0.8s cubic-bezier(0.2, 0.7, 0.3, 1); }
.er-label { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; }
.er-val { display: block; color: var(--ink); font: 650 14px var(--display); }
.ms-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 4px; border-bottom: 1px solid var(--grid); font-size: 13px;
}
.ms-row .ms-ico {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
  background: rgba(var(--overlay-rgb),0.05); border: 1px solid var(--line); color: var(--muted);
}
.ms-row.done .ms-ico { background: var(--brand-grad); border-color: transparent; color: #fff; font-weight: 700; }
.ms-row .ms-body { flex: 1; color: var(--ink-2); }
.ms-row.done .ms-body b { color: var(--ink); }

/* ---------- command palette ---------- */
.palette-back {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5,6,10,0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  display: flex; justify-content: center; align-items: flex-start; padding-top: 14vh;
}
.palette { width: 540px; max-width: calc(100vw - 32px); border-radius: 18px; padding: 12px; }
.palette input {
  background: var(--well); font-size: 15px; padding: 12px 14px; margin-bottom: 8px;
}
#palList { max-height: 320px; overflow-y: auto; }
.pal-item {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px; border-radius: 10px; cursor: pointer;
  color: var(--ink-2); font-size: 13.5px;
}
.pal-item:hover { background: rgba(var(--overlay-rgb),0.05); }
.pal-item.on {
  background: linear-gradient(135deg, rgba(57,135,229,0.28), rgba(144,133,233,0.2));
  color: var(--ink);
}
.pal-ico { width: 20px; text-align: center; color: var(--muted); }
.pal-item.on .pal-ico { color: var(--blue); }
.pal-foot { padding: 8px 12px 2px; border-top: 1px solid var(--grid); margin-top: 6px; }

/* ---------- first-run tour ---------- */
#tourBack { position: fixed; inset: 0; z-index: 55; background: rgba(5,6,10,0.55); }
.tour-bubble {
  position: fixed; width: 340px; border-radius: 16px; padding: 18px;
  animation: fadeUp 0.3s ease;
}
.tour-bubble h4 { font: 600 15px var(--display); color: var(--ink); margin: 4px 0 6px; }
.tour-bubble p { color: var(--ink-2); font-size: 13px; }
.tour-hi {
  position: relative; z-index: 56 !important;
  box-shadow: 0 0 0 3px var(--blue), 0 0 30px rgba(57,135,229,0.6) !important;
  border-radius: 12px;
}

/* ---------- morning briefing card ---------- */
.brief-card { border-color: rgba(201,133,0,0.4); animation: fadeUp 0.4s ease; margin-top: 36px; }
.brief-card .report h2 { font-size: 13.5px; margin: 12px 0 4px; }

/* ---------- replay toolbar & speed slider ---------- */
.rp-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chip-group { display: flex; gap: 6px; flex-wrap: wrap; }
.chip-group .acct-chip { padding: 5px 11px; font-size: 12px; }
.rp-speed { display: inline-flex; align-items: center; gap: 8px; }
.rp-speed input[type=range] {
  -webkit-appearance: none; appearance: none;
  width: 130px; height: 5px; border-radius: 99px; padding: 0;
  background: linear-gradient(90deg, #3987e5, #9085e9);
  border: none; box-shadow: none; cursor: pointer;
}
.rp-speed input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid #3987e5;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
#rpSpeedLab { color: var(--ink); font: 650 12.5px var(--display); min-width: 30px; }

/* ---------- home dashboard ----------
   Auto-fit grid rather than named grid-template-areas on purpose: widgets
   are user-hideable (Appearance -> Home widgets), and a named-area grid
   leaves a reserved blank slot behind a hidden item instead of closing the
   gap. eval/brief/gap are forced full-width (they carry the most content/
   interactive controls); the compact utility widgets auto-flow into
   however many columns fit, reflowing cleanly for ANY subset that's shown. */
.home-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.wg { margin-bottom: 0; animation: fadeUp 0.4s cubic-bezier(0.2,0.7,0.3,1) backwards; }
.wg-eval, .wg-brief, .wg-gap, .wg-news { grid-column: 1 / -1; }
.wg-eval { animation-delay: 0.03s; }
.wg-brief { animation-delay: 0.08s; max-height: 460px; overflow-y: auto; }
.wg-actions { animation-delay: 0.13s; }
.wg-note { animation-delay: 0.18s; }
.wg-stats { animation-delay: 0.23s; }
.wg-market { animation-delay: 0.28s; }
.wg-gap { animation-delay: 0.33s; }
.qa-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.qa {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--well); border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink-2); font: 600 12px var(--sans); padding: 14px 6px; cursor: pointer;
  transition: transform 0.14s, border-color 0.14s, background 0.14s;
}
.qa span { font-size: 19px; color: var(--blue); }
.qa:hover { transform: translateY(-2px); border-color: rgba(57,135,229,0.5);
  background: rgba(57,135,229,0.08); }
.wg .tiles.two .tile { padding: 9px 11px; }
.wg .tiles.two .t-value { font-size: 17px; }
.wg-brief .report h2 { font-size: 12.5px; margin: 10px 0 4px; }
.wg-brief .report p { font-size: 12.5px; }

/* ---------- global download progress bar ---------- */
/* "Your datasets" — instant-switch cards on the Data page */
.ds-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ds-chip {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 14px 10px 10px; border-radius: 14px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border);
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.ds-chip:hover { background: var(--glass-2); border-color: var(--glass-highlight); }
.ds-chip:active { transform: scale(0.98); }
.ds-chip.sel { border-color: var(--blue); background: rgba(57,135,229,0.12); cursor: default; }
.ds-badge { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: #fff; font: 700 15px var(--display);
  background: var(--brand-grad); }
.ds-info { display: flex; flex-direction: column; line-height: 1.25; }
.ds-info b { color: var(--ink); font-size: 13.5px; }
.ds-info small { color: var(--muted); font-size: 11px; }
.ds-chip.sel .ds-info small { color: #7ede7e; }

/* Sleek glass download toast — floats bottom-center, shows live progress. */
.dl-toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 80; width: min(440px, calc(100vw - 32px)); padding: 14px 18px 16px;
  border-radius: 18px;
  background: rgba(22, 24, 34, 0.72);
  -webkit-backdrop-filter: blur(22px) saturate(1.4); backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid var(--glass-highlight);
  box-shadow: 0 18px 50px rgba(0,0,0,0.5), inset 0 1px 0 rgba(var(--overlay-rgb),0.08);
  animation: dlRise 0.5s cubic-bezier(0.2, 0.8, 0.3, 1);
}
@keyframes dlRise { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
.dl-toast-row { display: flex; align-items: center; gap: 10px; margin-bottom: 11px; }
.dl-orb { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand-grad);
  box-shadow: 0 0 0 0 rgba(57,135,229,0.5); animation: dlPulse 1.6s ease-out infinite; }
@keyframes dlPulse {
  0% { box-shadow: 0 0 0 0 rgba(57,135,229,0.45); }
  70% { box-shadow: 0 0 0 9px rgba(57,135,229,0); }
  100% { box-shadow: 0 0 0 0 rgba(57,135,229,0); }
}
.dl-text { flex: 1; min-width: 0; color: var(--ink); font: 600 13px var(--display);
  letter-spacing: 0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-pct { flex: 0 0 auto; color: var(--ink-2); font: 700 13px var(--display); font-variant-numeric: tabular-nums; }
.dl-track { height: 7px; border-radius: 99px; background: rgba(var(--overlay-rgb),0.09); overflow: hidden; }
.dl-track-fill {
  height: 100%; width: 3%; border-radius: 99px; position: relative;
  background: linear-gradient(90deg, var(--blue), var(--purple, #9085e9));
  transition: width 0.8s cubic-bezier(0.3, 0.8, 0.4, 1);
}
.dl-track-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(var(--overlay-rgb),0.35), transparent);
  animation: dlShimmer 1.5s linear infinite;
}
@keyframes dlShimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) {
  .dl-orb, .dl-track-fill::after, .dl-toast { animation: none; }
}

/* ---------- replay system trade log ---------- */
.rp-syslog {
  margin-top: 10px; padding: 10px 13px; border-radius: 12px;
  background: rgba(201,133,0,0.07); border: 1px solid rgba(201,133,0,0.3);
  font-size: 12.5px; color: var(--ink-2);
  display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center;
}
.rp-syslog .sys-trade { white-space: nowrap; }
.rp-syslog em { color: var(--muted); font-style: normal; }

/* ================= glass icon system =================
   Custom inline-SVG icons that replace the old picture emojis. Stroke uses
   currentColor (reliable through <use> shadow trees, unlike gradient refs);
   the "alive" feel comes from a slow synchronized breathe (scale + glow).   */
svg.gi {
  width: 1.2em; height: 1.2em;
  vertical-align: -0.22em;
  margin-right: 0.42em;
  overflow: visible;
  color: #a9b4f9;                       /* default: soft periwinkle (violet family) */
  animation: giBreathe 4.6s ease-in-out infinite;
  flex: 0 0 auto;
}
svg.gi.warm  { color: #e2c66b }         /* sun */
svg.gi.gold  { color: #e7c34c }
svg.gi.silver{ color: #c6ccda }
svg.gi.bronze{ color: #cf9a68 }
svg.gi.red   { color: #e66767 }
svg.gi.aqua  { color: #35b98a }
@keyframes giBreathe {
  0%, 100% { transform: scale(1);    filter: drop-shadow(0 0 1px rgba(169, 180, 249, 0.25)); }
  50%      { transform: scale(1.06); filter: drop-shadow(0 0 5px rgba(169, 180, 249, 0.65)); }
}
button svg.gi { animation-duration: 5.2s }   /* slightly out of phase with titles feels organic */
@media (prefers-reduced-motion: reduce) { svg.gi, .gi-nb .nb-page { animation: none !important } }

/* ---- the notebook: a real 3D page-flip (pure CSS — SVG 3D is unreliable in Safari) ---- */
.gi-nb {
  display: inline-block; position: relative;
  width: 1.35em; height: 1.1em;
  vertical-align: -0.18em; margin-right: 0.42em;
  perspective: 70px; transform-style: preserve-3d;
  animation: giBreathe 4.6s ease-in-out infinite;
}
.gi-nb i { position: absolute; display: block; }
.gi-nb .nb-base {                          /* cover + violet spine */
  inset: 0;
  background: rgba(var(--overlay-rgb), 0.06);
  border: 1.3px solid #a9b4f9;
  border-left: 3px solid #9085e9;
  border-radius: 2px 3px 3px 2px;
}
.gi-nb .nb-line { left: 32%; right: 16%; height: 1.3px; border-radius: 1px;
                  background: rgba(169, 180, 249, 0.75); }
.gi-nb .nb-line.l1 { top: 30% } .gi-nb .nb-line.l2 { top: 50% } .gi-nb .nb-line.l3 { top: 70% }
.gi-nb .nb-page {                          /* the page that periodically turns over the spine */
  top: 10%; bottom: 10%; left: 14%; right: 12%;
  background: linear-gradient(135deg, #e6e9ff, #a9b4f9);
  border-radius: 1px 2px 2px 1px;
  transform-origin: left center;
  opacity: 0;
  animation: nbFlip 7s cubic-bezier(0.45, 0, 0.3, 1) infinite;
}
.gi-nb .nb-page.p2 { animation-delay: 0.4s; background: linear-gradient(135deg, #cfd6ff, #9085e9); }
@keyframes nbFlip {
  0%, 54%  { transform: rotateY(0deg);    opacity: 0; }
  57%      { transform: rotateY(-8deg);   opacity: 0.95; }
  72%      { transform: rotateY(-165deg); opacity: 0.95; }
  76%, 100%{ transform: rotateY(-180deg); opacity: 0; }
}
/* big lock on gated overlays reuses the system at a larger size */
.lock-ico svg.gi { width: 30px; height: 30px; margin: 0 }
