:root {
  color-scheme: light;
  --ink: #142238;
  --muted: #667085;
  --line: #dbe2ea;
  --paper: #f4f7fa;
  --white: #fff;
  --blue: #155eef;
  --cyan: #22c7d6;
  --orange: #ff8a3d;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-size: 16px; }
.topbar { min-height: 76px; padding: 14px clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; font-weight: 800; }
.brand small { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }
.brand-mark { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--blue); border-radius: 12px 4px 12px 4px; }
.status { color: var(--muted); font-size: .875rem; }
main { max-width: 1240px; margin: auto; padding: 52px 24px 72px; }
.intro { max-width: 720px; margin-bottom: 38px; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 800; }
h1 { margin: 8px 0 16px; font-size: clamp(2.6rem, 7vw, 5.6rem); line-height: .92; letter-spacing: -.065em; }
.intro > p:last-child { max-width: 590px; color: var(--muted); font-size: 1.08rem; line-height: 1.6; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .85fr); background: var(--white); border: 1px solid var(--line); box-shadow: 0 24px 80px rgba(28, 45, 74, .09); }
.calculator, .result { padding: clamp(24px, 4vw, 48px); }
.result { border-left: 1px solid var(--line); background: linear-gradient(150deg, #f8fbff, #fff); }
.section-heading { display: flex; justify-content: space-between; padding-bottom: 20px; margin-bottom: 26px; border-bottom: 1px solid var(--line); font-weight: 800; }
.step { color: var(--blue); }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: 1fr 1fr; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
label { display: grid; gap: 8px; margin-bottom: 18px; color: #344054; font-size: .9rem; font-weight: 700; }
input, select { width: 100%; height: 50px; padding: 0 14px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; color: var(--ink); font: inherit; }
input:focus, select:focus { outline: 3px solid rgba(21, 94, 239, .14); border-color: var(--blue); }
.options { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 22px; }
.check { display: flex; align-items: center; gap: 8px; margin: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
button { width: 100%; min-height: 54px; border: 0; border-radius: 8px; background: var(--blue); color: white; font: inherit; font-weight: 800; cursor: pointer; }
button:hover { filter: brightness(.94); }
.secondary { margin-top: 24px; background: white; color: var(--ink); border: 1px solid var(--line); }
.empty { min-height: 360px; display: grid; place-content: center; text-align: center; color: var(--muted); }
.empty > span { width: 72px; height: 72px; margin: 0 auto 16px; display: grid; place-items: center; border-radius: 50%; background: #eaf0ff; color: var(--blue); font-size: 2rem; font-weight: 900; }
.empty h2 { margin: 0 0 8px; color: var(--ink); }
.empty p { max-width: 310px; line-height: 1.55; }
.total-label { color: var(--muted); }
.total { margin: 8px 0 4px; font-size: clamp(2.8rem, 6vw, 4.8rem); font-weight: 900; letter-spacing: -.06em; }
.total small { font-size: .4em; color: var(--blue); }
.unit { color: var(--muted); }
.breakdown { margin-top: 34px; border-top: 1px solid var(--line); }
.breakdown div { display: flex; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.breakdown dt { color: var(--muted); }
.breakdown dd { margin: 0; font-weight: 800; white-space: nowrap; }
.error { padding: 18px; border-left: 4px solid #dc2626; background: #fff1f2; }
.error p { margin-bottom: 0; line-height: 1.5; }
.notice { padding: 12px; color: #854d0e; background: #fef9c3; border-radius: 8px; }
footer { padding: 24px; color: var(--muted); text-align: center; font-size: .875rem; }
[hidden] { display: none !important; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .result { border-left: 0; border-top: 1px solid var(--line); }
  .grid.three { grid-template-columns: 1fr; }
}

@media (max-width: 540px) {
  .status { display: none; }
  main { padding: 34px 14px 54px; }
  .grid.two { grid-template-columns: 1fr; }
  .calculator, .result { padding: 22px; }
}

@media print {
  .topbar, .intro, .calculator, footer, .secondary { display: none; }
  main { padding: 0; }
  .workspace { display: block; border: 0; box-shadow: none; }
  .result { border: 0; }
}
