/* Quant Data explorer · base: tokens, reset and the app shell.
   Quant Operators family style (same neutrals as family.css in the product apps: Geist, pill buttons,
   16px-radius cards, mono uppercase labels). Quant Data's own colour is orange, red-orange second;
   blue is the second chart line. Dark is the default; <html> carries .dark or .light ("qo-theme").

   One scale everywhere — text: 18 page title · 16 card title · 14 body · 13 secondary · 12 field labels ·
   11 mono labels. Space: 4 · 8 · 12 · 16 · 24 · 32. Controls 36px tall, small buttons 28px.
   Radius: 8 controls · 12 inner boxes · 16 cards. */

:root, :root.dark {
  color-scheme: dark;
  --bg: #06070c; --surface: #0d0f18; --surface-2: #141726; --line: #242940; --line-strong: #343a58;
  --fg: #eef0fb; --muted: #9aa0b8; --faint: #7d839c; --placeholder: #6f7590;
  --field: #151826; --field-border: #4a5072; --field-border-hover: #646b92;
  --sidebar: #090a12; --grid-line: #1f2335;
  --ok: #34d399; --warn: #fbbf4a; --bad: #f87171; --shadow: 0 0 0;
  --brand: #fb923c; --brand-2: #f97316; --brand-fg: #06070c;
  --c1: var(--brand); --c2: #60a5fa; --c3: #a3e635; --c4: #f472b6; --c5: #c084fc; --c6: #2dd4bf;
  --font: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --side: 256px; --ctl: 36px; --ctl-sm: 28px;
  --r-ctl: 8px; --r-box: 12px; --r-card: 16px;
  --gap: 16px; --pad: 24px;
}
:root.light {
  color-scheme: light;
  --bg: #f6f7fb; --surface: #ffffff; --surface-2: #eceef5; --line: #dcdfea; --line-strong: #c3c8d8;
  --fg: #0b0d17; --muted: #565c74; --faint: #6b7188; --placeholder: #8a90a6;
  --field: #ffffff; --field-border: #959bb0; --field-border-hover: #6f758c;
  --sidebar: #eef0f6; --grid-line: #e3e6ef;
  --ok: #047857; --warn: #b45309; --bad: #dc2626; --shadow: 22 26 48;
  --brand: #c2410c; --brand-2: #9a3412; --brand-fg: #ffffff;
  --c2: #1d4ed8; --c3: #4d7c0f; --c4: #be185d; --c5: #7c3aed; --c6: #0f766e;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
a { color: var(--brand); text-underline-offset: 2px; }
h1, h2, p { margin: 0; }
code, .mono { font-family: var(--mono); font-size: 13px; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---- shell: full-height sidebar (brand, nav, footer) + content with its own title bar ---- */
.app { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--sidebar); }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; color: var(--fg); text-decoration: none; font: 600 15px/1.2 var(--font); letter-spacing: -0.01em; }
.brand-sub { display: block; font: 500 11px/1.3 var(--mono); color: var(--faint); text-transform: uppercase; letter-spacing: .12em; margin-top: 2px; }
.logo { width: 28px; height: 28px; flex: none; display: block; }
.nav { flex: 1; overflow-y: auto; padding: 0 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.nav-group { font: 500 11px/16px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 16px 10px 4px; }
.nav-group:first-child { padding-top: 4px; }
.nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r-ctl); color: var(--muted); text-decoration: none; font-size: 14px; transition: background-color .15s, color .15s; }
.nav a:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); color: var(--fg); }
.nav a.on { background: var(--surface-2); color: var(--fg); font-weight: 500; }
.nav a.on .ico { color: var(--brand); }
.ico { width: 16px; height: 16px; flex: none; }
.side-foot { border-top: 1px solid var(--line); padding: 12px 16px 14px; display: grid; gap: 8px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }

.main { min-width: 0; display: flex; flex-direction: column; position: relative; isolation: isolate; }
/* faint family grid behind the top of every page, fading out (as on quantoperators.com) */
.main::before { content: ""; position: absolute; inset: 0 0 auto; height: 420px; z-index: -1; pointer-events: none;
  background-image: linear-gradient(to right, var(--grid-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px; mask-image: radial-gradient(80% 60% at 50% 0, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(80% 60% at 50% 0, #000 30%, transparent 75%); }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--gap); padding: 14px 32px; min-height: 68px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-title { flex: 1; min-width: 0; }
.top h1 { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.top-title p { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-actions { display: flex; gap: 8px; align-items: center; }
.content { padding: var(--pad) 32px 64px; width: 100%; max-width: 1400px; }
.view { display: grid; gap: var(--gap); min-width: 0; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .side { position: sticky; z-index: 6; height: auto; flex-direction: row; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding: 10px 12px; } .brand-sub, .nav-group, .side-foot { display: none; }
  .nav { flex-direction: row; overflow-x: auto; padding: 6px 8px; gap: 4px; }
  .nav a { white-space: nowrap; }
  .top { position: static; padding: 12px 16px; }
  .top-title p { white-space: normal; }
  .content { padding: 16px 16px 48px; }
}
