:root {
  --blue: #174eb0;
  --ink: #10233f;
  --muted: #546578;
  --line: #bdc8d7;
  --paper: #fdfdfe;
  --dot: rgba(23, 78, 176, .16);
  --surface: rgba(255, 255, 255, .72);
  --surface-strong: rgba(255, 255, 255, .88);
  --tint: #f1f5fd;
  --on-blue: #ffffff;
  --code-bg: #173f73;
  --code-ink: #ffffff;
  color-scheme: light dark;
  --sans: Arial, Helvetica, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --blue: #7ea6ef;
    --ink: #e2e9f4;
    --muted: #9cabbf;
    --line: #34455e;
    --paper: #0b1424;
    --dot: rgba(126, 166, 239, .12);
    --surface: rgba(17, 28, 47, .78);
    --surface-strong: rgba(17, 28, 47, .92);
    --tint: #18284a;
    --on-blue: #0b1424;
    --code-bg: #060d19;
    --code-ink: #e2e9f4;
  }
  .team-card > img { filter: brightness(.92); }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
.libdoc-body { min-height: 100vh; color: var(--ink); background-color: var(--paper); background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 15px 15px; font: 16px/1.55 var(--sans); }
a { color: var(--blue); }
a:hover { color: var(--ink); }
h1, h2, h3, p { margin-top: 0; }
.skip-link, .libdoc-skip { position: absolute; top: -48px; left: 16px; z-index: 4; padding: 8px 12px; background: var(--blue); color: var(--on-blue); }
.skip-link:focus, .libdoc-skip:focus { top: 12px; }
.libdoc-frame { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: clamp(46px, 9vw, 150px); width: min(1320px, calc(100% - 48px)); min-height: calc(100vh - 40px); margin: 20px auto; }
.libdoc-sidebar { position: sticky; top: 20px; align-self: start; min-height: calc(100vh - 40px); padding: 24px 20px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-strong); }
.libdoc-sidebar::before { content: ""; position: absolute; top: 72px; right: 20px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue); }
.libdoc-brand { display: block; color: var(--ink); font-size: 28px; font-weight: 700; letter-spacing: -.05em; text-decoration: none; }
.libdoc-term { margin: 10px 0 34px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.libdoc-label { margin: 26px 0 8px; color: var(--muted); font: 700 10px/1.4 var(--mono); letter-spacing: .07em; text-transform: uppercase; }
.libdoc-nav { margin: 0; padding: 0; list-style: none; }
.libdoc-nav li { border-left: 1px dashed var(--line); }
.libdoc-nav a { display: block; padding: 7px 11px; color: var(--ink); font-size: 14px; text-decoration: none; }
.libdoc-nav a::before { content: "•"; margin-right: 8px; color: var(--blue); }
.libdoc-nav a:hover, .libdoc-nav a[aria-current="page"] { color: var(--blue); background: var(--tint); }
.libdoc-nav-group summary { display: flex; align-items: center; padding: 7px 11px; color: var(--ink); font-size: 14px; cursor: pointer; list-style: none; }
.libdoc-nav-group summary::-webkit-details-marker { display: none; }
.libdoc-nav-group summary::before { content: "•"; margin-right: 8px; color: var(--blue); }
.libdoc-nav-group summary::after { content: ""; width: 5px; height: 5px; margin: -3px 0 0 9px; border-right: 1px solid currentColor; border-bottom: 1px solid currentColor; transform: rotate(45deg); opacity: .55; }
.libdoc-nav-group[open] summary::after { margin-top: 3px; transform: rotate(-135deg); }
.libdoc-nav-group summary:hover, .libdoc-nav-group summary.is-active { color: var(--blue); background: var(--tint); }
.libdoc-subnav { margin: 0; padding: 0; list-style: none; }
.libdoc-nav .libdoc-subnav li { border-left: 0; }
.libdoc-subnav a { padding-left: 27px; }
.libdoc-side-note { position: absolute; bottom: 20px; margin: 0; color: var(--muted); font: 10px/1.5 var(--mono); }
.libdoc-content { min-width: 0; }
.libdoc-main { width: min(720px, 100%); padding: 35px 0 45px; }
.libdoc-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 22px; width: min(720px, 100%); padding: 17px 0 24px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 11px; }
.libdoc-footer a { color: var(--blue); text-decoration: none; }
.libdoc-footer a:hover { text-decoration: underline; }

/* Shared documentation page structure */
.page-header, .libdoc-page-header { padding: 20px 0 24px; border-bottom: 1px dashed var(--line); }
.page-header h1, .libdoc-page-header h1 { margin: 0; color: var(--ink); font-size: clamp(42px, 6vw, 72px); line-height: .97; letter-spacing: -.07em; }
.page-header > p:not(.eyebrow):not(.term-line), .libdoc-subtitle { max-width: 610px; margin: 22px 0 0; font-size: 20px; line-height: 1.38; }
.eyebrow, .libdoc-crumb { margin: 0 0 22px; color: var(--muted); font: 12px/1.4 var(--sans); }
.eyebrow { font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.term-line { margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.section-rule { position: relative; padding: 34px 0 40px; border-top: 1px dashed var(--line); }
.section-rule::before { content: ""; position: absolute; top: -14px; right: 2px; width: 25px; height: 25px; border: 1px dashed var(--line); border-radius: 50%; background: var(--paper); }
.section-rule h2 { margin-bottom: 13px; font-size: 24px; letter-spacing: -.03em; }
.intro-grid, .two-column, .home-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(210px, .8fr); gap: 40px; }
.intro-grid > div p { max-width: 590px; }
.facts-box { padding: 16px; border: 1px dashed var(--line); background: var(--surface); }
.facts-box dl, .assessment-list, .calendar-list, .libdoc-assessment { margin: 0; }
.facts-box dl > div { padding: 7px 0; border-bottom: 1px dashed var(--line); }
.facts-box dl > div:last-child { border-bottom: 0; }
dt { color: var(--muted); font: 700 10px/1.4 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
dd { margin: 2px 0 0; font-size: 13px; }
.link-grid { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px dashed var(--line); border-right: 0; border-bottom: 0; }
.link-grid a { min-height: 96px; padding: 16px; border-right: 1px dashed var(--line); border-bottom: 1px dashed var(--line); color: var(--ink); text-decoration: none; }
.link-grid a:hover { background: var(--tint); color: var(--blue); }
.link-grid strong, .link-grid span { display: block; }
.link-grid strong { font-size: 14px; }
.link-grid span { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.compact-list, .plain-list, .question-list, .outcome-list, .reference-list, .notes-list, .plan-list { margin: 0; padding: 0; list-style: none; }
.compact-list, .plan-list, .outcome-list, .plain-list, .question-list, .reference-list, .notes-list, .calendar-list { border-top: 1px dashed var(--line); }
.compact-list li, .plan-list > li, .outcome-list li, .plain-list li, .question-list li, .reference-list > li, .notes-list li, .calendar-list > div { border-bottom: 1px dashed var(--line); }
.compact-list a { display: grid; grid-template-columns: 39px 1fr; gap: 10px; padding: 9px 0; color: var(--ink); font-size: 14px; text-decoration: none; }
.compact-list a:hover { color: var(--blue); }
.compact-list span, .plan-list > li > span, .notes-list span, .reference-list > li > span { color: var(--blue); font: 700 11px/1.5 var(--mono); }
.assessment-list > div, .libdoc-assessment div { display: flex; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.assessment-list dt, .calendar-list dt { color: var(--ink); font: 400 14px/1.4 var(--sans); letter-spacing: 0; text-transform: none; }
.assessment-list dd, .libdoc-assessment dd { margin: 0; color: var(--blue); font-weight: 700; }
.plan-list > li { display: grid; grid-template-columns: 43px 1fr; gap: 16px; padding: 20px 0; scroll-margin-top: 16px; }
.plan-list h2 { margin-bottom: 5px; font-size: 17px; }
.plan-list p { max-width: 650px; margin: 0; color: var(--muted); font-size: 14px; }
.outcome-list li { display: grid; grid-template-columns: 50px 1fr; gap: 12px; padding: 10px 0; font-size: 13px; }
.outcome-list span { color: var(--blue); font: 700 10px/1.4 var(--mono); }
.plain-list li { position: relative; padding: 9px 0 9px 18px; font-size: 14px; }
.plain-list li::before { content: "•"; position: absolute; left: 0; color: var(--blue); }
.question-list li { padding: 10px 0; font-size: 14px; }
.notice { margin: 0; padding: 14px 16px; border-left: 3px solid var(--blue); background: var(--surface); color: var(--muted); font-size: 14px; }
code { padding: 1px 4px; background: var(--tint); color: var(--ink); font: .9em var(--mono); }
.notes-list a { display: grid; grid-template-columns: 42px 1fr minmax(170px, .8fr); gap: 13px; padding: 13px 0; color: var(--ink); text-decoration: none; }
.notes-list a:hover strong { color: var(--blue); }
.notes-list strong { font-size: 14px; }
.notes-list small { color: var(--muted); font-size: 12px; }
.calendar-list > div { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 11px 0; }
.calendar-list dd { margin: 0; color: var(--muted); }
.team-grid { display: grid; gap: 13px; }
.team-card { display: grid; grid-template-columns: 100px minmax(0, 1fr); overflow: hidden; border: 1px dashed var(--line); background: var(--surface); }
.team-card > img { display: block; width: 100px; height: 100px; object-fit: cover; object-position: center 28%; border-right: 1px dashed var(--line); }
.team-card-body { padding: 16px; }
.team-card-body .eyebrow { margin-bottom: 11px; }
.team-card-body h2 { margin-bottom: 7px; font-size: 19px; }
.team-card-body a { font-size: 13px; overflow-wrap: anywhere; }
.reference-list > li { display: grid; grid-template-columns: 54px 1fr; gap: 13px; padding: 15px 0; }
.reference-list strong, .reference-list small { display: block; }
.reference-list strong { font-size: 14px; }
.reference-list small { margin-top: 3px; color: var(--muted); font-size: 12px; }
.markdown-content { max-width: 660px; font-size: 17px; line-height: 1.68; }
.markdown-content > * { max-width: 62ch; }
.markdown-content h2 { margin-top: 40px; font-size: 24px; line-height: 1.15; }
.markdown-content h3 { margin-top: 29px; font-size: 17px; line-height: 1.25; }
.markdown-content li + li { margin-top: 8px; }
.markdown-content pre { overflow-x: auto; padding: 15px; background: var(--code-bg); color: var(--code-ink); }
.markdown-content pre code { padding: 0; background: transparent; color: inherit; }
.markdown-content blockquote { margin: 22px 0; padding: 2px 0 2px 16px; border-left: 3px solid var(--blue); color: var(--muted); }
.markdown-content hr { margin: 40px 0 24px; border: 0; border-top: 1px dashed var(--line); }
.markdown-content table { width: 100%; margin: 22px 0; border-collapse: collapse; font-size: 15px; line-height: 1.45; background: var(--surface); }
.markdown-content th, .markdown-content td { padding: 9px 12px; border: 1px dashed var(--line); text-align: left; vertical-align: top; }
.markdown-content thead th { background: var(--tint); }
.deadline-box { margin-top: 26px; }
.back-link { margin: 0 0 46px; font-size: 13px; }

/* Prototype-only home treatment */
.libdoc-page-header { padding-top: 0; }
.libdoc-crumb span { margin: 0 6px; color: var(--blue); }
.libdoc-meta { display: flex; flex-wrap: wrap; gap: 8px 0; margin-top: 24px; color: var(--muted); font-size: 12px; }
.libdoc-meta span { padding: 0 12px; border-left: 1px dashed var(--line); }
.libdoc-meta span:first-child { padding-left: 0; border-left: 0; }
.libdoc-toc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 32px 0 38px; border: 1px dashed var(--line); }
.libdoc-toc p, .libdoc-toc a { margin: 0; padding: 13px 15px; font-size: 13px; }
.libdoc-toc p { grid-column: 1 / -1; border-bottom: 1px dashed var(--line); font-weight: 700; }
.libdoc-toc a { color: var(--blue); border-right: 1px dashed var(--line); }
.libdoc-toc a:last-child { border-right: 0; }
.libdoc-section { position: relative; padding: 28px 0 36px; border-top: 1px dashed var(--line); }
.libdoc-section::before { content: ""; position: absolute; top: -14px; right: 2px; width: 25px; height: 25px; border: 1px dashed var(--line); border-radius: 50%; background: var(--paper); }
.libdoc-section h2 { margin: 0 0 13px; font-size: 24px; letter-spacing: -.03em; }
.libdoc-section > p { max-width: 650px; margin-bottom: 0; font-size: 17px; }
.libdoc-facts { display: grid; grid-template-columns: 100px 90px 1fr; gap: 18px; margin-top: 28px; padding: 16px; border: 1px dashed var(--line); background: var(--surface); }
.libdoc-facts span, .libdoc-facts strong { display: block; }
.libdoc-facts span { margin-bottom: 5px; color: var(--muted); font: 700 10px/1.3 var(--mono); text-transform: uppercase; }
.libdoc-facts strong { font-size: 12px; line-height: 1.45; }
.libdoc-topics { margin: 0; padding: 0; list-style: none; border-top: 1px dashed var(--line); }
.libdoc-topics li { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 11px 0; border-bottom: 1px dashed var(--line); }
.libdoc-topics span { color: var(--blue); font: 700 11px/1.5 var(--mono); }
.libdoc-topics a { color: var(--ink); font-weight: 700; text-decoration: none; }
.libdoc-topics a:hover { color: var(--blue); text-decoration: underline; }

@media (max-width: 850px) {
  .libdoc-frame { grid-template-columns: 1fr; gap: 20px; margin-top: 16px; }
  .libdoc-sidebar { position: static; min-height: auto; }
  .libdoc-side-note { position: static; margin-top: 22px; }
  .libdoc-main, .libdoc-footer { width: min(720px, 100%); margin: 0 auto; }
  .libdoc-main { padding-top: 20px; }
}

@media (max-width: 720px) {
  .libdoc-frame { width: min(100% - 28px, 1320px); }
  .intro-grid, .two-column, .home-columns { grid-template-columns: 1fr; gap: 28px; }
  .link-grid { grid-template-columns: repeat(2, 1fr); }
  .notes-list a { grid-template-columns: 32px 1fr; }
  .notes-list small { grid-column: 2; }
}

@media (max-width: 560px) {
  .libdoc-main { padding-bottom: 35px; }
  .page-header h1, .libdoc-page-header h1 { font-size: 45px; }
  .page-header > p:not(.eyebrow):not(.term-line), .libdoc-subtitle { font-size: 18px; }
  .link-grid, .libdoc-toc { grid-template-columns: 1fr; }
  .libdoc-toc a { border-right: 0; border-bottom: 1px dashed var(--line); }
  .libdoc-toc a:last-child { border-bottom: 0; }
  .libdoc-facts { grid-template-columns: 1fr; gap: 13px; }
  .libdoc-footer { display: grid; }
}

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