:root {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #19283e;
  background: #f7f8fa;
  font-synthesis: none;
  --muted: #53657c;
  --line: #dce3ec;
  --blue: #245cde;
  --teal: #137b72;
  --mono: ui-monospace, SFMono-Regular, Consolas, monospace;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-underline-offset: 4px; }
button, input, select { font: inherit; }
button { border: 1px solid #ccd6e3; background: white; border-radius: 7px; padding: 9px 13px; font-size: 12px; font-weight: 550; cursor: pointer; color: #263953; }
button:hover { background: #eef3fc; border-color: #9caec8; }
button:disabled { opacity: .5; cursor: wait; }
.primary { background: var(--blue); color: white; border-color: var(--blue); }
.primary:hover { background: #194ec6; color: white; }
button:focus-visible, a:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #698fff; outline-offset: 4px; }
[hidden] { display: none !important; }
.wrap { width: min(1080px, calc(100% - 64px)); margin: auto; }
.topbar { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; text-decoration: none; }
.brand-mark { padding: 8px; border: 1px solid #bdc9da; border-radius: 6px; background: white; font: 12px var(--mono); }
nav { display: flex; gap: 24px; font-size: 12px; }
nav a { text-decoration: none; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 30px 0 24px; }
h1 { font-size: clamp(24px, 3vw, 32px); letter-spacing: -.04em; font-weight: 600; margin: 0; }
.page-heading p { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 9px 0 0; overflow-wrap: anywhere; }
.divider { margin: 0 10px; color: #65768b; }
.actions { display: flex; flex-wrap: wrap; gap: 7px; flex-shrink: 0; }
.workspace { padding: 24px; background: white; border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 4px 20px #263a5509; }
.status { font-size: 12px; line-height: 1.6; color: var(--muted); margin: 0 0 18px; }
.status:empty { display: none; }
.status.error { color: #92312a; background: #fff4f2; padding: 12px; border-radius: 6px; }
.controls { display: grid; grid-template-columns: minmax(0,1fr) 26px minmax(0,1fr) 152px; gap: 13px; align-items: end; }
.controls > label > span { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; }
.baseline { background: var(--blue); }
.candidate { background: var(--teal); }
select { width: 100%; border: 1px solid #cdd7e5; border-radius: 6px; background: white; padding: 10px 28px 10px 10px; color: #24364f; font-size: 12px; min-width: 0; }
.swap { padding: 8px 0; border: 0; font-size: 20px; color: var(--muted); background: transparent; }
.statistic { border: 0; padding: 0; margin: 0; }
.statistic legend { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.segmented { display: flex; border: 1px solid #d7dfeb; border-radius: 6px; padding: 3px; background: #f4f6fa; height: 37px; }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.segmented span { display: flex; justify-content: center; align-items: center; height: 100%; font-size: 11px; border-radius: 4px; color: var(--muted); }
.segmented input:checked + span { background: white; color: #1e3a60; box-shadow: 0 1px 4px #263a5520; }
.segmented input:focus-visible + span { outline: 3px solid #698fff; }
.result-strip { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 23px 0 0; }
.result-strip h2 { font-size: 21px; letter-spacing: -.03em; font-weight: 550; margin: 0; }
.flags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 7px; }
.pill { padding: 5px 8px; background: #f0f3f8; border: 1px solid #e1e7ef; border-radius: 5px; font-size: 10px; color: #485d76; }
.pill.caution { color: #79501c; background: #fff7e9; border-color: #ead9b6; }
.metric-cards { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin: 23px 0 26px; }
.metric-card { min-width: 0; padding: 0 18px; border-right: 1px solid #e4eaf2; }
.metric-card:first-child { padding-left: 0; }
.metric-card:last-child { padding-right: 0; border: 0; }
.metric-card h3 { font-size: 11px; font-weight: 500; color: var(--muted); margin: 0 0 10px; }
.metric-value { font-size: clamp(20px, 2.5vw, 28px); letter-spacing: -.04em; font-weight: 600; overflow-wrap: anywhere; }
.metric-value small { font: 10px var(--mono); color: var(--muted); margin-left: 4px; }
.metric-detail { font: 10px var(--mono); color: var(--muted); margin-top: 7px; overflow-wrap: anywhere; }
.delta { display: inline-block; font-size: 10px; font-weight: 550; margin-top: 11px; color: #176e58; background: #edf7f2; padding: 4px 6px; border-radius: 4px; }
.delta.increase { background: #fff5e8; color: #805015; }
.delta.neutral { background: #f0f3f8; color: var(--muted); }
.chart-panel { border-top: 1px solid #e4eaf2; padding-top: 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.panel-title h3 { font-size: 13px; margin: 0; font-weight: 550; }
.panel-title select { max-width: 190px; font-size: 11px; padding: 7px 24px 7px 9px; }
#chart { padding-top: 23px; }
.chart-row { display: grid; grid-template-columns: minmax(125px, 190px) minmax(0,1fr); align-items: center; gap: 18px; margin: 0 0 17px; }
.chart-row-head { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 11px; }
.chart-row-head span { overflow-wrap: anywhere; }
.chart-row-head strong { font: 500 11px var(--mono); }
.track { position: relative; height: 22px; border-left: 1px solid #cbd6e5; background: repeating-linear-gradient(90deg,#f3f6fa 0,#f3f6fa calc(25% - 1px),#e4eaf3 calc(25% - 1px),#e4eaf3 25%); }
.bar { height: 100%; background: #cbd6e7; border-radius: 0 3px 3px 0; min-width: 1px; transition: width .18s; }
.bar.is-baseline { background: var(--blue); }
.bar.is-candidate { background: var(--teal); }
.range { position: absolute; height: 10px; top: 6px; border-left: 2px solid #122b4c; border-right: 2px solid #122b4c; min-width: 2px; z-index: 1; }
.range:after { content: ""; position: absolute; left: 0; right: 0; top: 4px; border-top: 1px solid #122b4c; }
.chart-scale { display: flex; justify-content: space-between; margin-left: 208px; font: 9px var(--mono); color: var(--muted); }
.chart-caption { font-size: 10px; line-height: 1.6; color: var(--muted); margin: 15px 0 0; }
.evidence { padding: 16px 0 25px; }
details { background: white; border: 1px solid var(--line); border-radius: 7px; margin-bottom: 9px; }
summary { font-size: 12px; padding: 16px 18px; cursor: pointer; font-weight: 550; }
summary span { color: var(--muted); font-size: 10px; font-weight: 400; margin-left: 10px; }
.detail-content { padding: 0 18px 18px; }
#changes { display: flex; flex-wrap: wrap; gap: 16px 30px; padding: 10px 0 17px; }
.change-row { display: flex; flex-direction: column; gap: 6px; font-size: 11px; }
.change-row span:first-child { color: var(--muted); }
#comparison-notes { margin: 0 0 20px; padding-left: 18px; font-size: 12px; line-height: 1.7; color: #465a73; }
#comparison-notes li { margin-bottom: 8px; }
.metadata { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; border-top: 1px solid var(--line); padding-top: 20px; }
.meta-item span { display: block; font-size: 10px; color: var(--muted); margin-bottom: 7px; }
.meta-item strong { display: block; font-size: 12px; font-weight: 450; line-height: 1.5; overflow-wrap: anywhere; }
.table-scroll { overflow-x: auto; padding: 0 18px 17px; }
table { width: 100%; border-collapse: collapse; font: 10px var(--mono); white-space: nowrap; }
caption { text-align: left; color: var(--muted); font-size: 10px; margin: 0 0 12px; }
th { color: var(--muted); font-weight: 500; text-align: right; padding: 10px; border-bottom: 1px solid var(--line); }
td { text-align: right; padding: 11px 10px; border-bottom: 1px solid #edf1f6; }
th:first-child, td:first-child { text-align: left; }
tr:last-child td { border: 0; }
.provenance { font-size: 10px; line-height: 1.8; color: var(--muted); margin-top: 18px; overflow-wrap: anywhere; }
.provenance a { margin-right: 14px; }
.data-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 10px; color: var(--muted); padding-top: 10px; }
.data-actions button { border: 0; padding: 0; background: transparent; font-size: 10px; color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }
footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--line); padding: 20px 0 30px; font-size: 10px; color: var(--muted); }
.skip:not(:focus) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.skip:focus { position: fixed; top: 10px; left: 10px; background: white; padding: 15px; z-index: 10; }
@media(max-width:850px) {
  .wrap { width: calc(100% - 36px); }
  .page-heading { align-items: flex-start; }
  .controls { grid-template-columns: minmax(0,1fr) 24px minmax(0,1fr); }
  .statistic { grid-column: 1/-1; width: 152px; }
  .metric-card { padding: 0 10px; }
  .metadata { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media(max-width:600px) {
  .wrap { width: calc(100% - 28px); }
  .page-heading { flex-direction: column; gap: 15px; padding: 24px 0 18px; }
  h1 { font-size: 27px; }
  .workspace { padding: 17px; }
  .controls { gap: 8px; }
  select { font-size: 10px; padding-left: 7px; }
  .result-strip { align-items: flex-start; flex-direction: column; gap: 10px; }
  .result-strip h2 { font-size: 21px; }
  .flags { justify-content: flex-start; }
  .metric-cards { grid-template-columns: repeat(2,minmax(0,1fr)); row-gap: 23px; }
  .metric-card:nth-child(2) { border: 0; padding-right: 0; }
  .metric-card:nth-child(3) { padding-left: 0; }
  .metric-value { font-size: 26px; }
  .chart-row { grid-template-columns: minmax(0,1fr); gap: 7px; margin-bottom: 18px; }
  .chart-row-head { flex-direction: row; justify-content: space-between; gap: 12px; }
  .chart-row-head strong { flex-shrink: 0; }
  .chart-scale { margin-left: 0; }
  .panel-title select { max-width: 167px; font-size: 10px; }
  .panel-title h3 { font-size: 12px; }
  summary span { display: block; margin: 6px 0 0 14px; }
  footer { font-size: 9px; }
}
@media(prefers-reduced-motion:reduce) { .bar { transition: none; } }
