:root {
  --bg: #f3f1ec;
  --surface: #fffefa;
  --surface-soft: #f8f6f1;
  --surface-blue: #eef3fa;
  --ink: #192535;
  --muted: #5f6873;
  --line: #d8d4cc;
  --line-strong: #c5c0b7;
  --accent: #145fd1;
  --accent-strong: #0d4eaa;
  --accent-soft: #eaf0f8;
  --teal: #168b7d;
  --warn: #824a0b;
  --warn-bg: #fbf1df;
  --warn-line: #e6c68d;
  --ok: #0c6853;
  --ok-bg: #e9f4ef;
  --ok-line: #add3c3;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 5.5rem; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
::selection { color: #fff; background: var(--accent); }
a {
  color: var(--accent-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); }
.skip {
  position: absolute;
  left: -9999px;
  top: .75rem;
  z-index: 99;
  padding: .55rem .8rem;
  color: #fff;
  background: var(--accent-strong);
  text-decoration: none;
}
.skip:focus { left: 1rem; }
.wrap { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; }

.site-header {
  color: #fff;
  background: #102746;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}
.site-header .wrap {
  min-height: 94px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand { margin: 0; }
.site-header .brand a {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: #fff;
  font-size: clamp(1.15rem, 2vw, 1.42rem);
  font-weight: 760;
  letter-spacing: -.02em;
  text-decoration: none;
}
.site-header .brand a::before {
  content: "";
  width: .35rem;
  height: 2rem;
  flex: 0 0 .35rem;
  background: #e4a13c;
}
.tag {
  max-width: 28rem;
  margin: 0;
  color: #b9cbe0;
  font-size: .92rem;
  line-height: 1.45;
  text-align: right;
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line-strong);
}
.nav-scroll {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: .55rem 0;
  scrollbar-width: thin;
  scrollbar-color: #b9cbe4 transparent;
}
.nav-scroll::-webkit-scrollbar { height: 4px; }
.nav-scroll::-webkit-scrollbar-thumb { background: #b9cbe4; border-radius: 0; }
.site-nav a {
  flex: 0 0 auto;
  white-space: nowrap;
  padding: .5rem .48rem;
  border: 0;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-bottom-color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  align-items: start;
  gap: 2.5rem;
  padding: 2rem 0 4rem;
}
.toc {
  position: sticky;
  top: 5.2rem;
  align-self: start;
  padding: .2rem 0 .2rem 1rem;
  border-left: 2px solid var(--line-strong);
}
.toc .toc-label {
  display: flex;
  align-items: center;
  gap: .45rem;
  margin: 0 0 .85rem;
  color: var(--ink);
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.toc .toc-label::before {
  content: "";
  width: 1.5rem;
  height: 2px;
  background: var(--teal);
}
.toc ol {
  counter-reset: toc-item;
  list-style: none;
  margin: 0;
  padding: 0;
}
.toc li {
  counter-increment: toc-item;
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: .35rem;
  align-items: start;
  margin: .15rem 0;
}
.toc li::before {
  content: counter(toc-item, decimal-leading-zero);
  padding-top: .43rem;
  color: #8a9bb0;
  font-size: .68rem;
  font-weight: 750;
}
.toc a {
  display: block;
  padding: .36rem .4rem;
  border-left: 2px solid transparent;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.35;
  text-decoration: none;
}
.toc a:hover {
  color: var(--accent-strong);
  background: transparent;
  border-left-color: var(--accent);
}

main {
  min-width: 0;
  padding: clamp(1.7rem, 3vw, 2.8rem) clamp(1.15rem, 4vw, 3.4rem) 3rem;
  border-top: 5px solid var(--accent);
  background: var(--surface);
}
h1 {
  max-width: 46rem;
  margin: 0;
  color: var(--ink);
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.045em;
}
h1::after {
  content: "";
  display: block;
  width: 2.5rem;
  height: 2px;
  margin-top: 1.1rem;
  background: var(--accent);
}
.lead {
  max-width: 47rem;
  margin: 1.2rem 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.12rem);
  line-height: 1.75;
}
h2 {
  margin: 2.8rem 0 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  line-height: 1.25;
  letter-spacing: -.025em;
}
.lead + h2 {
  margin-top: 2.3rem;
  padding-top: 0;
  border-top: 0;
}
h3 {
  margin: 0 0 .45rem;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.35;
}
p { margin: .65rem 0; }
strong { font-weight: 750; }
kbd {
  display: inline-block;
  min-width: 1.5em;
  padding: .08rem .35rem;
  border: 1px solid #c8d3df;
  border-bottom-width: 2px;
  border-radius: 2px;
  color: #233a57;
  background: #f5f8fb;
  font-family: inherit;
  font-size: .86em;
  line-height: 1.35;
  white-space: nowrap;
}

.callout {
  margin: 1.2rem 0;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  background: var(--surface-blue);
}
.callout.do-not-skip {
  color: var(--warn);
  border-color: var(--warn-line);
  border-left-color: #cf841d;
  background: var(--warn-bg);
}
.callout.ok {
  color: var(--ok);
  border-color: var(--ok-line);
  border-left-color: var(--teal);
  background: var(--ok-bg);
}
.branch-box {
  display: grid;
  gap: 0;
  margin: 1rem 0;
}
.branch-box.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.branch {
  min-width: 0;
  padding: 1rem .85rem;
  border: 1px solid var(--line);
  border-top: 3px solid #c5dafa;
  background: var(--surface);
}
.branch + .branch { border-left: 0; }
.branch strong {
  display: block;
  margin-bottom: .28rem;
  color: var(--ink);
}
.steps {
  counter-reset: step;
  list-style: none;
  margin: 0;
  padding: 0;
}
.steps > li {
  position: relative;
  margin: 0 0 1rem;
  padding: 1.15rem 1.2rem 1.15rem 3.8rem;
  border: 1px solid var(--line);
  border-left: 3px solid #c7daf8;
  background: var(--surface-soft);
}
.steps > li::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  position: absolute;
  top: 1.08rem;
  left: .95rem;
  color: var(--accent);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: .03em;
}
.steps > li p:first-of-type { margin-top: 0; }
.symptom-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.symptom-map a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 2.9rem;
  padding: .65rem 2rem .65rem .9rem;
  border: 0;
  border-bottom: 1px solid #cbdcf4;
  color: #24405f;
  background: transparent;
  font-size: .9rem;
  line-height: 1.35;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease;
}
.symptom-map a::after {
  content: "→";
  position: absolute;
  right: .8rem;
  color: var(--accent);
  font-size: 1.05rem;
}
.symptom-map a:hover {
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
}
.figure {
  margin: 1rem 0 .3rem;
  padding: .4rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}
.figure picture { display: block; }
.figure img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 140px;
  border-radius: 0;
  background: #edf2f7;
  object-fit: cover;
}
.figure figcaption {
  margin: .45rem 0 .1rem;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.45;
}
.faq details {
  margin: .6rem 0;
  padding: .7rem 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
}
.faq details[open] { border-color: #bcd2f2; background: #f7faff; }
.faq summary {
  cursor: pointer;
  padding: 0 1rem;
  color: var(--ink);
  font-weight: 720;
}
.faq summary::marker { color: var(--accent); }
.faq details p { margin: .6rem 1rem .1rem; color: var(--muted); }
.sources {
  margin-top: 2.5rem;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface-soft);
}
.sources h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.sources ul { margin-bottom: 0; padding-left: 1.2rem; }
.disclaimer { color: var(--muted); font-size: .86rem; }
.site-footer {
  padding: 1.6rem 0 2.3rem;
  color: #a9bad0;
  background: #102746;
  font-size: .88rem;
}
.site-footer p { margin: 0; }

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; gap: 1rem; }
  .toc {
    position: static;
    padding: .75rem 0;
    border-left: 0;
    border-top: 1px solid var(--line-strong);
    border-bottom: 1px solid var(--line-strong);
  }
  .toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .1rem .6rem; }
}
@media (max-width: 700px) {
  .wrap { width: min(100% - 1.25rem, 1180px); }
  .site-header .wrap { min-height: 100px; align-items: flex-start; flex-direction: column; justify-content: center; gap: .55rem; }
  .tag { text-align: left; }
  .nav-scroll { padding: .5rem 0; }
  .site-nav a { padding: .38rem .62rem; font-size: .82rem; }
  .layout { padding: 1rem 0 2.5rem; }
  main { padding: 1.35rem .95rem 2.2rem; }
  h1 { font-size: clamp(1.8rem, 9vw, 2.35rem); }
  h2 { margin-top: 2.2rem; }
  .branch-box.two { grid-template-columns: 1fr; }
  .branch + .branch { border-left: 1px solid var(--line); border-top: 0; }
  .steps > li { padding-right: .9rem; padding-left: 3.4rem; }
  .steps > li::before { left: .75rem; }
}
@media (max-width: 480px) {
  .toc ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .symptom-map { grid-template-columns: 1fr; }
}
