:root {
  --ink: #17211c;
  --muted: #647069;
  --line: #dce2dd;
  --paper: #ffffff;
  --wash: #f4f6f3;
  --accent: #176b4b;
  --accent-soft: #e5f3ed;
  --warm: #fff7e7;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--wash);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; }
a { color: var(--accent); text-underline-offset: 3px; }
.skip-link { position: fixed; top: -5rem; left: 1rem; z-index: 50; padding: .7rem 1rem; border-radius: .4rem; color: white; background: var(--ink); }
.skip-link:focus { top: 1rem; }
.guide-topbar { position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(10px); }
.guide-brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.guide-brand span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: white; background: var(--accent); font-weight: 800; }
.guide-topbar nav { display: flex; gap: .3rem; }
.guide-topbar nav a { padding: .45rem .7rem; border-radius: 6px; color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 650; }
.guide-topbar nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.guide-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.guide-sidebar { position: sticky; top: 68px; height: calc(100vh - 68px); overflow: auto; padding: 1.2rem .75rem; border-right: 1px solid var(--line); background: #fafbf9; }
.nav-label, .eyebrow { margin: 0 0 .6rem; color: var(--accent); font-size: .67rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.document-list { display: flex; flex-direction: column; }
.document-list a { display: flex; justify-content: space-between; gap: .6rem; padding: .62rem .7rem; border-radius: 7px; color: var(--ink); text-decoration: none; font-size: .76rem; }
.document-list a:hover, .document-list a[aria-current="page"] { color: #0d563b; background: var(--accent-soft); }
.document-list small { color: var(--muted); white-space: nowrap; }
main { width: min(1120px, 100%); padding: 2rem clamp(1rem, 4vw, 4rem) 6rem; }
.breadcrumbs { display: flex; gap: .5rem; color: var(--muted); font-size: .72rem; }
.guide-hero { padding: 3.5rem 0 2.5rem; border-bottom: 1px solid var(--line); }
.guide-hero h1 { max-width: 850px; margin: 0; font-size: clamp(2rem, 5vw, 4.2rem); line-height: 1; letter-spacing: -.055em; }
.hero-description { max-width: 800px; margin: 1.2rem 0; color: #47534c; font-size: clamp(1rem, 2vw, 1.25rem); line-height: 1.6; }
.hero-actions { display: flex; align-items: center; gap: 1rem; color: var(--muted); font: .72rem ui-monospace, monospace; }
.primary-action { display: inline-flex; padding: .65rem .9rem; border-radius: 7px; color: white; background: var(--accent); text-decoration: none; font: 700 .78rem Inter, sans-serif; }
.document-context { display: grid; grid-template-columns: minmax(220px,.7fr) minmax(0,1.4fr); gap: 3rem; padding: 3rem 0; border-bottom: 1px solid var(--line); }
.document-context h2, .guide-section h2 { margin: 0; font-size: 1.6rem; letter-spacing: -.03em; }
.document-context p { color: var(--muted); line-height: 1.6; }
.document-context dl { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper); }
.document-context dl > div { display: grid; grid-template-columns: minmax(130px,.55fr) 1fr; border-bottom: 1px solid var(--line); }
.document-context dl > div:last-child { border-bottom: 0; }
.document-context dt, .document-context dd { margin: 0; padding: .8rem; overflow-wrap: anywhere; }
.document-context dt { font-size: .75rem; font-weight: 750; background: #fafbf9; }
code { display: block; margin-top: .25rem; color: var(--muted); font: .65rem ui-monospace, monospace; }
.field-help { margin: 0 0 .35rem !important; font-size: .7rem; }
.literal { white-space: pre-wrap; overflow-wrap: anywhere; font: .75rem/1.5 ui-monospace, monospace; }
.literal.null, .literal.empty { color: var(--muted); font-style: italic; }
.literal.boolean { color: #155b7b; font-weight: 700; }
.section-jump { display: flex; align-items: center; gap: .5rem; overflow: auto; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.section-jump strong { margin-right: .5rem; white-space: nowrap; font-size: .72rem; }
.section-jump a { display: inline-flex; gap: .35rem; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); background: white; text-decoration: none; white-space: nowrap; font-size: .68rem; }
.section-jump span { color: var(--muted); }
.guide-section { padding-top: 3rem; }
.section-header { display: flex; justify-content: space-between; gap: 2rem; align-items: end; margin-bottom: 1.3rem; }
.section-header p:last-child { margin: .5rem 0 0; color: var(--muted); font-size: .8rem; }
.section-header > a { font-size: .75rem; white-space: nowrap; }
.record-stack { display: flex; flex-direction: column; gap: 1rem; }
.record-card { scroll-margin-top: 84px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); box-shadow: 0 5px 18px rgba(22,34,27,.03); }
.record-card:target, .record-card.focused { outline: 3px solid #74b998; outline-offset: 2px; }
.record-card > header { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding: 1.15rem 1.25rem; border-bottom: 1px solid var(--line); }
.record-kind { margin: 0 0 .25rem; color: var(--accent); font-size: .62rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.record-card h3 { margin: 0; font-size: 1.1rem; letter-spacing: -.015em; overflow-wrap: anywhere; }
.raw-link { font-size: .72rem; white-space: nowrap; }
.record-description { margin: 0; padding: 1rem 1.25rem; color: #435047; font-size: .88rem; line-height: 1.6; }
.interpretation { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1px; margin: 0 1.25rem 1rem; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.interpretation > div { padding: .75rem; background: var(--warm); }
.interpretation strong { font-size: .72rem; }
.interpretation p { margin: .3rem 0 0; color: #625943; font-size: .72rem; line-height: 1.45; }
.expanded-fields { margin: 0; border-top: 1px solid var(--line); }
.expanded-field { display: grid; grid-template-columns: minmax(160px,.42fr) minmax(0,1.58fr); border-bottom: 1px solid var(--line); }
.expanded-field:last-child { border-bottom: 0; }
.expanded-field > dt, .expanded-field > dd { min-width: 0; margin: 0; padding: .9rem 1.25rem; overflow-wrap: anywhere; }
.expanded-field > dt { background: #fafbf9; font-size: .76rem; font-weight: 750; }
.expanded-field > dt small { display: block; margin-top: .45rem; color: var(--muted); font-size: .66rem; font-weight: 400; line-height: 1.35; }
.expanded-field > dd { font-size: .76rem; }
.expanded-field.standalone { display: block; padding: 1rem 1.25rem; }
.value-list { margin: 0; padding-left: 1.2rem; }
.value-list li { margin: .25rem 0; padding-left: .2rem; }
.nested-fields { margin: 0; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.nested-fields > div { display: grid; grid-template-columns: minmax(120px,.45fr) minmax(0,1fr); border-bottom: 1px solid var(--line); }
.nested-fields > div:last-child { border-bottom: 0; }
.nested-fields dt, .nested-fields dd { margin: 0; padding: .55rem; }
.nested-fields dt { background: #f7f8f6; font-size: .7rem; font-weight: 700; }
.nested-fields dt small { display: block; margin-top: .2rem; color: var(--muted); font: .6rem ui-monospace, monospace; }
.evidence-link { display: flex; flex-direction: column; padding: .55rem .65rem; border: 1px solid #ead8ad; border-radius: 6px; color: #6c4b08; background: var(--warm); text-decoration: none; }
.evidence-link span { margin-top: .2rem; font-size: .65rem; }
.nested-records { display: flex; flex-direction: column; gap: .65rem; }
.nested-record { scroll-margin-top: 84px; padding: .75rem; border: 1px solid var(--line); border-radius: 7px; }
.nested-record > header { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .6rem; }
.nested-record > header a { font-size: .66rem; white-space: nowrap; }
.record-card > footer { display: flex; justify-content: space-between; padding: .75rem 1.25rem; background: #fafbf9; font-size: .68rem; }
:focus-visible { outline: 3px solid #69b795; outline-offset: 2px; }

@media (max-width: 850px) {
  .guide-layout { grid-template-columns: 1fr; }
  .guide-sidebar { position: static; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .document-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .document-context { grid-template-columns: 1fr; gap: 1.2rem; }
}
@media (max-width: 580px) {
  .guide-topbar { padding: 0 .8rem; }
  .guide-topbar nav a:first-child { display: none; }
  .document-list { grid-template-columns: 1fr; }
  main { padding: 1.2rem .8rem 4rem; }
  .guide-hero { padding-top: 2rem; }
  .document-context dl > div, .expanded-field, .nested-fields > div { grid-template-columns: 1fr; }
  .interpretation { grid-template-columns: 1fr; }
  .record-card > header, .section-header { align-items: start; flex-direction: column; }
  .raw-link { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
