:root {
  --paper: #f4efe6;
  --ink: #243028;
  --muted: #5c6b63;
  --card: #fffdf8;
  --line: #e0d8c8;
  --accent: #3d5c4a;
  --accent-dark: #2c4438;
  --warm: #c45c3e;
  --forest: #3d5c4a;
  --info: #4a6d7c;
  --danger: #b54a45;
  --warn: #c4843a;
  --ok: #3d5c4a;
  --help: #efe6d4;
  --shadow: 0 14px 36px rgba(36, 48, 40, 0.08);
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Segoe UI", system-ui, sans-serif;
  --radius: 16px;
  --header-h: 64px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 480px at 8% -12%, #fff8ee 0%, transparent 52%),
    radial-gradient(820px 380px at 100% 0%, #e8e0d0 0%, transparent 48%),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.6;
  min-height: 100vh;
}
a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, var(--line));
}
a:visited { color: var(--accent); }
a:hover {
  color: var(--accent-dark);
  text-decoration-color: var(--warm);
}
a:focus-visible { outline: 2px solid var(--warm); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; text-decoration: none; }
.skip:focus { left: 1rem; background: #fff; padding: .4rem .8rem; z-index: 20; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  min-height: var(--header-h);
  padding: 0 6vw; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: color-mix(in srgb, var(--paper) 86%, white);
  backdrop-filter: blur(12px); z-index: 8; gap: 1rem; flex-wrap: wrap;
}
.brand { display: flex; gap: .75rem; align-items: center; color: inherit; text-decoration: none; font-weight: 700; }
.brand:visited, .brand:hover { color: inherit; text-decoration: none; }
.brand-stack { display: flex; flex-direction: column; gap: .08rem; line-height: 1.15; }
.brand-name { font-size: 1.08rem; letter-spacing: -.02em; }
.brand-tag { font-size: .72rem; font-weight: 600; color: var(--muted); letter-spacing: .01em; }
.mark {
  width: 2.15rem; height: 2.15rem; border-radius: 12px; background: var(--accent); color: #fffdf8;
  display: grid; place-items: center; font-family: var(--serif); font-weight: 700; font-size: 1.15rem;
}
nav { display: flex; gap: .7rem 1rem; flex-wrap: wrap; align-items: center; }
nav a, .foot a, .crumb a {
  color: var(--accent);
  text-decoration: none;
}
nav a:visited, .foot a:visited, .crumb a:visited { color: var(--accent); }
nav a:hover, .foot a:hover, .crumb a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-color: var(--warm);
}
main { padding: 2.2rem 6vw 4.5rem; max-width: 1140px; margin: 0 auto; }
.hero h1, h1 {
  font-family: var(--serif);
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.15; letter-spacing: -.03em; margin: .2rem 0 1rem;
  font-weight: 500;
}
.eyebrow { letter-spacing: .08em; font-size: .86rem; color: var(--accent-dark); font-weight: 700; text-transform: uppercase; }
.lead { font-size: 1.18rem; max-width: 44rem; color: var(--muted); }
.promise { font-family: var(--serif); font-size: 1.3rem; max-width: 40rem; }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin: 1.4rem 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .75rem 1.2rem; border-radius: 999px;
  border: 1px solid var(--accent-dark); background: #fff; color: var(--accent-dark);
  text-decoration: none; font-weight: 650; cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
a.btn, a.btn:visited { color: var(--accent-dark); text-decoration: none; }
a.btn.primary, a.btn.primary:visited { color: #fff; }
a.btn:hover { color: var(--accent-dark); text-decoration: none; }
a.btn.primary:hover { color: #fff; }
.btn.ghost { background: transparent; }
.btn.compact { min-height: 40px; padding: .4rem .9rem; font-size: .92rem; }
.btn:focus-visible { outline: 3px solid var(--warm); outline-offset: 2px; }
.trust { display: grid; gap: .4rem; padding: 0; list-style: none; color: var(--muted); }
.trust li::before { content: "✓ "; color: var(--accent); font-weight: 700; }
.grid-cats, .how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin: 2.4rem 0; }
.grid-cats article, .card, .wizard, .result-card, .how article, .legal-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.2rem 1.3rem; box-shadow: var(--shadow);
}
.how article { background: #fff; }
.how span { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 999px; background: var(--help); color: var(--accent-dark); font-weight: 800; margin-bottom: .5rem; }
.not-a-calculator { max-width: 42rem; }
.foot { padding: 2rem 6vw 5.5rem; border-top: 1px solid var(--line); color: var(--muted); background: #ebe4d6; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; max-width: 1140px; margin: 0 auto; }
.foot nav { display: grid; gap: .35rem; }
.legal-strip { font-size: .92rem; }
.muted { color: var(--muted); }
.narrow, .landing, .legal { max-width: 46rem; }
.wizard { display: grid; gap: 1.1rem; }
.steps { display: flex; gap: .4rem; flex-wrap: wrap; }
.steps button {
  border: 0; background: #fff; color: var(--muted); padding: .45rem .75rem; border-radius: 999px; cursor: pointer; border: 1px solid var(--line);
}
.steps button[aria-current="step"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.field { display: grid; gap: .3rem; margin: .75rem 0; }
.label-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem;
}
.label-row h2 { margin: 0; font-size: 1.25rem; }
.field label, .label-row label { font-weight: 650; }
.help-wrap { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; }
.help-wrap .help-panel, .label-row .help-panel { flex: 1 1 100%; }
.help-btn {
  width: 1.7rem; height: 1.7rem; border-radius: 999px; border: 1px solid var(--accent);
  background: var(--help); color: var(--accent-dark); font-weight: 800; cursor: pointer; line-height: 1;
  flex: 0 0 auto;
}
.help-btn[aria-expanded="true"] { background: var(--accent); color: #fff; }
.help-panel {
  background: var(--help); border-radius: 12px; padding: .7rem .85rem; color: var(--forest); font-size: .95rem;
}
body.help-expanded .help-panel { display: block; }
.help, .example { font-size: .92rem; color: var(--muted); margin: 0; }
.hint { background: var(--help); border-left: 4px solid var(--accent); padding: .8rem 1rem; border-radius: 12px; }
.legal-box { border-color: #f0d3a8; background: #fff8ee; }
input, select, textarea {
  font: inherit; padding: .7rem .8rem; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; width: 100%; min-height: 46px;
}
input[type="checkbox"],
input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  min-height: 0;
  min-width: 0;
  padding: 0;
  flex: 0 0 auto;
  align-self: center;
  accent-color: var(--accent);
  cursor: pointer;
}
label:has(> input[type="checkbox"]),
label:has(> input[type="radio"]) {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: fit-content;
  max-width: 100%;
  font-weight: 550;
  cursor: pointer;
}
.field > input[type="checkbox"] { justify-self: start; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.option-card { border: 1px solid var(--line); border-radius: 16px; padding: 1rem; margin-top: 1rem; background: #fbf7ef; }
.chips { display: flex; gap: .5rem; flex-wrap: wrap; }
.chips label, .chips .btn { display: flex; gap: .4rem; align-items: center; background: #fff; border: 1px solid var(--line); padding: .45rem .75rem; border-radius: 999px; color: var(--accent-dark); }
.chips .btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.weight { display: grid; grid-template-columns: 9rem 1fr 3.4rem; gap: .6rem; align-items: center; }
.weight-help { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.weight-help .help-panel { flex: 1 1 100%; }
.headline { font-family: var(--serif); font-size: clamp(1.7rem, 4vw, 2.7rem); line-height: 1.2; }
.badge { display: inline-block; padding: .3rem .75rem; border-radius: 999px; font-weight: 700; font-size: .9rem; }
.badge.robust, .badge.feasible { background: #e4efe8; color: var(--ok); }
.badge.tense { background: #fde7c8; color: #8a5a16; }
.badge.stressed, .badge.notfeasibleunderassumptions { background: #f8d6d4; color: #8a3230; }
.insight { border-left: 4px solid var(--warm); padding: .2rem 0 .2rem 1rem; margin: 1rem 0; }
.insight.critical { border-color: var(--danger); }
.insight.important { border-color: var(--warn); }
.insight.interesting { border-color: var(--warm); }
.insight.info { border-color: var(--info); }
.table-wrap { overflow: auto; }
.compare { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.compare th, .compare td { padding: .65rem; border-bottom: 1px solid var(--line); text-align: right; }
.compare th:first-child, .compare td:first-child { text-align: left; }
.bar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.sliders { display: grid; gap: 1rem; }
details.why, .landing details { margin-top: .4rem; }
.landing details, .legal details { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .6rem .9rem; margin: .6rem 0; }
.error { color: var(--danger); }
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .7rem; }
.crumb { font-size: .9rem; color: var(--muted); margin-bottom: 1rem; }
.warn-box { background: #fff4e5; border: 1px solid #f0d3a8; border-radius: 14px; padding: 1rem; }
.cookie-bar {
  position: sticky; bottom: 0; z-index: 9;
  display: flex; gap: 1rem; justify-content: space-between; align-items: center; flex-wrap: wrap;
  padding: 1rem 6vw; background: var(--accent-dark); color: #f7f3ea;
}
.cookie-bar a, .cookie-bar a:visited { color: #f0c4b4; text-decoration-color: color-mix(in srgb, #f0c4b4 70%, transparent); }
.cookie-bar a:hover { color: #fff; text-decoration-color: var(--warm); }
.cookie-bar[hidden] { display: none !important; }
.local-banner {
  margin: 0; padding: .55rem 6vw; text-align: center; font-size: .95rem;
  background: var(--accent-dark); color: #f7f3ea;
}
.local-banner a, .local-banner a:visited { color: #f0c4b4; text-decoration-color: color-mix(in srgb, #f0c4b4 70%, transparent); }
.local-banner.compact { padding: .4rem 5vw; font-size: .88rem; background: var(--accent-dark); }
.pills { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1.2rem 0 0; list-style: none; }
.pills li {
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: .35rem .85rem; font-size: .92rem; color: var(--forest);
}
.section-label { letter-spacing: .08em; font-size: .86rem; color: var(--accent-dark); font-weight: 700; text-transform: uppercase; }
.privacy-panel { margin: 2.4rem 0; }
.privacy-hint { border-left-color: var(--forest); }
.app-embed { margin: 2.8rem 0 3rem; }
.app-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: .8rem; margin: 1rem 0 0; padding: .85rem 1rem;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0;
}
.app-toolbar p { margin: 0; color: var(--forest); }
.app-storage-notice { margin: .6rem 0 0; }
.app-lazy-hint { margin: .4rem 0 0; color: var(--muted, #5c6b63); }
.app-frame-wrap {
  margin-top: 0; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  overflow: hidden; background: #fff; box-shadow: var(--shadow); min-height: 720px;
}
.app-frame { width: 100%; height: 780px; border: 0; display: block; background: #fff; }
.app-frame[data-lazy]:not([src]) { background: repeating-linear-gradient(-45deg, #f7f3ea, #f7f3ea 12px, #fff 12px, #fff 24px); }
.wasm-wait { text-align: center; padding: 1.2rem; }
.app-shell main.app-main { padding-top: 1.4rem; }
.app-legal { text-align: center; padding: 0 6vw 2rem; }
body.embed .local-banner { font-size: .82rem; }
body.embed .app-legal { display: none; }
.faq-home { max-width: 46rem; margin: 2rem 0 3rem; }
@media (max-width: 720px) {
  .top { flex-direction: column; align-items: flex-start; }
  .row, .weight, .foot-grid { grid-template-columns: 1fr; }
  main { padding: 1.3rem 5vw 3.2rem; }
  .compare { display: block; overflow-x: auto; }
  .cookie-bar { flex-direction: column; align-items: stretch; }
  .app-frame, .app-frame-wrap { min-height: 640px; height: 640px; }
}
@media print {
  .top, .foot, .actions, .sliders, nav, .skip, .cookie-bar, .help-btn { display: none !important; }
  body { background: #fff; }
}
