@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-400.woff2") format("woff2");
}

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-sans-3-latin-600.woff2") format("woff2");
}

@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/source-serif-4-latin-600.woff2") format("woff2");
}

:root {
  --bg: #f7f8fc;
  --card: #ffffff;
  --ink: #171923;
  --muted: #3e4458;
  --line: #e2e5f0;
  --accent: #7955e8;
  --accent-ink: #4c2e9e;
  --soft: #e9e3ff;
  --stop: #f8ecec;
  --stop-ink: #6e2424;
  --check: #e8f6ef;
  --check-ink: #0f5132;
  --shadow: 0 10px 30px rgba(23, 25, 35, 0.05);
  --header: 72px;
  --wrap: 1120px;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --radius: 18px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}

code {
  overflow-wrap: anywhere;
  font-size: 0.95em;
}

a {
  color: var(--accent-ink);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

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

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

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 20;
  background: var(--ink);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: 8px;
}

.skip:focus {
  top: 12px;
}

.wrap {
  width: min(var(--wrap), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 248, 252, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner {
  min-height: var(--header);
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  margin-right: auto;
}

.brand-mark {
  width: 36px;
  height: 36px;
  flex: none;
}

.brand-name {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-toggle {
  display: none;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 12px;
  color: var(--ink);
  font: 600 0.95rem/1 var(--sans);
  padding: 0 14px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 8px 10px;
  border-radius: 999px;
}

.site-nav a[aria-current="page"] {
  background: var(--soft);
  color: var(--accent-ink);
}

.site-nav a:hover {
  background: var(--card);
}

main {
  padding-bottom: 72px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
  padding-top: 22px;
}

.crumbs a {
  color: var(--muted);
}

.page-hero {
  padding: 18px 0 8px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  max-width: 18ch;
}

.lede {
  font-size: 1.18rem;
  max-width: 62ch;
  color: var(--ink);
}

.layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  margin-top: 12px;
}

.layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.toc {
  position: sticky;
  top: calc(var(--header) + 16px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px 16px;
  box-shadow: var(--shadow);
}

.toc summary {
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.toc ol {
  margin: 8px 0 0;
  padding-left: 18px;
}

.toc a {
  color: var(--ink);
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

.content > section {
  margin-top: 36px;
}

.content h2 {
  font-size: clamp(1.55rem, 2vw, 2rem);
  margin: 0 0 10px;
}

.content h3 {
  font-size: 1.28rem;
  margin: 22px 0 8px;
}

.content p,
.content li {
  max-width: 72ch;
}

.hero-grid,
.two-col,
.card-grid {
  display: grid;
  gap: 18px;
}

.hero-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  margin-top: 8px;
}

.card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

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

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  box-shadow: var(--shadow);
}

.card h2,
.card h3 {
  margin-top: 0;
}

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

.card a.more {
  font-weight: 600;
}

.soft {
  background: var(--soft);
  border-color: transparent;
}

figure.diagram {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

figure.diagram img {
  display: block;
  width: 100%;
  height: auto;
}

figcaption {
  padding: 10px 14px 14px;
  color: var(--muted);
  font-size: 0.92rem;
}

.flow {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  overflow-x: auto;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

th {
  background: #f3f1fb;
  font-size: 0.92rem;
}

tr:last-child td {
  border-bottom: 0;
}

ol.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: step;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  margin: 0 0 12px;
  padding: 14px 14px 14px 64px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  max-width: none;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.callout {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 16px 0;
  max-width: 72ch;
}

.callout p:first-child {
  margin-top: 0;
}

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

.callout-note {
  background: var(--soft);
}

.callout-stop {
  background: var(--stop);
  color: var(--stop-ink);
}

.callout-stop a {
  color: #5a1d1d;
}

.callout-check {
  background: var(--check);
  color: var(--check-ink);
}

.callout-check a {
  color: #0c3d26;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
}

.checklist li {
  margin: 0 0 8px;
  max-width: none;
}

.checklist label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.checklist input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--accent);
  flex: none;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 18px;
}

.chip,
.button {
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: 600 0.95rem/1 var(--sans);
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip[aria-pressed="true"],
.button-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.button-primary:hover {
  background: #6844d6;
}

.case {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 18px 16px;
  margin-bottom: 14px;
}

.case h3 {
  margin-top: 12px;
}

.case dl {
  display: grid;
  gap: 8px;
}

.case dt {
  font-weight: 600;
}

.case dd {
  margin: 0 0 8px;
}

.calc {
  display: grid;
  gap: 12px;
}

.calc label,
.contact label {
  display: grid;
  gap: 6px;
  font-weight: 600;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #c9ceda;
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 12px;
  font: 400 1rem/1.4 var(--sans);
}

input:focus,
textarea:focus,
select:focus {
  outline: 3px solid #d9cff8;
  border-color: var(--accent);
}

.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.contact-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.form-status:empty,
.field-error:empty {
  display: none;
}

.field-error,
.form-status {
  font-weight: 600;
}

.field-error {
  color: var(--stop-ink);
}

.form-status[data-state="success"],
.form-status[data-state="error"] {
  margin-top: 12px;
}

.form-status[data-state="success"] {
  background: var(--check);
  color: var(--check-ink);
  padding: 12px 14px;
  border-radius: 12px;
}

.form-status[data-state="error"] {
  background: var(--stop);
  color: var(--stop-ink);
  padding: 12px 14px;
  border-radius: 12px;
}

.contact label.checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
}

.contact label.checkline input {
  width: 20px;
  height: 20px;
  flex: none;
  margin-top: 4px;
}

.meter {
  height: 14px;
  background: #eceff6;
  border-radius: 999px;
  overflow: hidden;
}

.meter span {
  display: block;
  height: 100%;
  background: var(--accent);
  width: 0;
}

.faq {
  border-top: 1px solid var(--line);
}

.faq details {
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 14px 12px;
  min-height: 44px;
}

.faq details p {
  margin: 0;
  padding: 0 12px 14px;
}

.related ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.related a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
}

.site-footer {
  background: var(--ink);
  color: #f7f8fc;
  padding: 36px 0 28px;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 24px;
}

.site-footer h2 {
  font-family: var(--sans);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 10px;
}

.site-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer li {
  margin: 6px 0;
}

.footer-note {
  margin-top: 22px;
  color: #c9cdd8;
  font-size: 0.92rem;
}

.back-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.legal h2 {
  scroll-margin-top: calc(var(--header) + 12px);
}

h2,
h3 {
  scroll-margin-top: calc(var(--header) + 12px);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.result-grid div {
  background: var(--soft);
  border-radius: 12px;
  padding: 10px 12px;
}

.result-grid strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.3rem;
}

@media (max-width: 1200px) {
  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
  }

  .js .site-nav.is-open {
    display: flex;
  }
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .toc {
    position: static;
  }

  .card-grid,
  .footer-grid,
  .hero-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .contact-row {
    grid-template-columns: 1fr;
  }

  .js .nav-toggle {
    display: inline-flex;
  }

  .js .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: var(--header);
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px 16px;
  }

  .js .site-nav.is-open {
    display: flex;
  }

  .site-nav a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .card-grid,
  .card-grid.cols-2,
  .footer-grid,
  .hero-grid,
  .result-grid {
    grid-template-columns: 1fr;
  }

  .js .toc:not([open]) ol {
    display: none;
  }
}

@media (max-width: 390px) {
  .wrap {
    width: min(var(--wrap), calc(100% - 24px));
  }

  h1 {
    font-size: 1.85rem;
  }

  .brand-sub {
    display: none;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
