:root {
  --ink: #172423;
  --muted: #536461;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --line: #d8ded9;
  --green: #0d5b4d;
  --green-bright: #16a37e;
  --green-soft: #e6f2ed;
  --amber: #8a5700;
  --amber-soft: #fff3d6;
  --red: #8f2d27;
  --red-soft: #fbe9e6;
  --shadow: 0 18px 50px rgba(23, 36, 35, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Yu Gothic", sans-serif;
  line-height: 1.75;
}

a {
  color: var(--green);
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 3px solid #0b6fff;
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  transform: translateY(-180%);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  background: var(--ink);
  color: white;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto;
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  font-weight: 750;
  text-decoration: none;
  letter-spacing: -0.02em;
}

.brand-mark {
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border-radius: 9px;
  background: var(--green);
  color: white;
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  width: min(calc(100% - 2rem), var(--max));
  margin: 3.5rem auto 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
  gap: clamp(2rem, 7vw, 7rem);
  align-items: end;
}

.eyebrow {
  margin: 0 0 0.75rem;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 800px;
  margin: 0;
  font-size: clamp(2.85rem, 7vw, 6rem);
  line-height: 1.05;
  letter-spacing: -0.065em;
  font-weight: 760;
}

h2 {
  margin: 0;
  font-size: clamp(2rem, 4.4vw, 3.8rem);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.35;
}

.hero-lede {
  max-width: 680px;
  margin: 1.8rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.75rem 1.4rem;
  font: inherit;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--green);
  color: white;
  box-shadow: 0 8px 20px rgba(13, 91, 77, 0.18);
}

.button.primary:hover {
  background: #09483d;
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.text-link {
  font-weight: 700;
}

.privacy-card {
  border: 1px solid #c8d8d0;
  border-radius: var(--radius-lg);
  padding: 1.7rem;
  background: var(--green-soft);
  box-shadow: var(--shadow);
}

.privacy-card h2 {
  margin-top: 1rem;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.privacy-card p {
  margin: 0.7rem 0 0;
  color: #354b47;
  font-size: 0.93rem;
}

.privacy-icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-weight: 900;
}

.fine-print {
  font-size: 0.78rem !important;
}

.trust-strip {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto 7rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
}

.trust-strip div {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 1.2rem 1rem;
  text-align: center;
}

.trust-strip div + div {
  border-left: 1px solid var(--line);
}

.trust-strip strong {
  font-size: 1.05rem;
}

.trust-strip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.diagnostic-shell,
.results,
.sources-section,
.about-section {
  width: min(calc(100% - 2rem), var(--max));
  margin: 0 auto 7rem;
}

.section-intro {
  max-width: 760px;
  margin-bottom: 2rem;
}

.section-intro > p:last-child {
  margin-top: 1rem;
  color: var(--muted);
}

.progress-panel {
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 1rem;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 245, 239, 0.96);
  backdrop-filter: blur(10px);
}

.progress-copy {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

progress {
  width: 100%;
  height: 0.55rem;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 999px;
  background: #d9ded9;
}

progress::-webkit-progress-bar {
  border-radius: 999px;
  background: #d9ded9;
}

progress::-webkit-progress-value {
  border-radius: 999px;
  background: var(--green-bright);
}

progress::-moz-progress-bar {
  border-radius: 999px;
  background: var(--green-bright);
}

.error-summary {
  margin: 1.25rem 0;
  border: 2px solid var(--red);
  border-radius: 14px;
  padding: 1rem 1.25rem;
  background: var(--red-soft);
}

.error-summary p,
.error-summary ul {
  margin: 0.5rem 0 0;
}

.question-section {
  margin-top: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.question-section-header {
  padding: clamp(1.4rem, 4vw, 2.3rem);
  border-bottom: 1px solid var(--line);
  background: #fbfcf9;
}

.question-section-header p:last-child {
  max-width: 700px;
  margin: 0.7rem 0 0;
  color: var(--muted);
}

fieldset {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: clamp(1.4rem, 4vw, 2.3rem);
}

fieldset + fieldset {
  border-top: 1px solid var(--line);
}

legend {
  max-width: 780px;
  padding: 0;
  font-weight: 750;
  line-height: 1.5;
}

.question-help {
  max-width: 760px;
  margin: 0.45rem 0 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.choice-grid.profile-grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.choice {
  position: relative;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice label {
  min-height: 50px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 0.7rem 0.85rem;
  background: #fff;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.choice label::before {
  content: "";
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
  border: 2px solid #8b9996;
  border-radius: 50%;
}

.choice.checkbox label::before {
  border-radius: 4px;
}

.choice input:checked + label {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--green);
}

.choice input:checked + label::before {
  border: 4px solid var(--green);
  background: white;
}

.choice.checkbox input:checked + label::before {
  border: 3px solid var(--green);
  background: var(--green);
  box-shadow: inset 0 0 0 2px white;
}

.choice input:focus-visible + label {
  outline: 3px solid #0b6fff;
  outline-offset: 3px;
}

.service-fieldset {
  background: #fbfcf9;
}

.service-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.form-note {
  color: var(--muted);
  font-size: 0.8rem;
}

.results {
  border-top: 3px solid var(--ink);
  padding-top: 3rem;
}

.result-header,
.split-intro {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  align-items: start;
}

.result-summary {
  margin: 2rem 0;
  border-radius: var(--radius-md);
  padding: 1.4rem 1.5rem;
}

.result-summary[data-status="stop"] {
  border: 1px solid #e2b9b5;
  background: var(--red-soft);
}

.result-summary[data-status="confirm"] {
  border: 1px solid #e4cf95;
  background: var(--amber-soft);
}

.result-summary[data-status="checked"] {
  border: 1px solid #bbd4c8;
  background: var(--green-soft);
}

.summary-label {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
}

.summary-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.summary-counts span {
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.78rem;
  font-weight: 750;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.result-panel,
.tailored-panel,
.switch-order,
.result-sources,
.confirmed-details {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  background: var(--surface);
}

.danger-panel {
  border-top: 5px solid var(--red);
}

.caution-panel {
  border-top: 5px solid var(--amber);
}

.panel-heading {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.status-dot {
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 50%;
  background: var(--red);
}

.caution-panel .status-dot {
  background: var(--amber);
}

.result-list {
  margin: 1rem 0 0;
  padding-left: 1.2rem;
}

.result-list li + li {
  margin-top: 0.8rem;
}

.result-list small {
  display: block;
  color: var(--muted);
}

.empty-item {
  color: var(--muted);
}

.tailored-panel,
.switch-order,
.result-sources,
.confirmed-details {
  margin-top: 1rem;
}

.tailored-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tailored-item {
  border-left: 3px solid var(--green-bright);
  padding-left: 1rem;
}

.tailored-item p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.switch-order ol {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: switch-step;
}

.switch-order li {
  display: grid;
  grid-template-columns: 2rem 5rem 1fr;
  gap: 0.75rem;
  align-items: start;
  counter-increment: switch-step;
}

.switch-order li + li {
  margin-top: 1rem;
}

.switch-order li::before {
  content: counter(switch-step);
  width: 1.8rem;
  height: 1.8rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: white;
  font-size: 0.78rem;
  font-weight: 800;
}

.switch-order span {
  color: var(--muted);
}

.source-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 1rem;
}

.source-link {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  text-decoration: none;
}

.source-link:hover {
  background: var(--green-soft);
}

.source-link span {
  color: var(--muted);
  font-size: 0.75rem;
}

.confirmed-details summary {
  font-weight: 750;
  cursor: pointer;
}

.disclaimer {
  margin: 1rem 0 0;
  border-left: 3px solid var(--ink);
  padding: 0.8rem 1rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.sources-section {
  padding-top: 2rem;
}

.split-intro > p {
  max-width: 460px;
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.source-library {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.source-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  background: var(--surface);
}

.source-card h3 {
  margin-top: 0.25rem;
  font-size: 1rem;
}

.source-card p {
  margin: 0.65rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-card a {
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 750;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.8rem;
}

.source-meta span {
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: #eef1ee;
  color: var(--muted);
  font-size: 0.69rem;
}

.source-meta .stale {
  background: var(--red-soft);
  color: var(--red);
  font-weight: 800;
}

.about-section {
  display: grid;
  grid-template-columns: 0.75fr 1.25fr;
  gap: clamp(2rem, 6vw, 6rem);
  align-items: start;
}

.boundary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.boundary-grid article {
  border-top: 3px solid var(--green);
  padding-top: 1rem;
}

.boundary-grid article:last-child {
  border-color: var(--red);
}

.boundary-grid ul {
  margin: 0.7rem 0 0;
  padding-left: 1.2rem;
  color: var(--muted);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  border-top: 1px solid var(--line);
  padding: 2rem max(1rem, calc((100% - var(--max)) / 2));
  color: var(--muted);
  font-size: 0.78rem;
}

footer p {
  margin: 0;
}

.noscript-message {
  position: fixed;
  inset: auto 1rem 1rem;
  z-index: 100;
  border-radius: 12px;
  padding: 1rem;
  background: var(--red);
  color: white;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .hero,
  .about-section {
    grid-template-columns: 1fr;
  }

  .hero {
    margin-top: 2rem;
  }

  .privacy-card {
    max-width: 560px;
  }

  .source-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-grid,
  .tailored-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  html {
    scroll-behavior: auto;
  }

  .site-header {
    min-height: 66px;
  }

  nav {
    display: none;
  }

  .brand {
    font-size: 0.9rem;
  }

  h1 {
    font-size: clamp(2.6rem, 14vw, 4.6rem);
  }

  .trust-strip {
    grid-template-columns: 1fr;
    margin-bottom: 5rem;
  }

  .trust-strip div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .choice-grid,
  .choice-grid.profile-grid,
  .service-grid,
  .source-link-grid,
  .source-library,
  .boundary-grid {
    grid-template-columns: 1fr;
  }

  .result-header,
  .split-intro {
    flex-direction: column;
  }

  .switch-order li {
    grid-template-columns: 2rem 1fr;
  }

  .switch-order li span {
    grid-column: 2;
  }

  footer {
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  body {
    background: white;
  }

  .site-header,
  .hero,
  .trust-strip,
  .diagnostic-shell,
  .sources-section,
  .about-section,
  footer,
  .print-button {
    display: none !important;
  }

  .results {
    width: 100%;
    margin: 0;
    border: 0;
    padding: 0;
  }

  .result-panel,
  .tailored-panel,
  .switch-order,
  .result-sources,
  .confirmed-details {
    break-inside: avoid;
    box-shadow: none;
  }
}
