/* Product Resolver system guide. Tokens are the editorial-monocle direction. */
:root {
  --bg:      oklch(98% 0.004 95);
  --surface: oklch(100% 0.002 95);
  --fg:      oklch(20% 0.018 70);
  --muted:   oklch(48% 0.012 70);
  --border:  oklch(90% 0.006 95);
  --accent:  oklch(52% 0.10 28);
  --accent-ink: oklch(98% 0.004 95);
  --accent-hover: oklch(44% 0.10 28);
  --fg-soft: oklch(32% 0.018 70);
  --line: oklch(86% 0.008 90);
  --chip: oklch(96% 0.006 95);
  --font-display: "Iowan Old Style", Charter, Georgia, serif;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "IBM Plex Mono", "JetBrains Mono", Menlo, monospace;
  --nav: 15.5rem;
  --measure: 68ch;
  --wide: 76rem;
}

* { box-sizing: border-box; }
html { scroll-padding-top: 1.25rem; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 18px/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; }
a { color: var(--fg); text-underline-offset: 0.18em; }
a:hover { background: oklch(94% 0.012 90); }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, .figure-scroll:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}
.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--fg);
  color: var(--bg);
  padding: 0.7rem 1rem;
  z-index: 5;
}
.skip:focus { top: 0.75rem; }

.shell {
  display: grid;
  grid-template-columns: var(--nav) minmax(0, 1fr);
  min-height: 100vh;
}
.nav {
  position: sticky;
  top: 0;
  align-self: start;
  max-height: 100vh;
  overflow: auto;
  padding: 1.25rem 1rem 2rem 1.25rem;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.brand {
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-decoration: none;
  display: block;
  margin-bottom: 0.35rem;
}
.brand small {
  display: block;
  margin-top: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 400;
}
.contents-toggle { display: none; }
.nav ol { list-style: none; margin: 1.25rem 0 0; padding: 0; }
.nav details { margin: 0; }
.nav ol a {
  display: flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  border-top: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.3;
  padding: 0.35rem 0;
}
.nav ol a[aria-current="page"] {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.nav .idx {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  width: 1.6rem;
  flex: none;
}

.main { min-width: 0; padding: 2.25rem 1.5rem 4rem; }
.wrap { max-width: var(--wide); }
.lede, .prose p, .prose li { max-width: var(--measure); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.12; }
h1 { font-size: clamp(2.6rem, 5vw, 4.4rem); margin: 0.2rem 0 0.8rem; max-width: 16ch; }
h2 { font-size: clamp(1.7rem, 2.4vw, 2.15rem); margin: 2.4rem 0 0.6rem; }
h3 { font-size: 1.35rem; margin: 1.6rem 0 0.4rem; }
h4 { font-size: 1.12rem; margin: 1.2rem 0 0.3rem; }
.kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.lede { font-size: 1.22rem; line-height: 1.45; margin-top: 0.4rem; }
.banner {
  display: grid;
  gap: 0.35rem 1.5rem;
  grid-template-columns: auto 1fr;
  border-top: 1px solid var(--fg);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 0;
  margin: 1.25rem 0 1.5rem;
  max-width: var(--wide);
  font-size: 0.95rem;
}
.banner strong { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.8rem 0 1rem; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--fg);
  padding: 0.28rem 0.5rem;
  background: var(--surface);
  color: var(--fg);
}
.chip.confirmed { border-width: 1.5px; }
.chip.open, .chip.unverified { color: var(--muted); border-color: var(--line); }
.chip.prototype { border-style: dashed; }
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 1rem;
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  font-size: 1rem;
}
.btn:hover { background: var(--accent-hover); color: var(--accent-ink); }
.btn:focus-visible { outline-color: var(--fg); }
.text-link { font-size: 1rem; }

table { border-collapse: collapse; width: 100%; font-size: 0.95rem; margin: 0.8rem 0 1.2rem; }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); padding: 0.55rem 0.7rem 0.55rem 0; }
th { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; color: var(--muted); }
.table-scroll { overflow-x: auto; max-width: 100%; margin: 0.5rem 0 1rem; }
.table-scroll:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
td.num, th.num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); font-size: 0.88rem; text-align: right; }

.figure {
  margin: 1.4rem 0 1.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--fg);
  max-width: var(--wide);
}
.figure h3 { margin-top: 0.25rem; max-width: 28ch; }
.figure-scroll {
  overflow-x: auto;
  max-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  margin: 0.7rem 0;
}
.figure-scroll svg { display: block; width: auto; max-width: none; height: auto; }
.takeaway { max-width: var(--measure); }
.takeaway strong { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; }
.equiv { max-width: 75ch; padding-left: 1.2rem; }
.equiv li { margin: 0.2rem 0; }
.fig-meta { color: var(--muted); font-size: 0.92rem; max-width: var(--measure); }

.note {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 0;
  margin: 1rem 0;
  max-width: var(--measure);
}
.note .kicker { margin-bottom: 0.25rem; }
code, .mono { font-family: var(--font-mono); font-size: 0.86em; }
pre {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.9rem 1rem;
  overflow-x: auto;
  max-width: var(--wide);
}
pre:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
.def {
  margin: 1rem 0 1.2rem;
  max-width: 78ch;
}
.def h3 { margin-bottom: 0.2rem; }
.def dt { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 0.45rem; }
.def dd { margin: 0.1rem 0 0; }
.path { list-style: none; padding: 0; margin: 0.6rem 0 1rem; max-width: 46rem; }
.path li { border-top: 1px solid var(--border); padding: 0.75rem 0; display: grid; grid-template-columns: 2.2rem 1fr; gap: 0.6rem; }
.path .n { font-family: var(--font-mono); color: var(--muted); }
.service {
  border-top: 1px solid var(--fg);
  padding-top: 0.4rem;
  margin-top: 2rem;
}
.search {
  width: min(100%, 28rem);
  min-height: 44px;
  font: 1rem var(--font-body);
  border: 1px solid var(--fg);
  background: var(--surface);
  color: var(--fg);
  padding: 0.4rem 0.7rem;
}
.hidden { display: none; }
.footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.92rem;
  max-width: var(--measure);
}
.continue { margin-top: 1.5rem; }
.checks { list-style: none; padding: 0; margin: 0.4rem 0 1.2rem; max-width: 46rem; }
.checks li { border-top: 1px solid var(--border); }
.checks label {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 0.35rem;
  align-items: start;
  min-height: 44px;
  padding: 0.45rem 0;
  cursor: pointer;
}
.checks input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.35rem 0 0 0.7rem;
  accent-color: var(--fg);
}
.checks label:focus-within { outline: 2px solid var(--fg); outline-offset: 2px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .nav {
    position: sticky;
    top: 0;
    max-height: none;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1rem;
    z-index: 3;
  }
  .contents-toggle {
    display: flex;
    align-items: center;
    min-height: 44px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .nav details ol { display: none; }
  .nav details[open] ol { display: block; max-height: 70vh; overflow: auto; }
  .brand small { display: inline; margin-left: 0.6rem; }
  .main { padding: 1.25rem 1rem 3rem; }
  h1 { font-size: 2.4rem; }
  .banner { grid-template-columns: 1fr; }
}
@media print {
  .nav, .skip, .btn { display: none !important; }
  .shell { display: block; }
  a { text-decoration: none; }
  .figure-scroll { overflow: visible; }
  .figure-scroll svg { max-width: 100%; width: 100%; height: auto; }
}
