:root {
  font-family: Inter, "Segoe UI", system-ui, sans-serif;
  color: #26314b;
  background: #f4f5f9;
  font-synthesis: none;
  --ink: #26314b;
  --muted: #687287;
  --line: #dfe3ed;
  --accent: #6254b7;
  --compare: #d87952;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-size: 16px; }
button, input { font: inherit; }
button, label.button, input[type=range], summary { cursor: pointer; }
button, a, input, summary { outline-offset: 4px; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #7b6bce; }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; padding: 18px 36px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 650; font-size: 21px; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; background: #343a76; color: #e3deff; border-radius: 12px; height: 43px; width: 43px; font-family: Georgia, serif; font-size: 37px; line-height: 1; padding-bottom: 7px; }
.brand small { display: block; font-size: 10px; font-weight: 650; letter-spacing: 2px; color: var(--muted); margin-top: 4px; }
.app-header nav { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 40px; border: 1px solid #d4d9e5; border-radius: 7px; background: #fff; color: var(--ink); padding: 9px 14px; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .15s; }
.button:hover { background: #f0eef9; border-color: #b7afd8; }
.button.quiet { border-color: transparent; background: transparent; }
.button.quiet:hover { background: #eeedf6; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: #4e4299; }
.full { width: 100%; }
.layout { display: grid; grid-template-columns: 285px minmax(0, 1fr); max-width: 1800px; margin: auto; }
.sidebar { padding: 32px 26px; border-right: 1px solid var(--line); background: #fbfbfd; min-height: calc(100vh - 88px); }
.eyebrow { font-size: 10px; letter-spacing: 1.6px; font-weight: 700; color: #797097; }
h1, h2, h3, p { margin-top: 0; }
.sidebar h1 { margin: 14px 0 12px; font-size: 28px; line-height: 1.26; letter-spacing: -.9px; font-weight: 600; }
.intro { color: var(--muted); font-size: 14px; line-height: 1.7; margin-bottom: 29px; }
fieldset { padding: 0; border: 0; margin: 0 0 23px; }
legend { font-size: 14px; font-weight: 650; margin-bottom: 11px; }
.model-picker label { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 7px; padding: 12px; margin-bottom: 8px; cursor: pointer; }
.model-picker label:has(input:checked) { background: #f0edf9; border-color: #b2a8d9; }
.model-picker input { accent-color: var(--accent); margin: 0; height: 16px; width: 16px; }
.model-picker strong { display: block; font-size: 14px; font-weight: 600; }
.model-picker small { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }
label { font-size: 14px; font-weight: 600; }
.field-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.field-heading>span { font-size: 13px; font-family: Georgia, serif; font-style: italic; color: var(--muted); }
input[type=number] { background: #fff; border: 1px solid #cfd6e3; border-radius: 6px; width: 100%; padding: 9px 11px; min-height: 41px; color: var(--ink); font-variant-numeric: tabular-nums; }
input[type=range] { accent-color: var(--accent); }
#rate-slider { width: 100%; margin: 12px 0 0; }
.field-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 7px 0 21px; }
.check-label { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.5; }
.check-label input { accent-color: var(--accent); height: 16px; width: 16px; margin: 0; }
.compare-control { margin-top: 23px; padding-top: 18px; border-top: 1px solid var(--line); }
#difference-field>label { display: block; margin-bottom: 8px; font-size: 13px; }
.presets { margin-top: 27px; padding-top: 24px; border-top: 1px solid var(--line); }
.presets h2 { font-size: 14px; font-weight: 650; margin-bottom: 7px; }
.presets button { display: flex; gap: 12px; align-items: center; background: transparent; border: 0; border-bottom: 1px solid #e7e9f0; padding: 13px 0; width: 100%; text-align: left; color: var(--ink); }
.presets button:hover strong { color: var(--accent); }
.presets strong { font-size: 13px; font-weight: 600; display: block; }
.presets small { display: block; margin-top: 5px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.preset-icon { font-size: 27px; color: #8c7cbe; width: 25px; text-align: center; }
.sidebar-note { margin: 28px 0 0; color: #83899a; font-size: 12px; line-height: 1.7; }
.workspace { padding: 33px 34px 20px; min-width: 0; }
.workspace-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.workspace-heading h2 { font-size: 28px; font-weight: 600; letter-spacing: -.8px; margin: 8px 0 0; }
.badge { border: 1px solid #d5d9e5; padding: 7px 9px; border-radius: 5px; font-size: 10px; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.equation-strip { display: flex; justify-content: space-between; gap: 20px; align-items: center; background: #eae8f5; border: 1px solid #ded9ef; border-radius: 9px; padding: 21px 24px; margin-bottom: 25px; }
.equation-strip span { display: block; font-size: 10px; letter-spacing: 1.4px; color: #776b98; font-weight: 650; margin-bottom: 9px; }
#equation { font-family: Georgia, "Times New Roman", serif; font-size: 25px; color: #443969; margin: 0; line-height: 1.6; }
#equation sub, #equation sup { font-size: .65em; }
.equation-strip>p { margin: 0; font-size: 13px; line-height: 1.7; color: #776c8c; max-width: 200px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); margin-bottom: 25px; padding: 0 0 23px; }
.stats>div { border-right: 1px solid var(--line); padding: 0 20px; }
.stats>div:first-child { padding-left: 0; }
.stats>div:last-child { border: 0; padding-right: 0; }
.stats span { display: block; color: var(--muted); font-size: 10px; font-weight: 650; letter-spacing: 1.1px; margin-bottom: 10px; }
.stats strong { display: block; font-size: 23px; letter-spacing: -.6px; font-weight: 550; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stats small { display: block; font-size: 11px; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 25px 14px; }
.panel-heading .eyebrow { font-size: 9px; letter-spacing: 1.5px; }
.panel-heading h3 { font-size: 17px; letter-spacing: -.2px; font-weight: 650; margin: 7px 0; }
.panel-heading p { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.5; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; color: var(--muted); font-size: 12px; }
.legend>span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 17px; height: 3px; border-radius: 3px; display: inline-block; }
.primary-swatch { background: var(--accent); }
.compare-swatch { background: var(--compare); }
.chart { padding: 0 16px; }
.chart svg { display: block; width: 100%; height: auto; }
.timeline { display: flex; align-items: center; gap: 17px; padding: 6px 25px 20px; }
.timeline label { display: flex; align-items: center; gap: 10px; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 400; }
.timeline output { font-weight: 650; color: var(--ink); min-width: 25px; }
.timeline input { min-width: 20px; width: 100%; }
.timeline>span { font-size: 11px; color: var(--muted); }
.chart-toolbar { border-top: 1px solid #eaecf2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding: 12px 25px; }
.chart-toolbar>span { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-toolbar>div { display: flex; gap: 4px; }
.chart-toolbar .button { min-height: 34px; font-size: 12px; padding: 7px 12px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; margin-top: 22px; }
.return-chart { max-width: 450px; margin: auto; }
.panel-footnote { border-top: 1px solid #eaecf2; padding: 15px 24px; color: var(--muted); font-size: 11px; line-height: 1.6; margin: 0; }
.orbit-panel { display: flex; flex-direction: column; }
.orbit-panel .table-scroll { flex: 1; }
.table-scroll { overflow: auto; padding: 0 24px 15px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
td, th { text-align: right; padding: 10px 7px; border-bottom: 1px solid #edf0f5; }
td:first-child, th:first-child { text-align: left; }
th { color: var(--muted); font-size: 11px; font-weight: 600; }
tr.selected { background: #f0edf9; color: #5b4ca1; font-weight: 650; }
.observation { display: flex; align-items: center; gap: 18px; margin-top: 23px; padding: 22px 25px; border: 1px dashed #d5d6e7; border-radius: 9px; }
.observation>span { color: #9687c4; font-size: 40px; }
.observation h3 { font-size: 14px; margin-bottom: 6px; }
.observation p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
.observation .button { font-size: 12px; margin-left: auto; flex-shrink: 0; }
footer { display: flex; justify-content: space-between; gap: 20px; color: #83899a; font-size: 10px; padding-top: 24px; line-height: 1.7; }
.notice { background: #eeedf8; color: #514579; border: 1px solid #d7d1ed; font-size: 14px; line-height: 1.5; padding: 12px 16px; border-radius: 7px; margin-bottom: 20px; }
.notice.error { background: #fff1eb; border-color: #e9c0b0; color: #934427; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; top: -70px; left: 20px; z-index: 10; background: var(--ink); color: #fff; padding: 12px; }
.skip-link:focus { top: 10px; }
dialog { width: calc(100% - 32px); max-width: 650px; max-height: 85vh; border: 1px solid var(--line); border-radius: 12px; padding: 26px 32px; color: var(--ink); box-shadow: 0 25px 100px #20254b33; }
dialog::backdrop { background: #171e3d77; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
dialog h2 { font-size: 27px; line-height: 1.3; margin: 22px 0; letter-spacing: -.5px; }
dialog h3 { font-size: 16px; margin: 24px 0 10px; }
dialog p, dialog li { font-size: 15px; line-height: 1.75; color: #626c81; }
dialog li { margin-bottom: 7px; }
dialog .field-note { font-size: 13px; }
@media (min-width: 1600px) {
  .layout { grid-template-columns: 310px minmax(0, 1fr); }
  .workspace { padding: 38px 48px 20px; }
  .sidebar { padding: 38px 33px; }
}
@media (max-width: 1200px) {
  .layout { grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar { padding: 28px 20px; }
  .workspace { padding: 28px 22px 18px; }
  .app-header { padding: 18px 24px; }
  .stats>div { padding: 0 12px; }
  .stats strong { font-size: 20px; }
  .equation-strip>p { max-width: 150px; font-size: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .return-chart { max-width: 400px; }
  .observation { flex-wrap: wrap; }
  .observation>div { flex: 1; }
}
@media (max-width: 800px) {
  .app-header { flex-wrap: wrap; padding: 18px 20px; gap: 18px; }
  .app-header nav { gap: 5px; }
  .app-header .button { font-size: 12px; padding: 8px 10px; }
  .layout { display: block; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); min-height: 0; padding: 24px 20px; }
  .sidebar h1 { font-size: 27px; }
  .sidebar h1 br { display: none; }
  .intro { margin-bottom: 24px; }
  .presets { display: none; }
  .sidebar-note { display: none; }
  .model-picker { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
  .model-picker legend { grid-column: 1/-1; }
  .model-picker label { margin-bottom: 0; padding: 12px 9px; gap: 8px; }
  .model-picker small { font-size: 10px; line-height: 1.5; }
  .model-picker strong { font-size: 13px; }
  .workspace { padding: 25px 20px 18px; }
  .workspace-heading { gap: 10px; }
  .workspace-heading h2 { font-size: 25px; }
  .workspace-heading .badge { display: none; }
  .workspace-heading .eyebrow { font-size: 9px; }
  .equation-strip { padding: 17px 18px; flex-wrap: wrap; gap: 8px; }
  #equation { font-size: 23px; }
  .equation-strip>p { max-width: none; font-size: 12px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 22px 0; }
  .stats>div:nth-child(odd) { padding-left: 0; }
  .stats>div:nth-child(even) { border: 0; padding-left: 16px; }
  .stats strong { font-size: 21px; }
  .stats span { font-size: 9px; }
  .stats small { font-size: 10px; }
  .panel-heading { padding: 20px 18px 12px; flex-wrap: wrap; gap: 13px; }
  .panel-heading h3 { font-size: 16px; }
  .panel-heading p { font-size: 12px; }
  .legend { font-size: 11px; margin-left: auto; }
  .chart { padding: 0 4px; }
  .timeline { padding: 8px 16px 18px; gap: 8px; }
  .timeline label { font-size: 11px; gap: 7px; }
  .chart-toolbar { padding: 12px 16px; }
  .chart-toolbar>span { font-size: 11px; }
  .chart-toolbar .button { font-size: 11px; }
  .observation { padding: 18px; gap: 12px; }
  .observation .button { margin-left: 30px; }
  .observation p { font-size: 12px; }
  footer { display: block; font-size: 10px; }
  footer span { display: block; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
