@import url("/styles.css");
:root {
  --paper: #f8faf9;
  --white: #ffffff;
  --ink: #203532;
  --muted: #536862;
  --link: #075c52;
  --amber: #dfac4e;
  --line: #d6e1dc;
  --soft: #e7f1ed;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.6 'Public Sans', system-ui, sans-serif; }
a { color: var(--link); text-underline-offset: .18em; }
a:hover { text-decoration-thickness: .12em; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; }
.skip { position: absolute; left: 1rem; top: -5rem; z-index: 5; background: var(--ink); color: white; padding: .4rem .7rem; }
.skip:focus { top: .4rem; }
.topbar { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; min-height: 68px; padding: 1rem 2rem; border-bottom: 1px solid var(--line); background: var(--white); }
.brand { color: var(--ink); font: 700 1.15rem/1.3 'Public Sans', system-ui, sans-serif; text-decoration: none; }
.top-meta { color: var(--muted); font-size: .8rem; }
.layout { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: minmax(215px, 260px) minmax(0, 1fr); align-items: start; }
.rail { position: sticky; top: 0; max-height: 100vh; overflow: auto; padding: 2.2rem 1.3rem 2rem 2rem; border-right: 1px solid var(--line); }
.rail-title { font-size: .9rem; font-weight: 700; margin: 0 0 .75rem .45rem; }
.rail-link { display: grid; grid-template-columns: 2.1em minmax(0, 1fr) .7em; align-items: baseline; gap: .45rem; padding: .45rem .4rem; color: var(--ink); text-decoration: none; font-size: .78rem; line-height: 1.36; border-radius: 4px; }
.rail-link.primary-link { display: block; padding-left: .45rem; font-size: .84rem; }
.rail-link:hover, .rail-link.active { background: var(--soft); }
.rail-link.active { font-weight: 700; }
.rail-number { color: var(--muted); font-variant-numeric: tabular-nums; }
.rail-dot { width: .45rem; height: .45rem; border-radius: 50%; align-self: center; background: var(--amber); }
.rail-dot.findings { background: var(--link); }
.rail-dot.changed { background: #b74845; }
.main { min-width: 0; padding: 2.5rem clamp(1.4rem, 5vw, 5.5rem) 6rem; }
.page-status:empty { display: none; }
.badge { display: inline-block; color: #735214; background: #fff1cf; border: 1px solid #eed18e; border-radius: 3px; padding: .22rem .5rem; font-size: .75rem; font-weight: 650; }
.badge.findings { background: #e9eff9; border-color: #bdcde9; color: #284a7c; }
.badge.changed { background: #fae8e7; border-color: #e5b8b5; color: #953e3b; }
.badge.support { background: var(--soft); border-color: var(--line); color: var(--muted); }
.prose { max-width: 71ch; }
.prose h1, .prose h2, .prose h3, .intro h1, .system-map h2, .index-list h2, .next-review h2 { font-family: 'Public Sans', system-ui, sans-serif; color: var(--ink); line-height: 1.24; letter-spacing: -.02em; }
.prose h1 { font-size: clamp(2.1rem, 4vw, 3.25rem); margin: .65rem 0 1.2rem; }
.prose h2 { font-size: 1.6rem; margin: 2.6rem 0 .65rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.prose h3 { font-size: 1.2rem; margin: 2rem 0 .5rem; }
.prose p { margin: .85rem 0 1.2rem; }
.prose p:first-of-type { color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { padding-left: .15rem; margin: .3rem 0; }
.prose blockquote { margin: 1.4rem 0; padding: .2rem 1.2rem; border-left: 4px solid var(--link); background: var(--soft); }
.prose blockquote p:first-of-type { color: var(--ink); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.prose code { font: .88em/1.4 "DejaVu Sans Mono", monospace; background: var(--soft); padding: .09em .25em; overflow-wrap: anywhere; }
.prose pre { background: #e4ece7; padding: 1rem 1.1rem; border-radius: 3px; overflow: auto; line-height: 1.5; }
.prose pre code { background: none; padding: 0; overflow-wrap: normal; }
.table-scroll { max-width: min(100%, 1050px); overflow-x: auto; margin: 1.4rem 0 2rem; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.48; }
.table-scroll th, .table-scroll td { text-align: left; vertical-align: top; padding: .7rem .85rem; border-bottom: 1px solid var(--line); min-width: 7.5rem; }
.table-scroll th { background: var(--soft); font-weight: 700; }
.table-scroll tr:last-child td { border-bottom: none; }
.intro, .system-map, .index-list, .next-review { max-width: 980px; }
.intro-note { color: var(--muted); margin: .1rem 0 .8rem; font-size: .9rem; }
.intro h1 { font-size: clamp(2.5rem, 5vw, 4.4rem); margin: 0 0 1.2rem; }
.lede { max-width: 63ch; font-size: 1.2rem; line-height: 1.55; margin: 0 0 1.5rem; }
.start-link { margin: 0 0 1.5rem; }
.start-link a { display: inline-block; padding: .7rem 1rem; background: var(--ink); color: white; border-radius: 4px; font-weight: 700; text-decoration: none; }
.start-link a:hover { background: #315c54; text-decoration: underline; }
.caution { max-width: 70ch; padding: .8rem 1rem; border-left: 4px solid var(--amber); background: #fff7e6; font-size: .9rem; }
.system-map { margin: 3.2rem 0; }
.system-map h2, .index-list h2, .next-review h2 { font-size: 1.55rem; margin: 0 0 1rem; }
.map-band { padding: .95rem 1.25rem; border: 1px solid #a8c1b7; display: flex; gap: 1rem; align-items: baseline; justify-content: space-between; }
.map-band strong { font-size: .97rem; }
.map-band span { font-size: .85rem; color: var(--muted); }
.map-band.work { background: #dcece4; }
.map-bracket { width: 1px; height: 18px; margin: auto; background: #88a89b; }
.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.map-band.app { background: var(--white); flex-direction: column; gap: .25rem; }
.map-band.contract { background: var(--ink); color: white; margin-top: 1rem; border-color: var(--ink); }
.map-band.contract span { color: #d5e4df; }
.map-side { max-width: 67ch; color: var(--muted); font-size: .9rem; margin: .8rem 0 0; }
.index-list { margin-top: 3rem; }
.index-list > p, .next-review > p { max-width: 68ch; }
.index-list ol { list-style: none; padding: 0; margin: 1.4rem 0; border-top: 2px solid var(--ink); }
.index-list li { border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: .75rem .2rem; }
.index-list li a { display: flex; gap: .9rem; color: var(--ink); text-decoration: none; align-items: baseline; }
.index-list li a:hover .chapter-title { text-decoration: underline; text-underline-offset: .2em; }
.chapter-no { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.chapter-title { font-weight: 650; }
.chapter-state { color: #795920; font-size: .77rem; white-space: nowrap; }
.chapter-state.findings { color: var(--link); }
.chapter-state.changed { color: #a04c46; }
.next-review { border-top: 1px solid var(--line); padding-top: 2rem; margin-top: 3rem; }
footer { border-top: 1px solid var(--line); padding: 1.5rem 2rem; color: var(--muted); font-size: .75rem; }

@media (max-width: 860px) {
  .topbar { padding: .8rem 1rem; }
  .top-meta { font-size: .7rem; text-align: right; }
  .layout { display: block; }
  .rail { position: static; max-height: none; display: flex; gap: .25rem; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: .65rem 1rem; white-space: nowrap; }
  .rail-title, .rail-dot { display: none; }
  .rail-link { display: inline-flex; flex: none; padding: .4rem .55rem; }
  .main { padding: 1.5rem 1.2rem 4rem; }
  .map-band { flex-direction: column; gap: .25rem; }
  .index-list li { align-items: flex-start; flex-direction: column; gap: .15rem; }
}

@media (max-width: 570px) {
  body { font-size: 16px; }
  .map-row { grid-template-columns: 1fr; gap: .6rem; }
  .map-band.contract { margin-top: .6rem; }
  .intro h1 { font-size: 2.4rem; }
  .prose h1 { font-size: 2rem; }
  .table-scroll::before { content: "Scroll sideways to read all columns"; display: block; padding: .45rem .2rem; color: var(--muted); font-size: .76rem; }
  .table-scroll table { min-width: 680px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  body { background: white; color: black; font-size: 11pt; }
  .topbar, .rail, .skip, footer, .page-status { display: none; }
  .layout { display: block; }
  .main { padding: 0; }
  .prose { max-width: none; }
  .prose h2 { break-after: avoid; }
  .table-scroll { overflow: visible; }
  a { color: black; }
}

.publication-note { margin: 0.7rem 0 1.2rem; color: #4d5966; font-size: 0.9rem; }
