/* Ocean SMP Public API - self-contained stylesheet.
 * Fonts load from Google Fonts (Geist, Geist Mono); the stack falls back to system fonts.
 */

:root {
  --bg: #040f1f;
  --bg-2: #061429;
  --panel: #0a1c36;
  --panel-2: #0e2543;
  --panel-3: #14305a;
  --line: #15325a;
  --line-strong: #245089;
  --text: #eaf4ff;
  --text-2: #bcd0e8;
  --dim: #8aa6c8;
  --amber: #38bdf8;
  --amber-soft: rgba(56, 189, 248, 0.14);
  --sea: #5eead4;
  --sea-soft: rgba(87, 207, 182, 0.12);
  --coral: #f07a6f;
  --coral-soft: rgba(240, 122, 111, 0.12);
  --blue: #83b9f5;
  --blue-soft: rgba(131, 185, 245, 0.12);
  --radius: 14px;
  --radius-sm: 8px;
  --rail-h: 58px;
  --nav-w: 302px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, "Cascadia Code", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.32);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1100px 520px at 78% -8%, rgba(37, 99, 235, 0.22), transparent 65%),
    radial-gradient(800px 460px at 8% 2%, rgba(56, 189, 248, 0.07), transparent 62%),
    var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

::selection { background: rgba(56, 189, 248, 0.3); color: #fff; }

a { color: var(--sea); text-decoration: none; }
a:hover { color: #8ee6d5; }

h1, h2, h3, h4 { margin: 0; line-height: 1.2; letter-spacing: -0.018em; font-weight: 650; }
h1 { font-size: clamp(28px, 3.4vw, 42px); letter-spacing: -0.03em; }
h2 { font-size: 22px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0 0 12px; color: var(--text-2); }
ul, ol { margin: 0 0 12px; padding-left: 22px; color: var(--text-2); }
li { margin: 4px 0; }
li::marker { color: var(--dim); }

code, pre, kbd, .mono { font-family: var(--mono); }
code { font-size: 0.9em; }
kbd {
  font-size: 11px;
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 6px;
  background: var(--bg-2);
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.62; }

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 200;
  background: var(--amber);
  color: #021726;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 10px; color: #021726; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ rail */

.rail {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--rail-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(4, 15, 31, 0.86);
  backdrop-filter: blur(14px);
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); flex: 0 0 auto; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: var(--amber);
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: -0.01em; }
.brand-sub { font-size: 10.5px; color: var(--dim); text-transform: uppercase; letter-spacing: 0.12em; margin-top: 3px; }

.rail-spacer { flex: 1 1 auto; }

.rail-link {
  color: var(--text-2);
  font-size: 13px;
  font-weight: 550;
  padding: 6px 9px;
  border-radius: 7px;
  white-space: nowrap;
}
.rail-link:hover { color: var(--text); background: var(--panel); }
.rail-link-quiet { color: var(--dim); }

.instrument {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  padding: 4px 6px 4px 10px;
  min-width: 0;
}
.signal {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dim);
  flex: 0 0 auto;
  box-shadow: 0 0 0 3px rgba(127, 155, 160, 0.12);
}
.signal[data-state="ok"] { background: var(--sea); box-shadow: 0 0 0 3px var(--sea-soft); }
.signal[data-state="bad"] { background: var(--coral); box-shadow: 0 0 0 3px var(--coral-soft); }
.signal[data-state="wait"] { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); animation: pulse 1.3s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.38; } }

.instrument-base {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-family: var(--mono);
  max-width: 172px;
  padding: 3px 2px;
  cursor: pointer;
}
.instrument-base option { background: var(--panel); color: var(--text); }
.instrument-read {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  white-space: nowrap;
  padding-right: 2px;
}
.instrument-read[data-state="ok"] { color: var(--sea); }
.instrument-read[data-state="bad"] { color: var(--coral); }
.instrument-refresh { width: 26px; height: 26px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  min-width: 30px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--panel-2);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.icon-btn:hover { background: var(--panel-3); border-color: #3a74b8; color: var(--text); }

.mobile-nav-toggle { display: none; }

/* ----------------------------------------------------------------- shell */

.shell {
  display: grid;
  grid-template-columns: var(--nav-w) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - var(--rail-h));
}

.nav {
  position: sticky;
  top: var(--rail-h);
  height: calc(100vh - var(--rail-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--line);
  padding: 16px 14px 22px;
  background: linear-gradient(180deg, rgba(8, 27, 33, 0.72), rgba(6, 20, 25, 0.35));
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}
.nav::-webkit-scrollbar { width: 8px; }
.nav::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; }
.nav::-webkit-scrollbar-track { background: transparent; }

.nav-search { position: relative; margin-bottom: 14px; }
.nav-search input {
  width: 100%;
  height: 38px;
  padding: 0 34px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-2);
  color: var(--text);
  font-size: 13px;
}
.nav-search input::placeholder { color: var(--dim); }
.nav-search input:focus { border-color: var(--line-strong); outline: none; box-shadow: 0 0 0 3px rgba(87, 207, 182, 0.09); }
.nav-search kbd { position: absolute; right: 9px; top: 50%; transform: translateY(-50%); pointer-events: none; }

.nav-list { display: flex; flex-direction: column; gap: 3px; }
.nav-group { margin-top: 13px; }
.nav-group:first-child { margin-top: 0; }
.nav-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--dim);
  padding: 0 10px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  padding: 6px 9px;
  text-align: left;
  color: var(--text-2);
  font-size: 12.5px;
}
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item[aria-current="page"] {
  background: var(--panel-2);
  border-color: var(--line-strong);
  color: var(--text);
  box-shadow: inset 2px 0 0 var(--amber);
}
.nav-method {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--sea);
  background: var(--sea-soft);
  border-radius: 4px;
  padding: 1px 5px;
  min-width: 34px;
  text-align: center;
}
.nav-method[data-method="POST"] { color: var(--amber); background: var(--amber-soft); }
.nav-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11.5px;
}
.nav-guide-icon {
  flex: 0 0 auto;
  width: 34px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
}
.nav-empty { color: var(--dim); font-size: 13px; padding: 16px 10px; line-height: 1.5; }

.nav-foot {
  margin-top: 22px;
  padding: 14px 10px 0;
  border-top: 1px solid var(--line);
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.55;
}
.nav-foot p { color: var(--dim); margin: 0 0 8px; font-size: inherit; }
.nav-foot-links { display: flex; gap: 12px; flex-wrap: wrap; }
.nav-foot-links a { font-size: 11.5px; }

.nav-backdrop { display: none; }

/* ------------------------------------------------------------------ main */

.main {
  min-width: 0;
  padding: 34px clamp(20px, 4vw, 52px) 0;
}
.doc {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding-bottom: 58px;
  outline: none;
}

.site-foot {
  max-width: 1040px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 18px 0 30px;
  color: var(--dim);
  font-size: 12px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.site-foot a { color: var(--dim); }
.site-foot a:hover { color: var(--text); }
.site-foot-sep { opacity: 0.45; }

.crumb {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 12px;
}
.crumb span { color: var(--line-strong); margin: 0 5px; }

.lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 76ch;
  margin: 10px 0 18px;
}

.block { margin-top: 34px; }
.block-title {
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.block-title::after { content: ""; height: 1px; flex: 1; background: var(--line); }

.callout {
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--sea);
  background: linear-gradient(90deg, var(--sea-soft), rgba(10, 28, 54, 0.4));
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  color: var(--text-2);
  font-size: 13.5px;
  margin: 14px 0;
}
.callout strong { color: var(--text); }
.callout[data-tone="warn"] { border-left-color: var(--amber); background: linear-gradient(90deg, var(--amber-soft), rgba(10, 28, 54, 0.4)); }
.callout[data-tone="bad"] { border-left-color: var(--coral); background: linear-gradient(90deg, var(--coral-soft), rgba(10, 28, 54, 0.4)); }
.callout p:last-child { margin-bottom: 0; }

.inline-code {
  font-family: var(--mono);
  font-size: 0.86em;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}
.inline-code[data-tone="sea"] { color: var(--sea); background: var(--sea-soft); border-color: rgba(87, 207, 182, 0.22); }

.muted { color: var(--dim); }
.mono { font-family: var(--mono); }

/* --------------------------------------------------------------- overview */

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.status-card {
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(14, 42, 50, 0.78), rgba(8, 27, 33, 0.9));
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.card-head h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.card-head .card-sub { font-family: var(--mono); font-size: 10.5px; color: var(--dim); }

.readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.readout > div {
  border: 1px solid var(--line);
  background: rgba(6, 20, 25, 0.5);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  min-width: 0;
}
.readout .k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 650; }
.readout .v { font-family: var(--mono); font-size: 20px; font-weight: 650; color: var(--text); line-height: 1.25; margin-top: 3px; }
.readout .v small { font-size: 12px; color: var(--dim); font-weight: 500; }

.status-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin-top: 12px;
  font-size: 12px;
  color: var(--dim);
}
.status-meta .mono { font-size: 11px; word-break: break-all; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 2px 9px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
  background: var(--panel);
  white-space: nowrap;
}
.chip[data-tone="sea"] { color: var(--sea); border-color: rgba(87, 207, 182, 0.35); background: var(--sea-soft); }
.chip[data-tone="brass"] { color: var(--amber); border-color: rgba(56, 189, 248, 0.35); background: var(--amber-soft); }
.chip[data-tone="bad"] { color: var(--coral); border-color: rgba(240, 122, 111, 0.35); background: var(--coral-soft); }

.mini-code {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.62;
  color: var(--text-2);
  background: rgba(6, 20, 25, 0.62);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  overflow: auto;
  white-space: pre;
}

.refresh-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--text-2);
  user-select: none;
}
.switch input { width: 14px; height: 14px; accent-color: var(--sea); }

.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 4px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--panel-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.06s ease;
}
.btn:hover { background: var(--panel-3); border-color: #3a74b8; }
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #021726;
}
.btn-primary:hover { background: #7dd3fc; border-color: #7dd3fc; color: #021726; }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-danger { color: var(--coral); border-color: rgba(240, 122, 111, 0.4); background: var(--coral-soft); }
.btn-danger:hover { background: rgba(240, 122, 111, 0.2); border-color: rgba(240, 122, 111, 0.6); }
.btn[aria-pressed="true"] { background: var(--amber-soft); border-color: rgba(56, 189, 248, 0.5); color: var(--amber); }

/* ----------------------------------------------------------------- steps */

.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.steps li {
  position: relative;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 15px 16px 15px 52px;
  margin: 0;
}
.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 15px;
  top: 14px;
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--amber-soft);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}
.steps { counter-reset: step; }
.steps h4 { margin-bottom: 5px; color: var(--text); }
.steps p { margin: 0; font-size: 13.5px; }
.steps p + p { margin-top: 7px; }
.steps .mini-code { margin-top: 9px; }

/* ---------------------------------------------------------------- tables */

.table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  background: var(--panel);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  font-weight: 700;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 20, 25, 0.45);
  white-space: nowrap;
}
td { padding: 9px 12px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(18, 48, 57, 0.35); }

.index-table td:first-child { white-space: nowrap; }
.row-link {
  background: none;
  border: 0;
  padding: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  text-align: left;
}
.row-link:hover { color: var(--amber); text-decoration: underline; text-underline-offset: 3px; }

.method-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sea);
  background: var(--sea-soft);
  border: 1px solid rgba(87, 207, 182, 0.26);
  border-radius: 4px;
  padding: 2px 6px;
  min-width: 42px;
}
.method-tag[data-method="POST"] { color: var(--amber); background: var(--amber-soft); border-color: rgba(56, 189, 248, 0.26); }
.method-tag[data-method="DELETE"] { color: var(--coral); background: var(--coral-soft); border-color: rgba(240, 122, 111, 0.26); }
.method-tag[data-method="PATCH"], .method-tag[data-method="PUT"] { color: var(--blue); background: var(--blue-soft); border-color: rgba(131, 185, 245, 0.26); }

.pname { font-family: var(--mono); font-size: 12px; color: var(--text); }
.req-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--amber); margin-left: 6px; vertical-align: 2px; }
.ptype { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.pdefault { font-family: var(--mono); font-size: 11px; color: var(--sea); }
.pdesc { color: var(--text-2); font-size: 12.5px; }

/* ------------------------------------------------------------- signature */

.signature {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: linear-gradient(160deg, var(--panel-2), var(--bg-2));
  padding: 11px 13px;
  margin: 16px 0 0;
}
.signature-path { font-family: var(--mono); font-size: 14px; color: var(--text); word-break: break-all; }
.signature-spacer { flex: 1 1 auto; }

.related {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.related a {
  border: 1px solid var(--line-strong);
  background: var(--panel);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--text-2);
}
.related a:hover { color: var(--amber); border-color: rgba(56, 189, 248, 0.45); }

/* --------------------------------------------------------------- console */

.console {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.console-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 20, 25, 0.55);
}
.console-bar .signature-path { font-size: 12px; color: var(--text-2); }

.console-body {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  min-height: 360px;
}
.req-pane {
  padding: 14px;
  border-right: 1px solid var(--line);
  min-width: 0;
}
.res-pane {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: rgba(5, 17, 21, 0.4);
}
.res-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
}
.res-status {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dim);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 2px 7px;
  white-space: nowrap;
}
.res-status[data-tone="ok"] { color: var(--sea); border-color: rgba(87, 207, 182, 0.4); background: var(--sea-soft); }
.res-status[data-tone="bad"] { color: var(--coral); border-color: rgba(240, 122, 111, 0.4); background: var(--coral-soft); }
.res-status[data-tone="wait"] { color: var(--amber); border-color: rgba(56, 189, 248, 0.4); background: var(--amber-soft); }
.res-meta { font-family: var(--mono); font-size: 11px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-tools { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.res-tools .icon-btn { height: 26px; min-width: 26px; padding: 0 7px; font-size: 11px; }

.res-body {
  margin: 0;
  padding: 13px;
  overflow: auto;
  flex: 1 1 auto;
  max-height: 560px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre;
  tab-size: 2;
}
.res-body:empty::before { content: "Response body"; color: var(--dim); font-style: italic; }

.headers-panel {
  border-top: 1px solid var(--line);
  padding: 9px 12px;
  max-height: 190px;
  overflow: auto;
  background: rgba(8, 27, 33, 0.7);
}
.headers-panel[hidden] { display: none; }
.header-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
  padding: 2px 0;
}
.header-row .hk { color: var(--dim); overflow-wrap: anywhere; }
.header-row .hv { color: var(--text-2); overflow-wrap: anywhere; }

/* JSON syntax */
.j-key { color: #8fc9ff; }
.j-str { color: #a6e3b8; }
.j-num { color: #f2c879; }
.j-bool { color: #f49a8f; }
.j-null { color: var(--dim); }

/* ----------------------------------------------------------------- forms */

.field { margin-bottom: 12px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 5px;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--bg-2);
  color: var(--text);
  padding: 8px 10px;
  font-size: 12.5px;
  font-family: var(--mono);
}
.field input:focus,
.field select:focus,
.field textarea:focus { border-color: var(--line-strong); outline: none; box-shadow: 0 0 0 3px rgba(87, 207, 182, 0.08); }
.field input::placeholder, .field textarea::placeholder { color: #5c777c; }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.55; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.token-row { display: flex; gap: 6px; }
.token-row input { flex: 1 1 auto; min-width: 0; }
.token-row .icon-btn { flex: 0 0 auto; height: auto; padding: 0 10px; }
.field .hint { font-size: 11px; color: var(--dim); margin-top: 4px; line-height: 1.45; }

.btn-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.btn-row .btn-primary { flex: 1 1 auto; }

/* --------------------------------------------------------------- snippets */

.snippet {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  overflow: hidden;
}
.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 20, 25, 0.45);
  overflow-x: auto;
}
.tab {
  border: 1px solid transparent;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  padding: 5px 10px;
  white-space: nowrap;
}
.tab:hover { color: var(--text); background: var(--panel-2); }
.tab[aria-selected="true"] { color: var(--text); background: var(--panel-2); border-color: var(--line-strong); }
.tab-spacer { flex: 1 1 auto; }
.tab-copy { flex: 0 0 auto; }
#snippet-body {
  margin: 0;
  padding: 14px;
  overflow: auto;
  max-height: 440px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre;
  tab-size: 2;
}
.snippet > pre {
  margin: 0;
  padding: 14px;
  overflow: auto;
  max-height: 440px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre;
  tab-size: 2;
}
.hint { font-size: 12px; line-height: 1.5; color: var(--dim); margin: 10px 0 0; }
.res-note { margin: 10px 12px; font-size: 12.5px; }
.res-note[hidden] { display: none; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.feature {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.feature h3 { margin: 9px 0 6px; font-size: 15px; }
.feature p { font-size: 12.5px; line-height: 1.55; margin: 0 0 9px; }
.feature a { font-size: 12px; font-weight: 600; }

/* ----------------------------------------------------------------- notes */

.notes { margin: 0; padding-left: 20px; }
.notes li { color: var(--text-2); font-size: 13.5px; margin: 6px 0; }

/* ---------------------------------------------------------------- events */

.event-list { display: grid; gap: 12px; }
.event-card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.event-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 20, 25, 0.4);
}
.event-name { font-family: var(--mono); font-size: 13px; color: var(--amber); }
.event-when { color: var(--dim); font-size: 12px; flex: 1 1 280px; }
.event-payload {
  margin: 0;
  padding: 12px 13px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  overflow-x: auto;
  white-space: pre;
}
.event-card .icon-btn { margin-left: auto; }
.event-card .snippet { border: 0; border-radius: 0; }
.event-card .tabs { border-bottom: 0; }

.stream-console {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.stream-toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(6, 20, 25, 0.5);
}
.stream-toolbar .field { margin: 0; flex: 1 1 240px; min-width: 180px; }
.stream-toolbar .field input { height: 32px; }
.stream-stats { display: flex; gap: 8px; flex-wrap: wrap; font-family: var(--mono); font-size: 11px; color: var(--dim); }
.stream-log {
  min-height: 280px;
  max-height: 520px;
  overflow: auto;
  padding: 6px 0;
  background: rgba(5, 17, 21, 0.55);
}
.stream-empty { color: var(--dim); font-size: 12.5px; padding: 26px 14px; text-align: center; }
.stream-row {
  display: grid;
  grid-template-columns: 74px 110px minmax(0, 1fr);
  gap: 8px;
  padding: 5px 12px;
  border-bottom: 1px solid rgba(23, 59, 68, 0.55);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.55;
  align-items: start;
}
.stream-row:last-child { border-bottom: 0; }
.stream-time { color: var(--dim); }
.stream-event { color: var(--sea); overflow-wrap: anywhere; }
.stream-event[data-kind="heartbeat"] { color: var(--dim); }
.stream-event[data-kind="error"] { color: var(--coral); }
.stream-data { color: var(--text-2); overflow-wrap: anywhere; white-space: pre-wrap; }
.stream-raw {
  margin: 0;
  padding: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-2);
  white-space: pre;
  overflow: auto;
  max-height: 520px;
  background: rgba(5, 17, 21, 0.55);
}
.stream-raw[hidden] { display: none; }

/* ------------------------------------------------------------------ misc */

.variant { margin-top: 12px; }
.variant-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--dim); font-weight: 650; margin-bottom: 6px; }

.copy-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 0; }

.kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kpi {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel);
  padding: 12px 13px;
}
.kpi .k { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); font-weight: 650; }
.kpi .v { font-family: var(--mono); font-size: 18px; color: var(--text); margin-top: 3px; }

.check-list { list-style: none; padding: 0; }
.check-list li { padding-left: 22px; position: relative; }
.check-list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--sea);
  font-size: 13px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translate(-50%, 16px);
  z-index: 250;
  background: #123039;
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 12.5px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast[data-show="true"] { opacity: 1; transform: translate(-50%, 0); }

/* -------------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .instrument-read { display: none; }
  .console-body { grid-template-columns: minmax(0, 1fr); }
  .req-pane { border-right: 0; border-bottom: 1px solid var(--line); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .mobile-nav-toggle { display: inline-flex; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .nav {
    position: fixed;
    top: var(--rail-h);
    left: 0;
    bottom: 0;
    width: min(320px, 88vw);
    height: auto;
    z-index: 80;
    transform: translateX(-102%);
    transition: transform 0.2s ease;
    background: var(--bg-2);
    box-shadow: var(--shadow);
  }
  .nav[data-open="true"] { transform: translateX(0); }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: var(--rail-h) 0 0;
    z-index: 70;
    background: rgba(3, 10, 13, 0.62);
    backdrop-filter: blur(2px);
  }
  .nav-backdrop[hidden] { display: none; }
  .rail-link { display: none; }
  .main { padding-top: 24px; }
}

@media (max-width: 640px) {
  .rail { padding: 0 12px; gap: 9px; }
  .brand-sub { display: none; }
  .brand-mark { width: 29px; height: 29px; }
  .instrument-base { max-width: 116px; }
  .instrument-refresh { display: none; }
  .main { padding-left: 16px; padding-right: 16px; }
  .readout { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .readout .v { font-size: 16px; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .kpi-grid { grid-template-columns: minmax(0, 1fr); }
  .feature-grid { grid-template-columns: minmax(0, 1fr); }
  .index-table th:nth-child(4),
  .index-table td:nth-child(4),
  .index-table th:nth-child(5),
  .index-table td:nth-child(5),
  .param-table th:nth-child(2),
  .param-table td:nth-child(2),
  .param-table th:nth-child(4),
  .param-table td:nth-child(4),
  .key-table th:nth-child(2),
  .key-table td:nth-child(2) { display: none; }
  .table-wrap th { white-space: normal; }
  .index-table,
  .index-table tbody,
  .index-table tr,
  .index-table td { display: block; width: 100%; }
  .index-table thead { display: none; }
  .index-table tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
  }
  .index-table tr:last-child { border-bottom: 0; }
  .index-table td { border: 0; padding: 0; }
  .index-table td:nth-child(1) { grid-column: 1; grid-row: 1; min-width: 0; }
  .index-table td:nth-child(2) { grid-column: 2; grid-row: 1; justify-self: end; align-self: start; }
  .index-table td:nth-child(3) { grid-column: 1 / -1; grid-row: 2; }
  .index-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
  .index-table tbody tr:hover td { background: transparent; }
  .stream-row { grid-template-columns: 64px minmax(0, 1fr); }
  .stream-data { grid-column: 1 / -1; padding-left: 0; }
  h1 { font-size: 27px; }
  .lede { font-size: 15px; }
  .block { margin-top: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ revamp ----
 * Ocean palette drawn from the logo. One accent (sky) + teal for success.
 * Motion: ease-out entrances 150-250ms, 30ms stagger, 0.97 press, no bounce.
 */
:root {
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-move: cubic-bezier(0.77, 0, 0.175, 1);
}

body {
  background:
    radial-gradient(1200px 560px at 82% -10%, rgba(37, 99, 235, 0.28), transparent 65%),
    radial-gradient(900px 520px at 4% 0%, rgba(14, 165, 233, 0.14), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  font-feature-settings: "tnum" 1, "kern" 1;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .lede { text-wrap: balance; }
p, li, .pdesc { text-wrap: pretty; max-width: 75ch; }
h1 {
  font-size: clamp(30px, 4vw, 48px);
  letter-spacing: -0.035em;
  background: linear-gradient(180deg, #fff 30%, #9fd4ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
td, th, .readout .v, .kpi .v, .res-meta, code, pre { font-variant-numeric: tabular-nums; }

/* logo */
.brand-mark {
  width: 36px; height: 36px; border: 0; background: none; box-shadow: none; border-radius: 0;
  filter: drop-shadow(0 4px 14px rgba(14, 165, 233, 0.45));
  transition: transform 0.25s var(--ease-out);
}
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand:hover .brand-mark { transform: rotate(-8deg) scale(1.06); }
.brand-name { font-size: 15px; }
.brand-sub { letter-spacing: 0.1em; }

/* surfaces: outer radius 14 / padding 14 -> inner radius 6 */
.rail { border-bottom-color: rgba(36, 80, 137, 0.6); }
.status-card, .console, .snippet, .event-card, .feature, .kpi, .table-wrap, .stream-console, .callout {
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 48, 90, 0.55), rgba(10, 28, 54, 0.85));
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px rgba(0, 4, 16, 0.35);
}
.feature, .event-card, .status-card { transition: border-color 0.2s var(--ease-out), transform 0.2s var(--ease-out); }
.feature:hover, .event-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.nav-item, .rail-link, .tab, .related a { border-radius: 8px; }
.nav-item { transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), transform 0.15s var(--ease-out); }
.nav-item:hover { transform: translateX(2px); }
.btn, .icon-btn, .nav-search input, .field input, .field select, .field textarea { border-radius: 10px; }
.btn-primary {
  background: linear-gradient(180deg, #7dd3fc, #38bdf8);
  box-shadow: 0 6px 20px rgba(14, 165, 233, 0.35);
  font-weight: 700;
}
.btn-primary:hover { background: linear-gradient(180deg, #a5e0ff, #5ccbfb); }
.btn, .icon-btn, .tab, .rail-link { transition: background 0.15s var(--ease-out), border-color 0.15s var(--ease-out), color 0.15s var(--ease-out), transform 0.15s var(--ease-out); }
.btn:active, .icon-btn:active, .tab:active { transform: scale(0.97); }
.nav-item[aria-current="page"] { box-shadow: inset 2px 0 0 var(--amber); }

/* page entrance: staggered ease-out */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes slide-in { from { opacity: 0; transform: translateX(-6px); } to { opacity: 1; transform: none; } }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(94, 234, 212, 0.5); } 100% { box-shadow: 0 0 0 8px rgba(94, 234, 212, 0); } }
.doc > * { animation: rise 0.25s var(--ease-out) both; }
.doc > *:nth-child(2) { animation-delay: 30ms; }
.doc > *:nth-child(3) { animation-delay: 60ms; }
.doc > *:nth-child(4) { animation-delay: 90ms; }
.doc > *:nth-child(5) { animation-delay: 120ms; }
.doc > *:nth-child(n+6) { animation-delay: 150ms; }
.nav-item { animation: slide-in 0.2s var(--ease-out) both; }
.nav-group:nth-child(2) .nav-item { animation-delay: 30ms; }
.nav-group:nth-child(3) .nav-item { animation-delay: 60ms; }
.nav-group:nth-child(n+4) .nav-item { animation-delay: 90ms; }
.signal[data-state="ok"] { animation: live 1.8s var(--ease-out) infinite; }
.res-body, .headers-panel, .stream-row { animation: rise 0.2s var(--ease-out) both; }
.toast { transition: opacity 0.18s var(--ease-out), transform 0.18s var(--ease-out); }
.skeleton, .res-status[data-tone="wait"] { animation: pulse 1.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .doc > *, .nav-item, .res-body, .headers-panel, .stream-row { animation: none !important; }
}

.instrument-base { width: 210px; max-width: 210px; background: transparent; border: 0; outline: 0; }
.instrument-base:focus { box-shadow: 0 1px 0 var(--amber); }
@media (max-width: 640px) { .instrument-base { width: 130px; max-width: 130px; } }

/* sandbox + extras */
.sandbox-toggle { border: 1px solid transparent; background: transparent; cursor: pointer; }
.sandbox-toggle[aria-pressed="true"] { color: var(--bg); background: var(--sea); border-color: var(--sea); font-weight: 700; }
body.is-sandbox .rail { box-shadow: inset 0 -2px 0 var(--sea); }
.guide-updated { margin-top: 34px; }

@media print {
  .rail, .nav, .nav-backdrop, .toast, .site-foot, .btn, .icon-btn, .tab-copy { display: none !important; }
  body { background: #fff !important; color: #000; font-size: 11pt; }
  .shell { display: block; }
  .doc { max-width: none; padding: 0; }
  h1 { background: none; color: #000; -webkit-text-fill-color: #000; }
  p, li, td, th, .lede, .pdesc { color: #000 !important; }
  .snippet, .callout, .table-wrap { background: none; box-shadow: none; border-color: #999; break-inside: avoid; }
  pre { white-space: pre-wrap; color: #000; }
  a { color: #000; text-decoration: underline; }
}

/* on-this-page jump menu for the new guides */
.block[id] { scroll-margin-top: calc(var(--rail-h) + 16px); }
.page-toc { margin: 22px 0 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(10, 28, 54, 0.5); }
.page-toc-label { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); font-weight: 650; margin-bottom: 8px; }
.page-toc-links { display: flex; flex-wrap: wrap; gap: 6px; }
.page-toc-link { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--text-2); font-size: 12px; transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out), border-color 0.15s var(--ease-out); }
.page-toc-link:hover { color: var(--text); border-color: var(--sea); background: var(--panel-3); }
.page-toc-link:active { transform: scale(0.97); }
