/* ==========================================================================
   Options Premium Pricer: glass UI
   Direction: frosted-glass "terminal". Deep navy base with a restrained mesh, translucent panels,
   IBM Plex Sans for reading and IBM Plex Mono for every number, amber as the single accent.
   Accessibility: text >= 4.5:1 on glass, visible focus rings, reduced-motion and reduced-transparency fallbacks.
   ========================================================================== */
:root {
  color-scheme: dark;
  --bg: #070b16;
  --ink: #f2f5fa;        /* primary text   ~15:1 on glass */
  --ink-2: #b9c4d6;      /* secondary text  ~9:1 */
  --ink-3: #93a0b6;      /* tertiary text   ~6:1 */
  --line: rgba(255, 255, 255, .16);
  --line-2: rgba(255, 255, 255, .07);
  --glass: rgba(18, 28, 50, .42);
  --fill: rgba(255, 255, 255, .05);
  --fill-2: rgba(255, 255, 255, .09);
  --accent: #f5b13d;
  --accent-ink: #1b1204;
  --teal: #2dd4bf;
  --blue: #60a5fa;
  --pos: #34d399;
  --neg: #fb7185;
  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --r-sm: 9px;
  --blur: blur(22px) saturate(170%);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .02), 0 22px 60px -24px rgba(0, 0, 0, .8);
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --header-h: 68px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 96px; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--ink);
  font: 400 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* backdrop: three soft light sources + a fine grid that fades out, so the glass has something to refract */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background:
    radial-gradient(1000px 720px at 4% -8%, rgba(45, 212, 191, .34), transparent 62%),
    radial-gradient(900px 660px at 100% 0%, rgba(245, 177, 61, .24), transparent 62%),
    radial-gradient(1100px 860px at 55% 112%, rgba(59, 130, 246, .34), transparent 62%),
    radial-gradient(700px 520px at 18% 62%, rgba(45, 212, 191, .11), transparent 62%),
    var(--bg);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse at 50% 28%, #000 15%, transparent 72%);
  mask-image: radial-gradient(ellipse at 50% 28%, #000 15%, transparent 72%);
}
code { font-family: var(--mono); font-size: .88em; background: var(--fill-2); padding: 1px 6px; border-radius: 6px; }
a { color: #8ec5ff; text-decoration: none; }
a:hover { text-decoration: underline; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 10px 14px; border-radius: var(--r-sm); font-weight: 600; }
.skip:focus { top: 12px; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.sm { width: 14px; height: 14px; }

/* ---------- glass surface ---------- */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, .075) 0%, rgba(255, 255, 255, .028) 100%), var(--glass);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: #101a2e; }
}
/* Reduced transparency: follow the OS setting by default, but the header toggle (html[data-glass]) always wins. */
@media (prefers-reduced-transparency: reduce) {
  html:not([data-glass="on"]) :is(.glass, .stat, .banner .cell, .welcome, #toast) { background: #0f172a; -webkit-backdrop-filter: none; backdrop-filter: none; }
}
html[data-glass="off"] :is(.glass, .stat, .banner .cell, .welcome, #toast) { background: #0f172a; -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-contrast: more) {
  :root { --line: rgba(255, 255, 255, .4); --ink-2: #e2e8f2; --ink-3: #cdd6e4; }
}

/* ---------- header ---------- */
.top {
  position: sticky; top: 12px; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1480px; width: calc(100% - 32px); margin: 12px auto 0; padding: 10px 14px 10px 12px; min-height: var(--header-h);
  border-radius: var(--r-xl);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: inherit; }
.brand:hover { text-decoration: none; }
.logo { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; background: linear-gradient(145deg, rgba(245, 177, 61, .28), rgba(255, 255, 255, .05)); border: 1px solid rgba(245, 177, 61, .35); box-shadow: 0 0 28px -6px rgba(245, 177, 61, .6); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.brand-text b { font-weight: 600; font-size: 16.5px; letter-spacing: .1px; }
.brand-text small { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-links { display: flex; align-items: center; gap: 8px; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 8px; font: 500 12.5px var(--font); padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--fill); color: var(--ink-2); white-space: nowrap; }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.pill.live { color: #b8f5dc; border-color: rgba(52, 211, 153, .4); }
.pill.live .dot { background: var(--pos); box-shadow: 0 0 10px var(--pos); }
.pill.snap { color: #ffe0a8; border-color: rgba(245, 177, 61, .4); }
.pill.snap .dot { background: var(--accent); box-shadow: 0 0 10px rgba(245, 177, 61, .8); }

/* ---------- buttons / chips ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px; cursor: pointer; white-space: nowrap;
  font: 500 14px var(--font); color: var(--ink); background: var(--fill-2); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: background .16s var(--ease), border-color .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .24); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { color: var(--accent-ink); font-weight: 600; background: linear-gradient(180deg, #ffc65f, #f0a52a); border-color: rgba(255, 220, 150, .7); box-shadow: 0 8px 24px -10px rgba(245, 177, 61, .9), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn.primary:hover { background: linear-gradient(180deg, #ffd07a, #f5b13d); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--fill-2); color: var(--ink); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 13.5px; }
.btn.icon-only { padding: 6px; width: 38px; }
.btn:disabled { opacity: .55; cursor: progress; }
:where(a, button, input, select, summary, [tabindex]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 4px 12px; cursor: pointer; font: 500 12.5px var(--font); color: var(--ink);
  background: var(--fill); border: 1px solid var(--line); border-radius: 999px; transition: background .16s var(--ease), border-color .16s var(--ease);
}
.chip:hover { background: var(--fill-2); border-color: rgba(245, 177, 61, .6); text-decoration: none; }
.chip.link { color: #8ec5ff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- layout ---------- */
.layout { display: grid; grid-template-columns: 372px minmax(0, 1fr); gap: 20px; max-width: 1480px; margin: 16px auto 0; padding: 0 16px 28px; align-items: start; }
.content { min-width: 0; outline: none; }
.panel { padding: 4px 18px 6px; }
.inputs { position: sticky; top: calc(var(--header-h) + 28px); max-height: calc(100vh - var(--header-h) - 44px); overflow: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .2) transparent; }
.inputs::-webkit-scrollbar { width: 8px; } .inputs::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 8px; }

/* ---------- input accordions ---------- */
.acc { border-bottom: 1px solid var(--line-2); }
.acc:last-child { border-bottom: 0; }
.acc summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 15px 2px; cursor: pointer; font: 600 12px/1 var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); border-radius: var(--r-sm); }
.acc summary::-webkit-details-marker { display: none; }
.acc summary em { font: 400 12px var(--font); letter-spacing: 0; text-transform: none; color: var(--ink-3); font-style: normal; }
.acc summary .ic { color: var(--accent); }
.acc summary .chev { margin-left: auto; color: var(--ink-3); transition: transform .22s var(--ease); }
.acc[open] summary .chev { transform: rotate(180deg); }
.acc-body { padding: 0 0 18px; }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.seg-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }

/* ---------- form controls ---------- */
.fld { display: block; }
.lbl { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; font: 500 12.5px var(--font); color: var(--ink-2); }
.lbl label { display: inline; margin: 0; cursor: pointer; font: inherit; color: inherit; }
.lbl output { margin-left: auto; font: 500 12.5px var(--mono); color: var(--ink); }
#chainPick { display: grid; gap: 10px; margin-top: 12px; }
input, select {
  width: 100%; min-width: 0; min-height: 42px; padding: 9px 12px; color: var(--ink); background: var(--fill); border: 1px solid var(--line); border-radius: var(--r-md);
  font: 500 15px var(--mono); transition: border-color .16s var(--ease), box-shadow .16s var(--ease), background .16s var(--ease);
}
input[type="text"], input:not([type]), #ticker, #apiBase, #surfTicker { font-family: var(--font); font-weight: 400; }
input::placeholder { color: var(--ink-3); font-family: var(--font); font-weight: 400; }
input:hover, select:hover { background: var(--fill-2); }
input:focus, select:focus { outline: none; border-color: rgba(245, 177, 61, .8); box-shadow: 0 0 0 3px rgba(245, 177, 61, .2); background: var(--fill-2); }
input:focus-visible, select:focus-visible { outline: none; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 36px; font-family: var(--font); font-weight: 500; font-size: 14px;
  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='%2393a0b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select option { background: #0e1626; color: var(--ink); }
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.in { position: relative; display: block; }
.in input { padding-right: 34px; }
.in .u { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font: 500 12.5px var(--mono); pointer-events: none; font-style: normal; }
.in.pre input { padding-left: 28px; padding-right: 12px; }
.in.pre .u { left: 12px; right: auto; }
label.inline { display: flex; align-items: center; gap: 10px; font: 500 13px var(--font); color: var(--ink-2); }
label.inline select { width: auto; min-height: 38px; }
.checkline { display: flex; align-items: center; gap: 10px; margin-top: 14px; font: 400 13px var(--font); color: var(--ink-2); cursor: pointer; }
.checkline input { width: 18px; height: 18px; min-height: 0; padding: 0; accent-color: var(--accent); flex: none; }

input[type="range"] { -webkit-appearance: none; appearance: none; height: 28px; padding: 0; background: transparent; border: 0; box-shadow: none; }
input[type="range"]:hover, input[type="range"]:focus { background: transparent; box-shadow: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: linear-gradient(90deg, rgba(245, 177, 61, .55), rgba(255, 255, 255, .14)); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: rgba(255, 255, 255, .14); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe2a4, var(--accent)); border: 2px solid #1b1204; box-shadow: 0 0 0 1px rgba(255, 255, 255, .4), 0 4px 14px rgba(245, 177, 61, .55); cursor: grab; }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 2px solid #1b1204; cursor: grab; }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.slider { margin-top: 14px; }
.premslide { margin-top: 10px; }

/* segmented control */
.seg { display: flex; gap: 3px; padding: 3px; margin-bottom: 8px; background: var(--fill); border: 1px solid var(--line); border-radius: var(--r-md); }
.seg-row .seg { margin-bottom: 0; }
.seg button { flex: 1; min-height: 36px; padding: 6px 8px; cursor: pointer; font: 500 13.5px var(--font); color: var(--ink-2); background: transparent; border: 0; border-radius: 9px; transition: background .16s var(--ease), color .16s var(--ease); }
.seg button:hover { background: var(--fill-2); color: var(--ink); }
.seg button.on { color: #ffe6b3; background: linear-gradient(180deg, rgba(245, 177, 61, .30), rgba(245, 177, 61, .14)); box-shadow: inset 0 0 0 1px rgba(245, 177, 61, .5); }

/* tooltip trigger */
.tip { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; margin: 0; cursor: help; color: var(--ink-3); background: transparent; border: 0; border-radius: 50%; }
.tip:hover, .tip:focus-visible { color: var(--accent); }
#tooltip { position: fixed; z-index: 300; max-width: 268px; padding: 10px 12px; font: 400 12.5px/1.45 var(--font); color: var(--ink); background: rgba(9, 14, 27, .96); border: 1px solid rgba(255, 255, 255, .2); border-radius: 10px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); opacity: 0; pointer-events: none; transform: translateY(4px); transition: opacity .14s var(--ease), transform .14s var(--ease); }
#tooltip.show { opacity: 1; transform: none; }

.hint { margin: 10px 0 0; font-size: 13px; color: var(--ink-3); }
.hint.bad { color: #ffb0bb; }
.hint.good { color: #9cf0c9; }
.ivbox { margin-top: 12px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); background: var(--fill); border: 1px solid var(--line); border-radius: var(--r-md); }
.ivbox b { color: var(--accent); font: 600 14px var(--mono); }
.ivbox .chip { margin-left: 6px; }
.opt { font-weight: 400; font-size: 13px; color: var(--ink-3); }

/* ---------- summary + welcome ---------- */
.summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 14px; min-height: 40px; }
.sum-line { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.sum-chip { padding: 4px 11px; font: 500 12.5px var(--mono); color: var(--ink-2); background: var(--fill); border: 1px solid var(--line-2); border-radius: 999px; white-space: nowrap; }
.sum-chip.lead { color: #ffe6b3; background: rgba(245, 177, 61, .14); border-color: rgba(245, 177, 61, .4); font-family: var(--font); font-weight: 600; }
.welcome { position: relative; padding: 22px 24px 20px; margin-bottom: 16px; background: radial-gradient(120% 140% at 0% 0%, rgba(45, 212, 191, .15), transparent 55%), linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .028)), var(--glass); }
.welcome h2 { margin: 0 0 14px; font: 600 19px var(--font); }
.welcome .x { position: absolute; right: 12px; top: 12px; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); background: transparent; border: 0; border-radius: 10px; }
.welcome .x:hover { color: var(--ink); background: var(--fill-2); }
.steps { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 0 0 16px; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 14px 14px 14px 52px; background: var(--fill); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.steps li::before { content: counter(s); position: absolute; left: 14px; top: 14px; width: 26px; height: 26px; display: grid; place-items: center; font: 600 13px var(--mono); color: var(--accent-ink); background: var(--accent); border-radius: 50%; }
.steps b { display: block; font-weight: 600; margin-bottom: 2px; }
.steps span { color: var(--ink-2); font-size: 13.5px; }
.lbl-inline { display: inline-flex; align-items: center; gap: 8px; font: 600 12px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.lbl-inline .ic { color: var(--accent); }

.error { display: flex; gap: 10px; padding: 12px 16px; margin-bottom: 14px; color: #ffd0d6; background: rgba(251, 113, 133, .12); border: 1px solid rgba(251, 113, 133, .5); border-radius: var(--r-md); }

/* ---------- KPI cards ---------- */
.hero { display: grid; grid-template-columns: 1.5fr repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.stat {
  position: relative; min-width: 0; padding: 14px 16px; overflow: hidden; background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .028)), var(--glass);
  border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.stat .k { font: 600 11px var(--font); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.stat .v { margin-top: 4px; font: 600 22px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.3px; }
.stat .s { margin-top: 2px; font-size: 12.5px; color: var(--ink-3); }
.stat .v.good, .banner .v.good { color: var(--pos); }
.stat .v.bad, .banner .v.bad { color: var(--neg); }
.stat.main { border-color: rgba(245, 177, 61, .5); background: radial-gradient(130% 150% at 0% 0%, rgba(245, 177, 61, .24), transparent 58%), linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .028)), var(--glass); }
.stat.main .v { font-size: 34px; color: #ffd48a; }
.stat.main .k { color: #f1cf95; }

.banner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.banner .cell { min-width: 0; padding: 12px 14px; background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .025)), var(--glass); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.banner .cell.lead { grid-column: span 2; border-color: rgba(245, 177, 61, .45); background: radial-gradient(130% 160% at 0% 0%, rgba(245, 177, 61, .2), transparent 60%), var(--glass); }
.banner .k { font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.banner .v { margin-top: 2px; font: 600 17px var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.banner .s { font-size: 12px; color: var(--ink-3); }
.adv summary { cursor: pointer; font-size: 12.5px; color: var(--ink-2); padding: 6px 0; }
.adv[open] summary { color: var(--ink); }
/* solid colour on purpose: no translucent surface, so it needs no reduced-transparency fallback */
.banner .note { grid-column: 1 / -1; padding: 10px 14px; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); background: #101a30; border: 1px solid var(--line); border-left: 3px solid #60a5fa; border-radius: var(--r-md); }

/* ---------- tabs ---------- */
.tabs { position: sticky; top: calc(var(--header-h) + 28px); z-index: 30; display: flex; gap: 4px; padding: 5px; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; border-radius: var(--r-lg); }
.tabs::-webkit-scrollbar { display: none; }
.tabs.more { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 44px), transparent); }
.tabs.more.start { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(90deg, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.tabs.end { -webkit-mask-image: linear-gradient(90deg, transparent, #000 44px); mask-image: linear-gradient(90deg, transparent, #000 44px); }
.tabs button { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 13px; cursor: pointer; white-space: nowrap; font: 500 13.5px var(--font); color: var(--ink-2); background: transparent; border: 0; border-radius: 11px; transition: background .16s var(--ease), color .16s var(--ease), box-shadow .2s var(--ease); }
.tabs button .ic { color: var(--ink-3); transition: color .16s var(--ease); }
.tabs button:hover { background: var(--fill-2); color: var(--ink); }
.tabs button.on { color: #fff; background: rgba(255, 255, 255, .11); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 0 26px -8px rgba(245, 177, 61, .7); }
.tabs button.on .ic { color: var(--accent); }
.tabpane { display: none; }
.tabpane.on { display: block; animation: rise .28s var(--ease); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- cards, tables, charts ---------- */
.card { padding: 20px 22px; margin-bottom: 16px; overflow: hidden; }
h3 { margin: 0 0 14px; font: 600 16px/1.3 var(--font); letter-spacing: .1px; }
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { padding: 8px 10px; text-align: left; font: 600 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line-2); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255, 255, 255, .03); }
.tbl td.num, .tbl th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl td.why { color: var(--ink-3); font-size: 13px; }
.lsmcrow { margin-top: 14px; flex-wrap: wrap; }
.greekgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.greekgrid .g { min-height: 262px; padding: 6px; background: rgba(255, 255, 255, .025); border: 1px solid var(--line-2); border-radius: var(--r-md); }
.plot { width: 100%; min-height: 360px; }
.plot.tall { min-height: 520px; }
.plot.xtall { min-height: 640px; }
.plot:not(.js-plotly-plot), .greekgrid .g:not(.js-plotly-plot) { background: linear-gradient(100deg, rgba(255, 255, 255, .03) 30%, rgba(255, 255, 255, .075) 45%, rgba(255, 255, 255, .03) 60%) 0 0 / 300% 100%; border-radius: var(--r-md); animation: shimmer 1.6s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
.render { width: 100%; height: auto; border-radius: var(--r-md); border: 1px solid var(--line); }
.wi-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 6px 0 16px; }
.wi-controls label { display: block; font: 500 13px var(--font); color: var(--ink-2); }
.wi-controls output { float: right; font: 600 13px var(--mono); color: var(--accent); }
.wi-controls input { margin-top: 6px; }
.wi-stats { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; }
.key-white { color: #fff; border-bottom: 1px dashed #fff; }
.key-amber { color: var(--accent); }

.check { display: grid; grid-template-columns: 64px 1fr; gap: 6px 14px; padding: 12px 0; align-items: baseline; border-bottom: 1px solid var(--line-2); }
.check:last-child { border-bottom: 0; }
.badge { padding: 4px 0; text-align: center; font: 600 11.5px var(--mono); border-radius: 7px; }
.badge.pass { color: #9cf0c9; background: rgba(52, 211, 153, .16); }
.badge.fail { color: #ffb0bb; background: rgba(251, 113, 133, .18); }
.check .d { grid-column: 2; font: 400 13px var(--mono); color: var(--ink-3); }

/* ---------- long-form text ---------- */
.prose h1 { margin: 0 0 8px; font: 700 26px/1.25 var(--font); letter-spacing: -.2px; }
.prose h2 { margin: 34px 0 12px; padding-top: 22px; font: 600 19px var(--font); border-top: 1px solid var(--line-2); text-transform: none; letter-spacing: 0; color: var(--ink); }
.prose h2:first-of-type { border-top: 0; padding-top: 0; }
.prose h3 { margin: 24px 0 8px; font: 600 15.5px var(--font); color: #ffd48a; }
.prose p, .prose li { color: #d0d8e6; max-width: 86ch; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin: 5px 0; }
.prose strong { color: var(--ink); }
.prose blockquote { margin: 14px 0; padding: 12px 18px; background: var(--fill); border-left: 3px solid var(--accent); border-radius: 0 var(--r-md) var(--r-md) 0; }
.prose blockquote p { margin: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line-2); margin: 26px 0; }
.prose table.tbl { display: block; overflow-x: auto; margin: 12px 0 18px; font-size: 13.5px; }
.prose table.tbl td, .prose table.tbl th { vertical-align: top; min-width: 96px; }
.prose table.tbl td:first-child { min-width: 130px; }
.prose .eq { margin: 10px 0 14px; padding: 12px 14px; overflow-x: auto; white-space: pre; font: 400 13px/1.6 var(--mono); color: var(--ink); background: rgba(0, 0, 0, .28); border: 1px solid var(--line-2); border-radius: var(--r-md); }

.foot { max-width: 1480px; margin: 0 auto; padding: 8px 24px 40px; text-align: center; font-size: 12.5px; color: var(--ink-3); }

/* ---------- toast + mobile bar ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; z-index: 250; max-width: calc(100% - 32px); padding: 11px 18px; font: 500 13.5px var(--font); color: var(--ink); background: rgba(12, 18, 34, .92); border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; box-shadow: 0 18px 44px rgba(0, 0, 0, .5); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.mbar { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; display: none; align-items: center; gap: 8px; padding: 8px 10px 8px 16px; border-radius: 999px; }
.mb-val { display: flex; flex-direction: column; margin-right: auto; line-height: 1.15; min-width: 0; }
.mb-val small { font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-val b { font: 600 18px var(--mono); color: #ffd48a; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .banner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { grid-template-columns: repeat(2, 1fr); }
  .stat.main { grid-column: 1 / -1; }
  .greekgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; padding: 0 12px 96px; }
  .inputs { position: static; max-height: none; overflow: visible; }
  .tabs { top: calc(var(--header-h) + 22px); }
  .mbar { display: flex; }
  .brand-text small { display: none; }
  .wi-controls { grid-template-columns: 1fr; }
  .wi-stats { grid-template-columns: repeat(2, 1fr); }
  .top { width: calc(100% - 24px); }
}
@media (max-width: 620px) {
  .top { padding: 8px 10px; }
  .top-links .btn span, .pill #dataPillText { display: none; }
  .pill { padding: 6px 9px; }
  .brand-text b { font-size: 15px; }
  .greekgrid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .stat .v { font-size: 19px; }
  .stat.main .v { font-size: 30px; }
  .welcome { padding: 20px 16px 16px; }
  .tabs button span { font-size: 13px; }
  .tbl { font-size: 13px; }
  .summary { flex-direction: column; align-items: stretch; }
}
@media (pointer: coarse) {
  input, select, .btn, .seg button, .tabs button { min-height: 46px; }
  .chip { min-height: 38px; }
  .tip { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
@media print {
  body::before, body::after, .top, .tabs, .inputs, .mbar { display: none !important; }
  .glass, .card, .stat { background: #fff !important; color: #000 !important; box-shadow: none !important; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

#glassToggle[aria-pressed="true"] { color: var(--accent); }

/* premium ↔ model comparison */
.fair { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; margin-bottom: 14px; font-size: 12.5px; color: var(--ink-2); background: rgba(245, 177, 61, .10); border: 1px solid rgba(245, 177, 61, .38); border-radius: var(--r-md); }
.fair small { display: block; font-size: 12px; color: var(--ink-2); }
.fair b { display: block; font: 600 20px var(--mono); color: #ffd48a; letter-spacing: -.2px; }
.basis { margin-top: 16px; }
.basis .seg { margin-bottom: 0; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }
.sum-chip.warn { color: #ffe6b3; background: rgba(245, 177, 61, .12); border-color: rgba(245, 177, 61, .5); }
