:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --sidebar: #0f172a;
  --text: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: "Segoe UI", system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; }
.hidden { display: none !important; }

.docs-shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar { width: 280px; background: var(--sidebar); color: #cbd5e1; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; flex-shrink: 0; overflow-y: auto; }
.sidebar-brand { padding: 22px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.logo { font-size: 21px; font-weight: 800; color: #fff; letter-spacing: -0.3px; }
.logo span { color: #60a5fa; margin-left: 3px; }
.version-pill { display: inline-block; margin-top: 6px; font-size: 11px; background: rgba(96,165,250,0.16); color: #93c5fd; padding: 2px 8px; border-radius: 999px; font-weight: 600; }

.toc { padding: 12px 12px 20px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.toc-group { font-size: 11px; text-transform: uppercase; letter-spacing: 0.7px; color: #64748b; font-weight: 700; margin: 14px 8px 6px; }
.toc-link { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 7px; color: #cbd5e1; text-decoration: none; font-size: 13.5px; transition: background 0.15s, color 0.15s; }
.toc-link:hover { background: rgba(255,255,255,0.07); color: #fff; }
.toc-link.active { background: var(--primary); color: #fff; font-weight: 600; }

.sidebar-actions { padding: 14px; border-top: 1px solid rgba(255,255,255,0.08); display: flex; flex-direction: column; gap: 8px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; text-decoration: none; border: 1px solid transparent; transition: all 0.15s; }
.btn-block { width: 100%; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,0.22); color: #e2e8f0; }
.btn-outline:hover { background: rgba(255,255,255,0.08); color: #fff; }

/* Main Content */
.content { flex: 1; max-width: 960px; padding: 36px 44px 72px; width: 100%; }
.doc-section { padding-bottom: 36px; margin-bottom: 36px; border-bottom: 1px solid var(--border); }
.hero-tag { display: inline-block; background: #dbeafe; color: #1d4ed8; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; }
h1 { font-size: 30px; line-height: 1.25; margin-bottom: 12px; letter-spacing: -0.4px; }
h2 { font-size: 22px; margin-bottom: 12px; letter-spacing: -0.2px; }
h3 { font-size: 16px; margin: 20px 0 8px; }
h4 { font-size: 14px; margin: 16px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.lead { font-size: 16px; color: var(--muted); margin-bottom: 24px; }
p { margin-bottom: 12px; color: #334155; }
code { background: #e2e8f0; color: #0f172a; padding: 2px 6px; border-radius: 5px; font-family: Consolas, "Courier New", monospace; font-size: 0.9em; }

.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; margin-top: 16px; }
.info-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.info-label { font-size: 12px; color: #64748b; text-transform: uppercase; font-weight: 700; margin-bottom: 6px; }
.info-value { font-size: 14px; }

.callout { padding: 14px 16px; border-radius: 8px; margin: 16px 0; font-size: 14px; }
.callout-warn { background: #fffbeb; border: 1px solid #fde68a; color: #78350f; }

.doc-list { margin: 10px 0 14px 20px; color: #334155; }
.doc-list li { margin-bottom: 8px; }

/* Endpoint header */
.ep-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ep-title code { font-size: 15px; font-weight: 700; background: #eff6ff; color: #1e3a8a; padding: 4px 10px; }
.scope-tag { font-size: 12px; background: #f1f5f9; border: 1px solid #cbd5e1; color: #334155; padding: 3px 8px; border-radius: 6px; font-weight: 600; }

/* Method badges */
.m-badge { display: inline-block; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.3px; min-width: 38px; text-align: center; }
.m-badge.lg { font-size: 12px; padding: 4px 9px; min-width: 52px; }
.m-badge.get { background: #16a34a; color: #fff; }
.m-badge.post { background: #2563eb; color: #fff; }

/* Status badges */
.status { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.s200 { background: #dcfce7; color: #166534; }
.s400 { background: #fee2e2; color: #991b1b; }
.s401, .s403, .s404, .s409 { background: #fee2e2; color: #991b1b; }
.sWarn { background: #fef3c7; color: #92400e; }
.sInfo { background: #dbeafe; color: #1e40af; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; font-size: 13.5px; }
th { text-align: left; background: #f1f5f9; padding: 10px 12px; font-weight: 700; color: #334155; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }

/* Code blocks */
.code-block { background: var(--code-bg); border-radius: 10px; overflow: hidden; margin: 12px 0 18px; border: 1px solid #1e293b; }
.code-header { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #1e293b; color: #94a3b8; font-size: 12px; font-weight: 600; }
.copy-btn { background: rgba(255,255,255,0.1); color: #e2e8f0; border: none; padding: 4px 10px; border-radius: 5px; font-size: 12px; cursor: pointer; font-weight: 600; }
.copy-btn:hover { background: var(--primary); color: #fff; }
.code-block pre { padding: 14px 16px; overflow-x: auto; }
.code-block pre code { background: transparent; color: var(--code-text); padding: 0; font-size: 13px; line-height: 1.55; }

/* Language tabs */
.lang-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.lang-tab { background: #e2e8f0; border: none; padding: 7px 14px; border-radius: 7px; font-weight: 600; font-size: 13px; cursor: pointer; color: #334155; }
.lang-tab.active { background: var(--primary); color: #fff; }

.docs-footer { color: #64748b; font-size: 13px; text-align: center; padding-top: 12px; }

/* Mobile */
@media (max-width: 900px) {
  .docs-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .content { padding: 24px 18px 48px; }
}

/* Print / PDF */
@media print {
  .sidebar, .copy-btn, .lang-tabs { display: none !important; }
  .content { max-width: 100%; padding: 0; }
  .lang-panel { display: block !important; }
  .code-block { break-inside: avoid; }
}
