/* nectere docs - page chrome. tokens match necterestyle.md */
:root {
  color-scheme: dark;
  --accent: #f97316;
  --accent-hover: #ea6d0b;
  --accent-subtle: rgba(249,115,22,0.10);
  --accent-glow: rgba(249,115,22,0.20);

  --bg: #06090f;
  --bg-surface: #0a0f1a;
  --panel-bar: #0b111e;
  --panel-bg: #0f1525;
  --bg-overlay: #151d30;

  --panel-border: rgba(255,255,255,0.10);
  --field-border: rgba(255,255,255,0.14);
  --border: rgba(255,255,255,0.06);
  --border-hover: rgba(255,255,255,0.12);

  --text-primary: #e8edf5;
  --text-secondary: #9aadc7;
  --text-muted: #5c6f8a;
  --doc-text: #c2cede;

  --success: #10b981; --success-bg: rgba(16,185,129,0.10);
  --error: #f43f5e;   --error-bg: rgba(244,63,94,0.10);
  --warning: #f59e0b; --warning-bg: rgba(245,158,11,0.10);
  --info: #60a5fa;    --info-bg: rgba(96,165,250,0.10);

  --sans: 'Public Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --toc-w: 284px;
  --product: var(--accent);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 24px; scrollbar-width: thin; scrollbar-color: rgba(249,115,22,0.2) transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--doc-text);
  font: 400 15px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse at 70% 0%, rgba(249,115,22,0.03), transparent 60%);
}
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(249,115,22,0.18); border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }

a { color: #fb9a5a; text-underline-offset: 3px; }
a:hover { color: #fdb27f; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
p { margin: 0; }
code, kbd, .mono { font-family: var(--mono); }
code { font-size: 0.86em; color: var(--text-primary); background: var(--bg-surface); border: 1px solid var(--panel-border); border-radius: 3px; padding: 1px 5px; overflow-wrap: anywhere; }
kbd { font-size: 0.8em; color: var(--text-primary); background: #1a2338; border: 1px solid rgba(255,255,255,0.14); border-bottom-width: 2px; border-radius: 3px; padding: 1px 6px; }
strong { color: var(--text-primary); font-weight: 600; }

/* ── left index ── */
.toc {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--toc-w);
  display: flex; flex-direction: column;
  background: var(--bg-surface);
  border-right: 1px solid var(--panel-border);
  z-index: 50;
  transition: transform 0.25s cubic-bezier(0.4,0,0.2,1);
}
.toc-head { padding: 18px 16px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.toc-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.toc-brand img { width: 30px; height: 30px; }
.toc-brand .n { font-size: 17px; font-weight: 700; color: var(--text-primary); letter-spacing: -0.3px; line-height: 1; }
.toc-brand .p { display: block; margin-top: 4px; font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--product); line-height: 1; }
.toc-tools { display: flex; gap: 6px; }
.toc-search {
  flex: 1; min-width: 0; height: 28px; padding: 0 9px;
  background: var(--bg); border: 1px solid var(--field-border); border-radius: 4px;
  color: var(--text-primary); font: 13px var(--sans); outline: none;
}
.toc-search:focus { border-color: var(--accent); }
.toc-search::placeholder { color: var(--text-muted); }
.toc-btn {
  height: 28px; min-width: 28px; padding: 0 8px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #1a2338; border: 1px solid rgba(255,255,255,0.12); border-radius: 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
  color: var(--text-secondary); font: 500 11px var(--sans); cursor: pointer;
}
.toc-btn:hover { background: #212b42; color: var(--text-primary); }
.toc-btn svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.toc-list { flex: 1; overflow-y: auto; padding: 10px 8px 24px; margin: 0; list-style: none; }
.toc-group { margin-bottom: 1px; }
.toc-g {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border: none; border-radius: 6px; background: none;
  color: var(--text-secondary); font: 500 13px var(--sans); text-align: left; cursor: pointer;
  position: relative;
}
.toc-g:hover { background: rgba(255,255,255,0.04); color: var(--text-primary); }
.toc-g .chev { width: 12px; flex: none; font-family: var(--mono); font-size: 11px; color: var(--text-muted); transition: transform 0.2s; display: inline-block; }
.toc-g .chev.none { visibility: hidden; }
.toc-group.open > .toc-g .chev { transform: rotate(90deg); }
.toc-g .num { font-family: var(--mono); font-size: 10px; color: var(--text-muted); width: 18px; flex: none; }
.toc-g .lbl { flex: 1; min-width: 0; }
.toc-group.active > .toc-g { color: var(--product); background: color-mix(in srgb, var(--product) 10%, transparent); font-weight: 600; }
.toc-group.active > .toc-g::before { content: ''; position: absolute; left: 0; top: 7px; bottom: 7px; width: 3px; border-radius: 0 2px 2px 0; background: var(--product); box-shadow: 0 0 8px color-mix(in srgb, var(--product) 30%, transparent); }
.toc-group.active > .toc-g .num { color: var(--product); }
.toc-sub { list-style: none; margin: 0 0 4px; padding: 0 0 0 34px; display: none; }
.toc-group.open > .toc-sub { display: block; }
.toc-sub a {
  display: block; padding: 4px 8px; border-radius: 4px;
  font-size: 12.5px; line-height: 1.4; color: var(--text-muted); text-decoration: none;
  border-left: 1px solid var(--border);
}
.toc-sub a:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.toc-sub a.active { color: var(--text-primary); border-left-color: var(--product); }
.toc-foot { padding: 10px 16px; border-top: 1px solid var(--border); font-family: var(--mono); font-size: 10px; color: var(--text-muted); display: flex; justify-content: space-between; gap: 8px; }
.toc-foot a { color: var(--text-muted); text-decoration: none; }
.toc-foot a:hover { color: var(--text-primary); }
.toc-hidden { display: none !important; }

.toc-open {
  position: fixed; top: 14px; left: 14px; z-index: 60;
  display: none; align-items: center; gap: 6px; height: 30px; padding: 0 10px;
  background: #1a2338; border: 1px solid rgba(255,255,255,0.14); border-radius: 4px;
  color: var(--text-primary); font: 500 12px var(--sans); cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toc-open svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; }
body.toc-collapsed .toc { transform: translateX(-100%); }
body.toc-collapsed .toc-open { display: inline-flex; }
body.toc-collapsed .doc { margin-left: 0; }

/* ── main column ── */
.doc { margin-left: var(--toc-w); transition: margin-left 0.25s cubic-bezier(0.4,0,0.2,1); }
.doc-inner { max-width: 1120px; margin: 0 auto; padding: 48px 48px 96px; display: flex; flex-direction: column; gap: 64px; }
@media (max-width: 1000px) {
  .doc { margin-left: 0; }
  .toc { transform: translateX(-100%); box-shadow: 0 0 60px rgba(0,0,0,0.6); }
  body.toc-mobile-open .toc { transform: none; }
  .toc-open { display: inline-flex; }
  body.toc-mobile-open .toc-open { display: none; }
  .doc-inner { padding: 64px 16px 72px; gap: 52px; }
}

header.hero { display: flex; flex-direction: column; gap: 18px; }
.eyebrow { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--product); }
.eyebrow span + span::before { content: '/'; color: var(--text-muted); margin-right: 14px; }
h1 { margin: 0; font-size: clamp(38px, 6vw, 60px); font-weight: 700; letter-spacing: -1.2px; line-height: 1.02; color: var(--text-primary); }
h1 .lt { color: var(--text-muted); font-weight: 600; }
.lead { font-size: 17px; line-height: 1.6; color: var(--doc-text); }
.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border: 1px solid var(--panel-border); border-radius: 4px; background: var(--panel-bg); font-size: 12px; color: var(--text-secondary); }
.fact b { font-family: var(--mono); font-weight: 500; color: var(--text-primary); }
.fact i { width: 8px; height: 8px; border-radius: 50%; background: var(--product); font-style: normal; }

section.s { display: flex; flex-direction: column; gap: 20px; }
h2 { margin: 0; display: flex; align-items: baseline; gap: 12px; font-size: 26px; font-weight: 650; letter-spacing: -0.5px; line-height: 1.15; color: var(--text-primary); scroll-margin-top: 24px; }
h2 .num { font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--product); letter-spacing: 0; }
h2::after { content: ''; flex: 1; height: 1px; background: var(--panel-border); transform: translateY(-7px); min-width: 24px; }
h3 { margin: 12px 0 0; font-size: 17px; font-weight: 600; color: var(--text-primary); letter-spacing: -0.2px; scroll-margin-top: 24px; }
h4 { margin: 4px 0 0; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.sub { display: flex; flex-direction: column; gap: 14px; }
.muted { color: var(--text-secondary); }
.small { font-size: 13px; }
.caption { font-size: 13px; color: var(--text-secondary); }
.caption code { font-size: 11.5px; }
ul.plain, ol.plain { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
ul.plain li::marker { color: var(--text-muted); }
ol.plain li::marker { color: var(--product); font-family: var(--mono); font-size: 12px; }

.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.cols-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .cols-2 { grid-template-columns: minmax(0,1fr); } }

/* note boxes */
.note { border: 1px solid var(--panel-border); border-left: 3px solid var(--info); background: var(--panel-bg); border-radius: 4px; padding: 12px 14px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.note.warn { border-left-color: var(--warning); }
.note.err { border-left-color: var(--error); }
.note.ok { border-left-color: var(--success); }
.note .t { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--info); }
.note.warn .t { color: var(--warning); }
.note.err .t { color: var(--error); }
.note.ok .t { color: var(--success); }

/* doc tables */
.tbl { overflow-x: auto; border: 1px solid var(--panel-border); border-radius: 4px; background: var(--panel-bg); }
.tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
.tbl th { text-align: left; padding: 9px 14px; background: var(--panel-bar); border-bottom: 1px solid var(--panel-border); font-size: 11px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.tbl td { padding: 9px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--doc-text); }
.tbl tr:last-child td { border-bottom: none; }
.tbl td.m, .tbl td .m { font-family: var(--mono); font-size: 12px; color: var(--text-primary); }
.tbl td.r { text-align: right; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.tbl .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 0; }

/* api method chips */
.verb { display: inline-block; min-width: 50px; text-align: center; font-family: var(--mono); font-size: 10px; font-weight: 600; padding: 2px 6px; border-radius: 3px; letter-spacing: 0.04em; }
.verb.get { color: var(--info); background: var(--info-bg); }
.verb.post { color: var(--success); background: var(--success-bg); }
.verb.put { color: var(--warning); background: var(--warning-bg); }
.verb.del { color: var(--error); background: var(--error-bg); }

/* code blocks + copy boxes */
pre.code {
  margin: 0; padding: 12px 14px; overflow-x: auto;
  background: var(--bg-surface); border: 1px solid var(--panel-border); border-radius: 4px;
  font: 12.5px/1.6 var(--mono); color: var(--text-secondary);
}
pre.code .c { color: var(--text-muted); }
pre.code .k { color: #fb9a5a; }
pre.code .s { color: #86efac; }
pre.code .v { color: #93c5fd; }
.codehead { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 6px 14px; background: var(--panel-bar); border: 1px solid var(--panel-border); border-bottom: none; border-radius: 4px 4px 0 0; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.codehead + pre.code { border-radius: 0 0 4px 4px; }
.copy { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; background: var(--bg-surface); border: 1px solid var(--panel-border); border-radius: 3px; }
.copy .lbl { font-size: 12px; color: var(--text-muted); flex: none; }
.copy code { flex: 1; min-width: 0; background: none; border: none; padding: 0; font-size: 12px; white-space: nowrap; overflow-x: auto; }
.copy-btn { height: 24px; padding: 0 9px; flex: none; background: #1a2338; border: 1px solid rgba(255,255,255,0.12); border-radius: 3px; color: var(--text-primary); font: 500 12px var(--sans); cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.copy-btn:hover { background: #212b42; }

/* segmented demo controls */
.ctl { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; }
.ctl .seg { display: inline-flex; align-items: center; gap: 10px; }
.ctl .seg > span { font-size: 11px; font-weight: 500; letter-spacing: 0.6px; text-transform: uppercase; color: var(--text-muted); }
.ctl .opts { display: inline-flex; gap: 2px; padding: 2px; background: var(--bg-surface); border: 1px solid var(--panel-border); border-radius: 4px; }
.ctl .opts button { min-width: 52px; height: 24px; padding: 0 10px; border: 1px solid transparent; border-radius: 3px; background: none; color: var(--text-secondary); font: 600 12px var(--sans); cursor: pointer; }
.ctl .opts button:hover { color: var(--text-primary); }
.ctl .opts button[aria-pressed="true"] { background: #1a2338; border-color: rgba(255,255,255,0.14); color: var(--text-primary); box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.ctl input[type=range] { accent-color: var(--accent); width: 140px; }
.ctl .val { font-family: var(--mono); font-size: 12px; color: var(--text-primary); min-width: 38px; }

/* step list */
.steps { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--panel-border); border-radius: 4px; background: var(--panel-bg); }
.step { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); align-items: start; }
.step:last-child { border-bottom: none; }
.step .n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-subtle); color: var(--accent); font: 600 12px var(--mono); }
.step .b { display: flex; flex-direction: column; gap: 3px; font-size: 14px; }
.step .b b { color: var(--text-primary); font-weight: 600; }
.step .pct { font-family: var(--mono); font-size: 12px; color: var(--text-secondary); white-space: nowrap; }

/* numbered callouts legend */
ol.pins { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px 22px; font-size: 13.5px; }
ol.pins li { display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 10px; align-items: start; }
ol.pins li > b:first-child { width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #1a0d02; font: 700 11px var(--mono); display: inline-flex; align-items: center; justify-content: center; margin-top: 1px; }

/* diagrams */
.diagram { border: 1px solid var(--panel-border); border-radius: 4px; background: var(--panel-bg); padding: 18px; overflow-x: auto; }
.diagram svg { display: block; min-width: 760px; width: 100%; height: auto; }
.diagram text { font-family: var(--sans); }

/* reference list */
ol.refs { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--text-secondary); }
ol.refs li::marker { font-family: var(--mono); color: var(--text-muted); }
.ref { font-family: var(--mono); font-size: 11.5px; text-decoration: none; color: #fb9a5a; white-space: nowrap; }
.ref:hover { text-decoration: underline; }

/* product landing cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 0 0 14px; background: var(--panel-bg); border: 1px solid var(--panel-border); border-radius: 4px; text-decoration: none; color: inherit; overflow: hidden; transition: border-color 0.2s; }
.card:hover { border-color: color-mix(in srgb, var(--c, var(--accent)) 55%, transparent); }
.card .bar { height: 3px; background: var(--c, var(--accent)); margin-bottom: 8px; }
.card .t { padding: 0 14px; font-size: 16px; font-weight: 600; color: var(--text-primary); }
.card .d { padding: 0 14px; font-size: 13px; color: var(--text-secondary); }
.card .k { padding: 0 14px; font-family: var(--mono); font-size: 11px; color: var(--text-muted); }
.card.soon { opacity: 0.5; pointer-events: none; }
