/* ==========================================================================
   4Docs — theme
   Written against the class contract in DESIGN.md. No remote fonts, no
   @import, no third-party anything: this file is the whole visual system and
   it ships compiled into our own output.
   ========================================================================== */

:root {
  /* Neutrals — the company site's greys, verbatim */
  --bg:            #ffffff;
  --bg-sunken:     #f5f5f5;
  --bg-raised:     #ffffff;
  --bg-code:       #1d4354;   /* the site's deep-teal panel colour, used for code surfaces */
  --bg-code-soft:  #f5f5f5;

  --line:          #e5e5e5;
  --line-strong:   #d3d6da;

  --ink:           #3a3a3a;   /* headings */
  --ink-soft:      #4b4f58;   /* body */
  --ink-faint:     #69727d;   /* muted */
  --ink-on-dark:   #e6eef2;

  /* Interactive colour: the site's deep teal. The brand red is the accent, used sparingly. */
  --accent:        #1d4354;
  --accent-soft:   #e8eef2;
  --accent-line:   #cbd7de;
  --brand:         #a11f22;
  --brand-soft:    #f7e9e9;

  /* Method colours, toned to the palette */
  --get:     #1e7a5a;  --get-bg:     #e3f1eb;
  --post:    #1d4354;  --post-bg:    #e8eef2;
  --put:     #b0812c;  --put-bg:     #f6eedf;
  --patch:   #557892;  --patch-bg:   #e9eef3;
  --delete:  #a11f22;  --delete-bg:  #f7e9e9;

  /* Status colours */
  --ok:      #1e7a5a;  --ok-bg:      #e3f1eb;
  --redir:   #557892;  --redir-bg:   #e9eef3;
  --client:  #b0812c;  --client-bg:  #f6eedf;
  --server:  #a11f22;  --server-bg:  #f7e9e9;

  --warn:      #8a6d3b;
  --warn-bg:   #fbf6e9;
  --warn-line: #ebddb3;

  /* The site's corners are sharp */
  --radius:    4px;
  --radius-sm: 3px;

  --sidebar-w: 300px;
  --console-w: 424px;

  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, sans-serif;
  --font-heading: Poppins, "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

/* Self-hosted: the site never fetches a font from a third party. Files and licence in
   src/render/assets/fonts/. Paths are relative to this stylesheet in assets/. */
@font-face {
  font-family: "Open Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("fonts/open-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("fonts/poppins-500-latin.woff2") format("woff2");
}
@font-face {
  font-family: Poppins;
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/poppins-600-latin.woff2") format("woff2");
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #12181c;
    --bg-sunken:     #171e23;
    --bg-raised:     #1a2228;
    --bg-code:       #0e1519;
    --bg-code-soft:  #1a2228;
    --line:          #2a343b;
    --line-strong:   #3a464f;
    --ink:           #e8ecef;
    --ink-soft:      #b3bcc4;
    --ink-faint:     #8391a0;
    --accent:        #9fc2d4;
    --accent-soft:   #1c2c35;
    --accent-line:   #2f4550;
    --brand:         #e07a7c;
    --brand-soft:    #3a1c1d;
    --get-bg:     #12302a;  --post-bg:  #1c2c35;  --put-bg:    #332a17;
    --patch-bg:   #1d2833;  --delete-bg:#3a1c1d;
    --ok-bg:      #12302a;  --redir-bg: #1d2833;
    --client-bg:  #332a17;  --server-bg:#3a1c1d;
    --get:  #6fcfae; --post: #9fc2d4; --put: #e0b878;
    --patch:#9db6cc; --delete:#e07a7c;
    --ok:   #6fcfae; --redir:#9db6cc; --client:#e0b878; --server:#e07a7c;
    --warn: #e0b878; --warn-bg: #2a2313; --warn-line: #453a1c;
  }
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code, pre, kbd { font-family: var(--mono); font-size: 0.86em; }
pre { margin: 0; }

button { font: inherit; color: inherit; }

img { max-width: 100%; height: auto; }

[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg-sunken);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  padding-bottom: 32px;
}

.content { min-width: 0; }

/* Operation pages get a third column for the console. */
.op-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--console-w);
  gap: 40px;
  align-items: start;
  padding: 0 40px 96px;
  max-width: 1500px;
}

.op-main { min-width: 0; padding-top: 36px; }

/* --------------------------------------------------------------------------
   Sidebar
   -------------------------------------------------------------------------- */

.sidebar-head {
  padding: 20px 18px 14px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--bg-sunken);
  z-index: 2;
}

.brand {
  display: block;
  font-weight: 650;
  font-size: 14.5px;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 14px;
}
.brand:hover { text-decoration: none; color: var(--accent); }

.product-switcher {
  /* Four products: a 2x2 grid keeps every label whole at the sidebar width. */
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 12px;
}

.product {
  text-align: center;
  padding: 5px 6px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-faint);
  border-radius: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.product:hover { text-decoration: none; color: var(--ink); }
.product.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

.nav-filter {
  width: 100%;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.nav-filter::placeholder { color: var(--ink-faint); }

.nav { padding: 14px 10px 0; }

.nav-group + .nav-group { margin-top: 18px; }

.nav-group-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0 8px 6px;
}

.nav-item {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.45;
}
.nav-item:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.nav-item.is-current {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 550;
}

.nav-item-label {
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
  min-width: 0;
}

/* --------------------------------------------------------------------------
   Method + status chips
   -------------------------------------------------------------------------- */

.method {
  flex: none;
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 2px 5px;
  border-radius: 3px;
  text-transform: uppercase;
  min-width: 46px;
  text-align: center;
}
.method-get    { color: var(--get);    background: var(--get-bg); }
.method-post   { color: var(--post);   background: var(--post-bg); }
.method-put    { color: var(--put);    background: var(--put-bg); }
.method-patch  { color: var(--patch);  background: var(--patch-bg); }
.method-delete { color: var(--delete); background: var(--delete-bg); }
.method-head, .method-options { color: var(--ink-soft); background: var(--bg-code-soft); }

.status {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 3px;
}
.status-2xx { color: var(--ok);     background: var(--ok-bg); }
.status-3xx { color: var(--redir);  background: var(--redir-bg); }
.status-4xx { color: var(--client); background: var(--client-bg); }
.status-5xx { color: var(--server); background: var(--server-bg); }

/* --------------------------------------------------------------------------
   Operation header
   -------------------------------------------------------------------------- */

.op-header { padding-bottom: 4px; }

.op-id {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px 12px;
  margin-bottom: 18px;
}

.op-id .method { font-size: 11px; padding: 3px 7px; min-width: 54px; }

.op-path {
  font-size: 14px;
  font-weight: 550;
  color: var(--ink);
  word-break: break-all;
  flex: 1 1 auto;
}

.op-path-var {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 0 2px;
  margin: 0 -1px;
}

.btn-copy {
  flex: none;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink-soft);
  cursor: pointer;
}
.btn-copy:hover { color: var(--ink); border-color: var(--ink-faint); }
.btn-copy.is-done { color: var(--ok); border-color: var(--ok); }

.op-title {
  font-size: 27px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 660;
  margin: 0 0 10px;
}

.op-desc {
  font-size: 15.5px;
  color: var(--ink-soft);
  margin: 0 0 14px;
  max-width: 68ch;
}

/* The honest "the spec has no prose for this" state. Elements renders a blank
   page here; we render the gap, because a visible gap is a fixable gap. */
.op-undocumented {
  display: flex;
  gap: 8px;
  align-items: baseline;
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  margin: 0 0 16px;
  max-width: 68ch;
}
.op-undocumented::before { content: "\26A0"; font-size: 13px; line-height: 1.5; }

.op-auth {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 8px;
}

.op-auth-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.chip {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--bg-code-soft);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.chip code { font-size: 11.5px; }

.chip-auth {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.chip-constraint {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 1px 5px;
  color: var(--ink-faint);
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.op-section { margin-top: 34px; }

.op-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.op-section-note {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-faint);
  background: var(--bg-code-soft);
  border-radius: 3px;
  padding: 1px 6px;
}

/* --------------------------------------------------------------------------
   THE SCHEMA TREE — the part the spike is judged on
   Flat rows, depth by guide line. No nested boxes: nested cards are exactly
   what makes a five-level schema unreadable in every tool we looked at.
   -------------------------------------------------------------------------- */

.schema-tree[id], .sk-row[id], .prose :is(h1, h2, h3, h4)[id] { scroll-margin-top: 24px; }

.schema-tree {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}

.sk-row {
  padding: 6px 12px;
  border-top: 1px solid var(--line);
}
.schema-tree > .sk-row:first-child,
.sk-children > .sk-row:first-child { border-top: none; }

.sk-row:hover { background: var(--bg-sunken); }

.sk-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
}

.sk-toggle {
  flex: none;
  width: 16px;
  height: 16px;
  padding: 0;
  margin-right: -1px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-faint);
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  border-radius: 3px;
}
.sk-toggle:hover { background: var(--line); color: var(--ink); }
.sk-toggle::before { content: "\25BE"; display: inline-block; transition: transform 0.12s; }
.sk-toggle[aria-expanded="false"]::before { transform: rotate(-90deg); }

.sk-spacer { flex: none; width: 16px; margin-right: -1px; }

.sk-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.sk-type {
  font-size: 12px;
  color: var(--ink-faint);
  font-family: var(--mono);
}

.sk-ref {
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 3px;
  padding: 1px 5px;
}
.sk-ref:hover { text-decoration: none; box-shadow: inset 0 0 0 1px var(--accent-line); }

.sk-required {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--delete);
  background: var(--delete-bg);
  border-radius: 3px;
  padding: 1px 5px;
}

.sk-nullable {
  font-size: 10.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  background: var(--bg-code-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0 5px;
}

.sk-desc {
  margin: 3px 0 0 23px;
  font-size: 13px;
  color: var(--ink-soft);
  max-width: 72ch;
}

.sk-enum {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: baseline;
}

.sk-enum-value {
  font-size: 11px;
  color: var(--patch);
  background: var(--patch-bg);
  border-radius: 3px;
  padding: 1px 5px;
}

.sk-enum-more { font-size: 11px; color: var(--ink-faint); }

/* A cycle is normal in a real schema, so it must not read as an error. */
.sk-circular {
  font-size: 11.5px;
  font-family: var(--mono);
  color: var(--ink-soft);
  background: var(--bg-code-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  padding: 1px 6px;
}
.sk-circular:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }

/* Children: indented, with a guide line. This is the whole depth cue. */
.sk-children {
  margin-left: 23px;
  border-left: 1px solid var(--line);
}

.sk-children .sk-children { border-left-color: var(--line); }

/* Deep levels get a faintly tinted ground so five levels down still reads as
   "inside something" without a box. */
.sk-row[data-depth="2"], .sk-row[data-depth="3"] { background: color-mix(in srgb, var(--bg-sunken) 45%, transparent); }
.sk-row[data-depth="4"], .sk-row[data-depth="5"], .sk-row[data-depth="6"] { background: color-mix(in srgb, var(--bg-sunken) 75%, transparent); }
.sk-row[data-depth="2"]:hover, .sk-row[data-depth="3"]:hover,
.sk-row[data-depth="4"]:hover, .sk-row[data-depth="5"]:hover,
.sk-row[data-depth="6"]:hover { background: var(--accent-soft); }

/* --------------------------------------------------------------------------
   Responses
   -------------------------------------------------------------------------- */

.resp-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.resp-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 4px 10px;
  font-size: 12.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.resp-tab:hover { border-color: var(--line-strong); color: var(--ink); }
.resp-tab.is-active {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--ink);
  font-weight: 550;
}

.resp-empty {
  font-size: 13.5px;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 14px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   The console — one card, so the sample and the live call are one object
   rather than Elements' lonely blue button plus a separate grey box.
   -------------------------------------------------------------------------- */

.console { position: sticky; top: 24px; padding-top: 36px; }

.console-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
}

.console-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: var(--bg-sunken);
}

.console-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 550;
  color: var(--ink-faint);
  cursor: pointer;
}
.console-tab:hover { color: var(--ink); }
.console-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: var(--bg-raised);
}

.curl-head, .console-panel > .server-select {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.server-select {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.server-select select, select.server {
  flex: 1;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 4px 6px;
  min-width: 0;
}

.curl-block {
  background: var(--bg-code);
  color: var(--ink-on-dark);
  padding: 14px;
  overflow-x: auto;
  font-size: 12px;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  tab-size: 2;
}
.curl-block code { color: inherit; font-size: 12px; }

/* Try It */

.tryit-form { padding: 4px 0 0; }

.tryit-group {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 12px;
}
.tryit-form > .tryit-group:first-of-type { border-top: none; }

.tryit-group legend {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 0;
  margin-bottom: 2px;
}

.tryit-note {
  font-size: 12px;
  color: var(--ink-faint);
  margin: 4px 0 10px;
}

.field { display: block; margin-bottom: 10px; }
.field:last-child { margin-bottom: 0; }

.field-label {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--ink-soft);
  margin-bottom: 4px;
}

.field-req {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--delete);
}

.field-hint { font-size: 11.5px; color: var(--ink-faint); font-weight: 400; }

.field-input, .field-textarea {
  width: 100%;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
}
.field-input::placeholder, .field-textarea::placeholder { color: var(--ink-faint); }
.field-textarea { line-height: 1.55; resize: vertical; }

.tryit-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: var(--bg-sunken);
}

.btn-send {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-send:hover { filter: brightness(1.08); }
.btn-send:disabled { opacity: 0.55; cursor: default; filter: none; }

.tryit-status { font-size: 12.5px; color: var(--ink-faint); }

.tryit-response { border-top: 1px solid var(--line); }

.tryit-response-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.tryit-response-time { font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }

/* The API answers a bad token with 500 instead of 401. Until that is fixed in
   the API, the console explains it rather than leaving the reader guessing. */
.tryit-hint {
  font-size: 12.5px;
  color: var(--warn);
  background: var(--warn-bg);
  border-top: 1px solid var(--warn-line);
  border-bottom: 1px solid var(--warn-line);
  margin: 0;
  padding: 9px 12px;
}

.tryit-response-body {
  background: var(--bg-code);
  color: var(--ink-on-dark);
  padding: 12px;
  margin: 0;
  max-height: 420px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.tryit-response-body code { color: inherit; font-size: 12px; }

/* --------------------------------------------------------------------------
   Guide pages
   -------------------------------------------------------------------------- */

.guide {
  padding: 40px 40px 96px;
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 48px;
  align-items: start;
}

.guide-main { min-width: 0; max-width: 76ch; }

.guide-toc {
  position: sticky;
  top: 28px;
  font-size: 13px;
  border-left: 1px solid var(--line);
  padding-left: 16px;
}
.guide-toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 8px;
}
.guide-toc ul { list-style: none; margin: 0; padding: 0; }
.guide-toc li { margin-bottom: 5px; }
.guide-toc a { color: var(--ink-soft); }
.guide-toc a:hover { color: var(--accent); }
.guide-toc .toc-3 { padding-left: 12px; font-size: 12.5px; }
.guide-toc .toc-4 { padding-left: 24px; font-size: 12.5px; }

.guide-title {
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 680;
  margin: 0 0 8px;
}

.guide-meta { font-size: 12.5px; color: var(--ink-faint); margin: 0 0 28px; }

/* Prose */
.prose { font-size: 15.5px; line-height: 1.72; }
.prose > :first-child { margin-top: 0; }
.prose h2 {
  font-size: 21px;
  letter-spacing: -0.015em;
  font-weight: 650;
  margin: 44px 0 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--line);
}
.prose h3 { font-size: 17px; font-weight: 620; margin: 32px 0 8px; }
.prose h4 { font-size: 15px; font-weight: 620; margin: 24px 0 6px; }
.prose p { margin: 0 0 16px; }
.prose ul, .prose ol { margin: 0 0 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose li > ul, .prose li > ol { margin: 6px 0 0; }
.prose strong { font-weight: 640; color: var(--ink); }
.prose code {
  background: var(--bg-code-soft);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 4px;
}
.prose pre {
  background: var(--bg-code);
  color: var(--ink-on-dark);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.65;
}
.prose pre code { background: none; border: none; padding: 0; color: inherit; }
.prose blockquote {
  margin: 0 0 18px;
  padding: 10px 16px;
  border-left: 3px solid var(--accent-line);
  background: var(--accent-soft);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-soft);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 6px 0 22px;
  background: var(--bg-sunken);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 20px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 7px 10px;
  text-align: left;
  vertical-align: top;
}
.prose th { background: var(--bg-sunken); font-weight: 640; }
.prose hr { border: none; border-top: 1px solid var(--line); margin: 32px 0; }

/* --------------------------------------------------------------------------
   Index page
   -------------------------------------------------------------------------- */

.index { padding: 56px 40px 96px; max-width: 900px; }
.index h1 { font-size: 32px; letter-spacing: -0.025em; margin: 0 0 10px; }
.index-lede { font-size: 16px; color: var(--ink-soft); margin: 0 0 36px; max-width: 62ch; }
.index-group + .index-group { margin-top: 32px; }
.index-group h2 {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.index-list { list-style: none; margin: 0; padding: 0; }
.index-list li { margin-bottom: 8px; display: flex; align-items: baseline; gap: 10px; }
.index-note { font-size: 13px; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1279px) {
  .op-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .console { position: static; padding-top: 34px; }
  .console-card { max-width: 720px; }
  .guide { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .guide-toc { display: none; }
}

@media (max-width: 899px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .nav { max-height: 55vh; overflow-y: auto; }
  .op-layout, .guide, .index { padding-left: 20px; padding-right: 20px; }
  .op-title { font-size: 23px; }
  .guide-title { font-size: 27px; }
}

@media print {
  .sidebar, .console, .btn-copy, .nav-filter { display: none !important; }
  .layout, .op-layout { display: block; }
}

/* ==========================================================================
   Phase 1 — search, landing pages, home, head additions
   Written against docs/design.md "Phase 1 additions".
   ========================================================================== */

/* Skip link: invisible until focused, then a clear pill at the top left. */
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 10;
  padding: 8px 14px;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 13px;
}
.skip-link:focus { top: 12px; text-decoration: none; }

/* --------------------------------------------------------------------------
   Search
   -------------------------------------------------------------------------- */

.search { position: relative; margin-bottom: 10px; }

.search-input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: var(--bg)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23737d8c' stroke-width='2.2' stroke-linecap='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>")
    no-repeat 10px center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
}
.search-input::placeholder { color: var(--ink-faint); }
.search-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px -12px rgba(16, 19, 26, 0.35);
  padding: 4px;
}

.search-result {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "method title" "method sub";
  column-gap: 8px;
  align-items: baseline;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  color: var(--ink);
}
.search-result:hover, .search-result.is-active { background: var(--accent-soft); text-decoration: none; }
.search-result .method { grid-area: method; align-self: start; margin-top: 3px; }
.search-result:not(:has(.method)) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "title" "sub"; }
.search-result-title {
  grid-area: title;
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 550;
  overflow-wrap: anywhere;
}
.search-result-sub { grid-area: sub; font-size: 11.5px; color: var(--ink-faint); }
.search-empty { padding: 10px 8px; font-size: 13px; color: var(--ink-faint); }

/* --------------------------------------------------------------------------
   Product landing page
   -------------------------------------------------------------------------- */

.landing { padding: 48px 40px 96px; max-width: 1180px; }

.landing-head { margin-bottom: 36px; max-width: 70ch; }
.landing-title { font-size: 34px; line-height: 1.15; letter-spacing: -0.025em; font-weight: 680; margin: 0 0 8px; }
.landing-lede { font-size: 16.5px; color: var(--ink-soft); margin: 0; }

.landing-section + .landing-section { margin-top: 44px; }

.landing-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.landing-count {
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  font-size: 12px;
  color: var(--ink-faint);
  background: var(--bg-code-soft);
  border-radius: 3px;
  padding: 1px 6px;
}

.landing-groups {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px 28px;
}

.landing-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 8px;
  background: var(--bg-raised);
  min-width: 0;
}
.landing-group-title {
  font-size: 13px;
  font-weight: 650;
  margin: 0 0 8px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.landing-list { list-style: none; margin: 0; padding: 0; }
.landing-list li { margin: 0; }
.landing-list a {
  display: block;
  padding: 4px 6px;
  margin: 0 -6px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.landing-list a:hover { background: var(--bg-sunken); color: var(--ink); text-decoration: none; }
.landing-list-ops a {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.landing-list-ops code { font-size: 12px; overflow-wrap: anywhere; color: var(--ink-soft); }
.landing-list-ops a:hover code { color: var(--ink); }

.landing-empty {
  font-size: 14px;
  color: var(--ink-faint);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Home — four tiles
   -------------------------------------------------------------------------- */

.home { padding: 56px 40px 96px; max-width: 1100px; }
.home-title { font-size: 36px; letter-spacing: -0.025em; line-height: 1.15; margin: 0 0 10px; }
.home-lede { font-size: 17px; color: var(--ink-soft); margin: 0 0 40px; max-width: 62ch; }

.home-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.home-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 20px 20px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--ink);
  transition: border-color 0.12s, transform 0.12s;
}
.home-tile:hover { text-decoration: none; border-color: var(--accent-line); transform: translateY(-1px); }
.home-tile-title { font-size: 19px; font-weight: 660; letter-spacing: -0.015em; color: var(--accent); }
.home-tile-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.home-tile-meta { margin-top: auto; padding-top: 8px; font-size: 12px; color: var(--ink-faint); font-family: var(--mono); }

/* --------------------------------------------------------------------------
   Response same-as-request
   -------------------------------------------------------------------------- */

.resp-same {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  font-size: 13.5px;
  color: var(--ink-soft);
}

@media (max-width: 899px) {
  .landing, .home { padding-left: 20px; padding-right: 20px; }
  .landing-title, .home-title { font-size: 27px; }
}

/* ==========================================================================
   Round 2 — brand logo, product marks, collapsible nav, example bodies
   ========================================================================== */

.brand { display: block; margin-bottom: 14px; line-height: 0; }
.brand-logo { display: block; width: 100%; max-width: 232px; height: auto; }

.home-tile-logo { height: 44px; width: auto; max-width: 170px; margin-bottom: 6px; object-fit: contain; }
.landing-logo { height: 56px; width: auto; max-width: 220px; object-fit: contain; margin-bottom: 10px; display: block; }
.landing-head { display: flex; flex-direction: column; }

/* Group titles are buttons now; keep the label look, add the affordance. */
.nav-group-title {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 4px 8px 6px;
  border-radius: var(--radius-sm);
}
.nav-group-title:hover { color: var(--ink); background: var(--bg); }
.nav-group-title::before {
  content: "\25BE";
  font-size: 10px;
  color: var(--ink-faint);
  transition: transform 0.12s;
}
.nav-group[data-collapsed="true"] .nav-group-title::before { transform: rotate(-90deg); }
.nav-group-count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--ink-faint);
  background: var(--bg-code-soft);
  border-radius: 3px;
  padding: 0 5px;
  display: none;
}
.nav-group[data-collapsed="true"] .nav-group-count { display: inline-block; }
.nav-group + .nav-group { margin-top: 10px; }

/* A single-option server select reads as a static label. */
select.server:has(option:only-child) {
  appearance: none;
  -webkit-appearance: none;
  border-color: transparent;
  background: transparent;
  padding-left: 0;
  pointer-events: none;
  color: var(--ink);
}

/* Example bodies under the schema trees. Same dark code surface as the cURL. */
.resp-example, .req-example { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.resp-example-head, .req-example-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
}
.resp-example-body, .req-example-body {
  background: var(--bg-code);
  color: var(--ink-on-dark);
  padding: 14px;
  margin: 0;
  overflow-x: auto;
  max-height: 480px;
  font-size: 12px;
  line-height: 1.6;
}
.resp-example-body code, .req-example-body code { color: inherit; font-size: 12px; }

/* ==========================================================================
   Brand pass — 4Thought Marketing system (2026-09-08)
   Typography and the few places the brand red belongs. Later rules win.
   ========================================================================== */

.op-title, .guide-title, .landing-title, .home-title, .index h1,
.prose h1, .prose h2, .prose h3, .prose h4,
.home-tile-title, .landing-group-title, .guide-toc-title, .landing-section-title,
.op-section-title, .nav-group-title, .brand, .product, .console-tab, .tryit-group legend,
.field-label, .op-auth-label, .resp-example-head, .req-example-head, .search-result-title {
  font-family: var(--font-heading);
}
.op-title, .guide-title, .landing-title, .home-title, .prose h2, .prose h3, .prose h4,
.home-tile-title, .landing-group-title { color: var(--ink); font-weight: 600; letter-spacing: -0.005em; }
.search-result-title { font-family: var(--mono); }
.prose { color: var(--ink-soft); }
.prose strong { color: var(--ink); }
.guide-meta, .sk-type, .sk-desc { color: var(--ink-faint); }

/* Eyebrow: the small red uppercase label the company site uses above headings. */
.home-lede, .landing-lede { color: var(--ink-soft); }
.home-title::before, .landing-title::before {
  content: "Documentation";
  display: block;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 12px;
}
.landing-title::before { content: "Product"; }

/* Current item: a red bar, white ground — not a tinted pill. */
.nav-item.is-current {
  background: var(--bg);
  color: var(--ink);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding-left: 7px;
}
.nav-item.is-current .nav-item-label, .nav-item.is-current { font-weight: 600; }

/* Product switcher: the active product is a solid teal tab. */
.product.is-active { background: var(--accent); color: #fff; box-shadow: none; }

/* Console tabs and section rules pick up the brand red as the single accent line. */
.console-tab.is-active { color: var(--accent); border-bottom-color: var(--brand); }
.op-section-title { color: var(--accent); border-bottom: 2px solid var(--accent); }
.landing-section-title { color: var(--accent); border-bottom: 2px solid var(--accent); }

/* Round 3: the full product logo (icon + wordmark) is the title of a tile and of
   a landing header. Every logo is the same height, so a row of tiles lines up;
   widths follow each file's aspect ratio. No box, no background: the artwork
   sits on the page the way it does on the company site. */
.home-tile-logo, .landing-logo {
  display: block;
  width: auto;
  max-width: 100%;
  padding: 0;
  background: none;
  object-fit: contain;
}
.home-tile-logo { height: 44px; margin: 0; }
.landing-logo { height: 52px; margin: 0; }
.home-tile-title { display: block; line-height: 0; }
.home-tile { border-top: 3px solid var(--accent); padding-top: 22px; gap: 12px; }
.home-tile:hover { border-color: var(--line); border-top-color: var(--brand); transform: none; }
.home-tile:hover .home-tile-logo { filter: brightness(0.92); }
.landing-title { line-height: 0; margin-bottom: 14px; }
.landing-title::before { line-height: 1.4; }

/* Sidebar hierarchy (Round 3). Three levels, three voices:
   section heading  - the red uppercase eyebrow the rest of the site uses
   group title      - Poppins, normal case, so "AdminSubscription" keeps its shape
   item             - body text for a guide; monospace only for an operation path,
                      because a path is code and a guide title is not. */
.nav-section {
  margin: 22px 0 8px;
  padding: 0 8px;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}
.nav-section:first-child { margin-top: 6px; }
.nav-group-title {
  font-family: var(--font-heading);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
}
.nav-group-title:hover { color: var(--ink); }
.nav-section + .nav-group { margin-top: 0; }
.nav-item-label { font-family: inherit; font-size: 13px; }
.nav-item .method + .nav-item-label { font-family: var(--mono); font-size: 11.5px; }
.home-tiles { gap: 20px; }
.home { padding-top: 64px; }
.home-title { font-size: 38px; max-width: 24ch; }

/* Required chip reads as brand red; type refs as teal. */
.sk-required { color: var(--brand); background: var(--brand-soft); }
.sk-ref { color: var(--accent); background: var(--accent-soft); }
.op-path-var { color: var(--accent); background: var(--accent-soft); }
.btn-send { background: var(--accent); }
.btn-send:hover { background: var(--brand); filter: none; }
.method { font-family: var(--mono); }
.op-id .method { color: #fff; }
.op-id .method-get { background: var(--get); }
.op-id .method-post { background: var(--post); }
.op-id .method-put { background: var(--put); }
.op-id .method-patch { background: var(--patch); }
.op-id .method-delete { background: var(--delete); }

/* ==========================================================================
   Round 3 — the body split (Adrian picked "option C", 2026-09-08)

   A request or response body is the schema tree at left and the example at
   right, when the section is wide enough for both; stacked otherwise. Inside
   a split the tree is compact: the required chip is a red dot (with a legend
   above the tree), the other chips shrink, depth tints go, and hovering a row
   lights the matching example line by shared data-path.
   ========================================================================== */

.op-section { container-type: inline-size; }

.body-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.body-split-tree { min-width: 0; }
.body-split .req-example, .body-split .resp-example { margin-top: 0; min-width: 0; }

@container (min-width: 820px) {
  .body-split { grid-template-columns: minmax(0, 1fr) minmax(300px, 42%); gap: 20px; }
  .body-split .req-example, .body-split .resp-example { position: sticky; top: 16px; }
}

.sk-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px;
  font-size: 11.5px;
  color: var(--ink-faint);
}
.sk-legend-dot, .body-split .sk-main .sk-required {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
}
/* The word stays in the markup for assistive tech; only its box changes.
   Selector depth beats the `.sk-main > *` inline rule below. */
.body-split .sk-main .sk-required {
  vertical-align: middle;
  padding: 0;
  overflow: hidden;
  text-indent: -999px;
  white-space: nowrap;
}

.body-split .schema-tree { padding: 4px; }
.body-split .sk-row { padding: 4px 8px; border-top: none; border-radius: 3px; }
/* The row is inline text with a hanging indent, not a flex line: when a long
   name + type + ref wraps in the narrower column, the second line starts under
   the name rather than under the caret. */
.body-split .sk-main {
  display: block;
  padding-left: 23px;
  text-indent: -23px;
  line-height: 1.6;
}
.body-split .sk-main > * { display: inline; margin-right: 8px; vertical-align: baseline; }
.body-split .sk-toggle, .body-split .sk-spacer {
  display: inline-block;
  width: 16px;
  margin: 0 7px 0 0;
  vertical-align: middle;
}
.body-split .sk-enum { display: inline-flex; }
.body-split .sk-name { font-size: 12.5px; }
.body-split .sk-type { font-size: 11.5px; }
.body-split .sk-ref { font-size: 11px; background: none; padding: 0; }
.body-split .sk-ref:hover { box-shadow: none; text-decoration: underline; }
.body-split .sk-nullable, .body-split .chip-constraint {
  font-size: 10.5px;
  font-family: var(--mono);
  color: var(--ink-faint);
  background: none;
  border: none;
  padding: 0;
}
.body-split .sk-desc { margin-left: 24px; font-size: 12.5px; }
.body-split .sk-children { margin-left: 14px; padding-left: 4px; border-left-color: var(--line-strong); }
.body-split .sk-row[data-depth] { background: transparent; }
.body-split .sk-row:hover, .body-split .sk-row.is-linked { background: var(--accent-soft); }
.body-split .sk-row.is-linked .sk-name { color: var(--accent); }

.body-split .req-example-body, .body-split .resp-example-body { max-height: 560px; }
.ex-line { display: block; margin: 0 -14px; padding: 0 14px 0 11px; border-left: 3px solid transparent; }
.ex-line.is-linked { background: rgba(255, 255, 255, 0.14); border-left-color: var(--brand); }
