:root {
  color-scheme: light;
  --page: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8faff;
  --text: #111827;
  --muted: #627084;
  --line: #e0e7f0;
  --brand: #185ee8;
  --brand-hover: #104ccc;
  --brand-soft: #edf4ff;
  --success: #087f5b;
  --warning: #8a5200;
  --warning-bg: #fff8e8;
  --shadow: 0 18px 55px rgba(23, 42, 77, .08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
:root[data-theme="night"] {
  color-scheme: dark;
  --page: #0e1420;
  --surface: #151e2d;
  --surface-soft: #1b2738;
  --text: #f2f5fa;
  --muted: #b4c0d0;
  --line: #2b394d;
  --brand: #79a7ff;
  --brand-hover: #9bbaff;
  --brand-soft: #1c2e4e;
  --success: #66d5ae;
  --warning: #ffcf71;
  --warning-bg: #362b19;
  --shadow: 0 18px 55px rgba(0, 0, 0, .28);
}
* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% -5%, rgba(24, 94, 232, .09), transparent 32rem), var(--page);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
button, a, select { touch-action: manipulation; }
a { color: var(--brand); }
.site-header {
  min-height: 68px;
  padding: max(12px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 12px max(20px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  max-width: 1240px;
  margin: auto;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--brand); color: #fff; font-size: 21px; }
.header-actions { display: flex; align-items: center; gap: 9px; }
.back-link, .theme-toggle { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; padding: 0 13px; font-size: 14px; font-weight: 650; text-decoration: none; }
.back-link { color: var(--muted); }
.theme-toggle { cursor: pointer; border: 1px solid var(--line); background: var(--surface); color: var(--text); }
.page-shell { width: min(100% - 32px, 980px); margin: 0 auto; padding: 34px 0 48px; }
.intro { text-align: center; max-width: 760px; margin: 10px auto 28px; }
.eyebrow { margin: 0 0 9px; color: var(--brand); letter-spacing: .13em; font-size: 11px; font-weight: 800; }
.intro h1 { margin: 0; font-size: clamp(32px, 6vw, 56px); line-height: 1.05; letter-spacing: -.055em; }
.intro-copy { max-width: 620px; margin: 14px auto 20px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.notice, .inline-note { border: 1px solid var(--line); border-radius: 14px; padding: 13px 15px; background: var(--surface-soft); color: var(--muted); text-align: left; font-size: 13px; line-height: 1.55; }
.notice strong { color: var(--text); }
.wizard-card, .results, .legal-sources { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); }
.wizard-card { padding: clamp(20px, 4vw, 36px); }
.wizard-top, .result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.wizard-top h2, .result-heading h2 { margin: 0; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.035em; }
.step-count { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; padding-top: 6px; }
.stepper { list-style: none; margin: 25px 0 30px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.stepper li { display: flex; align-items: center; gap: 9px; color: var(--muted); position: relative; font-size: 13px; }
.stepper li::after { content: ""; position: absolute; z-index: 0; left: 34px; right: 8px; top: 16px; height: 1px; background: var(--line); }
.stepper li:last-child::after { display: none; }
.stepper span { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; flex: 0 0 32px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-weight: 800; }
.stepper li b { position: relative; z-index: 2; display: inline-block; padding: 0 7px 0 1px; background: var(--surface); font-weight: 700; line-height: 1.4; text-decoration: none !important; text-decoration-line: none !important; }
.stepper li.active, .stepper li.done { color: var(--brand); }
.stepper li.active span, .stepper li.done span { background: var(--brand); border-color: var(--brand); color: white; }
.wizard-step h3 { margin: 0 0 5px; font-size: 21px; letter-spacing: -.025em; }
.section-copy { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.section-copy.small { margin-bottom: 12px; font-size: 12px; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.field { display: flex; flex-direction: column; min-width: 0; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field > span { color: var(--text); font-size: 13px; font-weight: 720; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.45; }
.field input, .field select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--text);
  background: var(--surface);
  outline: none;
  font-size: 16px;
}
.field input:focus, .field select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 17%, transparent); }
.field input[type="number"] { appearance: textfield; }
.field input[type="number"]::-webkit-inner-spin-button, .field input[type="number"]::-webkit-outer-spin-button { appearance: none; margin: 0; }
.inline-note { margin-top: 16px; }
.warning-note { background: var(--warning-bg); color: var(--warning); }
.checklist-block { margin-top: 24px; }
.checklist-block h4 { margin: 0 0 6px; font-size: 15px; }
.checklist { display: grid; gap: 8px; }
.check-option {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}
.check-option input { width: 18px; height: 18px; flex: 0 0 18px; margin: 1px 0 0; accent-color: var(--brand); }
.wizard-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; padding-bottom: max(0px, env(safe-area-inset-bottom)); }
.button { min-height: 48px; border-radius: 12px; padding: 0 18px; font-weight: 750; font-size: 14px; cursor: pointer; touch-action: manipulation; }
.button.primary { color: white; background: var(--brand); border: 1px solid var(--brand); }
.button.primary:hover { background: var(--brand-hover); }
.button.secondary { color: var(--text); background: var(--surface); border: 1px solid var(--line); }
.form-error { margin-top: 14px; color: #b42318; background: #fff0ef; border: 1px solid #ffd4d0; padding: 12px; border-radius: 11px; font-size: 13px; }
.results { margin-top: 24px; padding: clamp(20px, 4vw, 32px); }
.result-heading { align-items: center; margin-bottom: 20px; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.result-card { min-width: 0; border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--surface-soft); }
.card-kicker { color: var(--brand); letter-spacing: .1em; font-size: 10px; font-weight: 850; }
.result-card h3 { margin: 8px 0 12px; font-size: 16px; }
.result-lines { display: grid; gap: 9px; }
.result-line { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 13px; line-height: 1.45; }
.result-line strong { color: var(--text); text-align: right; }
.result-message { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 0; }
.result-message + .result-message { margin-top: 8px; }
.result-message.good { color: var(--success); }
.result-message.alert { color: var(--warning); }
.result-footer { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.6; }
.official-links, .source-links { display: flex; flex-wrap: wrap; gap: 9px; margin: 12px 0 18px; }
.official-links a, .source-links a { display: inline-flex; align-items: center; min-height: 40px; border: 1px solid var(--line); border-radius: 10px; padding: 0 11px; text-decoration: none; font-size: 12px; font-weight: 700; background: var(--surface); }
.legal-sources { margin-top: 22px; padding: clamp(20px, 4vw, 30px); }
.legal-sources h2 { margin: 0 0 9px; font-size: 20px; }
.legal-sources p { color: var(--muted); font-size: 13px; line-height: 1.65; }
.fine-print { border-top: 1px solid var(--line); padding-top: 12px; }
.site-footer { padding: 18px max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); text-align: center; color: var(--muted); font-size: 12px; }
[hidden] { display: none !important; }
@media (max-width: 700px) {
  .site-header { padding-inline: max(14px, env(safe-area-inset-left)) max(14px, env(safe-area-inset-right)); min-height: 60px; }
  .brand { font-size: 14px; }
  .back-link, .theme-toggle { padding: 0 10px; font-size: 12px; }
  .page-shell { width: min(100% - 22px, 620px); padding-top: 23px; }
  .intro { margin-top: 5px; }
  .intro-copy { font-size: 15px; }
  .wizard-card, .results, .legal-sources { border-radius: 18px; }
  .field-grid, .result-grid { grid-template-columns: minmax(0, 1fr); }
  .wizard-top { align-items: center; }
  .stepper { margin: 20px 0 25px; }
  .stepper li { gap: 6px; font-size: 11px; }
  .stepper li::after { left: 30px; }
  .stepper span { width: 28px; height: 28px; flex-basis: 28px; }
  .stepper li::after { top: 14px; }
  .wizard-step h3 { font-size: 19px; }
  .result-heading { align-items: flex-start; flex-direction: column; }
  .print-button { width: 100%; }
  .wizard-actions { position: sticky; bottom: 0; margin-inline: -20px; padding: 12px 20px max(12px, env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); z-index: 5; }
  .wizard-actions .button { flex: 1; }
}
@media print {
  :root, :root[data-theme="night"] {
    color-scheme: light;
    --page: #fff;
    --surface: #fff;
    --surface-soft: #fff;
    --text: #111827;
    --muted: #374151;
    --line: #cbd5e1;
    --brand: #185ee8;
    --brand-soft: #edf4ff;
    --success: #087f5b;
    --warning: #8a5200;
    --warning-bg: #fff8e8;
    --shadow: none;
  }
  body { background: #fff; color: #111827; }
  .site-header, .intro, .wizard-card, .legal-sources, .site-footer, .print-button, #restartButton { display: none !important; }
  .results { display: block !important; box-shadow: none; border: 0; margin: 0; padding: 0; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-card { break-inside: avoid; }
  .result-footer { font-size: 10pt; }
  a { color: #111827; text-decoration: none; }
}

/* v6: header actions keep readable widths on narrow phones. */
.site-header{flex-wrap:wrap}.brand{min-width:0}.brand-mark{flex-shrink:0}.header-actions{flex-shrink:0;flex-wrap:wrap}.back-link,.theme-toggle{white-space:nowrap}.field{min-width:0}.field input,.field select{min-width:0;max-width:100%;font-size:16px}@media(max-width:540px){.site-header{justify-content:center;gap:8px}.site-header .brand{justify-content:center;width:100%}.header-actions{width:100%;justify-content:center}.wizard-actions{position:static;backdrop-filter:none;-webkit-backdrop-filter:none}.stepper li{min-width:0}.stepper li b{overflow-wrap:anywhere}}
