/* FundedQuants — "Aurora" design system. Night (default) + Day themes, glass surfaces, ethereal light.
   Rules: page titles use the display face; every number uses the UI sans (tabular only in columns);
   chart colours come from --series-* (validated palette), P&L text from --up/--down with a sign. */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --font-display: "Cinzel", "Cormorant Garamond", Georgia, serif;
  --font-serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-ui: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --bg: #050714; --bg-2: #0a0d21;
  --surface: rgba(17, 21, 42, .70); --surface-solid: #11152a; --surface-2: rgba(255, 255, 255, .045);
  --surface-3: rgba(255, 255, 255, .075); --field: rgba(8, 10, 26, .62);
  --line: rgba(255, 255, 255, .085); --line-2: rgba(255, 255, 255, .16);
  --ink: #eef0ff; --ink-2: #b8bedc; --muted: #8189ae; --faint: #5b628a;
  --aurora-a: #6ee7ff; --aurora-b: #9b8cff; --aurora-c: #ff9ad5; --aurora-d: #ffd59a;
  --accent: #a5b0ff; --accent-strong: #8b97ff; --accent-ink: #0b0d1c;
  --glow: 0 0 0 1px rgba(155, 140, 255, .35), 0 0 32px -6px rgba(155, 140, 255, .55);
  --up: #3ee08f; --down: #ff7a90; --warn: #fab219; --good: #0ca30c; --serious: #ec835a; --critical: #d03b3b;
  --gold: #f6d58b; --silver: #d7def0; --bronze: #e3a77a; --platinum: #c6f1ff;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; --series-4: #c98500;
  --series-5: #d55181; --series-6: #008300; --series-7: #9085e9; --series-8: #e66767;
  --grid: #232845; --axis: #383d5c;
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .75), 0 1px 0 rgba(255, 255, 255, .04) inset;
  --sidebar-w: 276px; --topbar-h: 66px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="day"] {
  color-scheme: light;
  --bg: #f2f1fb; --bg-2: #e9ebfa;
  --surface: rgba(255, 255, 255, .74); --surface-solid: #fbfbfe; --surface-2: rgba(23, 26, 60, .04);
  --surface-3: rgba(23, 26, 60, .07); --field: rgba(255, 255, 255, .85);
  --line: rgba(23, 26, 60, .09); --line-2: rgba(23, 26, 60, .18);
  --ink: #141632; --ink-2: #474c70; --muted: #6c7196; --faint: #9a9fbd;
  --aurora-a: #2fb8d8; --aurora-b: #6f5ff0; --aurora-c: #e2559e; --aurora-d: #d79a2b;
  --accent: #5b4fe0; --accent-strong: #4a3ed1; --accent-ink: #ffffff;
  --glow: 0 0 0 1px rgba(91, 79, 224, .30), 0 0 28px -8px rgba(91, 79, 224, .45);
  --up: #08804a; --down: #c8324f; --gold: #b8860b; --silver: #7b86a6; --bronze: #a85f2c; --platinum: #2a8fb3;
  --series-1: #2a78d6; --series-2: #eb6834; --series-3: #1baf7a; --series-4: #eda100;
  --series-5: #e87ba4; --series-6: #008300; --series-7: #6250d6; --series-8: #e34948;
  --grid: #e3e3ee; --axis: #c4c5d6;
  --shadow: 0 24px 50px -28px rgba(32, 30, 80, .35), 0 1px 0 rgba(255, 255, 255, .7) inset;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--ink); font: 15px/1.55 var(--font-ui);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--aurora-a); outline-offset: 2px; border-radius: 6px; }
::selection { background: rgba(155, 140, 255, .35); }
h1, h2, h3, h4 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
.hide { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ethereal sky (fixed, behind everything) ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background:
  radial-gradient(1200px 700px at 12% -10%, rgba(110, 231, 255, .10), transparent 60%),
  radial-gradient(900px 600px at 95% 5%, rgba(155, 140, 255, .14), transparent 60%),
  radial-gradient(1000px 800px at 60% 120%, rgba(255, 154, 213, .09), transparent 60%),
  linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%); }
.sky::before { content: ""; position: absolute; inset: -50%; opacity: .55; background-image:
  radial-gradient(1px 1px at 20px 30px, rgba(255, 255, 255, .75), transparent 50%),
  radial-gradient(1px 1px at 120px 80px, rgba(255, 255, 255, .5), transparent 50%),
  radial-gradient(1.5px 1.5px at 200px 160px, rgba(200, 220, 255, .65), transparent 50%),
  radial-gradient(1px 1px at 320px 40px, rgba(255, 255, 255, .45), transparent 50%),
  radial-gradient(1px 1px at 280px 260px, rgba(255, 230, 250, .55), transparent 50%),
  radial-gradient(1.2px 1.2px at 60px 220px, rgba(255, 255, 255, .5), transparent 50%);
  background-size: 360px 300px; animation: drift 180s linear infinite; }
.sky .aurora { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(90px); opacity: .32;
  mix-blend-mode: screen; animation: float 38s var(--ease) infinite alternate; }
.sky .aurora.a { background: radial-gradient(circle, var(--aurora-a), transparent 62%); top: -30vmax; left: -20vmax; }
.sky .aurora.b { background: radial-gradient(circle, var(--aurora-b), transparent 62%); top: -25vmax; right: -25vmax; animation-delay: -12s; }
.sky .aurora.c { background: radial-gradient(circle, var(--aurora-c), transparent 62%); bottom: -40vmax; left: 25vw; opacity: .18; animation-delay: -24s; }
:root[data-theme="day"] .sky::before { opacity: 0; }
:root[data-theme="day"] .sky .aurora { mix-blend-mode: multiply; opacity: .16; }
@keyframes drift { to { transform: translate3d(-360px, -300px, 0); } }
@keyframes float { 0% { transform: translate3d(0, 0, 0) scale(1); } 100% { transform: translate3d(6vw, 4vh, 0) scale(1.12); } }
@media (prefers-reduced-motion: reduce) { .sky::before, .sky .aurora { animation: none; } * { scroll-behavior: auto !important; } }

/* ---------- type ---------- */
.display { font-family: var(--font-display); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 500; }
.iris-text { background: linear-gradient(100deg, var(--aurora-a), var(--aurora-b) 45%, var(--aurora-c) 80%, var(--aurora-d));
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); } .ink2 { color: var(--ink-2); } .faint { color: var(--faint); }
.small { font-size: 12.5px; } .xs { font-size: 11.5px; } .lg { font-size: 17px; }
.mono { font-family: var(--font-mono); }
.num { font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); }
.center { text-align: center; } .right { text-align: right; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--topbar-h); z-index: 40; display: flex; align-items: center;
  gap: 14px; padding: 0 18px 0 16px; background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px) saturate(150%); -webkit-backdrop-filter: blur(18px) saturate(150%); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; min-width: 0; }
.brand .mark { width: 34px; height: 34px; flex: 0 0 34px; }
.brand .word { font-family: var(--font-display); font-weight: 700; letter-spacing: .14em; font-size: 15px; white-space: nowrap; }
.brand .word b { font-weight: 700; } .brand .word i { font-style: normal; opacity: .65; }
.product-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.product-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 10px var(--up); }
.topbar .spacer { flex: 1; }
.icon-btn { position: relative; width: 40px; height: 40px; display: inline-grid; place-items: center; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink-2); cursor: pointer; transition: .2s var(--ease); }
.icon-btn:hover { color: var(--ink); background: var(--surface-3); box-shadow: var(--glow); }
.icon-btn .count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: linear-gradient(120deg, var(--aurora-c), var(--aurora-b)); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; }
.me-btn { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); cursor: pointer; color: var(--ink); }
.me-btn:hover { box-shadow: var(--glow); }
.me-btn .who { font-weight: 700; font-size: 13.5px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.burger { display: none; }

.sidebar { position: fixed; top: var(--topbar-h); bottom: 0; left: 0; width: var(--sidebar-w); z-index: 30; display: flex; flex-direction: column;
  padding: 16px 12px 12px; background: color-mix(in srgb, var(--bg) 55%, transparent); border-right: 1px solid var(--line);
  backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); }
.sidebar .cta { margin: 0 4px 14px; }
.nav { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 12px; scrollbar-width: thin; }
.nav a, .nav button.nav-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 9px 12px; margin: 1px 0; border-radius: 12px;
  color: var(--ink-2); font-size: 14px; font-weight: 600; text-decoration: none; border: 0; background: none; cursor: pointer; text-align: left;
  transition: background .2s var(--ease), color .2s var(--ease); position: relative; }
.nav a svg, .nav button.nav-item svg { flex: 0 0 18px; opacity: .85; }
.nav a:hover, .nav button.nav-item:hover { color: var(--ink); background: var(--surface-2); }
.nav a.active { color: var(--ink); background: linear-gradient(90deg, rgba(155, 140, 255, .20), rgba(110, 231, 255, .06)); }
.nav a.active::before { content: ""; position: absolute; left: -2px; top: 9px; bottom: 9px; width: 3px; border-radius: 3px;
  background: linear-gradient(var(--aurora-a), var(--aurora-b)); box-shadow: 0 0 12px var(--aurora-b); }
.nav .lock { margin-left: auto; opacity: .55; }
.nav .tag { margin-left: auto; font-size: 10px; font-weight: 800; letter-spacing: .08em; padding: 2px 7px; border-radius: 999px;
  background: linear-gradient(120deg, var(--aurora-a), var(--aurora-b)); color: #0b0d1c; }
.nav details { margin-top: 8px; }
.nav summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; cursor: pointer; color: var(--muted);
  font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; user-select: none; }
.nav summary::-webkit-details-marker { display: none; }
.nav summary svg { transition: transform .2s var(--ease); }
.nav details[open] summary svg { transform: rotate(90deg); }
.side-foot { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 2px; }
.main { margin-left: var(--sidebar-w); padding: calc(var(--topbar-h) + 26px) clamp(16px, 3vw, 36px) 64px; min-width: 0; }
.page { max-width: 1320px; margin: 0 auto; animation: rise .45s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; margin-bottom: 12px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); } .crumbs a:hover { color: var(--ink); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: clamp(24px, 3.2vw, 38px); }
.page-head .sub { font-family: var(--font-serif); font-style: italic; font-size: clamp(17px, 1.6vw, 21px); color: var(--ink-2); margin-top: 6px; }
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.legal { max-width: 1320px; margin: 48px auto 0; padding-top: 18px; border-top: 1px solid var(--line); color: var(--faint); font-size: 11.5px; line-height: 1.6; }
.legal a { color: var(--muted); }
.scrim { position: fixed; inset: 0; background: rgba(3, 4, 12, .55); backdrop-filter: blur(3px); z-index: 25; opacity: 0; pointer-events: none; transition: .25s; }
.bottom-nav { display: none; }

/* ---------- surfaces ---------- */
.card, .glass { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(140%); -webkit-backdrop-filter: blur(18px) saturate(140%); }
.card { padding: clamp(16px, 2vw, 24px); position: relative; }
.card.flat { box-shadow: none; }
.card.tight { padding: 14px 16px; }
.card h2, .card h3 { font-size: 15px; font-weight: 800; letter-spacing: .01em; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head .t { display: flex; align-items: center; gap: 10px; }
.card-head .t svg { color: var(--accent); }
.iris { position: relative; }
.iris::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(135deg, var(--aurora-a), var(--aurora-b) 40%, var(--aurora-c) 75%, var(--aurora-d));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; }
.halo { box-shadow: var(--shadow), 0 0 60px -20px rgba(155, 140, 255, .55); }
.hero-card { padding: clamp(22px, 3.4vw, 40px); overflow: hidden; }
.hero-card::after { content: ""; position: absolute; right: -120px; top: -140px; width: 420px; height: 420px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(155, 140, 255, .28), transparent 65%); }
.divider { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

/* ---------- grid ---------- */
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.span2 { grid-column: span 2; } .span3 { grid-column: span 3; }
.row { display: flex; align-items: center; gap: 10px; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.stack { display: grid; gap: 10px; } .stack.lg { gap: 18px; }
.mt { margin-top: 18px; } .mt-s { margin-top: 10px; } .mb { margin-bottom: 18px; } .mb-s { margin-bottom: 10px; }

/* ---------- buttons ---------- */
.btn { --b: var(--surface-2); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 18px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--b); color: var(--ink); font-weight: 700; font-size: 14px; cursor: pointer; text-decoration: none !important;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), background .2s var(--ease); white-space: nowrap; }
.btn:hover { background: var(--surface-3); box-shadow: var(--glow); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { border: 0; color: #0b0d1c; background: linear-gradient(115deg, #8ff0ff 0%, #b2a6ff 48%, #ffb3e1 100%); background-size: 160% 100%;
  box-shadow: 0 10px 30px -12px rgba(155, 140, 255, .75), inset 0 1px 0 rgba(255, 255, 255, .6); }
.btn.primary:hover { background-position: 100% 0; box-shadow: 0 14px 40px -12px rgba(155, 140, 255, .95), inset 0 1px 0 rgba(255, 255, 255, .6); }
:root[data-theme="day"] .btn.primary { color: #fff; background: linear-gradient(115deg, #2fb8d8 0%, #6f5ff0 50%, #e2559e 100%); }
.btn.ghost { background: transparent; }
.btn.danger { color: #fff; border: 0; background: linear-gradient(120deg, #e2556e, #c8324f); }
.btn.sm { padding: 7px 12px; font-size: 12.5px; border-radius: 11px; }
.btn.lg { padding: 15px 26px; font-size: 15.5px; border-radius: 16px; }
.btn.block { width: 100%; }
.link-btn { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 700; padding: 0; }

/* ---------- chips / badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.glow { background: linear-gradient(120deg, rgba(110, 231, 255, .16), rgba(155, 140, 255, .18)); color: var(--ink); border-color: rgba(155, 140, 255, .35); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 800;
  letter-spacing: .03em; border: 1px solid transparent; white-space: nowrap; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.good { color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); border-color: color-mix(in srgb, var(--up) 30%, transparent); }
.badge.bad { color: var(--down); background: color-mix(in srgb, var(--down) 12%, transparent); border-color: color-mix(in srgb, var(--down) 30%, transparent); }
.badge.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.badge.info { color: var(--aurora-a); background: color-mix(in srgb, var(--aurora-a) 12%, transparent); border-color: color-mix(in srgb, var(--aurora-a) 30%, transparent); }
.badge.gold { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); border-color: color-mix(in srgb, var(--gold) 30%, transparent); }
.badge.neutral { color: var(--ink-2); background: var(--surface-2); border-color: var(--line); }
.promo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  color: #0b0d1c; background: linear-gradient(120deg, var(--aurora-d), var(--aurora-c)); letter-spacing: .04em; }

/* ---------- forms ---------- */
label.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.input, input.input, select.input, textarea.input { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); outline: none; transition: border-color .2s, box-shadow .2s; }
.input:focus { border-color: rgba(155, 140, 255, .65); box-shadow: 0 0 0 4px rgba(155, 140, 255, .14); }
textarea.input { min-height: 120px; resize: vertical; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.err { color: var(--down); font-size: 13px; min-height: 18px; }
.ok { color: var(--up); font-size: 13px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent-strong); flex: 0 0 18px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 42px; height: 24px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--line); position: relative; transition: .2s; flex: 0 0 42px; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--ink-2); transition: .25s var(--ease); }
.switch input:checked + .track { background: linear-gradient(120deg, var(--aurora-a), var(--aurora-b)); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); background: #fff; }
.switch input:focus-visible + .track { outline: 2px solid var(--aurora-a); outline-offset: 2px; }

/* ---------- tabs & segmented ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; padding: 11px 14px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--aurora-a), var(--aurora-b), var(--aurora-c)); box-shadow: 0 0 12px var(--aurora-b); }
.seg { display: inline-flex; padding: 4px; gap: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); flex-wrap: wrap; }
.seg button { padding: 8px 14px; border-radius: 10px; border: 0; background: none; color: var(--ink-2); font-weight: 700; font-size: 13px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); box-shadow: 0 0 0 1px var(--line-2), 0 6px 18px -8px rgba(155, 140, 255, .6); }

/* ---------- choice tiles (challenge configurator) ---------- */
.choices { display: grid; gap: 12px; }
.choice { position: relative; display: grid; gap: 6px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2);
  cursor: pointer; text-align: left; color: var(--ink); transition: .2s var(--ease); }
.choice:hover { background: var(--surface-3); transform: translateY(-1px); }
.choice[aria-checked="true"] { border-color: transparent; background: linear-gradient(160deg, rgba(110, 231, 255, .14), rgba(155, 140, 255, .18) 60%, rgba(255, 154, 213, .10));
  box-shadow: 0 0 0 1.5px rgba(155, 140, 255, .75), 0 18px 44px -18px rgba(155, 140, 255, .8); }
.choice .tick { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; }
.choice[aria-checked="true"] .tick { border: 0; background: linear-gradient(120deg, var(--aurora-a), var(--aurora-b)); color: #0b0d1c; }
.choice .big { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.choice .promo { position: absolute; top: -10px; left: 14px; }

/* ---------- stat tiles & meters ---------- */
.stat { padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2); min-width: 0; container-type: inline-size; }
.stat .label { font-size: 12px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: clamp(15px, 12.5cqi, 26px); font-weight: 800; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.stat .delta { font-size: 12.5px; font-weight: 700; margin-top: 2px; }
.stat .spark { margin-top: 8px; height: 28px; }
.hero-number { font-size: clamp(40px, 5vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.meter { height: 10px; border-radius: 999px; background: color-mix(in srgb, var(--series-1) 18%, transparent); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--series-1); transition: width .6s var(--ease); }
.meter.warn > i { background: var(--warn); } .meter.bad > i { background: var(--critical); } .meter.good > i { background: var(--good); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; font-weight: 700; }

/* ---------- tables ---------- */
.tbl-wrap { overflow-x: auto; border-radius: 16px; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 800;
  padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--surface-solid); }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background .15s; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; } .tbl .c { text-align: center; }
.tbl td.strong { font-weight: 800; }
@media (max-width: 720px) {
  table.tbl.stackable thead { display: none; }
  table.tbl.stackable, .tbl.stackable tbody, .tbl.stackable tr, .tbl.stackable td { display: block; width: 100%; }
  .tbl.stackable tr { padding: 10px 4px; border-bottom: 1px solid var(--line); }
  .tbl.stackable td { border: 0; padding: 5px 10px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .tbl.stackable td::before { content: attr(data-label); color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: left; }
}

/* ---------- avatars, podium, lists ---------- */
.avatar { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; color: #0b0d1c;
  background: conic-gradient(from 200deg, var(--aurora-a), var(--aurora-b), var(--aurora-c), var(--aurora-d), var(--aurora-a)); box-shadow: 0 0 0 2px var(--surface-solid); }
.avatar.sm { width: 30px; height: 30px; flex-basis: 30px; font-size: 12px; } .avatar.lg { width: 64px; height: 64px; flex-basis: 64px; font-size: 22px; }
.list { display: grid; gap: 2px; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; }
.list .item:hover { background: var(--surface-2); }
.list .item .grow { flex: 1; min-width: 0; }
.trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- empty states ---------- */
.empty { display: grid; justify-items: center; text-align: center; gap: 10px; padding: clamp(26px, 5vw, 56px) 16px; }
.empty .orb { width: 92px; height: 92px; border-radius: 50%; position: relative; display: grid; place-items: center; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .45), transparent 40%), conic-gradient(from 120deg, var(--aurora-a), var(--aurora-b), var(--aurora-c), var(--aurora-a));
  box-shadow: 0 0 60px -6px rgba(155, 140, 255, .65); animation: breathe 6s ease-in-out infinite; }
.empty .orb svg { color: #0b0d1c; }
.empty h3 { font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase; font-size: 18px; font-weight: 600; }
.empty p { color: var(--ink-2); max-width: 520px; }
@keyframes breathe { 50% { transform: scale(1.05); box-shadow: 0 0 80px -4px rgba(155, 140, 255, .8); } }

/* ---------- overlays ---------- */
.modal-bg { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px; background: rgba(3, 4, 12, .62);
  backdrop-filter: blur(6px); animation: fade .2s var(--ease); }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px; border-radius: 24px; background: var(--surface-solid);
  border: 1px solid var(--line-2); box-shadow: 0 40px 120px -30px rgba(0, 0, 0, .8), 0 0 80px -30px rgba(155, 140, 255, .6); animation: pop .28s var(--ease); }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.modal-head h3 { font-family: var(--font-display); letter-spacing: .08em; text-transform: uppercase; font-size: 17px; font-weight: 600; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 85; width: min(440px, 100%); padding: 22px; background: var(--surface-solid);
  border-left: 1px solid var(--line-2); box-shadow: -30px 0 80px -30px rgba(0, 0, 0, .7); animation: slide .3s var(--ease); overflow-y: auto; }
.pop { position: absolute; z-index: 70; min-width: 260px; padding: 8px; border-radius: 18px; background: var(--surface-solid); border: 1px solid var(--line-2);
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, .75); animation: pop .2s var(--ease); }
.pop .menu-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 12px; border: 0; background: none;
  color: var(--ink); text-decoration: none !important; cursor: pointer; text-align: left; font-weight: 600; font-size: 13.5px; }
.pop .menu-item:hover { background: var(--surface-2); }
.pop .menu-item small { display: block; color: var(--muted); font-weight: 500; font-size: 12px; }
.notif { display: grid; grid-template-columns: 10px 1fr; gap: 10px; padding: 12px; border-radius: 12px; text-decoration: none !important; color: var(--ink); }
.notif:hover { background: var(--surface-2); }
.notif .pip { width: 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: transparent; }
.notif.unread .pip { background: var(--aurora-c); box-shadow: 0 0 10px var(--aurora-c); }
.toasts { position: fixed; z-index: 95; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 10px; pointer-events: none; width: min(460px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 14px; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .8);
  font-weight: 600; font-size: 13.5px; animation: pop .25s var(--ease); pointer-events: auto; display: flex; gap: 10px; align-items: center; }
.toast.good { border-color: color-mix(in srgb, var(--up) 45%, transparent); } .toast.bad { border-color: color-mix(in srgb, var(--down) 45%, transparent); }
.chat-fab { position: fixed; right: 22px; bottom: 22px; z-index: 50; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; color: #0b0d1c;
  display: grid; place-items: center; background: conic-gradient(from 210deg, var(--aurora-a), var(--aurora-b), var(--aurora-c), var(--aurora-a));
  box-shadow: 0 18px 50px -12px rgba(155, 140, 255, .9); animation: breathe 7s ease-in-out infinite; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.skeleton { border-radius: 12px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; min-height: 16px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.loading { display: grid; place-items: center; min-height: 40vh; color: var(--muted); }
.spinner { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--aurora-b); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.chart .tick { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.chart .ref { stroke-width: 1.5; stroke-dasharray: 0; }
.chart .ref-label { font-size: 10.5px; font-weight: 800; letter-spacing: .04em; fill: var(--ink-2); }
.chart .xhair { stroke: var(--line-2); stroke-width: 1; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; min-width: 140px; padding: 10px 12px; border-radius: 12px; background: var(--surface-solid);
  border: 1px solid var(--line-2); box-shadow: 0 16px 40px -14px rgba(0, 0, 0, .7); font-size: 12.5px; transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap; }
.chart-tip .tv { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-tip .tl { color: var(--muted); font-size: 11.5px; }
.chart-tip .row { gap: 8px; }
.chart-tip .key { width: 12px; height: 2px; border-radius: 2px; flex: 0 0 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.sq { width: 10px; height: 10px; border-radius: 3px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal .day { min-height: 74px; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); display: grid; align-content: space-between; font-size: 12px; }
.cal .day.out { opacity: .35; } .cal .day.today { box-shadow: 0 0 0 1.5px rgba(155, 140, 255, .7); }
.cal .day .d { color: var(--muted); font-weight: 700; } .cal .day .v { font-weight: 800; font-size: 12.5px; } .cal .day .n { color: var(--muted); font-size: 11px; }
.cal .day.pos { background: color-mix(in srgb, var(--series-1) 16%, var(--surface-2)); }
.cal .day.neg { background: color-mix(in srgb, var(--series-8) 16%, var(--surface-2)); }

.hb { display: grid; gap: 10px; }
.hb-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr auto; align-items: center; gap: 12px; font-size: 13px; }
.hb-row .hb-l { color: var(--ink-2); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hb-row .hb-v { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; min-width: 60px; }
.hb-track { height: 12px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.hb-track i { display: block; height: 100%; border-radius: 0 4px 4px 0; }
.hb-row:focus-visible, .hb-row:hover { outline: none; } .hb-row:hover .hb-track i { filter: brightness(1.15); }
.calm .sky::before, .calm .sky .aurora, .calm .empty .orb, .calm .chat-fab { animation: none !important; }
@media (max-width: 720px) { .hide-sm { display: none !important; } }
@media (min-width: 721px) { .show-sm { display: none !important; } }

/* ---------- certificates ---------- */
.cert { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); }
.cert.locked svg { filter: grayscale(1) brightness(.6); opacity: .55; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.1fr .9fr; }
.auth-art { position: relative; padding: clamp(28px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.auth-art h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: clamp(30px, 4.4vw, 58px); line-height: 1.08; }
.auth-art .serif { font-size: clamp(19px, 2vw, 24px); color: var(--ink-2); max-width: 560px; margin-top: 16px; }
.auth-panel { display: grid; place-items: center; padding: 24px; }
.auth-card { width: min(420px, 100%); padding: 30px; }
.orbit { position: absolute; border-radius: 50%; border: 1px solid rgba(155, 140, 255, .22); pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1023px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .main { margin-left: 0; }
  .burger { display: inline-grid; }
  .sidebar { transform: translateX(-104%); transition: transform .3s var(--ease); z-index: 60; top: 0; padding-top: 18px; width: min(320px, 86vw);
    background: var(--surface-solid); box-shadow: 30px 0 80px -30px rgba(0, 0, 0, .8); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; z-index: 55; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr; } .auth-art { min-height: 46vh; }
}
@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { padding: 0 10px; gap: 8px; } .product-pill, .me-btn .who { display: none; }
  .brand .word { font-size: 13px; letter-spacing: .1em; }
  .main { padding: calc(var(--topbar-h) + 16px) 14px 96px; }
  .g2, .g3, .g4, .g5, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .span2, .span3 { grid-column: auto; }
  .page-head { align-items: flex-start; }
  .bottom-nav { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 45; padding: 6px;
    border-radius: 20px; background: color-mix(in srgb, var(--surface-solid) 88%, transparent); border: 1px solid var(--line-2); backdrop-filter: blur(16px);
    box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .8); }
  .bottom-nav a, .bottom-nav button { display: grid; justify-items: center; gap: 3px; padding: 7px 2px; border-radius: 14px; color: var(--muted); font-size: 10.5px;
    font-weight: 700; text-decoration: none; border: 0; background: none; cursor: pointer; }
  .bottom-nav a.active { color: var(--ink); background: var(--surface-3); }
  .chat-fab { bottom: 92px; right: 14px; width: 50px; height: 50px; }
  .cal .day { min-height: 54px; padding: 6px; } .cal .day .n { display: none; }
  .modal { padding: 18px; border-radius: 20px; }
}
@media print { .sky, .topbar, .sidebar, .bottom-nav, .chat-fab, .toasts { display: none !important; } .main { padding: 0; } .card { box-shadow: none; backdrop-filter: none; } }

/* small-phone fixes: journal calendar cells and ranking tab bars */
.cal .day { min-width: 0; overflow: hidden; }
@media (max-width: 520px) {
  .cal { gap: 3px; }
  .cal .day { min-height: 54px; padding: 5px 4px; border-radius: 9px; }
  .cal .day .v { font-size: 10px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
  .cal .day .n { display: none; }
}
html, body { overflow-x: clip; }
