:root {
  --burgundy: #742638;
  --burgundy-dark: #4e1926;
  --burgundy-deep: #351018;
  --rose: #e9d9dd;
  --warm: #f6f2ed;
  --paper: #fffdf9;
  --sand: #e8ded2;
  --gold: #d9a95f;
  --charcoal: #25272a;
  --muted: #62666b;
  --line: #d8d0c8;
  --success: #2f6751;
  --warning: #8b5d1b;
  --danger: #9b2c2c;
  --radius: 18px;
  --shadow: 0 22px 60px rgba(53, 16, 24, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--charcoal);
  background: var(--warm);
  font: 16px/1.58 Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: -80px;
  padding: 10px 16px;
  background: white;
  color: var(--burgundy-dark);
  border-radius: 8px;
}
.skip-link:focus { top: 16px; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.topbar {
  min-height: 82px;
  padding: 14px clamp(20px, 5vw, 72px);
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--burgundy-dark);
  color: white;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .06em;
}
.brand strong, .brand small { display: block; }
.brand strong { color: var(--burgundy-dark); font-size: 17px; letter-spacing: .01em; }
.brand small { margin-top: 1px; color: var(--muted); font-size: 12px; }
.top-actions { display: flex; gap: 18px; }
.text-button {
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--burgundy-dark);
  cursor: pointer;
  font-weight: 700;
}
.text-button:hover { border-color: currentColor; }

main { overflow: hidden; }
.hero {
  min-height: 610px;
  padding: clamp(66px, 9vw, 120px) clamp(20px, 7vw, 104px);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
  align-items: center;
  gap: clamp(42px, 8vw, 120px);
  color: white;
  background:
    radial-gradient(circle at 82% 24%, rgba(217,169,95,.24), transparent 19%),
    linear-gradient(135deg, var(--burgundy-deep) 0%, var(--burgundy-dark) 56%, #6a2132 100%);
}
.hero::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -165px;
  bottom: -190px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
}
.eyebrow {
  margin: 0 0 12px;
  color: var(--burgundy);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.hero .eyebrow { color: #e6c891; }
.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(46px, 6.4vw, 90px);
  line-height: .97;
  letter-spacing: -.045em;
}
.hero-lead {
  max-width: 790px;
  margin: 28px 0 0;
  color: rgba(255,255,255,.84);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.55;
}
.hero-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button {
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--burgundy); color: white; }
.button-primary:hover { background: #8b3045; }
.hero .button-primary { background: var(--gold); color: var(--burgundy-deep); }
.hero .button-primary:hover { background: #edc37f; }
.button-secondary { border-color: var(--burgundy); background: transparent; color: var(--burgundy-dark); }
.button-secondary:hover { background: var(--rose); }
.hero .button-secondary { border-color: rgba(255,255,255,.45); color: white; }
.hero .button-secondary:hover { background: rgba(255,255,255,.1); }
.hero-note {
  padding: 30px;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 20px;
  background: rgba(255,255,255,.08);
  backdrop-filter: blur(8px);
  box-shadow: 0 24px 60px rgba(0,0,0,.15);
}
.hero-note .note-label { margin: 0 0 10px; color: #e6c891; font-weight: 800; }
.hero-note > p:not(.note-label) { margin: 0; font-size: 20px; font-weight: 700; line-height: 1.4; }
.hero-note ul { margin: 22px 0 0; padding-left: 20px; color: rgba(255,255,255,.78); }
.hero-note li + li { margin-top: 9px; }

.method-strip {
  padding: 42px clamp(20px, 7vw, 104px);
  display: grid;
  grid-template-columns: minmax(260px, .7fr) 1.3fr;
  gap: 48px;
  align-items: end;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.method-strip h2 { margin: 0; max-width: 600px; font-size: clamp(25px, 3vw, 38px); line-height: 1.15; }
.method-strip ol {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.method-strip li { padding: 10px 12px; border-top: 2px solid var(--sand); color: var(--muted); font-weight: 700; }

.workspace, .result-section {
  width: min(1180px, calc(100% - 40px));
  margin: clamp(56px, 8vw, 104px) auto;
}
.workspace-head, .result-toolbar {
  margin-bottom: 26px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
}
.workspace h2, .result-section h2, .sources-note h2 { margin: 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.08; }
.save-state { color: var(--muted); font-size: 14px; text-align: right; }
.save-state.saved { color: var(--success); }
.progress-wrap {
  padding: 24px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--paper);
}
.progress-meta { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 10px; font-weight: 800; }
.progress-track { height: 6px; overflow: hidden; border-radius: 999px; background: var(--sand); }
.progress-track span { display: block; width: 11%; height: 100%; background: var(--burgundy); transition: width .25s ease; }
.step-tabs {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 7px;
}
.step-tab {
  min-height: 44px;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.step-tab[aria-selected="true"] { border-color: var(--burgundy); background: var(--rose); color: var(--burgundy-dark); }
.step-tab.is-complete { border-color: #9fb8aa; color: var(--success); }
.stage-card {
  min-height: 510px;
  padding: clamp(28px, 5vw, 60px);
  border: 1px solid var(--line);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.stage-heading { max-width: 820px; margin-bottom: 34px; }
.stage-heading .stage-kicker { margin: 0 0 8px; color: var(--burgundy); font-size: 13px; font-weight: 800; }
.stage-heading h3 { margin: 0; color: var(--burgundy-dark); font-size: clamp(28px, 4vw, 44px); line-height: 1.08; }
.stage-heading p { margin: 14px 0 0; color: var(--muted); font-size: 17px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.form-grid .full { grid-column: 1 / -1; }
.field { min-width: 0; }
.field > label, .field > legend { display: block; margin-bottom: 8px; color: var(--charcoal); font-weight: 800; }
.field > small { display: block; margin-top: 7px; color: var(--muted); }
fieldset.field { margin: 0; padding: 0; border: 0; }
input[type="text"], input[type="url"], input[type="date"], input[type="number"], select, textarea {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #bdb4ab;
  border-radius: 9px;
  background: white;
  color: var(--charcoal);
}
textarea { min-height: 132px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--burgundy); }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.choice-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.choice {
  min-height: 56px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: white;
  cursor: pointer;
}
.choice:hover { border-color: var(--burgundy); background: #fff9fa; }
.choice:has(input:checked) { border-color: var(--burgundy); background: var(--rose); }
.choice input { margin-top: 4px; accent-color: var(--burgundy); }
.choice span { display: block; line-height: 1.35; }
.choice small { display: block; margin-top: 4px; color: var(--muted); }
.legal-list { display: grid; gap: 10px; }
.legal-choice { padding: 16px; }
.legal-choice strong { color: var(--burgundy-dark); }
.legal-choice small { line-height: 1.45; }
.inline-callout { padding: 16px 18px; border-left: 4px solid var(--gold); background: #fbf4e7; color: #60471d; }
.stage-actions {
  padding: 18px 24px;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper);
}
.stage-actions .button { min-width: 126px; }

.result-section { scroll-margin-top: 20px; }
.toolbar-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.summary-banner {
  padding: clamp(26px, 5vw, 48px);
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, var(--burgundy-deep), var(--burgundy));
}
.summary-banner h3 { margin: 0; font-size: clamp(26px, 4vw, 42px); }
.summary-banner p { max-width: 880px; margin: 14px 0 0; color: rgba(255,255,255,.84); }
.summary-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.summary-stat { padding: 15px; border: 1px solid rgba(255,255,255,.2); border-radius: 11px; background: rgba(255,255,255,.08); }
.summary-stat strong, .summary-stat span { display: block; }
.summary-stat strong { font-size: 24px; }
.summary-stat span { color: rgba(255,255,255,.75); font-size: 13px; }
.report-block { margin-top: 20px; padding: clamp(24px, 4vw, 38px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.report-block h3 { margin: 0 0 18px; color: var(--burgundy-dark); font-size: 25px; }
.report-block h4 { margin: 24px 0 8px; }
.report-block p { white-space: pre-wrap; }
.facts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fact { padding: 14px; border-radius: 10px; background: var(--warm); }
.fact strong { display: block; margin-bottom: 4px; color: var(--burgundy-dark); }
.fact span { color: var(--muted); overflow-wrap: anywhere; }
.version-card { margin-top: 12px; padding: 18px; border: 1px solid var(--line); border-left: 4px solid var(--burgundy); border-radius: 10px; }
.version-card h4 { margin: 0 0 8px; color: var(--burgundy-dark); }
.version-card p { margin: 8px 0; }
.matrix-table { width: 100%; margin-top: 15px; border-collapse: collapse; font-size: 14px; }
.matrix-table th, .matrix-table td { padding: 10px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.matrix-table th { background: var(--rose); color: var(--burgundy-dark); }
.status { display: inline-block; padding: 4px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.status-confirmed { background: #dcebe2; color: var(--success); }
.status-check { background: #f5e8ce; color: var(--warning); }
.status-no { background: #f1dddd; color: var(--danger); }
.clean-list { margin: 0; padding-left: 20px; }
.clean-list li + li { margin-top: 7px; }
.result-footer-actions { margin-top: 24px; text-align: right; }
.danger-button { border: 0; background: transparent; color: var(--danger); text-decoration: underline; cursor: pointer; }

.sources-note {
  padding: clamp(48px, 8vw, 88px) clamp(20px, 7vw, 104px);
  background: var(--sand);
}
.sources-note > * { max-width: 980px; }
.sources-note p { font-size: 18px; }
.sources-note .small { color: var(--muted); font-size: 14px; }
.site-footer {
  min-height: 150px;
  padding: 34px clamp(20px, 7vw, 104px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  color: white;
  background: var(--burgundy-deep);
}
.site-footer strong, .site-footer span { display: block; }
.site-footer span { margin-top: 6px; color: rgba(255,255,255,.64); font-size: 13px; }
.site-footer p { margin: 0; text-align: right; color: rgba(255,255,255,.78); }
.site-footer p strong { display: inline; color: white; }

.modal {
  width: min(820px, calc(100% - 30px));
  max-height: min(86vh, 850px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  color: var(--charcoal);
  background: var(--paper);
  box-shadow: 0 30px 90px rgba(0,0,0,.3);
}
.modal::backdrop { background: rgba(24, 9, 13, .72); backdrop-filter: blur(3px); }
.modal-small { width: min(620px, calc(100% - 30px)); }
.modal-head { padding: 24px 28px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.modal-head h2 { margin: 0; color: var(--burgundy-dark); font-size: 30px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: white; color: var(--burgundy-dark); font-size: 26px; cursor: pointer; }
.instruction-content { padding: 26px 28px; overflow: auto; }
.instruction-lead { margin-top: 0; font-size: 18px; font-weight: 700; }
.instruction-list { padding-left: 23px; }
.instruction-list li + li { margin-top: 15px; }
.callout { margin-top: 24px; padding: 16px; border-left: 4px solid var(--gold); background: #fbf4e7; }
.modal-actions { padding: 18px 28px; border-top: 1px solid var(--line); text-align: right; }
.toast {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  max-width: min(380px, calc(100% - 40px));
  padding: 13px 16px;
  border-radius: 10px;
  color: white;
  background: var(--burgundy-dark);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(15px);
  pointer-events: none;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-note { max-width: 680px; }
  .method-strip { grid-template-columns: 1fr; gap: 28px; }
  .step-tabs { grid-template-columns: repeat(3, 1fr); }
  .summary-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .topbar { align-items: flex-start; }
  .brand small { display: none; }
  .top-actions { gap: 10px; flex-direction: column; align-items: flex-end; }
  .text-button { padding: 3px 0; }
  .hero { padding-top: 66px; padding-bottom: 70px; }
  .hero h1 { font-size: clamp(42px, 14vw, 62px); }
  .method-strip ol { grid-template-columns: repeat(2, 1fr); }
  .workspace, .result-section { width: min(100% - 24px, 1180px); }
  .workspace-head, .result-toolbar { align-items: flex-start; flex-direction: column; }
  .save-state { text-align: left; }
  .progress-wrap { padding: 18px 14px; }
  .stage-card { padding: 28px 18px; }
  .form-grid, .choice-grid, .choice-grid.three, .facts-grid { grid-template-columns: 1fr; }
  .toolbar-actions { justify-content: flex-start; }
  .toolbar-actions .button { flex: 1 1 145px; }
  .matrix-table { display: block; overflow-x: auto; }
  .site-footer { align-items: flex-start; flex-direction: column; }
  .site-footer p { width: 100%; text-align: right; }
  .modal-head, .instruction-content, .modal-actions { padding-left: 20px; padding-right: 20px; }
}

@media print {
  body { background: white; color: black; font-size: 11pt; }
  .topbar, .hero, .method-strip, .workspace, .sources-note, .site-footer, .result-toolbar, .result-footer-actions, .toast { display: none !important; }
  .result-section { display: block !important; width: 100%; margin: 0; }
  #resultContent { display: block; }
  .summary-banner { color: black; background: white; border: 2px solid black; }
  .summary-banner p, .summary-stat span { color: black; }
  .summary-stat { border-color: #777; }
  .report-block { break-inside: avoid; box-shadow: none; border-color: #888; }
  .matrix-table th { color: black; background: #eee; }
}
