:root {
  color-scheme: dark;
  --page: oklch(0.176 0.021 282);
  --panel: oklch(0.226 0.026 283);
  --field: oklch(0.195 0.025 282);
  --raised: oklch(0.265 0.032 281);
  --line: oklch(0.326 0.036 282);
  --field-line: oklch(0.525 0.043 282);
  --ink: oklch(0.968 0.013 284);
  --muted: oklch(0.751 0.034 281);
  --accent: oklch(0.785 0.126 283);
  --action: oklch(0.838 0.106 283);
  --action-hover: oklch(0.890 0.077 283);
  --on-action: oklch(0.223 0.077 282);
  --mint: oklch(0.855 0.112 168);
  --error: oklch(0.831 0.108 20);
  --art-grid: oklch(0.60 0.1 282 / 0.14);
  --art-glow: oklch(0.48 0.155 285 / 0.27);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --mono: 'SF Mono', 'Cascadia Mono', 'Consolas', monospace;
}

:root[data-theme="light"] {
  color-scheme: light;
  --page: oklch(0.978 0.009 282);
  --panel: oklch(1 0 0);
  --field: oklch(0.982 0.008 282);
  --raised: oklch(0.949 0.022 283);
  --line: oklch(0.901 0.027 282);
  --field-line: oklch(0.650 0.044 281);
  --ink: oklch(0.229 0.048 283);
  --muted: oklch(0.472 0.049 282);
  --accent: oklch(0.478 0.194 282);
  --action: oklch(0.473 0.197 282);
  --action-hover: oklch(0.421 0.188 282);
  --on-action: oklch(0.99 0.004 282);
  --mint: oklch(0.443 0.101 169);
  --error: oklch(0.487 0.166 20);
  --art-grid: oklch(0.54 0.13 284 / 0.15);
  --art-glow: oklch(0.70 0.15 285 / 0.20);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.55 var(--font); background: var(--page); color: var(--ink); }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; line-height: 1.25; }
p { text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
:target { scroll-margin-top: 24px; }
.container { width: min(1160px, calc(100% - 80px)); margin-inline: auto; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 1.17em; height: 1.17em; display: inline-block; vertical-align: middle; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

.site-header { border-bottom: 1px solid var(--line); }
.header-inner { min-height: 70px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.wordmark { width: max-content; display: inline-flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 750; letter-spacing: 0.03em; }
.wordmark img { display: block; }
.wordmark small { color: var(--muted); font: 600 10px var(--mono); margin-left: 3px; letter-spacing: 0.1em; }
.main-nav { display: flex; align-items: center; gap: 32px; }
.main-nav a { color: var(--muted); font-size: 14px; padding-block: 8px; transition: color 160ms ease; }
.main-nav a:hover { color: var(--ink); }
.theme-switch, .segmented { display: inline-flex; gap: 3px; border: 1px solid var(--line); background: var(--field); border-radius: 9px; padding: 3px; }
.theme-switch { justify-self: end; }
.theme-switch button, .segmented button { border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 6px 10px; font-size: 12px; font-weight: 650; white-space: nowrap; transition: background 160ms ease, color 160ms ease; }
.theme-switch button { display: inline-flex; align-items: center; gap: 5px; }
.theme-switch button[aria-pressed="true"], .segmented button[aria-pressed="true"] { background: var(--raised); color: var(--ink); }
.theme-switch button:hover, .segmented button:hover { color: var(--ink); }

.hero { position: relative; isolation: isolate; min-height: 374px; display: flex; align-items: center; }
.hero-copy { z-index: 1; padding: 46px 0 45px; }
.hero-label { display: flex; align-items: center; gap: 9px; color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: 0.1em; }
.hero-label span { display: inline-block; width: 7px; height: 7px; border: 1px solid currentColor; transform: rotate(45deg); }
.hero h1 { margin: 14px 0; font-size: 64px; line-height: 1.10; font-weight: 790; letter-spacing: -0.035em; }
.hero h1 em { color: var(--accent); font-style: normal; }
.hero-desc { max-width: 34em; color: var(--muted); font-size: 16px; }
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 22px; margin-top: 27px; }
.hero-art { position: absolute; inset: 1px -18px 0 auto; width: 58%; overflow: hidden; background: radial-gradient(ellipse at 58% 48%, var(--art-glow), transparent 61%); }
.hero-art::before {
  content: ''; position: absolute; inset: 0;
  background-image: linear-gradient(to right, var(--art-grid) 1px, transparent 1px), linear-gradient(to bottom, var(--art-grid) 1px, transparent 1px);
  background-size: 34px 34px; background-position: center;
  mask-image: radial-gradient(ellipse at 58% 48%, black 9%, transparent 70%);
}
#orbit { position: relative; width: 100%; height: 100%; display: block; }
.orbit-toggle {
  position: absolute; z-index: 2; right: 6px; bottom: 20px;
  width: 38px; height: 38px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--field-line); border-radius: 50%; color: var(--muted);
  background: var(--field); transition: background 160ms ease, color 160ms ease;
}
.orbit-toggle:hover { background: var(--raised); color: var(--ink); }

.button { min-height: 45px; display: inline-flex; justify-content: center; align-items: center; gap: 9px; padding: 0 17px; border-radius: 9px; border: 1px solid transparent; font-weight: 700; font-size: 14px; white-space: nowrap; transition: background 160ms ease, border-color 160ms ease, transform 160ms ease; }
.button:active { transform: translateY(1px); }
.button.primary { background: var(--action); color: var(--on-action); }
.button.primary:hover { background: var(--action-hover); }
.button.secondary { background: var(--field); color: var(--ink); border-color: var(--line); }
.button.secondary:hover { background: var(--raised); border-color: var(--field-line); }
.button.compact { min-height: 38px; padding-inline: 13px; font-size: 13px; }
.quiet-link, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 650; transition: color 160ms ease; }
.quiet-link:hover, .text-button:hover { color: var(--accent); }
.text-button { border: 0; background: transparent; padding: 7px 0 7px 7px; }

.workbench { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); align-items: start; gap: 18px; }
.panel { background: var(--panel); border-radius: 15px; border: 1px solid var(--line); }
.input-panel, .results-panel { padding: 23px 24px 19px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-tools { display: flex; align-items: center; gap: 10px; }
.panel-head h2 { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 740; }
.heading-icon { color: var(--accent); width: 20px; height: 20px; }
.step-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 19px; padding: 4px; border-radius: 9px; background: var(--field); border: 1px solid var(--line); }
.step-tabs button { padding: 8px 4px; border: 0; border-radius: 6px; display: flex; align-items: center; justify-content: center; gap: 8px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 670; transition: color 160ms ease, background 160ms ease; }
.step-tabs button:hover { color: var(--ink); }
.step-tabs button span { font-family: var(--mono); font-size: 11px; }
.step-tabs button[aria-selected="true"] { color: var(--ink); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line); }
.step-tabs button[aria-selected="true"] span { color: var(--accent); }
.step { margin-top: 21px; }
.step-title { min-height: 32px; display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 15px; }
.step-title h3 { font-size: 18px; font-weight: 740; }
.grid.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#monthly-fields { margin-top: 13px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; }
.field label small { color: var(--muted); margin-left: 4px; font-weight: 500; }
.input-box { display: flex; align-items: center; gap: 9px; padding-inline: 11px; min-height: 44px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); transition: border-color 160ms ease, box-shadow 160ms ease; }
.input-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.input-box:has([aria-invalid="true"]) { border-color: var(--error); }
.input-box:has(input:disabled) { opacity: .62; }
.input-box input { width: 100%; min-width: 0; padding: 8px 0; font-weight: 650; font-size: 16px; font-variant-numeric: tabular-nums; color: var(--ink); border: 0; background: transparent; outline: 0; appearance: textfield; }
.input-box input::-webkit-inner-spin-button { appearance: none; }
.input-box input::placeholder, .slot-name::placeholder { color: var(--muted); }
.prefix, .suffix { color: var(--muted); font-size: 12px; flex: none; }
.prefix { font-size: 15px; }
.field-error, .form-message { color: var(--error); font-size: 12px; margin-top: 6px; }
.step-note { font-size: 12px; color: var(--muted); margin-top: 11px; }
.fit-intro { margin: -7px 0 13px; }
.fit-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 9px; padding: 10px 0; border-top: 1px solid var(--line); }
.fit-row label { display: block; font-size: 13px; font-weight: 650; }
.fit-row small { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
.fit-row select { color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 7px; font: 13px var(--font); padding: 6px 8px; min-height: 35px; }
.form-footer, .results-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; border-top: 1px solid var(--line); }
.form-footer { margin-top: 19px; padding-top: 14px; }
.form-state, .live { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.mobile-result { display: none; }
.form-state span, .live span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; }
.live { color: var(--mint); white-space: nowrap; }
.live span { background: currentColor; }
.results-panel { position: sticky; top: 18px; display: flex; flex-direction: column; min-height: 457px; }
.lead-metric { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding-block: 22px 19px; min-width: 0; }
.lead-metric h3, .ledger-head h3 { font-size: 13px; font-weight: 650; color: var(--muted); }
.hourly { display: flex; align-items: baseline; gap: 5px; margin: 1px 0 4px; font-variant-numeric: tabular-nums; line-height: 1.13; white-space: nowrap; }
.hourly strong { font-size: 53px; letter-spacing: -0.04em; font-weight: 720; }
.hourly[data-compact="true"] strong { font-size: 32px; letter-spacing: -0.02em; }
.currency { color: var(--accent); font-size: 27px; font-weight: 650; }
.hourly-unit, .metric-caption { color: var(--muted); font-size: 11px; }
@property --work-share {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}
.time-ring { width: 85px; height: 85px; margin-right: 6px; flex: none; padding: 6px; border-radius: 50%; background: conic-gradient(var(--accent) 0 var(--work-share, 0%), var(--mint) var(--work-share, 0%) var(--has-time, 0%), var(--line) var(--has-time, 0%)); transform: rotate(-22deg); transition: --work-share 240ms ease-out; }
.time-ring > div { height: 100%; display: grid; place-items: center; border-radius: 50%; background: var(--panel); color: var(--accent); font-size: 25px; transform: rotate(22deg); }
.summary-metrics { display: grid; grid-template-columns: 1.15fr 1fr 1fr; padding: 13px 0; border-block: 1px solid var(--line); }
.summary-metrics div { min-width: 0; padding-inline: 11px; border-left: 1px solid var(--line); }
.summary-metrics div:first-child { border: 0; padding-left: 0; }
.summary-metrics div:last-child { padding-right: 0; }
.summary-metrics span, .summary-metrics strong { display: block; }
.summary-metrics span { font-size: 11px; color: var(--muted); }
.summary-metrics strong { overflow-wrap: anywhere; font-size: 18px; font-weight: 670; font-variant-numeric: tabular-nums; }
.time-ledger { padding: 15px 0 14px; }
.ledger-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-variant-numeric: tabular-nums; gap: 8px; }
.time-track { display: flex; gap: 2px; background: var(--line); height: 7px; overflow: hidden; border-radius: 4px; margin: 9px 0 8px; }
.time-track span { display: block; width: 0%; transition: width 210ms ease-out; }
#work-bar, .swatch.work { background: var(--accent); }
#commute-bar, .swatch.commute { background: var(--mint); }
.ledger-legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.ledger-legend > div { display: flex; align-items: center; gap: 5px; }
.ledger-legend strong { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.swatch { width: 7px; height: 7px; display: inline-block; border-radius: 2px; }
.commute-impact { color: var(--muted); font-size: 12px; margin-top: 12px; }
.results-footer { margin-top: auto; padding-top: 11px; }
.results-footer p { font-size: 12px; color: var(--muted); }
.results-footer strong { margin-left: 4px; color: var(--ink); }

.section-block { margin-top: 25px; }
.section-heading { margin-bottom: 14px; }
.section-heading h2 { font-size: 24px; font-weight: 760; }
.section-heading p { margin-top: 5px; font-size: 13px; color: var(--muted); }
.scenario { padding: 23px 24px; }
.scenario-grid { display: grid; grid-template-columns: 1.08fr 1fr; gap: 30px; align-items: stretch; }
.scenario-switch { max-width: 100%; }
.range-label, .range-ends { display: flex; justify-content: space-between; gap: 8px; }
.range-label { font-size: 13px; margin-top: 13px; }
.range-ends { color: var(--muted); font: 11px/1.6 var(--mono); }
.range-label output { color: var(--accent); font: 650 13px/1.55 var(--mono); }
input[type="range"] { accent-color: var(--accent); width: 100%; margin: 6px 0 0; height: 22px; cursor: pointer; }
input[type="range"]:disabled { cursor: default; opacity: .5; }
.scenario-result { padding: 14px 17px; background: var(--field); border-radius: 10px; border: 1px solid var(--line); }
.scenario-result > span, .scenario-result p { font-size: 12px; color: var(--muted); }
.scenario-result > div { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.scenario-result strong { font-size: 27px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.delta { color: var(--mint); background: color-mix(in oklch, var(--mint) 12%, var(--field)); border-radius: 5px; padding: 2px 7px; font-size: 12px; font-variant-numeric: tabular-nums; }

.compare-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.compare-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.compare-slot { padding: 15px 18px; }
.slot-head { display: flex; justify-content: space-between; align-items: center; min-height: 33px; }
.slot-head h3 { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.slot-head h3 span { display: grid; place-items: center; width: 25px; height: 25px; background: var(--raised); border-radius: 6px; color: var(--accent); font: 700 13px var(--mono); }
.slot-name { display: block; width: 100%; margin-top: 9px; min-height: 38px; padding: 7px 10px; font-size: 14px; font-weight: 600; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 7px; }
.slot-summary { color: var(--muted); font-size: 12px; margin: 9px 0 11px; }
.compare-results { margin-top: 12px; padding: 15px 18px; }
#compare-insight { color: var(--ink); font-size: 13px; overflow-wrap: anywhere; padding: 2px 0 10px; }
.compare-results table { width: 100%; border-collapse: collapse; table-layout: fixed; text-align: left; font-size: 13px; font-variant-numeric: tabular-nums; }
.compare-results th, .compare-results td { padding: 10px 7px 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.compare-results th[scope="row"] { color: var(--muted); font-weight: 550; }
.compare-results td[data-better="true"] { color: var(--mint); font-weight: 700; }
.method details { border-top: 1px solid var(--line); padding: 11px 0; }
.method details:last-child { border-bottom: 1px solid var(--line); }
.method summary { width: fit-content; cursor: pointer; font-weight: 620; font-size: 14px; }
.method details p { color: var(--muted); max-width: 66ch; margin: 7px 0 1px 15px; font-size: 13px; }
.site-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 20px 0 25px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.site-footer .icon { margin-right: 5px; }

@media (max-width: 1000px) {
  .container { width: calc(100% - 48px); }
  .hero { min-height: 344px; }
  .hero h1 { font-size: 57px; }
  .hero-art { width: 57%; inset-inline-end: -14px; }
  .input-panel, .results-panel { padding-inline: 18px; }
  .hourly strong { font-size: 46px; }
  .time-ring { width: 66px; height: 66px; padding: 5px; margin-right: 0; }
}

@media (max-width: 740px) {
  .container { width: calc(100% - 36px); }
  .header-inner { grid-template-columns: 1fr auto; grid-template-rows: 58px auto; gap: 0 10px; }
  .main-nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; border-top: 1px solid var(--line); gap: 12px; }
  .main-nav a { min-height: 44px; display: flex; align-items: center; padding-inline: 2px; font-size: 12px; }
  .theme-switch button { min-height: 38px; }
  .button.compact, .step-tabs button { min-height: 44px; }
  .hero-actions .quiet-link { min-height: 44px; }
  #reset { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
  #reset span { display: none; }
  .workbench, .scenario-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .results-panel { position: static; min-height: 0; }
  .mobile-result { display: grid; justify-items: end; align-content: center; min-height: 44px; min-width: 68px; font-size: 11px; color: var(--muted); line-height: 1.2; }
  .mobile-result strong { color: var(--accent); font-size: 15px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .mobile-result:hover strong { text-decoration: underline; }
  .hero { min-height: 304px; }
  .hero-copy { padding-block: 32px 31px; }
  .hero h1 { font-size: 49px; }
  .hero-desc { max-width: 24em; font-size: 14px; }
  .hero-art { width: 56%; }
  .scenario { padding: 19px 17px; }
}

@media (max-width: 520px) {
  .container { width: calc(100% - 30px); }
  .hero { min-height: auto; display: block; }
  .hero-copy { position: relative; padding: 23px 0 18px; }
  .hero h1 { font-size: clamp(28px, 8.55vw, 42px); margin-block: 9px 13px; }
  .hero-desc { max-width: 25em; }
  .hero-actions { gap: 15px; margin-top: 16px; }
  .hero-art { inset: 12px -8px auto auto; height: 126px; width: 39%; }
  .hero-art::before { background-size: 16px 16px; }
  .orbit-toggle { top: 7px; right: -3px; bottom: auto; width: 44px; height: 44px; border-color: transparent; background: transparent; }
  .input-panel { padding-top: 14px; }
  .step-tabs { margin-top: 12px; }
  .step { margin-top: 15px; }
  .time-ring { width: 72px; height: 72px; }
  .summary-metrics strong { font-size: 15px; }
  .summary-metrics div { padding-inline: 7px; }
  .compare-grid { grid-template-columns: minmax(0, 1fr); }
  .compare-heading { align-items: flex-start; }
  .site-footer { line-height: 1.4; }
}

@media (max-width: 360px) {
  .wordmark small { display: none; }
  .input-panel, .results-panel { padding-inline: 13px; }
  .time-ring { width: 55px; height: 55px; }
  .hourly strong { font-size: 40px; }
  .hourly[data-compact="true"] strong { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
