
:root {
  --bg: #ffffff;
  --bg-subtle: #f7f8fa;
  --bg-code: #f6f8fa;
  --fg: #1c1e21;
  --fg-muted: #616a75;
  --fg-faint: #8b949e;
  --accent: #1f6feb;
  --accent-soft: #e7f0ff;
  --border: #e3e6ea;
  --border-strong: #ccd2d9;
  --required: #d33a3a;
  --chip-bg: #e7f0ff;
  --chip-fg: #1a4f9c;
  --nav-active-bg: #eef2f7;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- TYPE SCALE (ONE-2652) ----
     The site first shipped at 15px/1.6 with 30px titles, which read as a dense tool UI beside
     the published Docusaurus reference at developer.onetablet.com — that site is the look we are
     replacing it WITH, so its roomier scale is the target, not a preference: 17px body copy,
     1.72 line-height, and headings that step far enough apart to see a section boundary while
     scrolling. Every size below is a token so the whole scale moves together; a hard-coded px
     in a rule is how half a page ends up at the old density. */
  --topbar-h: 64px;
  --fs-body: 17px;
  --lh-body: 1.72;
  --fs-h1: 38px;
  --fs-h2: 28px;
  --fs-h3: 21px;
  --fs-section: 30px;
  --fs-nav: 15px;
  --fs-small: 15px;     /* table cells, param descriptions — one step under body */
  --fs-mono: 14px;      /* inline identifiers, tabs, pills */
  --fs-code: 13.5px;    /* code blocks, where density genuinely helps */
  --fs-eyebrow: 12.5px; /* uppercase card headers and media pills */
  --space-section: 46px;
  --space-para: 18px;
}
:root[data-theme='dark'] {
  --bg: #16181d;
  --bg-subtle: #1c1f26;
  --bg-code: #1c1f26;
  --fg: #e6e9ef;
  --fg-muted: #a3adba;
  --fg-faint: #7b8794;
  --accent: #6ea8ff;
  --accent-soft: #1d2b45;
  --border: #2b2f38;
  --border-strong: #3a404b;
  --required: #ff7a7a;
  --chip-bg: #1d2b45;
  --chip-fg: #9dc2ff;
  --nav-active-bg: #232733;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: 0.9em; }

/* ---- top bar ---- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 22px;
  height: var(--topbar-h); padding: 0 26px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-weight: 700; font-size: 19px; color: var(--fg); }
.topbar .docs-link { font-size: var(--fs-small); font-weight: 500; }
.topbar .spacer { flex: 1; }
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; cursor: pointer;
  background: transparent; border: 0; border-radius: 8px; color: var(--fg-muted);
}
.theme-toggle:hover { background: var(--bg-subtle); }

/* ---- three-pane layout ---- */
.layout {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr) 440px;
  align-items: start;
}
.sidebar {
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 22px 12px 70px 18px;
  border-right: 1px solid var(--border);
}
.content { min-width: 0; padding: 34px 44px 140px; }
.aside {
  position: sticky; top: var(--topbar-h);
  max-height: calc(100vh - var(--topbar-h)); overflow-y: auto;
  padding: 34px 24px 90px 8px;
}

/* ---- nav tree ---- */
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list .nav-list { margin-left: 14px; padding-left: 10px; border-left: 1px solid var(--border); }
.nav-row {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 10px; margin: 2px 0;
  border-radius: 7px;
  color: var(--fg-muted); font-size: var(--fs-nav);
  cursor: pointer;
}
.nav-row:hover { background: var(--nav-active-bg); text-decoration: none; }
.nav-row .label { flex: 1; min-width: 0; }
.nav-row.is-open { color: var(--accent); font-weight: 600; }
.nav-row.is-active { background: var(--nav-active-bg); color: var(--accent); font-weight: 600; }
.nav-row .chevron {
  flex: none; width: 15px; height: 15px; color: var(--fg-faint);
  transition: transform 0.12s ease;
}
.nav-row[aria-expanded='true'] .chevron { transform: rotate(90deg); }
.nav-group > .nav-list[hidden] { display: none; }

/* ---- page body ---- */
h1.page-title { font-size: var(--fs-h1); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.015em; }
.op-path {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: var(--fs-mono); color: var(--fg-muted);
  background: var(--bg-subtle); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 11px; margin-bottom: 24px;
}
.op-path .verb { color: var(--accent); font-weight: 700; }
.prose p { margin: 0 0 var(--space-para); }
.prose h2 { font-size: var(--fs-h2); line-height: 1.25; margin: 42px 0 14px; letter-spacing: -0.01em; }
.prose h3 { font-size: var(--fs-h3); line-height: 1.3; margin: 32px 0 10px; }
.prose ul, .prose ol { margin: 0 0 var(--space-para); padding-left: 26px; }
.prose li { margin: 7px 0; }
.prose code, .param-desc code, td code {
  background: var(--chip-bg); color: var(--chip-fg);
  border-radius: 4px; padding: 1px 5px;
}
.prose pre { background: var(--bg-code); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; margin: 0 0 var(--space-para); overflow-x: auto; font-size: var(--fs-code); line-height: 1.6; }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose blockquote { margin: 0 0 var(--space-para); padding: 4px 18px; border-left: 3px solid var(--border-strong); color: var(--fg-muted); }
.table-scroll { overflow-x: auto; margin: 0 0 22px; }
table { border-collapse: collapse; width: 100%; font-size: var(--fs-small); }
th, td { border: 1px solid var(--border); padding: 10px 13px; text-align: left; vertical-align: top; }
th { background: var(--bg-subtle); font-weight: 600; }

/* ---- request / response block ---- */
h2.section-title { font-size: var(--fs-section); line-height: 1.25; margin: var(--space-section) 0 16px; letter-spacing: -0.01em; }
.media-pill {
  display: inline-block; font-family: var(--mono); font-size: var(--fs-eyebrow); letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--fg-muted);
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 5px 12px; margin-bottom: 18px;
}
.tab-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.tab {
  font-family: var(--mono); font-size: var(--fs-mono); color: var(--fg-muted);
  background: transparent; border: 1px solid transparent; border-radius: 7px;
  padding: 6px 14px; cursor: pointer;
}
.tab.is-selected { color: var(--accent); border-color: var(--accent); font-weight: 600; }
.disclosure {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: var(--fs-mono); letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--fg); font-weight: 700;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.disclosure .chevron { width: 14px; height: 14px; transition: transform 0.12s ease; }
.disclosure[aria-expanded='true'] .chevron { transform: rotate(90deg); }
.required-flag {
  display: block; margin: 4px 0 8px 20px;
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--required); font-weight: 700;
}

/* The indented parameter list, with the thin guide line and a tick per row. */
.params { list-style: none; margin: 0 0 10px; padding: 0 0 0 22px; border-left: 1px solid var(--border); }
.params .params { margin-top: 10px; margin-bottom: 6px; }
.param { position: relative; padding: 11px 0 11px 16px; }
.param::before {
  content: ''; position: absolute; left: -1px; top: 22px;
  width: 9px; height: 1px; background: var(--border-strong);
}
.param-name { font-family: var(--mono); font-size: 14.5px; font-weight: 700; color: var(--fg); }
.param-type { font-family: var(--mono); font-size: var(--fs-mono); color: var(--fg-faint); margin-left: 9px; }
.param-required { font-size: 12px; text-transform: uppercase; color: var(--required); font-weight: 700; margin-left: 9px; letter-spacing: 0.05em; }
.param-desc { margin: 6px 0 0; color: var(--fg-muted); font-size: var(--fs-small); }
.param-desc p { margin: 0 0 10px; }
.possible-values { margin-top: 8px; font-size: var(--fs-small); color: var(--fg-muted); }
.possible-values strong { color: var(--fg); }
.chip {
  display: inline-block; font-family: var(--mono); font-size: 13.5px;
  background: var(--chip-bg); color: var(--chip-fg);
  border-radius: 4px; padding: 2px 7px; margin: 0 2px;
}
.example-pane pre {
  background: var(--bg-code); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 16px; overflow-x: auto; font-size: var(--fs-code); line-height: 1.6;
}
[hidden] { display: none !important; }

/* ---- right-hand cards ---- */
.card { border: 1px solid var(--border); border-radius: 10px; margin-bottom: 22px; background: var(--bg); }
.card-header {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 13px 16px;
  font-family: var(--mono); font-size: var(--fs-eyebrow); letter-spacing: 0.06em;
  text-transform: uppercase; font-weight: 700; color: var(--fg);
}
.card-header + .card-body { border-top: 1px solid var(--border); }
.card-body { padding: 14px 16px; }
.card-action {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--fg-muted); background: none; border: 0; cursor: pointer; font-weight: 700;
}
.card-action:hover { color: var(--accent); }
.auth-note { margin: 0; font-size: var(--fs-small); color: var(--fg-muted); line-height: 1.65; }

.lang-tabs { display: flex; gap: 8px; padding: 12px 12px 0; flex-wrap: wrap; }
.lang-tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  width: 82px; height: 70px; cursor: pointer;
  background: var(--bg); border: 1px solid var(--border); border-radius: 9px;
  color: var(--fg-muted);
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
}
.lang-tab svg { width: 27px; height: 27px; }
.lang-tab.is-selected { border-color: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.variant-row { padding: 12px 12px 0; }
.variant-pill {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase;
  border: 1px solid var(--accent); color: var(--accent); border-radius: 999px;
  padding: 3px 12px; background: var(--accent-soft);
}
.code-panel { padding: 12px; }
/* Capped on purpose: a long sample must not push the REQUEST card below the sticky column's
   scroll, which is how the third card became unreachable on tall operations. */
.code-block {
  display: flex; background: var(--bg-code); border: 1px solid var(--border);
  border-radius: 8px; overflow-y: auto; max-height: 460px;
  font-family: var(--mono); font-size: var(--fs-code); line-height: 1.6;
}
.code-gutter {
  flex: none; padding: 10px 8px; text-align: right; color: var(--fg-faint);
  background: var(--bg-subtle); border-right: 1px solid var(--border); user-select: none;
}
.code-gutter span { display: block; }
.code-lines { flex: 1; min-width: 0; overflow-x: auto; padding: 10px 12px; margin: 0; white-space: pre; }

@media (max-width: 1400px) {
  .layout { grid-template-columns: 272px minmax(0, 1fr); }
  .aside { grid-column: 2; position: static; max-height: none; padding: 0 44px 70px; }
}
@media (max-width: 900px) {
  /* Below this the roomier scale stops being roomy and starts being a phone with two words per
     line, so the type steps back down — the tokens are the only thing that has to move. */
  :root { --fs-body: 16px; --fs-h1: 30px; --fs-h2: 23px; --fs-h3: 19px; --fs-section: 25px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .aside { grid-column: 1; padding: 0 22px 70px; }
  .content { padding: 24px 22px 80px; }
}
