/* ==========================================================================
   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 — warm-cool slate, slightly warmer than Stoplight's flat grey */
  --bg:            #ffffff;
  --bg-sunken:     #f7f8fa;
  --bg-raised:     #ffffff;
  --bg-code:       #1e2330;
  --bg-code-soft:  #f4f5f8;

  --line:          #e4e7ec;
  --line-strong:   #d0d5dd;

  --ink:           #10131a;
  --ink-soft:      #4a5261;
  --ink-faint:     #737d8c;
  --ink-on-dark:   #e6e9f0;

  --accent:        #4338ca;
  --accent-soft:   #eef0fe;
  --accent-line:   #c7cbf7;

  /* Method colours */
  --get:     #0f766e;  --get-bg:     #d9f2ee;
  --post:    #1d4ed8;  --post-bg:    #dde6fd;
  --put:     #a45608;  --put-bg:     #fbebd2;
  --patch:   #6d28d9;  --patch-bg:   #eee2fd;
  --delete:  #b42318;  --delete-bg:  #fde3e0;

  /* Status colours */
  --ok:      #067647;  --ok-bg:      #d6f5e3;
  --redir:   #1d4ed8;  --redir-bg:   #dde6fd;
  --client:  #b54708;  --client-bg:  #fbeee0;
  --server:  #b42318;  --server-bg:  #fde3e0;

  --warn:      #92400e;
  --warn-bg:   #fdf3e2;
  --warn-line: #f0d9b0;

  --radius:    8px;
  --radius-sm: 5px;

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

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0f1117;
    --bg-sunken:     #14171f;
    --bg-raised:     #171b24;
    --bg-code:       #0b0d12;
    --bg-code-soft:  #171b24;
    --line:          #262b36;
    --line-strong:   #343a48;
    --ink:           #e8ebf2;
    --ink-soft:      #a8b0be;
    --ink-faint:     #7b8494;
    --accent:        #a5b0ff;
    --accent-soft:   #1b1f36;
    --accent-line:   #333a63;
    --get-bg:     #0d2b28;  --post-bg:  #12203f;  --put-bg:    #33240d;
    --patch-bg:   #241640;  --delete-bg:#3a1512;
    --ok-bg:      #0c2a1c;  --redir-bg: #12203f;
    --client-bg:  #33240d;  --server-bg:#3a1512;
    --get:  #5fd4c4; --post: #8bb0ff; --put: #e0a75c;
    --patch:#c4a5ff; --delete:#ff9d94;
    --ok:   #57cf95; --redir:#8bb0ff; --client:#e0a75c; --server:#ff9d94;
    --warn: #e0b878; --warn-bg: #2a2113; --warn-line: #453519;
  }
}

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

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  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; }
}
