/* Caroline Docs. Tokens copied from services/webapp/static/styles.css so the docs read as the app and the
   landing do: navy chrome, the gold C, gold only for what is current,
   green allows and red refuses. System fonts, nothing loaded from elsewhere. */
:root {
  --ink: #1c2536;
  --ink-soft: #5b6678;
  --bg: #f2f4f7;
  --card: #ffffff;
  --line: #e3e7ee;
  --navy: #131c2e;
  --navy-hover: #1d2a45;
  --action: #1f3a5f;
  --gold: #FFD60A;
  --gold-line: #d4a800;
  --surface: #f4f6f9;
  --inset: #f8fafc;
  --rail-active: #e1e5ec;
  --rail-active-line: #c7ceda;
  --off-ink: #6f798d;
  --allow: #15803d; --allow-bg: #e8f6ee; --allow-line: #b7e3c8;
  --deny: #b91c1c; --deny-bg: #fdecec; --deny-line: #f3c1c1;
  --code-bg: #0b1322; --code-ink: #e6eaf2; --code-soft: #8f9ab0; --code-line: #2a3650;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --top-h: 60px;
  --nav-w: 272px;
  --toc-w: 220px;
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); }
body { margin: 0; font-family: var(--sans); font-size: 15.5px; line-height: 1.6; color: var(--ink); background: var(--card); -webkit-font-smoothing: antialiased; }
a { color: var(--action); text-underline-offset: 2px; }
a:hover { color: var(--navy-hover); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }

/* ------------------------------------------------------------- top bar */
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); display: flex; align-items: center; gap: 20px; padding: 0 20px; background: var(--navy); color: #eef1f6; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; flex: none; }
.brand:hover { color: #fff; }
.brand svg { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font-size: 17px; font-weight: 650; letter-spacing: .2px; }
.brand span { padding: 1px 8px; border: 1px solid #2a3650; border-radius: 10px; font-family: var(--mono); font-size: 12px; color: #b9c2d4; }
.top-tabs { display: flex; gap: 4px; margin-left: 8px; }
.top-tabs a { padding: 6px 12px; border-radius: 6px; font-size: 14px; font-weight: 550; color: #b9c2d4; text-decoration: none; }
.top-tabs a:hover { color: #fff; background: var(--navy-hover); }
.top-tabs a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px 0 var(--gold); border-radius: 0; }
.search { position: relative; margin-left: auto; width: min(340px, 40vw); }
.search input { width: 100%; height: 36px; padding: 0 64px 0 34px; border: 1px solid #2a3650; border-radius: 8px; background: #0b1322; color: #fff; font: inherit; font-size: 14px; }
.search input::placeholder { color: #8f9ab0; }
.search input:focus { outline: none; border-color: var(--gold); }
.search svg { position: absolute; left: 10px; top: 10px; width: 16px; height: 16px; fill: none; stroke: #8f9ab0; stroke-width: 2; }
.search kbd { position: absolute; right: 8px; top: 8px; padding: 0 6px; border: 1px solid #2a3650; border-radius: 4px; font-family: var(--mono); font-size: 11.5px; color: #8f9ab0; }
.search input:not(:placeholder-shown) ~ kbd { display: none; }
.search-results { position: absolute; top: 42px; left: 0; right: 0; max-height: 60vh; overflow: auto; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 16px 40px -12px rgba(10, 20, 30, .35); padding: 6px; }
.search-results a { display: block; padding: 8px 10px; border-radius: 6px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a.is-cur { background: var(--surface); }
.search-results a small { display: block; color: var(--ink-soft); font-size: 12.5px; }
.search-results p { margin: 8px 10px; color: var(--ink-soft); font-size: 14px; }
.top-links { display: flex; align-items: center; gap: 14px; flex: none; }
.top-links a { color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; }
.top-links .open-app { padding: 7px 14px; border-radius: 4px; background: #fff; color: var(--navy); }
.top-links .open-app:hover { background: #eef1f6; color: var(--navy); }
.menu-btn { display: none; }

/* ------------------------------------------------------------- layout */
.layout { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--toc-w); max-width: 1440px; margin: 0 auto; }
.layout.no-toc { grid-template-columns: var(--nav-w) minmax(0, 1fr); }

/* the left nav */
.nav { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 22px 14px 40px 20px; border-right: 1px solid var(--line); background: var(--inset); }
.nav h4 { margin: 18px 10px 6px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.nav h4:first-child { margin-top: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav li a, .nav li span { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 5px 10px; border-radius: 6px; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.nav li a:hover { background: var(--rail-active); }
.nav li a[aria-current="page"] { background: var(--card); box-shadow: inset 2px 0 0 var(--gold), 0 0 0 1px var(--line); font-weight: 600; }
.nav li span { color: var(--off-ink); cursor: default; }
.tag { flex: none; padding: 0 7px; border: 1px solid var(--line); border-radius: 9px; font-size: 11px; font-weight: 600; letter-spacing: .02em; color: var(--ink-soft); background: var(--card); }
.tag.planned { border-style: dashed; }
.tag.preview { color: #8a5a00; border-color: #f0d68a; background: #fff8e1; }

/* the page */
.main { min-width: 0; padding: 36px 56px 80px; }
.crumbs { margin: 0 0 6px; font-size: 13px; color: var(--ink-soft); }
.crumbs a { color: var(--ink-soft); text-decoration: none; }
.main h1 { margin: 0 0 10px; font-size: 34px; line-height: 1.15; letter-spacing: -.02em; font-weight: 700; }
.lede { margin: 0 0 28px; font-size: 18px; line-height: 1.55; color: var(--ink-soft); max-width: 760px; }
.main h2 { margin: 44px 0 12px; padding-top: 4px; font-size: 23px; letter-spacing: -.012em; font-weight: 700; }
.main h3 { margin: 28px 0 8px; font-size: 17.5px; font-weight: 650; }
.main p, .main li { max-width: 780px; }
.main ul, .main ol { padding-left: 22px; }
.main li { margin: 4px 0; }
.main h2 .anchor, .main h3 .anchor { margin-left: 8px; font-weight: 400; color: var(--rail-active-line); text-decoration: none; visibility: hidden; }
.main h2:hover .anchor, .main h3:hover .anchor { visibility: visible; }
code { font-family: var(--mono); font-size: .88em; padding: 1px 5px; border-radius: 4px; background: var(--surface); border: 1px solid var(--line); }
pre { position: relative; margin: 14px 0 20px; padding: 16px 18px; max-width: 860px; overflow-x: auto; border-radius: 10px; background: var(--code-bg); color: var(--code-ink); font-family: var(--mono); font-size: 13.5px; line-height: 1.6; border: 1px solid var(--code-line); }
pre code { padding: 0; border: 0; background: none; font-size: inherit; color: inherit; }
pre .c { color: var(--code-soft); }
pre .k { color: #ffd60a; }
pre .s { color: #8fd3ff; }
.copy { position: absolute; top: 8px; right: 8px; padding: 3px 9px; border: 1px solid var(--code-line); border-radius: 4px; background: var(--navy); color: #b9c2d4; font: 600 12px var(--sans); cursor: pointer; }
.copy:hover { color: #fff; }
.codehead { display: flex; gap: 0; max-width: 860px; margin: 14px 0 -14px; }
.codehead button { padding: 7px 14px; border: 1px solid var(--code-line); border-bottom: 0; background: #1a2438; color: var(--code-soft); font: 600 12.5px var(--sans); cursor: pointer; }
.codehead button:first-child { border-radius: 10px 0 0 0; }
.codehead button:last-child { border-radius: 0 10px 0 0; }
.codehead button[aria-selected="true"] { background: var(--code-bg); color: #fff; box-shadow: inset 0 2px 0 var(--gold); }
.codehead + pre { border-top-left-radius: 0; }

table { width: 100%; max-width: 860px; margin: 14px 0 22px; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); background: var(--inset); }
td code { white-space: nowrap; }

.callout { max-width: 820px; margin: 18px 0 22px; padding: 13px 16px; border: 1px solid var(--line); border-left: 3px solid var(--action); border-radius: 8px; background: var(--inset); font-size: 14.5px; }
.callout b:first-child { display: block; margin-bottom: 2px; }
.callout.warn { border-left-color: var(--deny); background: #fffafa; }
.callout.ok { border-left-color: var(--allow); background: #fbfefc; }
.callout p { margin: 4px 0; }
.pill { display: inline-block; padding: 0 8px; border-radius: 9px; border: 1px solid; font-family: var(--mono); font-size: 12.5px; font-weight: 600; }
.pill.allow { color: var(--allow); background: var(--allow-bg); border-color: var(--allow-line); }
.pill.deny { color: var(--deny); background: var(--deny-bg); border-color: var(--deny-line); }
.method { display: inline-block; min-width: 46px; padding: 0 6px; margin-right: 6px; border-radius: 4px; font-family: var(--mono); font-size: 12px; font-weight: 700; text-align: center; color: #fff; background: var(--action); }
.method.get { background: var(--allow); }
.endpoint { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; max-width: 860px; margin: 16px 0 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--inset); font-family: var(--mono); font-size: 14px; }
.endpoint .who { margin-left: auto; font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); }

/* steps */
.steps { list-style: none; counter-reset: st; padding: 0 !important; }
.steps > li { position: relative; counter-increment: st; padding: 0 0 18px 46px; margin: 0; border-left: 2px solid var(--line); margin-left: 14px; }
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before { content: counter(st); position: absolute; left: -15px; top: -2px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13.5px; font-weight: 700; }
.steps > li > b:first-child { display: block; font-size: 16px; margin-bottom: 2px; }

/* home */
.hero { margin: -36px -56px 34px; padding: 44px 56px 40px; background: var(--navy); color: #eef1f6; }
.hero .std { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; font-family: var(--mono); font-size: 13px; color: #fff; font-weight: 600; }
.hero .std span { padding: 1px 9px; border: 1px solid #2a3650; border-radius: 10px; font-size: 12px; }
.hero h1 { color: #fff; font-size: 40px; margin-bottom: 12px; }
.hero p { margin: 0 0 22px; max-width: 700px; font-size: 18px; color: #b9c2d4; }
.hero .cta { display: flex; gap: 12px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 10px; height: 42px; padding: 0 18px; border-radius: 4px; font-weight: 650; font-size: 15px; text-decoration: none; }
.btn.light { background: #fff; color: var(--navy); }
.btn.light:hover { background: #eef1f6; color: var(--navy); }
.btn.ghost { border: 1px solid #2a3650; color: #fff; }
.btn.ghost:hover { background: var(--navy-hover); color: #fff; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin: 14px 0 8px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); transition: border-color .15s, box-shadow .15s; }
.tile:hover { border-color: var(--rail-active-line); box-shadow: 0 8px 24px -14px rgba(10, 20, 30, .35); color: var(--ink); }
.tile svg { width: 24px; height: 24px; fill: none; stroke: var(--action); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tile b { font-size: 16px; }
.tile span { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
.tile.is-planned { border-style: dashed; background: var(--inset); }
.flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; max-width: 900px; margin: 18px 0 26px; }
.flow div { position: relative; padding: 14px 16px; border: 1px solid var(--line); background: var(--inset); }
.flow div:first-child { border-radius: 10px 0 0 10px; }
.flow div:last-child { border-radius: 0 10px 10px 0; }
.flow div + div { border-left: 0; }
.flow b { display: block; font-size: 14.5px; }
.flow span { font-size: 13.5px; color: var(--ink-soft); }
.flow small { display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-soft); letter-spacing: .04em; text-transform: uppercase; }

/* the right toc */
.toc { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 36px 20px 40px 8px; font-size: 13.5px; }
.toc p { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-soft); }
.toc a { display: block; padding: 3px 0 3px 12px; border-left: 2px solid var(--line); color: var(--ink-soft); text-decoration: none; }
.toc a.sub { padding-left: 24px; }
.toc a:hover { color: var(--ink); }
.toc a.is-cur { color: var(--ink); border-left-color: var(--gold); font-weight: 600; }
.toc .edit { margin-top: 22px; display: flex; flex-direction: column; gap: 6px; padding-top: 14px; border-top: 1px solid var(--line); }
.toc .edit a { border: 0; padding: 0; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 860px; margin-top: 56px; }
.pager a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); }
.pager a:hover { border-color: var(--rail-active-line); }
.pager small { display: block; font-size: 12.5px; color: var(--ink-soft); }
.pager .next { text-align: right; grid-column: 2; }
.foot { max-width: 860px; margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* narrow screens */
@media (max-width: 1180px) {
  .layout { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .layout, .layout.no-toc { grid-template-columns: minmax(0, 1fr); }
  .nav { display: none; position: fixed; inset: var(--top-h) 0 0 0; height: auto; z-index: 15; }
  body.nav-open .nav { display: block; }
  .main { padding: 24px 16px 60px; }
  .hero { margin: -24px -16px 28px; padding: 32px 16px; }
  .hero h1 { font-size: 30px; }
  .top { gap: 10px; padding: 0 12px; }
  .top-tabs, .top-links a:not(.open-app), .search kbd, .brand span { display: none; }
  .search { width: auto; flex: 1; min-width: 0; }
  .top-links .open-app { padding: 7px 10px; font-size: 13px; }
  .menu-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid #2a3650; border-radius: 6px; background: none; color: #fff; }
  .menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
  .flow { grid-template-columns: 1fr 1fr; }
  .flow div { border-radius: 0 !important; border-left: 1px solid var(--line) !important; }
  td code { white-space: normal; }
}
@media (max-width: 480px) {
  .brand b { display: none; }
}

/* home: the four readers, and what holds for all of them */
.paths { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; max-width: 1000px; margin: 14px 0 8px; }
.path { display: flex; flex-direction: column; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.path svg { width: 26px; height: 26px; fill: none; stroke: var(--action); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.main .path h3 { margin: 10px 0 4px; font-size: 18px; }
.path p { margin: 0 0 12px; font-size: 14.5px; color: var(--ink-soft); }
.path .go { align-self: flex-start; margin-bottom: 10px; font-weight: 650; text-decoration: none; }
.path .go:hover { text-decoration: underline; }
.path ul { list-style: none; margin: 0; padding: 10px 0 0 !important; border-top: 1px solid var(--line); }
.path li { margin: 2px 0; font-size: 14px; }
.path li span { color: var(--off-ink); }
.promises { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 28px; max-width: 1000px; }
.promises li { display: flex; flex-direction: column; gap: 4px; padding-left: 14px; border-left: 2px solid var(--gold-line); }
.promises b { font-size: 15.5px; }
.promises span { font-size: 14px; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 860px) { .paths, .promises { grid-template-columns: minmax(0, 1fr); } }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 1000px; }
@media (max-width: 860px) { .tiles.two { grid-template-columns: minmax(0, 1fr); } }
.hero .lede { color: #b9c2d4; }
.flow.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 860px) { .flow.three { grid-template-columns: minmax(0, 1fr); } }
