/* ============================================================
   TempMail MMO — API Docs ( © BrewVN. All Rights Reserved )
   ============================================================ */

:root {
  color-scheme: light;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --sidebar-w: 272px;
  --code-w: 460px;
  --topbar-h: 60px;

  --accent: #6366f1;
  --accent-strong: #4f46e5;
  --accent-soft: rgba(99, 102, 241, 0.12);
  --get: #10b981;
  --post: #3b82f6;
  --sse: #a855f7;

  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-code: #0b1020;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-faint: #94a3b8;

  --sidebar-bg: #0b1220;
  --sidebar-bg-soft: #101a2e;
  --sidebar-border: rgba(148, 163, 184, 0.14);
  --sidebar-text: #cbd5e1;
  --sidebar-text-muted: #7c8aa0;
  --sidebar-active-bg: rgba(99, 102, 241, 0.16);
  --sidebar-active-text: #a5b4fc;

  --table-head-bg: #f1f5f9;
  --table-row-alt: #fafbfd;
  --chip-bg: #eef2ff;
  --chip-text: #4338ca;
  --note-bg: #fffbeb;
  --note-border: #f59e0b;
  --note-text: #78350f;
  --req-bg: #fee2e2;
  --req-text: #b91c1c;
  --opt-bg: #e2e8f0;
  --opt-text: #475569;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.14);
  --radius: 10px;
}

[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0d1424;
  --bg-subtle: #111a2e;
  --bg-code: #070c18;
  --border: #1f2b45;
  --border-strong: #2c3b5c;
  --text: #e6edf9;
  --text-muted: #93a1b8;
  --text-faint: #64748b;

  --sidebar-bg: #080e1b;
  --sidebar-bg-soft: #0d1526;
  --sidebar-border: rgba(148, 163, 184, 0.1);

  --table-head-bg: #14203a;
  --table-row-alt: #101a30;
  --chip-bg: rgba(99, 102, 241, 0.16);
  --chip-text: #a5b4fc;
  --note-bg: rgba(245, 158, 11, 0.08);
  --note-border: #d97706;
  --note-text: #fcd34d;
  --req-bg: rgba(239, 68, 68, 0.16);
  --req-text: #fca5a5;
  --opt-bg: rgba(148, 163, 184, 0.14);
  --opt-text: #94a3b8;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 24px);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--chip-bg);
  color: var(--chip-text);
  padding: 2px 6px;
  border-radius: 6px;
  word-break: break-word;
}

/* ---------- Topbar ---------- */

.docs-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--topbar-h);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.docs-topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 9px;
  object-fit: contain;
  display: block;
  background: #fff;
  padding: 2px;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35), 0 0 0 1px rgba(148, 163, 184, 0.25);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 14.5px; font-weight: 700; white-space: nowrap; }
.brand-text span {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-pill {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}

.topbar-spacer { flex: 1; }

.topbar-actions { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.icon-btn:hover { color: var(--text); border-color: var(--border-strong); text-decoration: none; }
.icon-btn svg { width: 16px; height: 16px; }

.home-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
  transition: filter 0.15s, transform 0.15s;
}
.home-link:hover { filter: brightness(1.08); transform: translateY(-1px); text-decoration: none; }

/* language dropdown */
.lang-dropdown { position: relative; }
.lang-dropdown > summary { list-style: none; }
.lang-dropdown > summary::-webkit-details-marker { display: none; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 190px;
  padding: 6px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  z-index: 70;
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
}
.lang-option:hover { background: var(--bg-subtle); text-decoration: none; }
.lang-option.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lang-option small {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
}

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

/* ---------- Layout ---------- */

.docs-shell {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  padding-top: var(--topbar-h);
  min-height: 100vh;
}

/* ---------- Sidebar ---------- */

.docs-sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  width: var(--sidebar-w);
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow: hidden;
}

.sidebar-search {
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--sidebar-border);
}
.sidebar-search-input {
  position: relative;
  display: flex;
  align-items: center;
}
.sidebar-search-input svg {
  position: absolute;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--sidebar-text-muted);
  pointer-events: none;
}
.sidebar-search-input input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  border-radius: 8px;
  border: 1px solid var(--sidebar-border);
  background: var(--sidebar-bg-soft);
  color: var(--sidebar-text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sidebar-search-input input::placeholder { color: var(--sidebar-text-muted); }
.sidebar-search-input input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.25); border-radius: 3px; }

.nav-group { margin-bottom: 18px; }
.nav-group-title {
  padding: 0 10px 6px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--sidebar-text-muted);
}
.nav-group ul { list-style: none; margin: 0; padding: 0; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6.5px 10px;
  border-radius: 7px;
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 0.12s, color 0.12s;
}
.nav-link:hover { background: rgba(148, 163, 184, 0.08); color: #fff; text-decoration: none; }
.nav-link.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-active-text);
  font-weight: 700;
  border-left-color: var(--accent);
}
.nav-link .nav-method {
  flex: none;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.3px;
  padding: 1.5px 5px;
  border-radius: 4px;
  color: #fff;
}
.nav-method.get { background: var(--get); }
.nav-method.post { background: var(--post); }
.nav-method.sse { background: var(--sse); }
.nav-link .nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* colored dot for nav items without a method badge */
.nav-dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin: 0 4.5px;
  border-radius: 50%;
  background: var(--sidebar-text-muted);
  opacity: 0.55;
  transition: opacity 0.12s, background 0.12s;
}
.nav-link:hover .nav-dot { opacity: 1; background: #fff; }
.nav-link.active .nav-dot { opacity: 1; background: var(--sidebar-active-text); }
.nav-dot.dot-get { background: var(--get); opacity: 0.85; }
.nav-dot.dot-post { background: var(--post); opacity: 0.85; }
.nav-dot.dot-sse { background: var(--sse); opacity: 0.85; }
.nav-link:hover .nav-dot.dot-get, .nav-link.active .nav-dot.dot-get { background: var(--get); }
.nav-link:hover .nav-dot.dot-post, .nav-link.active .nav-dot.dot-post { background: var(--post); }
.nav-link:hover .nav-dot.dot-sse, .nav-link.active .nav-dot.dot-sse { background: var(--sse); }
.nav-group li.hidden-by-search { display: none; }
.sidebar-empty-hint {
  display: none;
  padding: 10px;
  font-size: 12px;
  color: var(--sidebar-text-muted);
}
.sidebar-empty-hint.visible { display: block; }

/* ---------- Main ---------- */

.docs-main {
  grid-column: 2;
  min-width: 0;
  padding: 36px 44px 80px;
  max-width: calc(var(--code-w) + 880px);
}

/* hero */
.docs-hero {
  padding: 34px 36px;
  border-radius: 16px;
  background:
    radial-gradient(900px 300px at 85% -20%, rgba(139, 92, 246, 0.25), transparent 60%),
    radial-gradient(700px 260px at 0% 120%, rgba(99, 102, 241, 0.18), transparent 55%),
    var(--sidebar-bg);
  color: #e6edf9;
  border: 1px solid rgba(148, 163, 184, 0.16);
  margin-bottom: 40px;
}
.docs-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: #a5b4fc;
  margin-bottom: 12px;
}
.eyebrow-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2);
}
.docs-hero h1 {
  margin: 0 0 12px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.2;
  color: #fff;
}
.docs-hero p { margin: 0 0 20px; color: #b6c2d9; max-width: 720px; font-size: 15px; }
.docs-hero p code { background: rgba(148, 163, 184, 0.16); color: #c7d2fe; }

.hero-facts { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-fact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.1);
  border: 1px solid rgba(148, 163, 184, 0.18);
  font-size: 12.5px;
  font-weight: 600;
  color: #dbe4f3;
}
.hero-fact .fact-key { color: #8b9bb5; font-weight: 500; }
.hero-fact code { background: transparent; color: #a5b4fc; padding: 0; font-size: 12px; }

/* sections */
.docs-section { margin-bottom: 56px; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.docs-section > h2 {
  position: relative;
  margin: 0 0 10px;
  padding-left: 16px;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.3;
}
/* accent bar beside the heading */
.docs-section > h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent), #8b5cf6);
}
.section-anchor {
  margin-left: 8px;
  color: var(--text-faint);
  font-weight: 400;
  opacity: 0;
  transition: opacity 0.15s;
}
.docs-section > h2:hover .section-anchor { opacity: 1; }

.section-lead { color: var(--text-muted); margin: 0 0 20px; max-width: 760px; }
.section-lead code { white-space: nowrap; }

/* endpoint block: doc column + sticky code column */
.endpoint-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--code-w);
  gap: 32px;
  align-items: start;
}
.endpoint-doc { min-width: 0; }
.endpoint-aside { position: sticky; top: calc(var(--topbar-h) + 24px); min-width: 0; }

.endpoint-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 14px;
}
.method-badge {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 4px 10px;
  border-radius: 6px;
  color: #fff;
}
.method-badge.get { background: var(--get); }
.method-badge.post { background: var(--post); }
.method-badge.sse { background: var(--sse); }
.endpoint-path {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  word-break: break-all;
}

.endpoint-doc p { margin: 0 0 12px; }
.endpoint-doc p code, .docs-section p code, .docs-section li code, .docs-section td code { white-space: nowrap; }

/* sub headings inside sections */
.block-heading {
  margin: 26px 0 10px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* tables */
.param-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin: 0 0 18px;
  box-shadow: var(--shadow-sm);
}
table.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.param-table caption {
  caption-side: top;
  text-align: left;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border);
}
.param-table th, .param-table td {
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}
.param-table thead th {
  background: var(--table-head-bg);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.param-table tbody tr:last-child td { border-bottom: none; }
.param-table tbody tr:nth-child(even) { background: var(--table-row-alt); }
.param-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  word-break: break-word;
}
.type-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 7px;
  white-space: nowrap;
}
.req-flag {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
}
.req-flag.required { background: var(--req-bg); color: var(--req-text); }
.req-flag.optional { background: var(--opt-bg); color: var(--opt-text); }

/* chips */
.chip-group { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0; }
.chip-group code {
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.chip-note { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* callouts */
.callout {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 0 0 16px;
  font-size: 13.5px;
  border: 1px solid;
}
.callout-icon { flex: none; font-size: 15px; line-height: 1.5; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout.warning {
  background: var(--note-bg);
  border-color: color-mix(in srgb, var(--note-border) 45%, transparent);
  color: var(--note-text);
}
.callout.info {
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--text);
}
.callout.danger {
  background: rgba(239, 68, 68, 0.07);
  border-color: rgba(239, 68, 68, 0.35);
  color: var(--text);
}
.callout strong { font-weight: 700; }
.callout code { background: rgba(148, 163, 184, 0.15); color: inherit; }

/* steps (quickstart) */
.steps { list-style: none; counter-reset: step; margin: 0; padding: 0; }
.steps li {
  counter-increment: step;
  position: relative;
  padding: 0 0 22px 52px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
}
.steps li::after {
  content: '';
  position: absolute;
  left: 15.5px;
  top: 34px;
  bottom: 4px;
  width: 1.5px;
  background: var(--border);
}
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps .step-title { font-weight: 700; display: block; margin-bottom: 2px; }
.steps .step-optional {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-faint);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 8px;
  vertical-align: 1px;
}

/* ---------- Code panels (macOS window style) ---------- */

.code-panel {
  border-radius: 12px;
  background: var(--bg-code);
  border: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow:
    0 1px 2px rgba(2, 6, 23, 0.4),
    0 12px 32px -12px rgba(2, 6, 23, 0.55);
  overflow: hidden;
  margin-bottom: 16px;
}
.code-panel-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(to bottom, rgba(148, 163, 184, 0.12), rgba(148, 163, 184, 0.05));
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}
/* macOS traffic lights */
.traffic-lights {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 2px;
}
.traffic-lights i {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: block;
}
.traffic-lights i:nth-child(1) { background: #ff5f57; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.traffic-lights i:nth-child(2) { background: #febc2e; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.traffic-lights i:nth-child(3) { background: #28c840; box-shadow: inset 0 0 0 0.5px rgba(0, 0, 0, 0.12); }
.code-panel-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #8b9bb5;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 9px;
  border-radius: 6px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.08);
  color: #9fb0c9;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.copy-btn:hover { background: rgba(148, 163, 184, 0.18); color: #fff; }
.copy-btn.copied { color: #34d399; border-color: rgba(52, 211, 153, 0.4); }
.copy-btn svg { width: 12px; height: 12px; }

.code-panel pre {
  margin: 0;
  padding: 14px 16px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.6;
  color: #d7e0f0;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.3) transparent;
}
.code-panel pre::-webkit-scrollbar { height: 8px; }
.code-panel pre::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 4px; }

/* request line inside code panel head */
.code-endpoint-line {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  font-family: var(--font-mono);
  font-size: 12px;
  color: #d7e0f0;
  word-break: break-all;
}
.code-endpoint-line .method-badge { font-size: 10px; padding: 3px 8px; }

/* ---------- Errors section ---------- */

.error-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.error-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.15s;
}
.error-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.error-code {
  flex: none;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 7px;
  color: #fff;
}
.error-code.c4xx { background: #f59e0b; }
.error-code.c5xx { background: #ef4444; }
.error-card p { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ---------- Footer ---------- */

.docs-footer {
  margin-top: 64px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: #696969;
  font-size: 12.5px;
}

/* ---------- Progress + scroll top ---------- */

.read-progress {
  position: fixed;
  top: var(--topbar-h);
  left: 0;
  right: 0;
  height: 3px;
  z-index: 65;
  background: transparent;
  pointer-events: none;
}
.read-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #d946ef);
  transition: width 0.1s linear;
}

.scroll-top-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 65;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid #b8b8b8;
  background: var(--bg);
  color: var(--text-muted);
  font-size: 17px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s, color 0.15s, border-color 0.15s;
}
.scroll-top-fab.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top-fab:hover { color: var(--accent); border-color: var(--accent); }

/* sidebar backdrop (mobile) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: var(--topbar-h) 0 0 0;
  background: rgba(2, 6, 23, 0.55);
  z-index: 45;
  opacity: 0;
  transition: opacity 0.2s;
}
.sidebar-backdrop.visible { opacity: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 1280px) {
  :root { --code-w: 380px; }
  .docs-main { padding: 32px 28px 72px; }
}

@media (max-width: 1080px) {
  .endpoint-grid { grid-template-columns: minmax(0, 1fr); }
  .endpoint-aside { position: static; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-main { grid-column: 1; padding: 22px 16px 64px; }

  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    width: min(300px, 86vw);
    box-shadow: var(--shadow-lg);
  }
  body.sidebar-open .docs-sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }

  .brand-text span { display: none; }
  .docs-topbar { padding: 0 14px; gap: 10px; }
  .docs-hero { padding: 24px 20px; margin-bottom: 32px; }
  .docs-hero h1 { font-size: 24px; }
  .docs-hero p { font-size: 14px; }
  .docs-section { margin-bottom: 44px; }
  .docs-section > h2 { font-size: 21px; padding-left: 13px; }
  .docs-section > h2::before { width: 3px; }
  .section-lead { margin-bottom: 16px; }
  .endpoint-grid { gap: 20px; }
  .endpoint-aside { order: -1; }
  .endpoint-title { gap: 8px; }
  .endpoint-path { font-size: 12.5px; padding: 4px 10px; }
  .icon-btn { font-size: 12px; padding: 0 8px; }
  .home-link { padding: 0 11px; font-size: 12px; }
}

@media (max-width: 640px) {
  body { font-size: 14.5px; }

  .docs-topbar { height: 54px; gap: 8px; padding: 0 10px; }
  :root { --topbar-h: 54px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 8px; }
  .brand-text strong { font-size: 13.5px; }
  .home-link span { display: none; }
  .home-link { padding: 0 10px; }
  .icon-btn { height: 32px; min-width: 32px; padding: 0 7px; }
  .icon-btn svg { width: 15px; height: 15px; }

  .docs-main { padding: 18px 12px 56px; }
  .version-pill { display: none; }
  .docs-hero { padding: 20px 16px; border-radius: 13px; }
  .docs-hero h1 { font-size: 21px; letter-spacing: -0.4px; }
  .docs-hero p { margin-bottom: 16px; }
  .hero-fact { padding: 6px 11px; font-size: 11.5px; }
  .hero-fact code { font-size: 11px; }

  .docs-section { margin-bottom: 38px; }
  .docs-section > h2 { font-size: 19px; padding-left: 12px; }
  .section-anchor { opacity: 1; }
  .section-lead code { white-space: normal; }
  .endpoint-doc p code, .docs-section p code, .docs-section li code, .docs-section td code { white-space: normal; }

  .endpoint-doc p code, .docs-section p code, .docs-section li code, .docs-section td code { word-break: break-word; }
  .endpoint-path { font-size: 11.5px; padding: 4px 9px; }
  .method-badge { font-size: 10px; padding: 3px 8px; }
  .block-heading { margin: 20px 0 8px; }

  /* tables: horizontal scroll instead of squished columns */
  .param-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .param-table { min-width: 560px; }
  .param-table th, .param-table td { padding: 8px 10px; font-size: 12.5px; }
  .param-table td:first-child { font-size: 11.5px; }

  .code-panel pre { padding: 12px 12px; font-size: 11.5px; line-height: 1.55; }
  .code-panel-head { padding: 7px 10px; }
  .code-endpoint-line { font-size: 11px; padding: 8px 12px; }
  .copy-btn { height: 24px; font-size: 10.5px; padding: 0 7px; }

  .steps li { padding-left: 44px; }
  .steps li::before { width: 28px; height: 28px; font-size: 12px; }
  .steps li::after { left: 13.5px; top: 30px; }

  .callout { padding: 12px 13px; font-size: 13px; gap: 10px; }
  .error-grid { grid-template-columns: 1fr; }
  .error-card { padding: 12px 13px; }

  .docs-footer { margin-top: 44px; flex-direction: column; align-items: flex-start; gap: 6px; }
  .scroll-top-fab { right: 14px; bottom: 14px; width: 38px; height: 38px; }
}

@media (max-width: 380px) {
  .brand-text strong { font-size: 12.5px; }
  .docs-hero h1 { font-size: 19px; }
  .hero-facts { gap: 7px; }
  .hero-fact { padding: 5px 9px; font-size: 11px; }
}

@media print {
  .docs-topbar, .docs-sidebar, .scroll-top-fab, .read-progress, .sidebar-backdrop, .copy-btn { display: none !important; }
  .docs-shell { grid-template-columns: 1fr; padding-top: 0; }
  .docs-main { grid-column: 1; max-width: none; padding: 0; }
  .endpoint-grid { grid-template-columns: 1fr; }
}
