:root {
  --ink: #1c2733;
  --ink-soft: #3d4c5e;
  --muted: #4a5a6d;
  --paper: #ffffff;
  --canvas: #f3f5f7;
  --panel: #fbfcfd;
  --line: #c8d1db;
  --line-strong: #8b99a9;
  --accent: #0b5d4e;
  --accent-strong: #084a3f;
  --accent-tint: #e7f1ee;
  --link: #0a4d8c;
  --link-strong: #083b6c;
  --focus: #0b5d4e;
  --danger: #8a1f1f;
  --danger-tint: #fbecec;
  --warning-tint: #fdf3e3;
  --warning-border: #8a6d1f;
  --focus-offset: #ffffff;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow: 0 1px 3px rgba(28, 39, 51, 0.12);
  --font: system-ui, "Segoe UI", -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-text-size-adjust: 100%;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

a:hover {
  color: var(--link-strong);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

h1,
h2,
h3,
h4,
p,
ul,
ol {
  margin: 0 0 0.9em;
}

h1 {
  font-size: clamp(1.5rem, 1.15rem + 1.6vw, 2.1rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  margin-top: 0.5em;
}

h3 {
  font-size: 1.05rem;
  line-height: 1.35;
}

ul,
ol {
  padding-left: 1.35em;
}

li {
  margin-bottom: 0.35em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3.5rem;
  z-index: 100;
  background: var(--ink);
  color: #ffffff;
  padding: 0.6rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  font-weight: 600;
}

.skip-link:focus {
  top: 0;
  color: #ffffff;
}

.site-header {
  background: var(--ink);
  color: #ffffff;
  padding: 0.9rem 1rem;
}

.site-wordmark {
  margin: 0;
  font-weight: 700;
  font-size: 1.05rem;
}

.wordmark-tag {
  display: inline-block;
  background: #2e4153;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  vertical-align: middle;
  letter-spacing: 0.03em;
}

.site-byline {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  color: #c9d4de;
}

.site-byline a {
  color: #ffffff;
  text-decoration: underline;
}

main {
  max-width: 47rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.lede {
  color: var(--ink-soft);
  font-size: 1.05rem;
  max-width: 40rem;
}

.start-panel {
  margin-top: 1.2rem;
}

.notice {
  border: 1px solid var(--line);
  border-left: 6px solid var(--line-strong);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.notice h2 {
  margin-top: 0;
  font-size: 1.05rem;
}

.notice p {
  margin-bottom: 0;
}

.notice-jurisdiction {
  border-left-color: var(--accent);
}

.notice-privacy {
  border-left-color: var(--link);
}

.notice-disclaimer {
  border: 2px solid var(--ink-soft);
  border-left: 6px solid var(--ink-soft);
  background: var(--panel);
}

.notice-safety {
  border-left-color: var(--danger);
  background: #fdf6f6;
}

.notice-noscript {
  border-left-color: var(--warning-border);
  background: var(--warning-tint);
}

.start-heading {
  margin-top: 1.5rem;
}

.ack-block {
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}

.ack-block label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 600;
}

.ack-block input[type="checkbox"] {
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.ack-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0.4rem 0 0 1.9rem;
}

.field-error {
  color: var(--danger);
  font-weight: 600;
  margin: 0.5rem 0 0 1.9rem;
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.app-content {
  min-width: 0;
}

.progress {
  margin: 0 0 0.8rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0.9rem 0.9rem 0.7rem;
}

.progress-summary {
  font-weight: 700;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
}

.progress-track {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 10px;
  border: none;
  border-radius: 999px;
  background: #dbe1e8;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.progress-track::-webkit-progress-bar {
  background: #dbe1e8;
  border-radius: 999px;
}

.progress-track::-webkit-progress-value {
  background: var(--accent);
  border-radius: 999px;
}

.progress-track::-moz-progress-bar {
  background: var(--accent);
  border-radius: 999px;
}

.progress-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0;
  margin: 0 0 0.6rem;
}

.progress-list li {
  margin: 0;
}

.progress-list button {
  font: inherit;
  font-size: 0.85rem;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  min-height: 40px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.progress-list button[aria-current="step"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  font-weight: 600;
}

.progress-list button:hover {
  border-color: var(--line-strong);
}

.step-badge {
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
  flex: 0 0 auto;
}

.step-name {
  line-height: 1.25;
}

.save-status-wrap {
  min-height: 1.7rem;
}

.save-status {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.banner {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
  background: var(--panel);
}

.banner p {
  margin: 0 0 0.5rem;
}

.banner p:last-child {
  margin-bottom: 0;
}

.banner-storage {
  background: var(--warning-tint);
  border-left: 6px solid var(--warning-border);
}

.banner-warning {
  background: var(--warning-tint);
  border-left: 6px solid var(--warning-border);
}

.banner-danger {
  background: var(--danger-tint);
  border-left: 6px solid var(--danger);
}

.banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.banner-confirm {
  margin-top: 0.6rem !important;
  font-weight: 600;
}

.step {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem 1.2rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
}

.step h2 {
  margin-top: 0;
}

.fact-note {
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-left: 3px solid var(--line);
  padding-left: 0.75rem;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem 1rem;
  margin: 0 0 1.1rem;
  min-width: 0;
}

legend {
  font-weight: 700;
  padding: 0 0.4rem;
}

.fieldset-facts > legend {
  color: var(--accent-strong);
}

.fieldset-choice {
  border: none;
  padding: 0 0 0.3rem;
}

.fieldset-choice legend {
  padding: 0;
}

.choice-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-bottom: 0.55rem;
}

.choice-row input[type="radio"] {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.choice-row label {
  padding-top: 0.12rem;
}

.fieldset-inline .choice-row {
  display: inline-flex;
  margin-right: 1.1rem;
}

.field {
  margin-bottom: 1rem;
}

.field > label,
.entry-label,
.question-label,
.custom-doc-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.hint {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.35rem;
}

input[type="text"],
select,
textarea {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
  max-width: 100%;
}

textarea {
  width: 100%;
  resize: vertical;
}

input[type="text"] {
  width: 100%;
}

select {
  min-height: 44px;
  width: 100%;
}

input[type="text"]:hover,
select:hover,
textarea:hover {
  border-color: var(--ink-soft);
}

.fact-with-source select,
.fact-with-source textarea {
  margin-bottom: 0.45rem;
}

.source-label {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin: 0 0.15rem 0.35rem;
}

.fact-with-source select {
  max-width: 22rem;
}

.char-count {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
  margin-top: 0.15rem;
}

.step-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.2rem;
  justify-content: flex-end;
}

.list-actions {
  margin: 0.4rem 0 1rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover {
  filter: brightness(1.05);
}

.btn:active {
  filter: brightness(0.95);
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-strong);
  color: #ffffff;
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line-strong);
}

.btn-secondary:hover {
  border-color: var(--ink-soft);
  color: var(--ink);
}

.btn-quiet {
  background: transparent;
  color: var(--link);
  border: none;
  padding: 0.35rem 0.5rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  min-height: 44px;
}

.btn-quiet:hover {
  color: var(--link-strong);
  text-decoration: underline;
}

.btn-danger {
  background: var(--danger);
  color: #ffffff;
}

.btn-danger:hover {
  color: #ffffff;
  background: #6d1818;
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}

.btn-danger-ghost:hover {
  background: var(--danger-tint);
  color: var(--danger);
}

.entry-card {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.9rem 1rem;
  margin-bottom: 1rem;
}

.entry-title {
  margin-top: 0;
  font-size: 1rem;
  color: var(--accent-strong);
}

.entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
  margin-top: 0.4rem;
}

.confirm-delete {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
}

.doc-row {
  margin-bottom: 0.9rem;
  padding: 0.7rem 0.9rem 0.8rem;
}

.doc-row legend {
  font-size: 1rem;
  color: var(--ink);
}

.seg-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.seg {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.seg input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  margin: 0;
}

.seg span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  border: 2px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--paper);
}

.seg input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.seg input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.seg:hover span {
  border-color: var(--ink-soft);
}

.doc-row-custom {
  border-style: dashed;
}

.field-inline {
  margin-bottom: 0.7rem;
}

.field-inline input[type="text"] {
  max-width: 26rem;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  background: var(--panel);
}

.official-links {
  margin-top: 1.6rem;
  border-top: 1px solid var(--line-strong);
  padding-top: 1.1rem;
}

.official-links h2 {
  font-size: 1.1rem;
}

.site-footer {
  background: var(--ink);
  color: #c9d4de;
  padding: 1.4rem 1rem 1.6rem;
}

.site-footer a {
  color: #ffffff;
}

.footer-brand {
  max-width: 47rem;
  margin: 0 auto 0.8rem;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.4rem;
  max-width: 47rem;
  margin: 0 auto 0.8rem;
  padding: 0;
}

.footer-links li {
  margin: 0;
}

.footer-meta {
  max-width: 47rem;
  margin: 0 auto;
  font-size: 0.85rem;
  color: #9fadb9;
}

.review-notice {
  border: 2px solid var(--ink-soft);
  border-left: 6px solid var(--ink-soft);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0.9rem 1rem;
  margin-bottom: 1.1rem;
  font-size: 0.95rem;
}

.review-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  margin-bottom: 1rem;
  padding: 0.9rem 1rem;
}

.review-card h3 {
  margin-top: 0;
}

.review-lines {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  margin: 0 0 0.7rem;
}

.review-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.7rem;
}

.review-card-actions .btn {
  min-height: 40px;
  padding: 0.3rem 0.8rem;
  font-size: 0.9rem;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.2rem 0;
}

.review-empty {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1rem;
  color: var(--ink-soft);
}

.reset-confirm {
  margin-top: 0.8rem;
}

.print-only {
  display: none;
}

.clip-helper {
  position: fixed;
  top: -9999px;
  left: -9999px;
  opacity: 0;
}

html:not(.js) .step {
  display: block;
}

html.js .step {
  display: none;
}

html.js .step.is-active {
  display: block;
}

html.js .step.is-skipped {
  display: none !important;
}

html.js #start-panel[hidden] {
  display: none;
}

html.js #start-panel.is-closed {
  display: none;
}

html.js #start-panel.is-open {
  display: block;
}

@media (prefers-reduced-motion: no-preference) {
  .btn,
  .seg span {
    transition: background-color 0.15s ease-out, border-color 0.15s ease-out, color 0.15s ease-out;
  }
}

@media (forced-colors: active) {
  .seg input {
    position: static;
    width: auto;
    height: auto;
    opacity: 1;
  }

  .seg input:checked + span {
    background: Highlight;
    color: HighlightText;
  }

  .progress-track {
    border: 1px solid currentColor;
  }

  .progress-track::-webkit-progress-value {
    background: Highlight;
  }

  .progress-track::-moz-progress-bar {
    background: Highlight;
  }

  .progress-list button[aria-current="step"] {
    background: Highlight;
    color: HighlightText;
  }

  .step-badge {
    border-color: currentColor;
  }

  .progress-list button[aria-current="step"] .step-badge,
  .progress-list button[data-complete] .step-badge {
    background: Highlight;
    border-color: Highlight;
    color: HighlightText;
  }

  .btn-primary {
    background: Highlight;
    color: HighlightText;
  }

  .btn-danger {
    background: Highlight;
    color: HighlightText;
  }

  .notice,
  .step,
  .entry-card,
  .review-card,
  .banner {
    border-color: currentColor;
  }

  .notice-disclaimer,
  .review-notice {
    border-color: currentColor;
  }
}

@media (min-width: 60em) {
  main {
    max-width: 68rem;
  }

  .app-layout.layout-active {
    grid-template-columns: 15.5rem minmax(0, 1fr);
    column-gap: 1.5rem;
  }

  .progress {
    position: sticky;
    top: 1rem;
    margin: 0;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
  }

  .progress-list {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 0.15rem;
  }

  .progress-list button {
    width: 100%;
    border: none;
    border-radius: var(--radius);
    padding: 0.5rem 0.65rem;
    min-height: 44px;
    text-align: left;
    justify-content: flex-start;
  }

  .progress-list button:hover {
    background: var(--canvas);
  }

  .progress-list button[aria-current="step"] {
    background: var(--accent-tint);
    color: var(--accent-strong);
    font-weight: 700;
  }

  .progress-list button[data-complete] {
    color: var(--ink-soft);
  }

  .step-badge {
    display: inline-flex;
    border: 1px solid var(--line-strong);
    color: var(--ink-soft);
  }

  .progress-list button[aria-current="step"] .step-badge {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
  }

  .progress-list button[data-complete] .step-badge {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
  }
}

@media (min-width: 35em) {
  .fact-with-source {
    display: grid;
    grid-template-columns: 1fr 12rem;
    column-gap: 1rem;
    align-items: end;
  }

  .fact-with-source > label:first-child,
  .fact-with-source > .hint {
    grid-column: 1 / -1;
  }

  .fact-with-source select {
    width: 100%;
  }
}

@media (max-width: 34.99em) {
  main {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .step {
    padding: 0.9rem 0.75rem 1rem;
  }

  .fieldset-inline .choice-row {
    margin-right: 0.8rem;
  }

  .step-actions .btn {
    flex: 1 1 auto;
  }
}

@media print {
  @page {
    size: A4;
    margin: 16mm 14mm;
  }

  html,
  body {
    background: #ffffff;
    color: #000000;
    font-size: 11pt;
    line-height: 1.45;
  }

  main,
  .site-footer,
  .no-print,
  .progress,
  .save-status-wrap,
  .banner,
  .step,
  .site-header,
  .skip-link,
  .start-panel,
  .official-links {
    display: none !important;
  }

  #print-area {
    display: block;
  }

  #print-area * {
    color: #000000;
  }

  .print-title {
    font-size: 17pt;
    font-weight: 700;
    margin: 0 0 0.3rem;
  }

  .print-meta {
    font-size: 10pt;
    margin-bottom: 0.9rem;
  }

  .print-label {
    font-weight: 700;
    border: 1.5pt solid #000000;
    padding: 0.35rem 0.5rem;
    margin-bottom: 0.9rem;
    font-size: 10.5pt;
  }

  .print-section {
    margin-bottom: 1rem;
    break-inside: auto;
  }

  .print-section h2 {
    font-size: 12pt;
    border-bottom: 1pt solid #000000;
    padding-bottom: 0.15rem;
    margin-bottom: 0.4rem;
    break-after: avoid;
  }

  .print-entry {
    break-inside: avoid;
    margin-bottom: 0.45rem;
  }

  .print-lines {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    margin: 0;
  }

  .print-lines li {
    margin-bottom: 0.25rem;
  }

  .print-disclaimer {
    border-top: 1pt solid #000000;
    margin-top: 1rem;
    padding-top: 0.6rem;
    font-size: 9.5pt;
  }

  .print-disclaimer p {
    margin-bottom: 0.4rem;
  }

  .print-footer {
    font-size: 9pt;
    margin-top: 0.8rem;
  }

  body.print-questions [data-print-group="full"] {
    display: none;
  }
}
