/* Fido Developers. Tokens are the brand guide's (~/Code/Fido/brand/Fido-Brand-Guide.md §2–§6, §11):
   navy #06213C, CTA blue #004AAD, teal #13B8C7 (teal-dark #0C7C8A as text on light), slate #516C7D,
   surface #F8FAFC, hairline #E3E9ED, aqua #EAFCFF, Outfit. Dark mode is built from the same navy.
   The header utility bar, header buttons and footer come from chrome.css (shared with fetchfido.ai). */

@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Outfit";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/outfit-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #f8fafc;
  --card: #ffffff;
  --heading: #06213c;
  --ink: #22222a;
  --muted: #516c7d;
  --link: #004aad;
  --link-hover: #00367e;
  --border: #e3e9ed;
  --teal-text: #0c7c8a;
  --wash: #eafcff;
  --tile-bg: #eafcff;
  --tile-ink: #0c7c8a;
  --code-bg: #eef4f7;
  --code-ink: #0a5f6a;
  --info-bg: #eafcff;
  --info-bd: #0c7c8a;
  --warn-bg: #fff7e6;
  --warn-bd: #b07d1a;
  --focus: #004aad;
  --shadow: 0 1px 2px rgba(6, 33, 60, .05);
  --shadow-raised: 0 10px 30px rgba(6, 33, 60, .08);
  --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --max: 1280px;
  --header-h: 72px;
  /* chrome.css hooks */
  --fido-util-bg: #ffffff;
  --fido-util-ink: #22222a;
  --fido-line: #e3e9ed;
  --fido-teal-text: #0c7c8a;
  --fido-teal-wash: #eafcff;
  --fido-max: var(--max);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #04172b;
    --surface: #06213c;
    --card: #082844;
    --heading: #ffffff;
    --ink: #e3edf3;
    --muted: #9bbccd;
    --link: #6fd4df;
    --link-hover: #a6ebf1;
    --border: #173a5a;
    --teal-text: #6fd4df;
    --wash: #072a46;
    --tile-bg: #0b3354;
    --tile-ink: #6fd4df;
    --code-bg: #0b2f4f;
    --code-ink: #a6ebf1;
    --info-bg: #072a46;
    --info-bd: #13b8c7;
    --warn-bg: #2e2510;
    --warn-bd: #e0a93a;
    --focus: #6fd4df;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-raised: 0 10px 30px rgba(0, 0, 0, .35);
    --fido-util-bg: #04172b;
    --fido-util-ink: #cfe6ee;
    --fido-line: #173a5a;
    --fido-teal-text: #6fd4df;
    --fido-teal-wash: #072a46;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #04172b;
  --surface: #06213c;
  --card: #082844;
  --heading: #ffffff;
  --ink: #e3edf3;
  --muted: #9bbccd;
  --link: #6fd4df;
  --link-hover: #a6ebf1;
  --border: #173a5a;
  --teal-text: #6fd4df;
  --wash: #072a46;
  --tile-bg: #0b3354;
  --tile-ink: #6fd4df;
  --code-bg: #0b2f4f;
  --code-ink: #a6ebf1;
  --info-bg: #072a46;
  --info-bd: #13b8c7;
  --warn-bg: #2e2510;
  --warn-bd: #e0a93a;
  --focus: #6fd4df;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow-raised: 0 10px 30px rgba(0, 0, 0, .35);
  --fido-util-bg: #04172b;
  --fido-util-ink: #cfe6ee;
  --fido-line: #173a5a;
  --fido-teal-text: #6fd4df;
  --fido-teal-wash: #072a46;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.55;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
main:focus { outline: none; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100; padding: 10px 16px;
  background: #004aad; color: #fff; border-radius: 0 0 8px 8px; font-weight: 600;
}
.skip-link:focus { top: 0; color: #fff; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 24px; height: var(--header-h);
  display: flex; align-items: center; gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 14px; text-decoration: none; color: var(--heading); flex: none; }
.brand:hover { color: var(--heading); }
.logo { height: 40px; width: auto; display: block; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: block; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: block; }
.brand-text {
  font-weight: 600; font-size: 1.0625rem; color: var(--muted); padding-left: 14px;
  border-left: 1px solid var(--border); line-height: 28px;
  /* The wordmark sits low in the logo image; drop the divider and label to match its middle. */
  position: relative; top: 4px;
}
.top-nav { margin-left: auto; align-self: stretch; display: flex; align-items: center; gap: 28px; }
.top-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 28px; }
.key-cta { min-height: 38px; padding: 0 18px; font-size: 0.9375rem; }
.top-nav li { display: flex; }
.top-nav a {
  display: inline-flex; align-items: center; padding: 6px 2px 5px; border-bottom: 2px solid transparent;
  text-decoration: none; color: var(--muted); font-weight: 500; font-size: 0.9375rem;
}
.top-nav a:hover { color: var(--heading); }
.top-nav a[aria-current] { color: var(--heading); font-weight: 600; border-bottom-color: #13b8c7; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: none;
  border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--heading); cursor: pointer;
}
.icon-btn:hover { border-color: #13b8c7; }
.icon-btn svg { width: 20px; height: 20px; }
.nav-toggle { display: none; }
.sidebar-actions { display: none; }

@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .header-inner { padding: 0 16px; gap: 12px; }
  .top-nav { display: none; }
  .js .nav-toggle { display: inline-flex; margin-left: auto; }
  .logo { height: 34px; }
  .brand { gap: 10px; }
  .brand-text { padding-left: 10px; font-size: 1rem; }
}

/* ---------------------------------------------------------------- shell and sidebar */
.shell {
  max-width: var(--max); margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px;
}
.sidebar {
  position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h));
  overflow-y: auto; padding: 36px 0 48px; font-size: 0.88rem;
}
.side-heading {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 22px 0 6px 12px;
}
.side-heading:first-child { margin-top: 0; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin: 0; }
.sidebar ul { border-left: 1px solid var(--border); margin-left: 12px; }
.sidebar ul a {
  display: flex; align-items: center; min-height: 34px; padding: 4px 14px; margin-left: -1px;
  border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35;
}
.sidebar ul a:hover { color: var(--heading); border-left-color: var(--border); }
.sidebar ul a[aria-current="page"] { color: var(--heading); font-weight: 600; border-left-color: #13b8c7; }
main { display: block; min-width: 0; }
.no-sidebar .shell { display: block; max-width: none; padding: 0; }
.no-sidebar .sidebar { display: none; }

@media (max-width: 900px) {
  .shell { display: block; padding: 0 16px; }
  .sidebar { display: none; }
  .js .sidebar.open {
    display: block; position: fixed; top: var(--menu-top, var(--header-h)); left: 0; right: 0; bottom: 0; height: auto; max-height: none; align-self: stretch; z-index: 40;
    background: var(--bg); padding: 20px 16px 32px; border-top: 1px solid var(--border);
  }
  .sidebar.open .sidebar-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; padding: 20px 12px 0; border-top: 1px solid var(--border); }
  .sidebar ul a { min-height: 44px; }
  body.menu-open { overflow: hidden; }
  .no-sidebar .shell { padding: 0; }
}

/* ---------------------------------------------------------------- doc pages */
.page { padding: 40px 0 80px; }
.doc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px 56px; }
.prose { max-width: 46rem; min-width: 0; }
@media (min-width: 1240px) {
  .doc.has-toc { grid-template-columns: minmax(0, 46rem) 200px; }
  .toc { position: sticky; top: calc(var(--header-h) + 36px); align-self: start; }
}
.toc { font-size: 0.84rem; padding-top: 4px; }
.toc h2 {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 10px;
}
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent;
  color: var(--muted); text-decoration: none; line-height: 1.4;
}
.toc a:hover { color: var(--heading); border-left-color: var(--border); }
.toc a.active { color: var(--heading); font-weight: 600; border-left-color: #13b8c7; }
@media (max-width: 1239px) { .toc { display: none; } }

h1, h2, h3 { color: var(--heading); line-height: 1.2; }
h1 { font-size: 1.55rem; font-weight: 800; letter-spacing: -0.01em; margin: 0 0 14px; }
.prose h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; margin: 2rem 0 0.6rem; padding-top: 1.4rem; border-top: 1px solid var(--border); }
.prose h1 + .lead + h2, .prose .lead + h2 { border-top: 0; padding-top: 0; }
h3 { font-size: 1rem; font-weight: 700; margin: 1.5rem 0 0.4rem; }
p, ul, ol { margin: 0 0 1rem; }
li { margin-bottom: 0.4rem; }
.lead { font-size: 1rem; color: var(--muted); line-height: 1.55; margin-bottom: 1.5rem; }
.muted { color: var(--muted); }
strong { color: var(--heading); font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }

.eyebrow {
  display: inline-flex; align-items: center; padding: 4px 14px; border-radius: 999px;
  background: var(--wash); color: var(--teal-text); font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 18px;
}

.pill {
  display: inline-flex; align-items: center; vertical-align: middle; padding: 2px 10px; border-radius: 999px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.02em; background: var(--wash); color: var(--teal-text);
  border: 1px solid color-mix(in srgb, #13b8c7 40%, transparent); line-height: 1.5;
}
h1 .pill, h2 .pill { margin-left: 8px; font-size: 0.8125rem; }

code, kbd {
  font-family: var(--mono); font-size: 0.875em; background: var(--code-bg); color: var(--code-ink);
  padding: 0.12em 0.4em; border-radius: 6px; overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- code blocks (navy in both themes) */
.codeblock {
  margin: 0 0 1.5rem; border-radius: 14px; overflow: hidden; background: #06213c;
  border: 1px solid #0f3354; box-shadow: var(--shadow-raised);
}
.codeblock-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 8px 0 18px; min-height: 44px; background: #0a2a48; border-bottom: 1px solid #0f3354;
}
.codeblock-lang { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: #9bbccd; }
pre.code {
  margin: 0; padding: 18px; color: #e3edf3; overflow-x: auto;
  font-family: var(--mono); font-size: 0.84rem; line-height: 1.6; tab-size: 2;
}
pre.code code { background: none; color: inherit; padding: 0; font-size: inherit; overflow-wrap: normal; border-radius: 0; }
.tk-key { color: #8fe9f2; }
.tk-str { color: #c3e88d; }
.tk-num, .tk-lit { color: #f7b267; }
.tk-cmd { color: #ffffff; font-weight: 700; }
.tk-flag { color: #8fe9f2; }
.tk-var { color: #f7b267; }
.tk-head { color: #9bbccd; }
.copy-btn {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 0.8125rem; font-weight: 600;
  background: transparent; color: #cfe6ee; border: 1px solid #285274; border-radius: 999px;
  padding: 0 14px; min-height: 32px; cursor: pointer;
}
.copy-btn:hover { background: #12395d; color: #fff; }
.copy-btn:focus-visible { outline-color: #6fd4df; }
.copy-btn svg { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- tables */
.table-wrap {
  overflow-x: auto; margin: 0 0 1.5rem; border: 1px solid var(--border); border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow);
}
.table-wrap:focus-visible { outline-offset: 0; }
table { border-collapse: collapse; width: 100%; font-size: 0.88rem; line-height: 1.5; }
th, td { text-align: left; vertical-align: top; padding: 12px 16px; border-bottom: 1px solid var(--border); }
th { background: var(--surface); color: var(--heading); font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td code { white-space: normal; overflow-wrap: normal; }
td:first-child code { white-space: nowrap; }

/* ---------------------------------------------------------------- callouts and steps */
.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--info-bd); background: var(--info-bg);
  border-radius: 10px; padding: 16px 18px; margin: 0 0 1.5rem;
}
.callout > strong { display: block; margin-bottom: 4px; }
.callout p { margin: 0; }
.callout.warn { border-left-color: var(--warn-bd); background: var(--warn-bg); }
.steps { list-style: none; counter-reset: step; padding-left: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 48px; margin-bottom: 1.25rem; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  background: #06213c; color: #fff; font-weight: 700; font-size: 0.875rem; display: grid; place-items: center;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .steps > li::before { background: #13b8c7; color: #06213c; }
}
:root[data-theme="dark"] .steps > li::before { background: #13b8c7; color: #06213c; }
.steps ul { margin-top: 0.5rem; }

/* ---------------------------------------------------------------- home (minimal docs index) */
.home-hero { border-bottom: 1px solid var(--border); }
.home-hero-inner {
  max-width: var(--max); margin: 0 auto; padding: 64px 24px 64px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center;
}
.kicker { font-family: var(--mono); font-size: 0.8125rem; color: var(--teal-text); margin: 0 0 14px; }
.home-hero h1 { font-size: 2.1rem; letter-spacing: -0.015em; }
@media (max-width: 600px) { .home-hero h1 { font-size: 1.7rem; } }
.home-hero .lead { max-width: 34rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 20px; }
.base-url { color: var(--muted); font-size: 0.9375rem; margin: 0; }
.home-hero-code .codeblock { margin: 0; box-shadow: none; }
.home-body { max-width: var(--max); margin: 0 auto; padding: 56px 24px 96px; }
.index-title {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.index-section { margin-bottom: 64px; }
.doc-index { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 56px; }
.doc-index li { margin: 0; border-top: 1px solid var(--border); }
.doc-index a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 16px;
  padding: 18px 0; text-decoration: none; color: var(--muted);
}
.doc-index a::after {
  content: "\2192"; grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted);
  transition: transform .15s, color .15s;
}
.doc-index a:hover::after { transform: translateX(3px); color: var(--link); }
.doc-index-name { color: var(--heading); font-weight: 600; font-size: 0.98rem; line-height: 1.4; }
.doc-index a:hover .doc-index-name { color: var(--link); }
.doc-index-desc { font-size: 0.88rem; line-height: 1.55; margin-top: 2px; }
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
.split .index-title { padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.plain-list { margin: 0 0 1rem; padding-left: 1.1rem; }
.plain-list li { margin-bottom: 0.6rem; padding-left: 2px; }
.plain-list li::marker { color: var(--teal-text); }
@media (max-width: 1000px) {
  .home-hero-inner { grid-template-columns: minmax(0, 1fr); gap: 36px; padding: 48px 24px; }
  .split { grid-template-columns: minmax(0, 1fr); gap: 40px; }
}
@media (max-width: 720px) { .doc-index { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .home-hero-inner { padding: 36px 16px 40px; }
  .home-body { padding: 40px 16px 72px; }
}

/* ---------------------------------------------------------------- reference */
.ref-bar { border-bottom: 1px solid var(--border); background: var(--surface); }
.ref-bar-inner { max-width: var(--max); margin: 0 auto; padding: 16px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.ref-bar h1 { font-size: 1.55rem; margin: 0; }
.ref-bar p { margin: 2px 0 0; font-size: 0.9rem; }
.ref-links { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
/* Tighter menu rows so more of the section list fits on screen. */
.ref-foot { max-width: var(--max); margin: 0 auto; padding: 16px 24px 48px; }
@media (max-width: 600px) { .ref-bar-inner { padding: 14px 16px; } }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* Selected response and sample tabs sit on a light chip, so their text must be dark in both themes. */
/* Response samples sit on the navy panel in both themes. Redoc gives their <code> the inline-code
   background and some tokens colors that are too dim there. */
/* The sample panel is navy in both themes, so unselected status tabs use light text. */

/* ---------------------------------------------------------------- navigation inside long pages */
.sidebar ul.side-sub { border-left: 0; margin: 2px 0 8px 14px; }
.sidebar ul.side-sub a { min-height: 30px; padding: 3px 12px; font-size: 0.82rem; border-left: 1px solid var(--border); }
.sidebar ul.side-sub a:hover { border-left-color: #13b8c7; }
.inline-toc { margin: 20px 0 8px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.inline-toc h2 { border: 0; padding: 0; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.inline-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.inline-toc a { display: inline-block; padding: 4px 0; text-decoration: none; font-weight: 500; }
.inline-toc a:hover { text-decoration: underline; }
@media (min-width: 901px) { .inline-toc { display: none; } }
.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: grid; gap: 2px; min-width: 0; max-width: 48%; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; text-decoration: none; background: var(--card); }
.pager a:hover { border-color: #13b8c7; }
.pager-next { text-align: right; margin-left: auto; }
.pager-dir { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pager-name { font-weight: 600; color: var(--heading); }
details.fold { margin: 12px 0 24px; }
details.fold > summary { cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; color: var(--link); list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary { margin-bottom: 14px; }
.top-nav a.fido-pill { color: #fff; border: 2px solid #004aad; margin: 0; padding: 0 18px; font-weight: 600; }
.top-nav a.fido-pill:hover { color: #fff; background: #00367e; border-color: #00367e; }
.sidebar-actions .fido-pill { color: #fff; }

@media (max-width: 900px) { .sidebar ul.side-sub a { min-height: 40px; display: flex; align-items: center; } }

/* ------------------------------------------------- phone width: wrap, don't scroll */
@media (max-width: 600px) {
  pre.code { white-space: pre-wrap; overflow-wrap: anywhere; overflow-x: visible; }
  pre.code code { white-space: inherit; overflow-wrap: anywhere; }
  th, td { padding: 9px 7px; font-size: 0.8125rem; overflow-wrap: break-word; }
  /* Three or more columns: one card per row, each value under its column name. */
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.stack tr { padding: 6px 0; border-bottom: 1px solid var(--border); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 6px 14px; font-size: 0.9375rem; }
  table.stack td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
  table.stack td:empty { display: none; }
  td code, th code { font-size: 0.75rem; }
  th { white-space: normal; }
  td code { overflow-wrap: anywhere; }
}

/* ------------------------------------------------------------ current section, reference list */
.sidebar ul.side-sub a[aria-current="location"] { color: var(--heading); font-weight: 600; border-left-color: #13b8c7; background: var(--surface); }
.toc a.active, .toc a[aria-current="location"], .inline-toc a[aria-current="location"] { color: var(--heading); font-weight: 600; }
.ref-crumb { margin: 0 0 2px; font-size: 0.875rem; }
.ref-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: var(--muted); }
.ref-pick select { min-height: 40px; max-width: 240px; padding: 0 34px 0 14px; border: 1px solid var(--border); border-radius: 999px; background-color: var(--card); color: var(--heading); font: inherit; font-weight: 600; font-size: 0.9375rem; }
.ref-foot { max-width: var(--max); margin: 0 auto; padding: 8px 24px 56px; }
.ref-foot .pager { margin-top: 24px; }
.ref-list { list-style: none; margin: 0 0 2.5rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ref-list a { display: grid; gap: 4px; height: 100%; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); text-decoration: none; color: inherit; }
.ref-list a:hover { border-color: #13b8c7; }
.ref-name { font-weight: 700; color: var(--heading); font-size: 0.98rem; }
.ref-desc { color: var(--muted); font-size: 0.88rem; }
.ref-count { margin-top: auto; padding-top: 6px; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
@media (max-width: 600px) { .ref-pick-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } .ref-pick select { max-width: 100%; } .ref-pick { width: 100%; } .ref-pick select { width: 100%; max-width: none; } .ref-foot { padding: 8px 16px 40px; } }

/* ------------------------------------------------------------ module page: what you can do; search */
.glance { border-bottom: 1px solid var(--border); background: var(--bg); }
.glance-inner { max-width: var(--max); margin: 0 auto; padding: 28px 24px 12px; }
.glance h2 { font-size: 1.1rem; margin: 0 0 6px; }
.glance .muted { margin: 0 0 18px; max-width: 80ch; }
.glance-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 14px; align-items: start; }
.g-area { border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.g-area > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; cursor: pointer; list-style: none; min-height: 44px; }
.g-area > summary::-webkit-details-marker { display: none; }
.g-area > summary::after { content: ''; width: 8px; height: 8px; margin-left: 4px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; flex: none; }
.g-area[open] > summary::after { transform: rotate(-135deg); }
.g-name { font-weight: 700; color: var(--heading); flex: 1; }
.g-count { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.g-area ul, .ref-results { list-style: none; margin: 0; padding: 0 8px 8px; }
.g-area li a, .ref-results li a { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 8px; border-radius: 8px; text-decoration: none; color: inherit; }
.g-area li a:hover, .ref-results li a:hover { background: var(--surface); }
.g-title { color: var(--heading); font-size: 0.9375rem; overflow-wrap: anywhere; }
.g-path { grid-column: 2; font-size: 0.78rem; color: var(--muted); background: none; padding: 0; overflow-wrap: anywhere; }
.g-who { display: inline-block; margin-left: 4px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.72rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.m { display: inline-block; min-width: 46px; padding: 1px 0; border-radius: 4px; text-align: center; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.04em; color: #fff; }
.m-get { background: #2e6b2e; } .m-post { background: #004aad; } .m-put, .m-patch { background: #7a5612; } .m-delete { background: #a8322a; }
.ref-details-h { max-width: var(--max); margin: 28px auto 0; padding: 0 24px; font-size: 1.1rem; }
.ref-search { margin: 20px 0 28px; max-width: 760px; }
.ref-search label { display: block; font-weight: 700; color: var(--heading); margin-bottom: 6px; }
.ref-search input { width: 100%; min-height: 48px; padding: 0 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); color: var(--heading); font: inherit; font-size: 1rem; }
.ref-results { margin-top: 10px; padding: 0; }
.ref-more { padding: 8px; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 600px) { .glance-inner { padding: 20px 16px 8px; } .glance-list { grid-template-columns: minmax(0, 1fr); } .ref-details-h { padding: 0 16px; } .g-area li a, .ref-results li a { grid-template-columns: 46px minmax(0, 1fr); } .m { min-width: 42px; } }

.g-more { margin: 0 8px 8px; }
.g-more > summary { cursor: pointer; padding: 8px; min-height: 40px; display: flex; align-items: center; color: #0c7c8a; font-weight: 600; font-size: 0.9rem; list-style: none; }
.g-more > summary::-webkit-details-marker { display: none; }
.g-more[open] > summary { color: var(--muted); }
.g-more ul { padding: 0; }
@media (prefers-color-scheme: dark) { .g-more > summary { color: #6fd4df; } }

/* The menu lists every area with its operations already showing: nothing to open. */
@media (max-width: 800px) {
  [data-fido-menu] { transform: scale(0.82); transform-origin: 100% 100%; right: 12px !important; bottom: 20px !important; }
}


/* ---------------------------------------------------------------- reference pages (rendered at build time) */
.prose.wide { max-width: 54rem; }
.ref-crumb { margin: 0 0 4px; font-size: 0.85rem; color: var(--muted); }
.ref-crumb a { color: var(--muted); }
.op-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 1rem; }
.op-line code { font-size: 0.95rem; overflow-wrap: anywhere; }
.op-line .m { font-size: 0.75rem; min-width: 52px; padding: 3px 0; }
.op-facts { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0 0 1.2rem; padding: 12px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.op-facts div { display: flex; gap: 8px; align-items: baseline; }
.op-facts dt { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.op-facts dd { margin: 0; font-size: 0.88rem; }
.op-sec { margin-top: 2rem; }
.op-sec > h2 { font-size: 1.1rem; margin: 0 0 0.6rem; padding-top: 1.2rem; border-top: 1px solid var(--border); }
.op-sec h3 { font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin: 1.2rem 0 0.4rem; }
.req { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; color: #a83232; border: 1px solid color-mix(in srgb, #a83232 40%, transparent); vertical-align: middle; }
.fnote { margin: 4px 0 0; font-size: 0.82rem; color: var(--muted); }
table.fields td p { margin: 0 0 4px; }
table.fields td p:last-child { margin: 0; }
table.fields td:first-child { white-space: nowrap; }
.fields-more, details.resp { margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; background: var(--card); }
.fields-more > summary, details.resp > summary { cursor: pointer; padding: 10px 14px; font-weight: 600; font-size: 0.9rem; list-style: none; display: flex; align-items: center; gap: 10px; }
.fields-more > summary::-webkit-details-marker, details.resp > summary::-webkit-details-marker { display: none; }
.fields-more > summary::before, details.resp > summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .12s; flex: none; }
.fields-more[open] > summary::before, details.resp[open] > summary::before { transform: rotate(45deg); }
.fields-more > .table-wrap, details.resp > :not(summary) { margin-left: 14px; margin-right: 14px; }
details.resp > :last-child, .fields-more > :last-child { margin-bottom: 14px; }
.status { display: inline-block; min-width: 40px; padding: 1px 8px; border-radius: 6px; font-size: 0.8rem; font-weight: 700; text-align: center; color: #fff; background: #5c6f7a; }
.status.s-2xx { background: #2e6b2e; } .status.s-4xx { background: #7a5612; } .status.s-5xx { background: #a83232; }
.area-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0 0.5rem; }
.area-jump a { padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 0.85rem; text-decoration: none; color: var(--ink); background: var(--card); }
.area-jump a:hover { border-color: #13b8c7; }
.op-area { margin-top: 1.8rem; scroll-margin-top: calc(var(--header-h) + 16px); }
.op-area > h2 { font-size: 1.1rem; margin: 0 0 6px; padding-top: 1rem; border-top: 1px solid var(--border); }
.op-list { list-style: none; margin: 0; padding: 0; }
.op-list li { margin: 0; border-bottom: 1px solid var(--border); }
.op-list li:last-child { border-bottom: 0; }
.op-list a { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 12px; align-items: baseline; padding: 9px 6px; text-decoration: none; color: var(--heading); border-radius: 8px; }
.op-list a:hover { background: var(--surface); }
.op-list .g-path { grid-column: 2; }
.side-back { margin: 0 0 14px 12px; font-size: 0.85rem; }
.side-heading a { color: inherit; text-decoration: none; }
.side-area { margin: 0 0 2px; }
.side-area > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 12px; font-weight: 600; font-size: 0.85rem; color: var(--heading); border-radius: 8px; }
.side-area > summary::-webkit-details-marker { display: none; }
.side-area > summary:hover { background: var(--surface); }
.side-area > summary::after { content: ''; width: 6px; height: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin-left: 6px; flex: none; }
.side-area[open] > summary::after { transform: rotate(-135deg); }
.side-area > summary .g-count { margin-left: auto; }
.sidebar .side-area ul a { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 6px; align-items: baseline; font-size: 0.82rem; min-height: 30px; padding: 3px 10px; }
.sidebar .side-area ul a .m { min-width: 0; font-size: 0.58rem; padding: 1px 0; }
.page-ref .page { padding-top: 44px; }
.page-ref .sidebar { padding-top: 44px; }
.sidebar .side-area ul a[aria-current="page"] { background: var(--aqua, #eafcff); border-left-color: #13b8c7; border-radius: 0 8px 8px 0; color: var(--heading); font-weight: 700; }
:root[data-theme="dark"] .sidebar .side-area ul a[aria-current="page"] { background: rgba(19,184,199,.16); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sidebar .side-area ul a[aria-current="page"] { background: rgba(19,184,199,.16); } }
.side-area.is-current > summary { color: var(--heading); box-shadow: inset 3px 0 0 #13b8c7; }
.side-heading a[aria-current="page"] { color: var(--heading); text-decoration: underline; text-decoration-color: #13b8c7; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.fcount { font-weight: 400; font-size: 0.82rem; color: var(--muted); }
table.fields th, table.fields td { padding: 8px 12px; }
table.fields td:nth-child(2) { min-width: 8.5rem; }
table.fields td code { white-space: normal; overflow-wrap: anywhere; }
table.fields td:first-child code { white-space: nowrap; overflow-wrap: normal; }
@media (min-width: 601px) {
  table.fields { table-layout: fixed; }
  table.fields th:nth-child(1) { width: 27%; }
  table.fields th:nth-child(2) { width: 17%; }
  table.fields td { overflow-wrap: anywhere; }
  table.fields td:first-child code { white-space: normal; overflow-wrap: anywhere; }
}

/* ---------------------------------------------------------------- Try it */
form.try { margin-top: 4px; }
.try-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; margin: 14px 0; }
.try-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.try-field label { font-size: 0.84rem; font-weight: 600; color: var(--heading); }
.try-in { font-weight: 400; color: var(--muted); font-size: 0.76rem; margin-left: 4px; text-transform: uppercase; letter-spacing: .04em; }
.try-field input, .try-field textarea { font: inherit; font-size: 0.88rem; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--heading); min-height: 40px; width: 100%; box-sizing: border-box; }
.try-field textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.84rem; line-height: 1.5; resize: vertical; }
.try-field input:focus, .try-field textarea:focus { outline: 2px solid #13b8c7; outline-offset: 1px; }
.try-remember { display: flex; align-items: center; gap: 8px; font-size: 0.86rem; margin: 12px 0; color: var(--muted); }
.try-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.try-send { background: #004aad; color: #fff; border: 0; border-radius: 999px; min-height: 44px; padding: 0 22px; font: inherit; font-weight: 600; font-size: 0.92rem; cursor: pointer; }
.try-send:hover { background: #00367e; }
.try-send:disabled { opacity: .6; cursor: progress; }
.try-note { font-size: 0.86rem; color: var(--muted); }
.try-result { margin-top: 16px; }
.try-status { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-weight: 600; }
.try-ms { font-weight: 400; color: var(--muted); font-size: 0.84rem; }
.try-result pre { max-height: 440px; overflow: auto; }
.try-more { margin: 4px 0 8px; }
.try-more > summary { cursor: pointer; font-weight: 600; font-size: 0.88rem; color: var(--heading); padding: 6px 0; }
