:root {
  color-scheme: dark;
  --bg: #0e1217;
  --surface: #151b22;
  --raised: #1b232c;
  --line: #2d3843;
  --muted: #a5b1be;
  --text: #edf1ef;
  --accent: #d1f586;
  --blue: #98c5ee;
  --red: #f6a49c;
  --mono: "IBM Plex Mono", monospace;
  --sans: Inter, system-ui, sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); }
button, input, select { font: inherit; }
button, summary { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { width: min(1220px, calc(100% - 64px)); margin-inline: auto; }
.site-head { border-bottom: 1px solid var(--line); }
.head-inner { display: flex; align-items: center; gap: 13px; min-height: 62px; }
.brand-group { display: flex; align-items: center; gap: 13px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 750; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.mark { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 3px; width: 29px; height: 29px; padding: 6px; background: var(--accent); border-radius: 6px; }
.mark i { height: 2px; border-radius: 2px; background: var(--bg); width: 100%; }
.mark i:first-child { width: 60%; }
.mark i:nth-child(2) { width: 80%; }
.version, .data-status { color: var(--muted); font: 11px var(--mono); }
.data-status { margin-left: auto; text-align: right; }

.author-credit { color: var(--muted); font-size: 12px; white-space: nowrap; }
.author-credit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.author-credit a:hover { color: var(--accent); }

main { padding-bottom: 40px; }
.intro { padding: 42px 0 25px; }
.intro h1 { margin: 0; font-size: clamp(36px, 5.4vw, 66px); font-weight: 750; line-height: 1.04; letter-spacing: -.062em; }
.intro em { color: var(--accent); font-style: normal; }
.intro p { max-width: 570px; margin: 14px 0 0; color: var(--muted); }
.tabs { display: flex; gap: 26px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 0 11px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 650; }
.tabs a[aria-current] { color: var(--accent); border-color: var(--accent); }

.workspace { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.view { min-width: 0; display: grid; gap: 14px; }
.panel { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
h2, h3 { margin: 0; letter-spacing: -.02em; }
h2 { font-size: 19px; line-height: 1.25; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }

.controls { padding: 18px; }
.controls h2 { margin-bottom: 16px; }
.controls label { display: grid; gap: 5px; margin-bottom: 11px; color: #c3cdd5; font-size: 12px; font-weight: 600; }
.controls input, .controls select { width: 100%; min-width: 0; min-height: 36px; padding: 7px 8px; border: 1px solid #394653; border-radius: 7px; background: #10161d; color: var(--text); font-size: 12px; }
.controls input { font-family: var(--mono); }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 8px; }
.controls fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.controls legend, summary { padding: 0; color: #c3cdd5; font-size: 12px; font-weight: 650; }
.range-pills, .chart-controls { display: flex; gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.range-pills { margin-top: 5px; }
.range-pills button, .chart-controls button { padding: 6px 8px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 650; }
.range-pills button { flex: 1; }
.range-pills button[aria-pressed=true], .chart-controls button[aria-pressed=true] { background: var(--raised); color: var(--accent); }
.range-hint { min-height: 18px; margin: 6px 0 0; font-size: 11px; }
.assumptions { margin-top: 10px; padding-top: 11px; border-top: 1px solid var(--line); }
.assumptions summary { margin-bottom: 0; }
.assumptions[open] summary { margin-bottom: 11px; }
.text-button { margin: 0 0 9px; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 12px; }

.section-head { padding: 17px 19px 12px; }
.section-head p, .methodology > p:first-of-type { margin: 5px 0 0; font-size: 12px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 19px; }
.card { padding: 13px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--raised); }
.card.lp { border-top-color: #8fae61; }
.card.hold { border-top-color: #6994b7; }
.card p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.card strong { display: block; margin: 5px 0 0; font: 600 clamp(19px, 3.2vw, 33px)/1.2 var(--mono); overflow-wrap: anywhere; }
.card .return { margin-top: 5px; font-family: var(--mono); }
.positive { color: var(--accent) !important; }
.negative { color: var(--red) !important; }
.verdict { padding: 13px 19px 15px; font-size: 13px; }
.verdict p { margin: 0; }
.verdict p + p { margin-top: 4px; }
.verdict a { display: inline-block; margin-top: 7px; }

.chart-panel { padding: 16px 19px 12px; }
.chart-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 5px 15px; margin: 10px 0 6px; color: var(--muted); font-size: 12px; }
.chart-legend span { display: flex; align-items: center; gap: 6px; }
.legend-dot { display: inline-block; width: 11px; height: 3px; border-radius: 2px; background: var(--accent); }
.legend-dot.hold { background: var(--blue); }
.legend-dot.band { height: 8px; border: 1px solid #668052; background: #293b2d; }
.chart-area { position: relative; height: clamp(220px, 24vw, 330px); }
.chart-area canvas { display: block; width: 100%; height: 100%; }
.chart-empty { position: absolute; inset: 6px 0; display: grid; place-content: center; margin: 0; padding: 14px; border: 1px dashed var(--line); border-radius: 8px; background: #11171e; color: var(--muted); text-align: center; }
.chart-tooltip { position: absolute; pointer-events: none; white-space: pre-line; max-width: 100%; padding: 6px 8px; border: 1px solid #43505b; border-radius: 6px; background: #1e2932; color: var(--text); font: 11px/1.45 var(--mono); }

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
th, td { padding: 8px 12px; border-top: 1px solid var(--line); text-align: right; }
th { background: #11171d; color: var(--muted); font-size: 11px; }
th:first-child, td:first-child { padding-left: 19px; text-align: left; }
th:last-child, td:last-child { padding-right: 19px; }
td small { display: block; color: var(--muted); font-size: 11px; }
.result { min-width: 76px; padding: 5px 7px; border: 1px solid transparent; border-radius: 6px; background: var(--raised); color: var(--text); font: 500 12px var(--mono); }
.result:hover { border-color: #637383; }
.result[aria-pressed=true] { border-color: #a2b96f; }
.result small { margin-top: 2px; font: 10px var(--sans); }

.methodology { padding: 18px 19px; }
.methodology h3 { margin-top: 19px; }
.methodology p, .methodology ol { font-size: 13px; }
.methodology ol { padding-left: 21px; }
.methodology li + li { margin-top: 6px; }
.source-list, .formula-list { display: grid; gap: 0; margin: 10px 0; }
.source-list > div, .formula-list > div { display: grid; grid-template-columns: 156px minmax(0, 1fr); gap: 8px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.source-list dt, .formula-list dt { color: var(--muted); font-size: 12px; }
.source-list dd, .formula-list dd { margin: 0; font-size: 13px; }
.methodology details { margin-top: 16px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.methodology details .table-scroll { margin-top: 10px; }
.methodology td { font: 11px var(--mono); }

@media (max-width: 850px) {
  .wrap { width: calc(100% - 38px); }
  .workspace { grid-template-columns: 225px minmax(0, 1fr); }
  .controls { padding: 14px; }
}

@media (max-width: 680px) {
  .wrap { width: calc(100% - 26px); }
  .head-inner { min-height: 54px; gap: 9px; padding-block: 8px; }
  .brand-group { flex-direction: column; align-items: flex-start; gap: 2px; }
  .author-credit { font-size: 11px; }
  .data-status { max-width: 155px; font-size: 10px; }
  .intro { padding-top: 28px; }
  .workspace { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .view { gap: 11px; }
  .section-head, .verdict, .chart-panel, .methodology, .cards { padding-inline: 13px; }
  .card { padding: 10px; }
  .card h3 { font-size: 13px; }
  .source-list > div, .formula-list > div { grid-template-columns: minmax(0, 1fr); gap: 3px; }
  th:first-child, td:first-child { padding-left: 13px; }
  th:last-child, td:last-child { padding-right: 13px; }
}
