/* ============ Tokens ============ */
:root {
  --bg: #f7f6f3;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --border: #e5e2db;
  --text: #1d1b18;
  --muted: #6c675f;
  --accent: #e8590c;
  --accent-strong: #c2410c;
  --accent-soft: #fff0e6;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #a16207;
  --warn-soft: #fdf4dc;
  --err: #dc2626;
  --err-soft: #fdecec;
  --info: #2563eb;
  --info-soft: #e8f0fe;
  --get: #0f766e;
  --get-soft: #ddf4f1;
  --code-bg: #faf9f6;
  --code-dark: #15151a;
  --code-dark-text: #e6e6ea;
  --j-key: #9333ea;
  --j-str: #15803d;
  --j-num: #c2410c;
  --j-bool: #2563eb;
  --j-null: #8a857c;
  --shadow: 0 1px 2px rgba(28, 25, 20, .05), 0 8px 24px rgba(28, 25, 20, .06);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --topbar-h: 62px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e0e10; --surface: #17171b; --surface-2: #1f1f24; --border: #2b2b32;
    --text: #ececef; --muted: #9b9ba5; --accent: #ff7b38; --accent-strong: #ff9459; --accent-soft: #2b1a10;
    --ok: #4ade80; --ok-soft: #12261a; --warn: #fbbf24; --warn-soft: #2a2210; --err: #f87171; --err-soft: #2c1414;
    --info: #60a5fa; --info-soft: #13203a; --get: #2dd4bf; --get-soft: #0f2a27; --code-bg: #121216;
    --j-key: #c084fc; --j-str: #86efac; --j-num: #fdba74; --j-bool: #93c5fd; --j-null: #8b8b95;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e0e10; --surface: #17171b; --surface-2: #1f1f24; --border: #2b2b32;
  --text: #ececef; --muted: #9b9ba5; --accent: #ff7b38; --accent-strong: #ff9459; --accent-soft: #2b1a10;
  --ok: #4ade80; --ok-soft: #12261a; --warn: #fbbf24; --warn-soft: #2a2210; --err: #f87171; --err-soft: #2c1414;
  --info: #60a5fa; --info-soft: #13203a; --get: #2dd4bf; --get-soft: #0f2a27; --code-bg: #121216;
  --j-key: #c084fc; --j-str: #86efac; --j-num: #fdba74; --j-bool: #93c5fd; --j-null: #8b8b95;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar-h) + 16px); }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, h5 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.025em; }
h2 { font-size: 24px; font-weight: 700; }
h3 { font-size: 17px; font-weight: 700; }
p { margin: 0 0 .9em; }
a { color: var(--accent); text-decoration: none; }
code { font-family: var(--mono); font-size: .86em; background: var(--surface-2); padding: .1em .4em; border-radius: 5px; }
pre code { background: none; padding: 0; }
b, strong { font-weight: 650; }
.muted { color: var(--muted); }
.lead { font-size: 16.5px; color: var(--muted); max-width: 760px; }
.eyebrow { display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
[hidden] { display: none !important; }

/* ============ Topbar ============ */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #ff8a3d, #e8590c); color: #fff; font-weight: 800; font-size: 13px;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 14.5px; }
.brand-text small { color: var(--muted); font-size: 12px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; }
.segmented button {
  border: 0; background: transparent; color: var(--muted); font: 600 13px var(--font);
  padding: 6px 14px; border-radius: 999px; cursor: pointer; transition: all .15s;
}
.segmented button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
body[data-env="prod"] .segmented button[data-env="prod"].active { background: var(--err); color: #fff; }
.lang-switch button { padding: 6px 10px; font-family: var(--mono); font-size: 12px; }
.cred-status { font-size: 12.5px; font-weight: 600; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.cred-status.is-missing { background: var(--warn-soft); color: var(--warn); }
.cred-status.is-ready { background: var(--ok-soft); color: var(--ok); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer; font-size: 16px;
}
.menu-toggle { display: none; }
.prod-banner {
  display: none; position: sticky; top: var(--topbar-h); z-index: 25; padding: 7px 20px;
  background: var(--err); color: #fff; font-size: 13px; text-align: center;
}
body[data-env="prod"] .prod-banner { display: block; }

/* ============ Layout ============ */
.layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); }
.sidebar {
  position: sticky; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
  overflow-y: auto; border-right: 1px solid var(--border); padding: 24px 14px;
}
.nav-title { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 18px 10px 6px; }
.nav-title:first-child { margin-top: 0; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px;
  color: var(--text); font-size: 14px; transition: background .12s;
}
.nav a:hover { background: var(--surface-2); }
.nav a.active { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.nav .method { font-size: 9.5px; padding: 2px 5px; }
.content { padding: 36px clamp(16px, 4vw, 48px) 80px; max-width: 1400px; min-width: 0; }

/* ============ Sections ============ */
.hero { padding-bottom: 12px; }
.steps { list-style: none; padding: 0; margin: 28px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.steps li { display: flex; gap: 12px; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.steps p { margin: 2px 0 0; font-size: 13.5px; color: var(--muted); }
.step-num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; font-size: 13px; }
.doc-section { margin-top: 64px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-top: 40px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; margin: 16px 0; }
.bullets { padding-left: 18px; }
.bullets li { margin-bottom: 6px; }
.footer { margin-top: 80px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; }

/* ============ Credentials ============ */
.cred-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 16px 0; }
.cred-options { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.base-url { margin-top: 16px; font-size: 13.5px; color: var(--muted); }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }
.flash { animation: flash 1.2s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 var(--accent); } 30% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 45%, transparent); } 100% { box-shadow: var(--shadow); } }

/* ============ Forms ============ */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.field-label code { background: none; padding: 0; font-size: 13px; }
.field-type { font: 500 11px var(--mono); color: var(--muted); }
.field-hint.error, .form-error { color: var(--err); font-size: 12.5px; margin: 0; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; font: 14px var(--font); color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 9px 11px; transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle, .toggle-inline { display: inline-flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.toggle small { color: var(--muted); }
.toggle input, .toggle-inline input { accent-color: var(--accent); margin-top: 4px; }
.toggle-inline { font-size: 12.5px; color: var(--muted); align-items: center; }
.toggle-inline input { margin-top: 0; }
.req { font-size: 10.5px; font-weight: 700; color: var(--err); background: var(--err-soft); padding: 1px 6px; border-radius: 999px; margin-left: 6px; }
.req-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font: 600 14px var(--font); padding: 10px 16px; cursor: pointer; transition: all .15s;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn-danger { background: var(--err); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 6px 11px; font-size: 12.5px; }
.btn.loading::before { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ Chips & badges ============ */
.method { font: 700 11px var(--mono); padding: 4px 8px; border-radius: 6px; letter-spacing: .03em; }
.method-get { background: var(--get-soft); color: var(--get); }
.method-post { background: var(--accent-soft); color: var(--accent-strong); }
.chip { display: inline-block; font: 600 11.5px var(--mono); padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-warn { background: var(--warn-soft); color: var(--warn); }
.chip-err { background: var(--err-soft); color: var(--err); }
.chip-muted { background: var(--surface-2); color: var(--muted); }
.env-chip { font: 700 11px var(--mono); padding: 4px 10px; border-radius: 999px; background: var(--get-soft); color: var(--get); }
body[data-env="prod"] .env-chip { background: var(--err); color: #fff; }
.env-tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; }
.env-dev { background: var(--get-soft); color: var(--get); }
.env-prod { background: var(--err-soft); color: var(--err); }

/* ============ Tables ============ */
.table-title { margin: 28px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
table.params { width: 100%; border-collapse: collapse; font-size: 14px; }
.params th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); background: var(--surface-2); padding: 9px 14px; }
.params td { padding: 11px 14px; border-top: 1px solid var(--border); vertical-align: top; }
.params td:first-child { white-space: nowrap; }
code.param { background: none; padding: 0; font-weight: 600; color: var(--text); }
.type { font: 500 12px var(--mono); color: var(--muted); }

/* ============ Callouts ============ */
.callout { display: flex; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); margin: 10px 0; font-size: 14px; }
.callout p { margin: 0; }
.callout-icon { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 12px var(--mono); color: #fff; margin-top: 1px; }
.callout-info { background: var(--info-soft); }
.callout-info .callout-icon { background: var(--info); }
.callout-warn { background: var(--warn-soft); }
.callout-warn .callout-icon { background: var(--warn); }

/* ============ Code blocks ============ */
.code-block { position: relative; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 10px 0; }
.code-block pre { margin: 0; padding: 14px 16px; overflow: auto; font: 12.8px/1.65 var(--mono); max-height: 420px; }
.code-block pre.tall { max-height: 560px; }
.code-block.dark { background: var(--code-dark); border-color: #26262e; color: var(--code-dark-text); }
.code-block.dark pre code { color: var(--code-dark-text); }
.copy {
  position: absolute; top: 8px; right: 8px; z-index: 1; font: 600 11.5px var(--font); padding: 4px 9px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); cursor: pointer; opacity: .85;
}
.code-block.dark .copy { background: #23232b; border-color: #34343e; color: #c9c9d1; }
.copy.copied { color: var(--ok); }
pre.plain { margin: 10px 0; padding: 12px 14px; background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: auto; font: 12.5px/1.6 var(--mono); white-space: pre-wrap; word-break: break-all; }
.j-key { color: var(--j-key); } .j-str { color: var(--j-str); } .j-num { color: var(--j-num); }
.j-bool { color: var(--j-bool); } .j-null { color: var(--j-null); }

/* ============ Tabs ============ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 14px 0 0; overflow-x: auto; }
.tab {
  border: 0; background: none; font: 600 13px var(--font); color: var(--muted); padding: 8px 12px;
  border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; white-space: nowrap;
}
.tab.active { color: var(--accent-strong); border-bottom-color: var(--accent); }
.tabbed { margin-top: 20px; }

/* ============ Signature live ============ */
.sig-live { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.sig-live-head { display: flex; justify-content: space-between; align-items: center; }
.sig-countdown { font: 600 13px var(--mono); color: var(--muted); }
.sig-progress { height: 4px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.sig-progress span { display: block; height: 100%; background: var(--accent); transition: width 1s linear; }
.sig-meta { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; font-size: 13px; }
.sig-meta dt { color: var(--muted); font-family: var(--mono); }
.sig-meta dd { margin: 0; font-family: var(--mono); font-weight: 600; }
.sig-value { display: block; padding: 12px; word-break: break-all; font-size: 12.5px; line-height: 1.6; background: var(--surface-2); border-radius: var(--radius-sm); }
.sig-value.muted { color: var(--muted); font-family: var(--font); }

/* ============ Endpoint ============ */
.endpoint { margin-top: 72px; padding-top: 8px; border-top: 1px solid var(--border); }
.endpoint-head { margin: 24px 0 8px; }
.endpoint-path { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.endpoint-path code { font-size: 15px; background: none; padding: 0; font-weight: 600; word-break: break-all; }
.endpoint-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.endpoint-doc { min-width: 0; }

.scenarios { display: flex; flex-direction: column; gap: 8px; }
.scenario { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.scenario summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; padding: 11px 14px; cursor: pointer; list-style: none; }
.scenario summary::-webkit-details-marker { display: none; }
.scenario summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform .15s; }
.scenario[open] summary::after { transform: rotate(180deg); }
.scenario-title { font-weight: 600; font-size: 14px; }
.scenario-msg { font-size: 12px; color: var(--muted); }
.scenario-body { padding: 0 14px 12px; font-size: 14px; }
#troubleshooting .scenario { margin-bottom: 8px; }

/* ============ Console ============ */
.console {
  position: sticky; top: calc(var(--topbar-h) + 16px); max-height: calc(100vh - var(--topbar-h) - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
}
body[data-env="prod"] .console { top: calc(var(--topbar-h) + 52px); max-height: calc(100vh - var(--topbar-h) - 68px); border-color: color-mix(in srgb, var(--err) 45%, var(--border)); }
.console-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.console-head h3 { margin: 2px 0 0; }
.field-group { border: 0; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-group legend { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.field-group .field:has(textarea) { grid-column: 1 / -1; }
.url-preview { display: flex; gap: 8px; align-items: flex-start; margin: 16px 0 12px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius-sm); }
.url-method { font: 700 11px var(--mono); color: var(--accent-strong); padding-top: 2px; }
.url-preview code { background: none; padding: 0; font-size: 12px; word-break: break-all; color: var(--muted); }
.console-actions { display: flex; gap: 8px; }
.console-actions .btn-primary { flex: 1; }
.form-error { margin-top: 10px; }
.hint { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.snippets { margin-top: 22px; padding-top: 6px; border-top: 1px dashed var(--border); }
.snippets-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.snippets .tabs { border-bottom: 0; margin: 8px 0 0; }

/* ============ Response ============ */
.response { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.response-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; padding: 8px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.response-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.response-msg { font-weight: 650; font-size: 15px; margin: 10px 0 8px; }
.explain { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 13.5px; margin: 8px 0; border-left: 3px solid; }
.explain p { margin: 4px 0 0; }
.explain-ok { background: var(--ok-soft); border-color: var(--ok); }
.explain-warn { background: var(--warn-soft); border-color: var(--warn); }
.explain-err { background: var(--err-soft); border-color: var(--err); }
.explain-muted { background: var(--surface-2); border-color: var(--muted); }
.sub { margin: 14px 0 0; font-size: 13px; }
.tab-panel { padding-top: 6px; }

.program-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 8px; }
.program-card { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.program-thumb { aspect-ratio: 16 / 9; background: var(--surface-2); }
.program-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.program-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.program-body h5 { font-size: 13.5px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.program-cat { font-size: 11px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.program-slug { font-size: 11px; word-break: break-all; }
.progress { height: 5px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--ok); }
.program-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.program-price { font-size: 12px; font-weight: 600; }
.program-actions { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.program-actions .btn { flex: 1; }
.program-actions .btn:not(.btn-ghost) { background: var(--accent-soft); color: var(--accent-strong); }

/* ============ Dialog ============ */
.dialog { border: 0; border-radius: var(--radius); padding: 0; max-width: 460px; width: calc(100% - 32px); background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0, 0, 0, .35); }
.dialog::backdrop { background: rgba(10, 10, 12, .55); backdrop-filter: blur(2px); }
.dialog form { padding: 24px; }
.confirm-summary dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 14px 0; padding: 12px; background: var(--surface-2); border-radius: var(--radius-sm); font-size: 13px; }
.confirm-summary dt { color: var(--muted); }
.confirm-summary dd { margin: 0; font-weight: 600; word-break: break-all; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ============ Responsive ============ */
@media (max-width: 1180px) {
  .endpoint-grid { grid-template-columns: minmax(0, 1fr); }
  .console, body[data-env="prod"] .console { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 880px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .menu-toggle { display: inline-grid; place-items: center; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); z-index: 40; width: 280px; background: var(--surface);
    transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  .brand-text small, .cred-status { display: none; }
}
@media (max-width: 560px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand-text { display: none; }
  .segmented button { padding: 6px 10px; font-size: 12px; }
  .content { padding: 24px 16px 64px; }
  .field-group { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 18px; }
}
