:root {
  color-scheme: dark;
  --bg: #070910;
  --surface: #0e111a;
  --surface-raised: #151a26;
  --surface-soft: #0a0d15;
  --surface-glass: rgba(14, 17, 26, .86);
  --border: #222838;
  --border-strong: #363e54;
  --text: #f5f7fc;
  --muted: #a7b0c3;
  --faint: #768198;
  --chart-text: #929db3;
  --accent: #8495ff;
  --accent-strong: #a66dff;
  --accent-soft: rgba(132, 149, 255, .14);
  --positive: #36d39a;
  --positive-soft: rgba(54, 211, 154, .12);
  --negative: #ff6f7d;
  --negative-soft: rgba(255, 111, 125, .12);
  --warning: #f6c45e;
  --model-iv: #58e0c2;
  --call: #62a9ff;
  --put: #b47cff;
  --shadow: 0 24px 70px rgba(0, 0, 0, .32);
  --shadow-soft: 0 12px 34px rgba(0, 0, 0, .16);
  --radius: 20px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root.light {
  color-scheme: light;
  --bg: #f3f5fa;
  --surface: #ffffff;
  --surface-raised: #fafbfe;
  --surface-soft: #eef1f7;
  --surface-glass: rgba(255, 255, 255, .88);
  --border: #dbe1ed;
  --border-strong: #c3ccdc;
  --text: #151925;
  --muted: #59657b;
  --faint: #738097;
  --chart-text: #657289;
  --accent: #536ee8;
  --accent-strong: #7b4fe0;
  --accent-soft: rgba(83, 110, 232, .10);
  --positive: #087b55;
  --positive-soft: rgba(8, 123, 85, .10);
  --negative: #c5314b;
  --negative-soft: rgba(197, 49, 75, .10);
  --warning: #936006;
  --model-iv: #087b6d;
  --call: #2678c9;
  --put: #7547bf;
  --shadow: 0 24px 65px rgba(26, 39, 68, .13);
  --shadow-soft: 0 12px 32px rgba(26, 39, 68, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 13% -10%, rgba(100, 122, 255, .14), transparent 34rem),
    radial-gradient(circle at 90% 11%, rgba(151, 86, 255, .10), transparent 30rem),
    linear-gradient(rgba(132, 149, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(132, 149, 255, .018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, auto, 34px 34px, 34px 34px, auto;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  left: 1rem;
  top: 1rem;
  transform: translateY(-180%);
  padding: .65rem 1rem;
  border-radius: .6rem;
  background: var(--text);
  color: var(--bg);
  text-decoration: none;
  font-weight: 700;
}
.skip-link:focus { transform: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  display: flex;
  align-items: center;
  gap: 2rem;
  min-height: 64px;
  padding: .7rem clamp(1rem, 4vw, 3.5rem);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 78%, transparent);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .025);
  backdrop-filter: blur(22px) saturate(135%);
}

.brand {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  text-decoration: none;
  font-size: 1.16rem;
  font-weight: 790;
  letter-spacing: -.052em;
  white-space: nowrap;
}
.brand-word {
  display: inline-block;
  line-height: 1;
}
.brand-word > span {
  background: linear-gradient(110deg, var(--accent), var(--accent-strong));
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
}
.header-note {
  flex: 1;
  margin: 0;
  color: var(--faint);
  font-size: .78rem;
}
.header-actions { display: flex; align-items: center; gap: .8rem; }
.market-state {
  color: var(--muted);
  font-size: .75rem;
  font-variant-numeric: tabular-nums;
}
.icon-button {
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
}
.icon-button:hover { border-color: var(--border-strong); color: var(--text); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.back-link { color: var(--muted); font-size: .82rem; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--text); }

main { width: 100%; }
.search-shell {
  padding: clamp(2.4rem, 7vw, 5.8rem) clamp(1rem, 4vw, 3.5rem) 2.2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 34%, transparent), transparent 78%);
  transition: padding .28s ease;
}
.search-copy, .ticker-form, .quick-tickers, .workspace {
  width: min(1420px, 100%);
  margin-inline: auto;
}
.search-copy { max-width: 780px; margin-inline: max(0px, calc((100% - min(1420px, 100%)) / 2)) auto; }
.eyebrow {
  margin: 0 0 .35rem;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(2.15rem, 4.8vw, 4rem);
  line-height: 1.01;
  letter-spacing: -.062em;
}
.search-copy > p:last-child {
  max-width: 680px;
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: clamp(.95rem, 1.5vw, 1.08rem);
}

.ticker-form {
  display: grid;
  grid-template-columns: minmax(230px, 1.4fr) minmax(220px, .8fr) auto;
  align-items: end;
  gap: .8rem;
  margin-top: 2.4rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--border-strong) 72%, transparent);
  border-radius: var(--radius);
  background: var(--surface-glass);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px) saturate(130%);
}
.field { display: grid; gap: .38rem; }
.field label, .compact-field {
  color: var(--muted);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .02em;
}
.field-help { color: var(--faint); font-size: .68rem; }
.input-group { position: relative; }
.input-group svg {
  position: absolute;
  left: .9rem;
  top: 50%;
  width: 18px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--faint);
  stroke-width: 1.7;
}
input, select {
  min-height: 45px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--text);
}
input { width: 100%; padding: .7rem .85rem; }
.input-group input {
  padding-left: 2.7rem;
  font-size: 1rem;
  font-weight: 750;
  letter-spacing: .04em;
  text-transform: uppercase;
}
select { width: 100%; padding: .7rem 2.2rem .7rem .85rem; }
input:hover, select:hover { border-color: var(--border-strong); }
input:focus, select:focus { border-color: var(--accent); }
select:disabled { cursor: not-allowed; opacity: .55; }
.primary-button, .secondary-button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border-radius: 11px;
  font-weight: 750;
}
.primary-button {
  padding: .75rem 1.4rem;
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 12px 30px rgba(91, 111, 228, .30), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.primary-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.primary-button:disabled { cursor: wait; filter: grayscale(.4); opacity: .62; transform: none; }
.primary-button svg { width: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.secondary-button {
  padding: .65rem 1rem;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: .78rem;
}
.secondary-button:hover { border-color: var(--accent); }
.quick-tickers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem;
  margin-top: .9rem;
  color: var(--faint);
  font-size: .7rem;
}
.quick-tickers button {
  padding: .32rem .66rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 800;
}
.quick-tickers button:hover { border-color: var(--accent); color: var(--text); }

.has-results .search-shell {
  position: sticky;
  z-index: 90;
  top: 64px;
  padding-top: .8rem;
  padding-bottom: .8rem;
  background: color-mix(in srgb, var(--bg) 91%, transparent);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .12);
  backdrop-filter: blur(22px) saturate(130%);
}
.has-results .search-copy { display: none; }
.has-results .ticker-form {
  margin-top: 0;
  padding: .8rem;
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}
.has-results .quick-tickers { display: none; }

.workspace { padding: 1.2rem 0 4rem; }
.status-row {
  display: flex;
  min-height: 34px;
  align-items: center;
  gap: .65rem;
  padding-inline: clamp(1rem, 2vw, 0);
  color: var(--muted);
  font-size: .75rem;
}
.status-row p { margin: 0; }
.status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--faint);
}
.status-dot.loading { background: var(--warning); animation: pulse 1.1s ease-in-out infinite; }
.status-dot.ok { background: var(--positive); }
.status-dot.warning { background: var(--warning); }
.status-dot.error { background: var(--negative); }
@keyframes pulse { 50% { opacity: .25; transform: scale(.72); } }
.text-button, .footer-button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: var(--accent);
  font-size: inherit;
  font-weight: 700;
}
.status-row .text-button { margin-left: auto; }
.loading-panel {
  margin: 1rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: .8rem;
}
.loading-panel p { margin: .7rem 0 0; }
.loading-line { height: 2px; overflow: hidden; border-radius: 2px; background: var(--border); }
.loading-line::after {
  display: block;
  width: 35%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  content: "";
  animation: load 1.2s ease-in-out infinite;
}
@keyframes load { from { transform: translateX(-110%); } to { transform: translateX(310%); } }
.empty-state {
  display: grid;
  min-height: 390px;
  place-items: center;
  align-content: center;
  padding: 2rem;
  text-align: center;
}
.empty-state h2 { margin: 1rem 0 .3rem; font-size: 1.15rem; }
.empty-state p { max-width: 510px; margin: 0; color: var(--muted); font-size: .83rem; }
.empty-graphic { display: flex; height: 64px; align-items: end; gap: 6px; }
.empty-graphic span {
  width: 8px;
  border-radius: 6px;
  background: linear-gradient(to top, var(--accent), var(--accent-strong));
  opacity: .4;
}
.empty-graphic span:nth-child(1) { height: 22px; }
.empty-graphic span:nth-child(2) { height: 42px; }
.empty-graphic span:nth-child(3) { height: 64px; opacity: .8; }
.empty-graphic span:nth-child(4) { height: 35px; }
.empty-graphic span:nth-child(5) { height: 50px; }

#results { padding-inline: clamp(1rem, 2.3vw, 0); }
.quote-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem 0 1rem;
}
.quote-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem; }
.quote-line h2 { margin: 0; font-size: clamp(1.65rem, 4vw, 2.25rem); letter-spacing: -.04em; }
#quotePrice { color: var(--muted); font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 450; }
.change-pill {
  padding: .28rem .6rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
}
.change-pill.positive { background: var(--positive-soft); color: var(--positive); }
.change-pill.negative { background: var(--negative-soft); color: var(--negative); }
.freshness { margin: .35rem 0 0; color: var(--faint); font-size: .7rem; }
.balance-badge {
  display: flex;
  align-items: center;
  gap: .65rem;
  padding: .7rem .9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
.balance-badge > span { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.balance-badge small, .balance-badge strong { display: block; }
.balance-badge small { color: var(--faint); font-size: .61rem; text-transform: uppercase; letter-spacing: .08em; }
.balance-badge strong { margin-top: .05rem; font-size: .77rem; text-transform: capitalize; }
.balance-badge.positive > span { background: var(--positive); }
.balance-badge.negative > span { background: var(--negative); }

.assumption-banner {
  display: flex;
  align-items: center;
  gap: .8rem;
  margin-bottom: 1rem;
  padding: .85rem 1rem;
  border: 1px solid color-mix(in srgb, var(--warning) 24%, var(--border));
  border-radius: 13px;
  background: color-mix(in srgb, var(--warning) 5%, var(--surface));
}
.assumption-banner svg { width: 18px; flex: 0 0 auto; fill: none; stroke: var(--warning); stroke-width: 1.7; }
.assumption-banner p { flex: 1; margin: 0; color: var(--muted); font-size: .73rem; }
.assumption-banner strong { color: var(--text); }

.scope-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(155px, 190px);
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: .9rem 1rem;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 16px;
  background:
    linear-gradient(115deg, color-mix(in srgb, var(--accent-soft) 68%, transparent), transparent 46%),
    var(--surface);
  box-shadow: var(--shadow-soft);
}
.scope-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--border));
  border-radius: 11px;
  background: var(--accent-soft);
  color: var(--accent);
}
.scope-icon svg { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.scope-copy { min-width: 0; }
.scope-copy > span {
  display: block;
  color: var(--accent);
  font-size: .59rem;
  font-weight: 820;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.scope-copy strong {
  display: block;
  margin-top: .12rem;
  overflow: hidden;
  font-size: .88rem;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-copy p { margin: .1rem 0 0; color: var(--faint); font-size: .67rem; }
.scope-applies {
  padding: .35rem .6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .62rem;
  font-weight: 750;
  white-space: nowrap;
}
.scope-range { min-width: 0; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}
.metric-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 1.05rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--surface-raised) 60%, transparent), var(--surface) 58%);
  box-shadow: var(--shadow-soft);
  transition: border-color .18s ease, transform .18s ease;
}
.metric-card::before {
  position: absolute;
  top: 0;
  right: 14%;
  left: 14%;
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--accent) 55%, transparent), transparent);
  content: "";
}
.metric-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.metric-card.primary {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 95%, transparent), var(--surface) 72%);
}
.metric-heading { display: flex; align-items: center; justify-content: space-between; gap: .3rem; color: var(--faint); font-size: .64rem; font-weight: 750; letter-spacing: .035em; text-transform: uppercase; }
.metric-heading h3 { margin: 0; color: inherit; font: inherit; letter-spacing: inherit; text-transform: inherit; }
.info-button {
  display: grid;
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  font-size: .62rem;
  line-height: 1;
}
.info-button:hover, .info-button:focus { color: var(--text); }
.info-popover {
  position: fixed;
  z-index: 300;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  width: min(330px, calc(100vw - 2rem));
  padding: .8rem;
  pointer-events: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
  text-align: left;
  text-transform: none;
}
.metric-card > strong { display: block; margin-top: .7rem; font-size: clamp(1.08rem, 1.9vw, 1.42rem); letter-spacing: -.042em; font-variant-numeric: tabular-nums; }
.metric-card > small { display: block; margin-top: .25rem; overflow: hidden; color: var(--faint); font-size: .63rem; text-overflow: ellipsis; white-space: nowrap; }
.value-positive { color: var(--positive) !important; }
.value-negative { color: var(--negative) !important; }

.analysis-card, .table-card, .source-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(165deg, color-mix(in srgb, var(--surface-raised) 34%, transparent), var(--surface) 40%);
  box-shadow: var(--shadow-soft);
}
.analysis-card { margin-bottom: 1rem; padding: clamp(1rem, 2.3vw, 1.5rem); }
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.3rem;
}
.section-heading h2 { margin: 0; font-size: 1.08rem; letter-spacing: -.03em; }
.section-heading p:not(.eyebrow) { margin: .25rem 0 0; color: var(--faint); font-size: .7rem; }
.chart-controls { display: flex; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: .65rem; }
.segmented {
  display: flex;
  overflow-x: auto;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 11px;
  background: var(--surface-soft);
  scrollbar-width: none;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented button {
  padding: .45rem .72rem;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 720;
  white-space: nowrap;
}
.segmented button[aria-selected="true"] {
  background: linear-gradient(135deg, var(--accent-soft), color-mix(in srgb, var(--accent-soft) 42%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 28%, transparent);
  color: var(--accent);
}
.compact-field { display: grid; gap: .25rem; white-space: nowrap; }
.compact-field select, .compact-field input { min-height: 34px; padding-top: .3rem; padding-bottom: .3rem; font-size: .72rem; }
.compact-field input { width: 135px; }
.chart-scale-field select { min-width: 112px; }
.chart-scale-field[data-inactive="true"] { opacity: .52; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: .95rem 0 .55rem; color: var(--faint); font-size: .64rem; }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 16px; height: 3px; border-radius: 3px; background: var(--faint); }
.legend i.positive { background: var(--positive); }
.legend i.negative { background: var(--negative); }
.legend i.spot { height: 0; border-top: 1px dashed var(--warning); background: transparent; }
.legend i.zero-gamma { height: 0; border-top: 1px dashed var(--accent); background: transparent; }
.legend i.max-pain { height: 0; border-top: 1px dotted var(--muted); background: transparent; }
.legend i.call { background: var(--call); }
.legend i.put { background: var(--put); }
.legend i.call-line { height: 0; border-top: 2px solid var(--call); background: transparent; }
.legend i.put-line { height: 0; border-top: 2px solid var(--put); background: transparent; }
.legend i.model-line { height: 0; border-top: 3px solid var(--model-iv); background: transparent; }
.chart-frame {
  position: relative;
  width: 100%;
  min-height: 400px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
  border-radius: 15px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--surface-raised) 56%, transparent), transparent 58%),
    var(--surface-soft);
}
.chart-frame.small { min-height: 280px; }
.data-chart { width: 100%; height: 400px; overflow: visible; }
.chart-frame.small .data-chart { height: 280px; }
.data-chart text { fill: var(--chart-text); font-family: var(--font); font-size: 11px; font-variant-numeric: tabular-nums; }
.data-chart .grid-line { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.data-chart .grid-line.vertical { opacity: .52; }
.data-chart .axis-line { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.data-chart .zero-line { stroke: var(--faint); stroke-width: 1; }
.data-chart .reference-line { pointer-events: none; stroke-width: 1.2; }
.data-chart .reference-line.spot { stroke: var(--warning); stroke-dasharray: 5 4; }
.data-chart .reference-line.zero-gamma { stroke: var(--accent); stroke-dasharray: 3 3; }
.data-chart .reference-line.max-pain { stroke: var(--muted); stroke-dasharray: 1 4; }
.data-chart .reference-label { paint-order: stroke; stroke: var(--surface-soft); stroke-width: 4px; stroke-linejoin: round; font-size: 9px; font-weight: 780; }
.data-chart .reference-label.spot { fill: var(--warning); }
.data-chart .reference-label.zero-gamma { fill: var(--accent); }
.data-chart .reference-label.max-pain { fill: var(--muted); }
.data-chart .positive-bar { fill: var(--positive); opacity: .82; }
.data-chart .negative-bar { fill: var(--negative); opacity: .82; }
.data-chart .clipped-bar { opacity: .92; }
.data-chart .clip-marker { pointer-events: none; stroke: var(--text); stroke-width: 1.6; }
.data-chart .clip-value {
  pointer-events: none;
  fill: var(--text);
  paint-order: stroke;
  stroke: var(--surface-soft);
  stroke-width: 4px;
  stroke-linejoin: round;
  font-size: 10px;
  font-weight: 780;
}
.data-chart .call-bar { fill: var(--call); opacity: .72; }
.data-chart .put-bar { fill: var(--put); opacity: .70; }
.data-chart .exposure-bar.active, .data-chart .call-bar.active, .data-chart .put-bar.active { opacity: 1; filter: brightness(1.15); }
.data-chart .model-path { fill: none; stroke: var(--model-iv); stroke-width: 2.8; }
.data-chart .call-path { fill: none; stroke: var(--call); stroke-width: 1.6; stroke-dasharray: 4 3; opacity: .72; }
.data-chart .put-path { fill: none; stroke: var(--put); stroke-width: 1.6; stroke-dasharray: 2 3; opacity: .72; }
.data-chart .point { stroke: var(--surface); stroke-width: 1.5; }
.data-chart .model-point { stroke-width: 1.8; }
.data-chart .hit { fill: transparent; pointer-events: all; }
.chart-tooltip {
  position: absolute;
  z-index: 20;
  max-width: 230px;
  padding: .55rem .65rem;
  pointer-events: none;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: color-mix(in srgb, var(--surface-raised) 94%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: .67rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.45;
}
.chart-summary { min-height: 1.2em; margin: .55rem .15rem 0; color: var(--faint); font-size: .67rem; }
.secondary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.analysis-card.compact { min-width: 0; }

.table-card { overflow: hidden; margin-bottom: 1rem; }
.table-heading { padding: 1rem 1.2rem; }
.table-actions { display: flex; align-items: end; gap: .6rem; }
.table-scroll { max-height: 520px; overflow: auto; border-top: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; font-size: .7rem; font-variant-numeric: tabular-nums; }
thead { position: sticky; z-index: 5; top: 0; }
th, td { padding: .62rem .75rem; border-bottom: 1px solid var(--border); text-align: right; white-space: nowrap; }
th { background: var(--surface-soft); color: var(--faint); font-weight: 750; }
th:first-child, td:first-child { position: sticky; left: 0; text-align: left; }
th:first-child { z-index: 6; background: var(--surface-soft); }
td:first-child { background: var(--surface); font-weight: 750; }
th button { padding: 0; border: 0; background: transparent; color: inherit; font-weight: inherit; }
th button:hover { color: var(--text); }
tbody tr:hover td { background: var(--surface-raised); }
tbody tr:hover td:first-child { background: var(--surface-raised); }
tbody tr[data-near-spot="true"] td { background: color-mix(in srgb, var(--warning) 5%, var(--surface)); }
.source-card {
  display: grid;
  grid-template-columns: minmax(180px, .65fr) 2fr auto;
  align-items: center;
  gap: 1.3rem;
  padding: 1.1rem 1.25rem;
}
.source-card h2 { margin: 0; font-size: .95rem; }
.source-card dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: .75rem; margin: 0; }
.source-card dl div { min-width: 0; }
.source-card dt { color: var(--faint); font-size: .6rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.source-card dd { margin: .1rem 0 0; overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }

footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1.2rem;
  padding: 1.6rem clamp(1rem, 4vw, 3.5rem);
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--faint);
  font-size: .7rem;
}
footer p { margin: 0; text-align: center; }
footer nav { display: flex; gap: 1rem; }
footer nav a, .footer-button { color: var(--muted); text-decoration: none; }
.compact-brand { font-size: .92rem; }

dialog {
  width: min(740px, calc(100% - 2rem));
  max-height: min(760px, calc(100vh - 2rem));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .5);
  color: var(--text);
}
dialog::backdrop { background: rgba(4, 6, 11, .76); backdrop-filter: blur(5px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.4rem; border-bottom: 1px solid var(--border); }
.dialog-header h2 { margin: 0; font-size: 1.2rem; }
.dialog-header .icon-button { font-size: 1.5rem; line-height: 1; }
.dialog-body { max-height: calc(100vh - 9rem); overflow-y: auto; padding: 1.25rem 1.4rem 1.8rem; }
.dialog-body section + section { margin-top: 1.35rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.dialog-body h3 { margin: 0 0 .35rem; font-size: .9rem; }
.dialog-body p { margin: 0; color: var(--muted); font-size: .78rem; }

.document { width: min(760px, calc(100% - 2rem)); margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) 0; }
.document h1 { font-size: clamp(2.2rem, 6vw, 4rem); }
.document-lead { margin: 1rem 0 3rem; color: var(--muted); font-size: 1.08rem; }
.document section { margin: 0 0 2rem; }
.document h2 { margin: 0 0 .45rem; font-size: 1.05rem; }
.document section p { margin: 0; color: var(--muted); }
.privacy-note { padding: 1rem 1.1rem; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); font-size: .8rem; }
.privacy-note strong { color: var(--text); }
.error-page {
  display: grid;
  width: min(680px, calc(100% - 2rem));
  min-height: calc(100vh - 64px);
  margin: 0 auto;
  place-content: center;
  justify-items: start;
  padding: 4rem 0 7rem;
}
.error-code {
  margin: 0 0 .8rem;
  color: var(--accent);
  font-size: clamp(3.5rem, 12vw, 7rem);
  font-weight: 800;
  letter-spacing: -.08em;
  line-height: .8;
}
.error-page h1 { max-width: 620px; margin: 0; font-size: clamp(2.1rem, 7vw, 4.5rem); letter-spacing: -.055em; line-height: 1.02; }
.error-page > p:not(.error-code) { max-width: 560px; margin: 1rem 0 1.8rem; color: var(--muted); font-size: 1rem; }
.error-home { width: auto; color: white; text-decoration: none; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .scope-bar { grid-template-columns: auto minmax(0, 1fr) minmax(155px, 185px); }
  .scope-applies { display: none; }
  .source-card { grid-template-columns: 1fr auto; }
  .source-card dl { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 760px) {
  .site-header { gap: .8rem; padding-inline: 1rem; }
  .header-note, .market-state { display: none; }
  .header-actions { margin-left: auto; }
  .search-shell { padding-top: 2.6rem; }
  .has-results .search-shell { position: static; padding-top: .85rem; padding-bottom: .85rem; }
  .ticker-form { grid-template-columns: 1fr; }
  .primary-button { width: 100%; }
  .workspace { padding-top: .8rem; }
  .status-row { flex-wrap: wrap; row-gap: .35rem; }
  .status-row p { min-width: 0; flex: 1 1 190px; }
  .status-row .text-button { flex: 0 0 auto; }
  .quote-header { align-items: flex-start; }
  .balance-badge { padding: .55rem .65rem; }
  .assumption-banner { align-items: flex-start; flex-wrap: wrap; }
  .assumption-banner p { min-width: calc(100% - 2rem); }
  .assumption-banner .text-button { margin-left: 1.8rem; }
  .scope-bar { grid-template-columns: auto minmax(0, 1fr); }
  .scope-range { grid-column: 1 / -1; }
  .scope-copy strong { white-space: normal; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { align-items: flex-start; flex-direction: column; }
  .chart-controls { width: 100%; justify-content: space-between; }
  .segmented { max-width: 100%; }
  .secondary-grid { grid-template-columns: 1fr; }
  .table-heading { align-items: flex-start; }
  .table-actions { width: 100%; justify-content: space-between; }
  .source-card { grid-template-columns: 1fr; }
  .source-card dl { grid-column: auto; grid-row: auto; grid-template-columns: 1fr; }
  .source-card .secondary-button { width: 100%; }
  footer { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .chart-frame, .data-chart { min-height: 330px; height: 330px; }
  .chart-frame.small, .chart-frame.small .data-chart { min-height: 270px; height: 270px; }
}

@media (max-width: 440px) {
  .quote-header { flex-direction: column; }
  .chart-controls { align-items: stretch; flex-direction: column; }
  .compact-field select { width: 100%; }
  .table-actions { align-items: stretch; flex-direction: column; }
  .compact-field input { width: 100%; }
  .table-actions .secondary-button { width: 100%; }
}

@media (max-width: 350px) {
  .metric-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .site-header, .search-shell, .status-row, .chart-controls, .table-actions, footer, .assumption-banner button { display: none !important; }
  body { background: white; color: black; }
  #results { padding: 0; }
  .analysis-card, .table-card, .metric-card, .source-card { break-inside: avoid; box-shadow: none; }
}
