/* =========================================================================
   Regnum Wealth — Research Terminal design system
   Premium fintech research platform. Light "paper" + dark "terminal" themes.
   Deep emerald primary · restrained gold · data-semantic up/down layer.
   ========================================================================= */

:root {
  color-scheme: light;
  --bg:        oklch(98.6% 0.006 255);
  --surface:   oklch(100% 0 0);
  --surface-2: oklch(97.3% 0.008 258);
  --surface-3: oklch(95% 0.011 260);
  --fg:        oklch(23% 0.025 262);
  --fg-soft:   oklch(35% 0.022 262);
  --muted:     oklch(50% 0.02 260);
  --faint:     oklch(57% 0.016 260);                           /* darkened from 66% for WCAG text contrast */
  --border:    oklch(90% 0.012 258);
  --border-2:  oklch(85% 0.015 258);

  --accent-h: 264;                                             /* Regnum royal blue — set by the admin theme picker */
  --accent-c: 0.15;
  --accent:      oklch(47% var(--accent-c) var(--accent-h));   /* royal blue default */
  --accent-2:    oklch(41% var(--accent-c) var(--accent-h));
  --accent-soft: oklch(94% 0.035 var(--accent-h));
  --accent-ink:  oklch(38% 0.13 var(--accent-h));
  --gold:        oklch(70% 0.12 78);
  --gold-soft:   oklch(95% 0.05 82);

  --up:     oklch(50% 0.13 152);
  --up-bg:  oklch(94% 0.05 152);
  --down:   oklch(55% 0.17 27);
  --down-bg:oklch(95% 0.05 27);
  --info:   oklch(54% 0.12 244);
  --info-bg:oklch(95% 0.04 244);
  --warn:   oklch(72% 0.13 72);
  --warn-bg:oklch(96% 0.06 82);

  --shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 1px rgba(15,23,42,.04);
  --shadow:    0 6px 18px -6px rgba(15,23,42,.14), 0 2px 6px -2px rgba(15,23,42,.08);
  --shadow-lg: 0 24px 60px -20px rgba(12,20,40,.32);

  --r-sm: 8px;  --r: 12px;  --r-lg: 18px;  --r-xl: 26px;
  --sidebar-w: 256px;
  --topbar-h: 62px;

  --font-display: 'Iowan Old Style', 'Charter', 'Georgia', 'Times New Roman', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', sans-serif;
  --font-mono: 'SFMono-Regular', 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg:        oklch(19% 0.02 262);
  --surface:   oklch(23% 0.022 262);
  --surface-2: oklch(26% 0.024 262);
  --surface-3: oklch(30% 0.026 262);
  --fg:        oklch(95% 0.008 255);
  --fg-soft:   oklch(84% 0.012 255);
  --muted:     oklch(69% 0.016 258);
  --faint:     oklch(60% 0.016 258);                /* lightened for dark-theme text contrast */
  --border:    oklch(32% 0.024 262);
  --border-2:  oklch(38% 0.026 262);

  --accent:      oklch(70% 0.14 var(--accent-h));
  --accent-2:    oklch(76% 0.14 var(--accent-h));
  --accent-soft: oklch(33% 0.06 var(--accent-h));
  --accent-ink:  oklch(88% 0.09 var(--accent-h));
  --gold:        oklch(78% 0.12 80);
  --gold-soft:   oklch(34% 0.05 82);

  --up:     oklch(72% 0.15 152);
  --up-bg:  oklch(32% 0.06 152);
  --down:   oklch(70% 0.16 27);
  --down-bg:oklch(33% 0.07 27);
  --info:   oklch(72% 0.12 244);
  --info-bg:oklch(32% 0.05 244);
  --warn:   oklch(80% 0.13 78);
  --warn-bg:oklch(35% 0.06 82);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow:    0 8px 24px -8px rgba(0,0,0,.55);
  --shadow-lg: 0 28px 70px -20px rgba(0,0,0,.7);
}
/* Dark theme: --accent / --down become LIGHT, so white text on them fails contrast — use dark ink. */
[data-theme="dark"] .side-user .avatar,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .icon-btn .badge,
[data-theme="dark"] .rw-cnk-fab,
[data-theme="dark"] .rw-bn-fab { color: oklch(20% 0.03 264); }

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 15px;
  transition: background .3s ease, color .3s ease;
}
a { color: inherit; text-decoration: none; }
h1,h2,h3,h4 { line-height: 1.12; font-weight: 600; letter-spacing: -0.02em; }
button { font-family: inherit; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }

.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.serif { font-family: var(--font-display); }
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em;
  font-weight: 600; color: var(--muted);
}
.muted { color: var(--muted); }
.up { color: var(--up); } .down { color: var(--down); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* ---------------------------------------------------------------- Buttons */
.btn {
  --bh: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--bh); padding: 0 16px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 550; letter-spacing: 0.01em;
  border: 1px solid transparent; cursor: pointer; white-space: nowrap;
  transition: transform .08s ease, background .18s, border-color .18s, box-shadow .18s, color .18s;
  background: var(--surface-2); color: var(--fg); border-color: var(--border);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 17px; height: 17px; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .btn-primary { color: oklch(18% 0.02 165); }
.btn-primary:hover { background: var(--accent-2); }
.btn-gold { background: var(--gold); color: oklch(28% 0.06 60); border-color: var(--gold); }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--fg-soft); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-outline { background: transparent; border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger { background: var(--down); color: #fff; border-color: var(--down); }
.btn-sm { --bh: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { --bh: 48px; padding: 0 24px; font-size: 15.5px; }
.btn-icon { width: var(--bh); padding: 0; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------------------------------------------------------- Badges */
.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  background: var(--surface-2); color: var(--fg-soft); border: 1px solid var(--border);
}
.pill.up   { background: var(--up-bg);   color: var(--up);   border-color: transparent; }
.pill.down { background: var(--down-bg); color: var(--down); border-color: transparent; }
.pill.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.pill.warn { background: var(--warn-bg); color: oklch(48% 0.13 66); border-color: transparent; }
[data-theme="dark"] .pill.warn { color: var(--warn); }
.pill.gold { background: var(--gold-soft); color: oklch(48% 0.1 66); border-color: transparent; }
[data-theme="dark"] .pill.gold { color: var(--gold); }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.rating { color: var(--gold); letter-spacing: 1px; font-size: 13px; }

/* ---------------------------------------------------------------- Cards */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r); box-shadow: var(--shadow-sm);
}
.card-pad { padding: 18px 20px; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 20px; border-bottom: 1px solid var(--border);
}
.card-hd h3 { font-size: 15px; letter-spacing: -0.01em; }
.card-bd { padding: 18px 20px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.stat .label { font-size: 12px; color: var(--muted); font-weight: 550; display: flex; align-items: center; gap: 7px; }
.stat .val { font-size: 27px; margin-top: 8px; font-weight: 600; }
.stat .sub { margin-top: 6px; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.ico-chip {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); flex: none;
}
.ico-chip svg { width: 16px; height: 16px; }

/* ---------------------------------------------------------------- Forms */
.field { display: flex; flex-direction: column; gap: 7px; }
.field > label { font-size: 12.5px; font-weight: 550; color: var(--fg-soft); }
.inp, .sel, textarea.inp {
  height: 42px; width: 100%; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: var(--surface); color: var(--fg);
  font-size: 14px; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
textarea.inp { height: auto; padding: 11px 13px; resize: vertical; line-height: 1.5; }
.inp::placeholder { color: var(--faint); }
.inp:focus, .sel:focus, textarea.inp:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 18%, transparent);
}
.inp-wrap { position: relative; display: flex; align-items: center; }
.inp-wrap svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--faint); pointer-events: none; }
.inp-wrap .inp { padding-left: 38px; }
.sel {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2373807a' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px;
}
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; user-select: none; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.switch { position: relative; width: 40px; height: 23px; flex: none; cursor: pointer; }
.switch input { opacity: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; background: var(--border-2); border-radius: 999px; transition: background .2s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 19px; height: 19px; background: #fff; border-radius: 50%; transition: transform .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(17px); }

/* ---------------------------------------------------------------- Tables */
.tbl-wrap { overflow: auto; position: relative; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.tbl-wrap.locked { max-height: 460px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--border); }
.tbl thead th {
  position: sticky; top: 0; z-index: 3; background: var(--surface-2); color: var(--muted);
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 650;
  border-bottom: 1px solid var(--border-2); cursor: default; user-select: none;
}
.tbl thead th.sortable { cursor: pointer; }
.tbl thead th.sortable:hover { color: var(--fg); background: var(--surface-3); }
.tbl th .sort-ico { display: inline-block; margin-left: 4px; opacity: .35; transition: opacity .15s; }
.tbl th[aria-sort="ascending"] .sort-ico,
.tbl th[aria-sort="descending"] .sort-ico { opacity: 1; color: var(--accent); }
.tbl td.num, .tbl th.num { text-align: right; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tbody tr:last-child td { border-bottom: none; }
/* Frozen first column (header + column lock) */
.tbl .lock-col { position: sticky; left: 0; z-index: 2; background: var(--surface); }
.tbl tbody tr:hover .lock-col { background: var(--surface-2); }
.tbl thead th.lock-col { z-index: 4; background: var(--surface-2); }
.tbl .lock-col::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: -1px; width: 14px;
  pointer-events: none; box-shadow: inset 11px 0 8px -10px rgba(0,0,0,.16);
}
.tbl .fund { display: flex; align-items: center; gap: 10px; }
.tbl .fund .avatar { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 12px; color: #fff; }
.tbl .fund .meta { display: flex; flex-direction: column; line-height: 1.25; }
.tbl .fund .meta small { color: var(--muted); font-size: 11.5px; }

/* ---------------------------------------------------------------- A11y */
/* Branded keyboard focus ring on every interactive element that isn't a plain text input. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
a:focus-visible, button:focus-visible, .side-link:focus-visible, .dd-item:focus-visible,
.seg button:focus-visible, .tab:focus-visible, .icon-btn:focus-visible, .acc-hd:focus-visible,
[role="button"]:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-main:focus, .app-main:focus-visible { outline: none; }
/* Skip-to-content link — off-screen until focused. */
.rw-skip { position: fixed; top: 8px; left: 8px; z-index: 3000; transform: translateY(-160%); transition: transform .18s;
  background: var(--accent); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; text-decoration: none; box-shadow: var(--shadow-lg); }
.rw-skip:focus { transform: none; }

/* ---------------------------------------------------------------- App shell */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: none; background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; z-index: 60;
  transition: transform .28s cubic-bezier(.4,0,.2,1), width .24s ease;
}
.side-brand { display: flex; align-items: center; gap: 11px; padding: 14px 18px; height: var(--topbar-h); border-bottom: 1px solid var(--border); text-decoration: none; overflow: hidden; }
/* Regnum brand lockup — theme-aware wordmark + emblem-only collapsed rail */
.side-brand .rw-logo { height: 30px; width: auto; max-width: 100%; object-fit: contain; display: block; }
.side-brand .rw-logo-mark { height: 34px; width: 34px; display: none; flex: none; }
.side-brand .rw-logo-dark { display: none; }                       /* white wordmark hidden in light theme */
[data-theme="dark"] .side-brand .rw-logo-light { display: none; }  /* dark wordmark hidden in dark theme */
[data-theme="dark"] .side-brand .rw-logo-dark { display: block; }
.side-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; }
.side-sec { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); font-weight: 650; padding: 14px 12px 7px; }
.side-link {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: var(--r-sm);
  color: var(--fg-soft); font-size: 13.5px; font-weight: 500; cursor: pointer; margin-bottom: 2px;
  transition: background .14s, color .14s;
}
.side-link svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.side-link:hover { background: var(--surface-2); color: var(--fg); }
.side-link.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.side-link.active svg { opacity: 1; color: var(--accent); }
.side-link .tag { margin-left: auto; font-size: 10px; padding: 1px 7px; border-radius: 999px; background: var(--gold-soft); color: oklch(48% 0.1 66); font-weight: 700; }
[data-theme="dark"] .side-link .tag { color: var(--gold); }
.side-foot { padding: 12px; border-top: 1px solid var(--border); }
.side-user { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); cursor: pointer; }
.side-user:hover { background: var(--surface-2); }
.side-user .avatar { width: 34px; height: 34px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.side-user .meta { line-height: 1.2; overflow: hidden; }
.side-user .meta b { font-size: 13px; display: block; }
.side-user .meta small { font-size: 11px; color: var(--muted); }

/* --- sidebar: product switcher, accordion submenus, admin dark rail --- */
.side-switch { display: flex; gap: 3px; margin: 12px 12px 4px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.side-switch button { flex: 1; border: none; background: transparent; color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 4px; border-radius: 9px; cursor: pointer; transition: background .15s, color .15s; }
.side-switch button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
.side-parent { cursor: pointer; }
.side-chev { margin-left: auto; display: grid; place-items: center; transition: transform .24s ease; opacity: .5; transform: rotate(-90deg); }
.side-chev svg { width: 15px; height: 15px; }
.side-parent.open .side-chev { transform: rotate(0deg); opacity: .85; }
.side-parent.open { background: var(--surface-2); color: var(--fg); }
.side-parent.open > svg { color: var(--accent); opacity: 1; }
.side-sub { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.side-parent.open + .side-sub { max-height: 560px; }
.side-sub-in { margin: 2px 0 8px 22px; padding-left: 12px; border-left: 1px solid var(--border); }
.side-sub a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; margin-bottom: 1px; border-radius: 8px; font-size: 13px; color: var(--fg-soft); cursor: pointer; transition: background .14s, color .14s; }
.side-sub a svg { width: 16px; height: 16px; opacity: .7; flex: none; }
.side-sub a:hover { background: var(--surface-2); color: var(--fg); }
.side-sub a.active { color: var(--accent-ink); background: var(--accent-soft); font-weight: 550; }
.side-sub a.active svg { color: var(--accent); opacity: 1; }
.side-sub a .sb { margin-left: auto; font-size: 10px; font-weight: 700; letter-spacing: .02em; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); }
.side-user-row { display: flex; align-items: center; gap: 6px; }
.side-logout { flex: none; width: 34px; height: 34px; }
.side-logout svg { width: 17px; height: 17px; }

/* collapsible icon rail (toggled from the topbar hamburger) */
.rail-tip { position: fixed; transform: translateY(-50%); background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 550; letter-spacing: .01em; padding: 5px 10px; border-radius: 7px; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 300; box-shadow: var(--shadow); transition: opacity .12s; }
.rail-tip.show { opacity: 1; }
@media (min-width: 861px) {
  .app-shell.collapsed .sidebar { width: 72px; }
  .app-shell.collapsed .side-brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .app-shell.collapsed .rw-logo { display: none; }
  .app-shell.collapsed .rw-logo-mark { display: block; }
  .app-shell.collapsed .side-switch { display: none; }
  .app-shell.collapsed .side-sec { display: none; }
  .app-shell.collapsed .side-nav { padding: 10px 12px 20px; }
  .app-shell.collapsed .side-link { justify-content: center; padding: 11px 0; gap: 0; }
  .app-shell.collapsed .side-link > span, .app-shell.collapsed .side-link .tag, .app-shell.collapsed .side-chev { display: none; }
  .app-shell.collapsed .side-sub { display: none; }
  .app-shell.collapsed .side-foot { padding: 12px 10px; }
  .app-shell.collapsed .side-user-row { justify-content: center; }
  .app-shell.collapsed .side-user { justify-content: center; padding: 8px 0; }
  .app-shell.collapsed .side-user .meta, .app-shell.collapsed .side-logout { display: none; }
}
/* Admin sidebar uses the default light rail (dark-navy override removed). */
.app-shell[data-app="admin"] .side-user .meta small { text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }

.app-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 12px; padding: 0 18px 0 14px;
  background: color-mix(in oklab, var(--surface) 80%, transparent);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--border);
}
.top-head { display: flex; flex-direction: column; justify-content: center; padding-left: 13px; border-left: 1px solid var(--border); min-width: 0; }
.topbar h1 { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .sub { font-size: 11.5px; color: var(--muted); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.top-search { position: relative; width: min(340px, 32vw); }
.top-search .ts-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); display: grid; pointer-events: none; }
.top-search .ts-ico svg { width: 17px; height: 17px; }
.top-search .inp { height: 40px; padding: 0 46px 0 38px; background: var(--surface-2); border-color: transparent; border-radius: 11px; font-size: 13.5px; }
.top-search .inp:hover { background: var(--surface-3); }
.top-search .inp:focus { background: var(--surface); border-color: var(--accent); }
.ts-kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); font: 11px/1 var(--font-mono); color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; pointer-events: none; }
.top-actions { display: flex; align-items: center; gap: 3px; }
.icon-btn.ghost { border-color: transparent; background: transparent; }
.icon-btn.ghost:hover { background: var(--surface-2); }
.icon-btn .badge { position: absolute; top: 3px; right: 3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--down); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; display: grid; place-items: center; border: 2px solid var(--surface); }
.top-sep { width: 1px; height: 26px; background: var(--border); margin: 0 7px; flex: none; }
.top-user { display: flex; align-items: center; gap: 9px; height: 42px; padding: 0 8px 0 6px; border: 1px solid transparent; border-radius: 12px; background: transparent; cursor: pointer; transition: background .15s, border-color .15s; }
.top-user:hover { background: var(--surface-2); }
.top-user .avatar { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
[data-theme="dark"] .top-user .avatar { color: oklch(18% 0.02 165); }
.top-user .who { display: flex; flex-direction: column; line-height: 1.2; text-align: left; min-width: 0; }
.top-user .who b { font-size: 13px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user .who small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-user .tu-chev { color: var(--faint); display: grid; }
.top-user .tu-chev svg { width: 14px; height: 14px; }
.hamburger { display: grid; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--fg-soft); display: grid; place-items: center; cursor: pointer;
  position: relative; transition: background .15s, border-color .15s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .dot { position: absolute; top: 8px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--down); border: 2px solid var(--surface); }
.top-profile { display: block; }
/* Account lives only in the topbar on mobile + tablet; sidebar account hidden ≤1180px */
@media (max-width: 1180px) { .side-foot { display: none; } }
@media (max-width: 860px) {
  .topbar .sub { display: none; }
  .top-head { border-left: none; padding-left: 0; }
  .topbar { gap: 8px; padding: 0 12px; }
  .top-sep { display: none; }
  .top-user { padding: 0; gap: 0; }    /* collapse to avatar-only on mobile */
  .top-user .who, .top-user .tu-chev { display: none; }
}
.app-main { padding: 24px 28px 80px; max-width: 1440px; width: 100%; margin: 0 auto; }
.view { display: none; animation: fade .3s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-hd { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-hd h2 { font-size: 23px; letter-spacing: -0.02em; }
.page-hd p { color: var(--muted); font-size: 13.5px; margin-top: 3px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.grid { display: grid; gap: 16px; }
.g-2 { grid-template-columns: repeat(2, 1fr); }
.g-3 { grid-template-columns: repeat(3, 1fr); }
.g-4 { grid-template-columns: repeat(4, 1fr); }
.row { display: flex; gap: 16px; }
.scrim { position: fixed; inset: 0; background: rgba(10,20,15,.45); backdrop-filter: blur(2px); z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.show { opacity: 1; pointer-events: auto; }

/* ---------------------------------------------------------------- Dropdown */
.dd { position: relative; }
.dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 200px; max-width: calc(100vw - 24px); z-index: 80;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-lg); padding: 6px; opacity: 0; transform: translateY(-6px) scale(.98);
  pointer-events: none; transition: opacity .16s, transform .16s;
}
.dd.open .dd-menu { opacity: 1; transform: none; pointer-events: auto; }
.dd-menu.left { left: 0; right: auto; }
.dd-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; font-size: 13.5px; cursor: pointer; color: var(--fg-soft); }
.dd-item:hover { background: var(--surface-2); color: var(--fg); }
.dd-item svg { width: 16px; height: 16px; opacity: .7; }
.dd-item.danger { color: var(--down); }
.dd-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.dd-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); padding: 8px 11px 4px; font-weight: 650; }

/* ---------------------------------------------------------------- Tabs / segmented */
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: none; background: transparent; padding: 7px 15px; border-radius: 8px; font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer; transition: background .15s, color .15s; }
.seg button.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg button.active { background: var(--surface-3); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: none; background: transparent; padding: 12px 4px; margin-right: 20px; font-size: 14px; font-weight: 550; color: var(--muted); cursor: pointer; position: relative; white-space: nowrap; }
.tabs button::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--accent); transform: scaleX(0); transition: transform .2s; }
.tabs button.active { color: var(--fg); }
.tabs button.active::after { transform: scaleX(1); }
.tab-panel { display: none; } .tab-panel.active { display: block; animation: fade .25s; }

/* ---------------------------------------------------------------- Accordion / collapsible */
.acc { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.acc + .acc { margin-top: 12px; }
.acc-hd { display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; user-select: none; }
.acc-hd:hover { background: var(--surface-2); }
.acc-hd .chev { margin-left: auto; transition: transform .25s; color: var(--muted); }
.acc.open .acc-hd .chev { transform: rotate(180deg); }
.acc-bd { max-height: 0; overflow: hidden; transition: max-height .32s ease; }
.acc.open .acc-bd { max-height: 1200px; }
.acc-bd-inner { padding: 4px 18px 18px; border-top: 1px solid var(--border); }

/* ---------------------------------------------------------------- Date picker */
.dp { position: relative; }
.dp-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 85; width: 260px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .16s, transform .16s;
}
.dp.open .dp-pop { opacity: 1; transform: none; pointer-events: auto; }
.dp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-nav b { font-size: 13.5px; }
.dp-nav button { width: 28px; height: 28px; border: none; background: transparent; border-radius: 7px; cursor: pointer; color: var(--fg-soft); display: grid; place-items: center; }
.dp-nav button:hover { background: var(--surface-2); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-grid span { text-align: center; font-size: 10.5px; color: var(--faint); padding: 4px 0; font-weight: 600; }
.dp-grid button { border: none; background: transparent; aspect-ratio: 1; border-radius: 7px; font-size: 12.5px; cursor: pointer; color: var(--fg); font-family: var(--font-mono); }
.dp-grid button:hover { background: var(--surface-2); }
.dp-grid button.muted { color: var(--faint); }
.dp-grid button.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dp-grid button.sel { background: var(--accent); color: #fff; font-weight: 700; }
[data-theme="dark"] .dp-grid button.sel { color: oklch(18% 0.02 165); }

/* ---------------------------------------------------------------- Toaster */
.toaster { position: fixed; bottom: 22px; right: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(340px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 11px; padding: 13px 14px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  animation: toastIn .35s cubic-bezier(.2,.9,.3,1.3); position: relative; overflow: hidden;
}
.toast.out { animation: toastOut .3s forwards; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes toastOut { to { transform: translateX(120%); opacity: 0; } }
.toast .t-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.toast .t-ico svg { width: 17px; height: 17px; }
.toast.success .t-ico { background: var(--up-bg); color: var(--up); }
.toast.error .t-ico { background: var(--down-bg); color: var(--down); }
.toast.info .t-ico { background: var(--info-bg); color: var(--info); }
.toast.warn .t-ico { background: var(--warn-bg); color: oklch(50% 0.13 66); }
.toast .t-body { flex: 1; min-width: 0; }
.toast .t-body b { font-size: 13.5px; display: block; }
.toast .t-body span { font-size: 12.5px; color: var(--muted); }
.toast .t-close { background: none; border: none; cursor: pointer; color: var(--faint); padding: 2px; }
.toast .t-bar { position: absolute; left: 0; bottom: 0; height: 2.5px; background: var(--accent); animation: tbar 4s linear forwards; }
.toast.success .t-bar { background: var(--up); } .toast.error .t-bar { background: var(--down); }
@keyframes tbar { from { width: 100%; } to { width: 0; } }

/* ---------------------------------------------------------------- Chatbot */
.chat-fab {
  position: fixed; bottom: 22px; right: 22px; z-index: 150; width: 56px; height: 56px; border-radius: 18px;
  border: none; cursor: pointer; background: linear-gradient(145deg, var(--accent), var(--accent-2)); color: #fff;
  display: grid; place-items: center; box-shadow: var(--shadow-lg); transition: transform .2s;
}
.chat-fab:hover { transform: translateY(-3px) scale(1.04); }
.chat-fab svg { width: 25px; height: 25px; }
.chat-fab .ping { position: absolute; top: -3px; right: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--gold); color: oklch(30% 0.06 60); font-size: 11px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--surface); }
.chat-panel {
  position: fixed; bottom: 90px; right: 22px; z-index: 151; width: min(384px, calc(100vw - 32px)); height: min(560px, calc(100vh - 130px));
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; overflow: hidden; transform: translateY(16px) scale(.96); opacity: 0; pointer-events: none;
  transform-origin: bottom right; transition: opacity .22s, transform .22s;
}
.chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.chat-hd { display: flex; align-items: center; gap: 11px; padding: 14px 16px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.chat-hd .bot-av { width: 36px; height: 36px; border-radius: 11px; background: rgba(255,255,255,.18); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }
.chat-hd b { font-size: 14.5px; } .chat-hd small { font-size: 11.5px; opacity: .85; display: flex; align-items: center; gap: 5px; }
.chat-hd .online { width: 7px; height: 7px; border-radius: 50%; background: #7ff0b0; }
.chat-hd button { margin-left: auto; background: rgba(255,255,255,.15); border: none; color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; background: var(--surface-2); }
.msg { max-width: 82%; padding: 10px 13px; border-radius: 14px; font-size: 13.5px; line-height: 1.5; }
.msg.bot { background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; align-self: flex-start; }
.msg.me { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }
[data-theme="dark"] .msg.me { color: oklch(18% 0.02 165); }
.msg.bot b { color: var(--accent); }
.chat-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 10px; background: var(--surface-2); }
.chat-chip { font-size: 12px; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--border-2); background: var(--surface); cursor: pointer; color: var(--fg-soft); }
.chat-chip:hover { border-color: var(--accent); color: var(--accent); }
.chat-in { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--border); background: var(--surface); }
.chat-in input { flex: 1; height: 40px; border: 1px solid var(--border-2); border-radius: 12px; padding: 0 13px; font-size: 13.5px; background: var(--surface-2); color: var(--fg); }
.chat-in input:focus { outline: none; border-color: var(--accent); }
.chat-in button { width: 40px; height: 40px; border-radius: 12px; border: none; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center; }
.typing { display: flex; gap: 4px; padding: 12px 14px; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; } .typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

/* ---------------------------------------------------------------- Bottom nav (mobile) */
.botnav { display: none; }
@media (max-width: 860px) {
  .botnav {
    display: flex; align-items: center; gap: 4px;
    position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    height: 62px; padding: 6px; z-index: 140;
    background: color-mix(in oklab, var(--surface) 84%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.5); backdrop-filter: blur(18px) saturate(1.5);
    border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow-lg);
  }
  .botnav-group { flex: 1; display: flex; align-items: center; gap: 4px; min-width: 0; }
  .botnav-tab {
    flex-grow: 1; flex-basis: 0; min-width: 0; display: flex; align-items: center; justify-content: center;
    height: 100%; padding: 0; border: none; background: transparent; cursor: pointer; overflow: hidden;
    transition: flex-grow .32s cubic-bezier(.4,0,.2,1);
  }
  .bt-in {
    display: inline-flex; align-items: center; gap: 7px; height: 40px; max-width: 100%;
    padding: 0 11px; border-radius: 999px; color: var(--muted);
    font-size: 12.5px; font-weight: 600; letter-spacing: .01em;
    transition: background .22s, color .22s, transform .12s;
  }
  .bt-in svg { width: 21px; height: 21px; flex: none; }
  .bt-label { max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; transition: max-width .3s, opacity .2s; }
  .botnav-tab:active .bt-in { transform: scale(.92); }
  .botnav-tab.active { flex-grow: 2.4; }
  .botnav-tab.active .bt-in { background: var(--accent-soft); color: var(--accent-ink); }
  .botnav-tab.active .bt-in svg { color: var(--accent); }
  .botnav-tab.active .bt-label { max-width: 90px; opacity: 1; }
  .botnav-fab {
    flex: none; width: 52px; height: 52px; margin: 0 3px; border-radius: 50%; border: none;
    background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #fff;
    display: grid; place-items: center; cursor: pointer; transform: translateY(-9px);
    box-shadow: 0 10px 22px -6px color-mix(in oklab, var(--accent) 60%, transparent), inset 0 1px 0 rgba(255,255,255,.25);
    transition: transform .15s;
  }
  [data-theme="dark"] .botnav-fab { color: oklch(18% 0.02 165); }
  .botnav-fab:active { transform: translateY(-9px) scale(.92); }
  .botnav-fab svg { width: 24px; height: 24px; }
  .chat-fab { display: none !important; }            /* replaced by the bottom-nav centre button */
  .chat-panel { bottom: 88px; right: 12px; }         /* float above the bar */
}
@media (max-width: 640px) { .botnav { left: 10px; right: 10px; } }

/* ---------------------------------------------------------------- Charts */
.chart { width: 100%; display: block; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; }
.chart .axis-lbl { fill: var(--faint); font-size: 10px; font-family: var(--font-mono); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chart-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-center { text-align: center; }
.chart-tip { position: fixed; z-index: 210; background: var(--fg); color: var(--bg); font-size: 12px; padding: 6px 9px; border-radius: 7px; pointer-events: none; opacity: 0; transition: opacity .12s; font-family: var(--font-mono); white-space: nowrap; box-shadow: var(--shadow); }
.chart-tip.show { opacity: 1; }

/* ---------------------------------------------------------------- Auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-aside { position: relative; overflow: hidden; background: oklch(24% 0.09 var(--accent-h)); color: #fff; padding: 44px; display: flex; flex-direction: column; }
.auth-aside .glow { position: absolute; border-radius: 50%; filter: blur(120px); opacity: .32; }
.auth-aside .g1 { width: 460px; height: 460px; background: oklch(52% 0.15 var(--accent-h)); top: -190px; right: -170px; }
.auth-aside .g2 { width: 360px; height: 360px; background: var(--gold); bottom: -170px; left: -130px; opacity: .09; }
.auth-brand { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; text-decoration: none; }
.auth-mobile-logo { display: none; }   /* brand shown above the form when the aside is hidden (≤900px) */
.auth-brand .mark { width: 40px; height: 40px; border-radius: 11px; background: rgba(255,255,255,.14); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 20px; }
.auth-hero { margin-top: clamp(30px, 7vh, 82px); position: relative; z-index: 2; }
.auth-hero h2 { font-family: var(--font-display); font-size: clamp(30px, 4vw, 44px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.08; }
.auth-hero p { margin-top: 16px; color: oklch(89% 0.03 var(--accent-h)); font-size: 15px; max-width: 42ch; }
.auth-quote { margin-top: auto; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.16); font-size: 13.5px; color: oklch(85% 0.03 var(--accent-h)); position: relative; z-index: 2; }

/* Live market-status badge (top of the aside) */
.auth-market { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; padding: 7px 13px; border-radius: 100px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.15); font: 600 12px/1 var(--font-mono); letter-spacing: .02em; color: rgba(255,255,255,.9); position: relative; z-index: 4; width: fit-content; }
.am-pulse { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; flex: none; animation: am-pulse 2s infinite; }
.am-pulse.idle { background: #f59e0b; animation: none; }
.am-pulse.closed { background: #94a3b8; animation: none; }
@keyframes am-pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5); } 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
.am-tip { position: absolute; top: calc(100% + 10px); left: 0; width: 264px; background: oklch(20% 0.07 var(--accent-h)); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 6px 14px; box-shadow: 0 20px 50px rgba(0,0,0,.4); opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .16s, transform .16s, visibility .16s; z-index: 20; }
.auth-market:hover .am-tip, .auth-market:focus-within .am-tip { opacity: 1; visibility: visible; transform: none; }
.am-row { display: flex; gap: 9px; padding: 8px 0; }
.am-row + .am-row { border-top: 1px solid rgba(255,255,255,.08); }
.am-row svg { width: 14px; height: 14px; color: rgba(255,255,255,.5); flex: none; margin-top: 1px; }
.am-lbl { font: 700 9.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.48); margin-bottom: 4px; }
.am-val { font-size: 12.5px; font-weight: 600; color: #fff; line-height: 1.3; }
.am-val .am-sub { display: block; font: 500 11px/1.3 var(--font-mono); color: rgba(255,255,255,.58); margin-top: 2px; }

/* Live platform stats strip (fills the aside mid-band) */
.auth-stats { display: flex; gap: clamp(20px, 3vw, 34px); margin-top: 26px; position: relative; z-index: 2; }
.auth-stat b { display: block; font-family: var(--font-display); font-size: clamp(20px, 2.4vw, 26px); font-weight: 700; letter-spacing: -0.01em; color: #fff; }
.auth-stat span { font: 500 11px/1.3 var(--font-mono); color: oklch(85% 0.03 var(--accent-h)); letter-spacing: .03em; }

/* Password show/hide eye toggle */
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border: none; background: transparent; border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--faint); padding: 0; }
.pw-eye:hover { color: var(--fg-soft); background: var(--surface-2); }
.inp-wrap .pw-eye svg { position: static; left: auto; width: 18px; height: 18px; color: inherit; pointer-events: none; }
.inp-wrap .inp.has-eye { padding-right: 42px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 28px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; letter-spacing: -0.02em; }
.auth-card .lead { color: var(--muted); margin-top: 6px; margin-bottom: 26px; font-size: 14px; }
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pw-meter { height: 5px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .3s, background .3s; border-radius: 999px; }

/* ---------------------------------------------------------------- Landing */
.lp-nav { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px; padding: 15px clamp(20px, 5vw, 64px); background: color-mix(in oklab, var(--bg) 80%, transparent); backdrop-filter: blur(14px); border-bottom: 1px solid var(--border); }
.lp-nav .links { display: flex; gap: 26px; margin-left: 24px; }
.lp-nav .links a { font-size: 14px; color: var(--fg-soft); font-weight: 500; }
.lp-nav .links a:hover { color: var(--accent); }
.brand-inline { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.brand-inline .mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(140deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }
.lp-section { padding: clamp(56px, 9vw, 110px) clamp(20px, 5vw, 64px); max-width: 1240px; margin: 0 auto; }
.lp-hero { text-align: center; padding-top: clamp(48px, 7vw, 84px); }
.lp-hero h1 { font-family: var(--font-display); font-size: clamp(38px, 6.4vw, 78px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.03; max-width: 16ch; margin: 20px auto 0; }
.lp-hero .accent-w { color: var(--accent); font-style: italic; }
.lp-hero p { max-width: 56ch; margin: 22px auto 0; font-size: clamp(15px, 2vw, 18px); color: var(--muted); }
.lp-cta { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.lp-trust { display: flex; gap: 30px; justify-content: center; flex-wrap: wrap; margin-top: 44px; opacity: .8; font-size: 13px; color: var(--muted); }
.lp-mock { margin: 56px auto 0; max-width: 1080px; border-radius: var(--r-xl); border: 1px solid var(--border); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface); }
.lp-mock .bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.lp-mock .bar i { width: 11px; height: 11px; border-radius: 50%; background: var(--border-2); }
.sec-eyebrow { text-align: center; }
.sec-title { font-family: var(--font-display); font-size: clamp(28px, 4vw, 44px); text-align: center; letter-spacing: -0.02em; margin: 10px auto 0; max-width: 20ch; font-weight: 600; }
.sec-sub { text-align: center; color: var(--muted); max-width: 54ch; margin: 14px auto 0; }
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 44px; margin-top: 48px; }
.cap-col .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 650; color: var(--accent); padding-bottom: 13px; border-bottom: 1.5px solid var(--accent-soft); }
.cap { display: flex; gap: 13px; padding: 17px 0; border-bottom: 1px solid var(--border); }
.cap:last-child { border-bottom: none; }
.cap .ci { flex: none; color: var(--accent); margin-top: 1px; line-height: 0; }
.cap .ci svg { width: 20px; height: 20px; }
.cap h3 { font-size: 15px; letter-spacing: -0.01em; font-weight: 600; }
.cap p { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.5; max-width: 36ch; }
.asset-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 44px; }
.asset-card { padding: 26px 22px; border-radius: var(--r-lg); border: 1px solid var(--border); background: var(--surface); position: relative; overflow: hidden; }
.asset-card .big { font-family: var(--font-display); font-size: 40px; font-weight: 700; color: var(--accent); }
.asset-card h3 { margin-top: 6px; font-size: 18px; } .asset-card p { color: var(--muted); font-size: 13px; margin-top: 8px; }
.lp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; text-align: center; }
.lp-stats .n { font-family: var(--font-display); font-size: clamp(30px, 4vw, 48px); font-weight: 700; }
.lp-stats .l { color: var(--muted); font-size: 13px; margin-top: 4px; }
.lp-band { background: oklch(24% 0.09 var(--accent-h)); color: #fff; border-radius: var(--r-xl); padding: clamp(40px, 6vw, 72px); text-align: center; position: relative; overflow: hidden; }
.lp-band h2 { font-family: var(--font-display); font-size: clamp(28px, 4vw, 46px); font-weight: 600; letter-spacing: -0.02em; }
.lp-band p { color: oklch(87% 0.03 var(--accent-h)); margin: 14px auto 26px; max-width: 50ch; }
.lp-foot { border-top: 1px solid var(--border); padding: 40px clamp(20px, 5vw, 64px); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 20px; color: var(--muted); font-size: 13px; max-width: 1240px; margin: 0 auto; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1080px) {
  .g-4 { grid-template-columns: repeat(2, 1fr); }
  .g-3 { grid-template-columns: repeat(2, 1fr); }
  .feat-grid, .asset-grid, .lp-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .auth-mobile-logo { display: block; margin: 0 0 20px; }
}
@media (max-width: 860px) {
  .sidebar { position: fixed; top: 0; left: 0; transform: translateX(-100%); box-shadow: var(--shadow-lg); z-index: 101; }
  .sidebar.open { transform: none; }
  .hamburger { display: grid; }
  .app-main { padding: 18px 16px 28px; }
  .g-2, .g-3, .g-4 { grid-template-columns: 1fr; }
  .caps { grid-template-columns: 1fr; gap: 8px; }
  .cap-col + .cap-col { margin-top: 8px; }
  .lp-nav .links { display: none; }
  .top-search { display: none; }
  /* lift toasts above the fixed bottom-nav (≈66px + safe-area) */
  .toaster { bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 640px) {
  .feat-grid, .asset-grid, .lp-stats { grid-template-columns: 1fr; }
  .page-hd { align-items: flex-start; }
  body { font-size: 14.5px; }
  .toaster { left: 16px; right: 16px; width: auto; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
