/* ============================================================
   Nurse Connector API Docs — Redesigned for performance
   ============================================================ */

/* ── Tokens ─────────────────────────────────────────────── */
:root {
    color-scheme: light;

    /* Surfaces — all opaque for GPU performance */
    --bg:            #f4f6f9;
    --bg-subtle:     #eaecf0;
    --surface:       #ffffff;
    --surface-solid: #ffffff;
    --surface-raised: #ffffff;
    --surface-muted: #f8f9fb;
    --surface-hover: #f0f2f5;

    /* Ink */
    --ink:           #0f172a;
    --ink-2:         #1e293b;
    --ink-3:         #475569;
    --ink-4:         #94a3b8;

    /* Brand */
    --brand:         #0f766e;
    --brand-2:       #0d9488;
    --brand-3:       #115e59;
    --brand-glow:    rgba(15,118,110,0.15);
    --brand-soft:    rgba(15,118,110,0.08);
    --brand-faint:   rgba(15,118,110,0.04);

    /* Accent */
    --accent:        #7c3aed;
    --accent-soft:   rgba(124,58,237,0.08);

    /* Semantic */
    --success:       #059669;
    --success-soft:  rgba(5,150,105,0.08);
    --warning:       #d97706;
    --warning-soft:  rgba(217,119,6,0.08);
    --danger:        #dc2626;
    --danger-soft:   rgba(220,38,38,0.08);

    /* Borders — solid for performance */
    --line:          #e2e8f0;
    --line-2:        #cbd5e1;

    /* Shadows — lighter */
    --shadow-sm:     0 1px 2px rgba(15,23,42,0.06);
    --shadow:        0 1px 3px rgba(15,23,42,0.08), 0 1px 2px rgba(15,23,42,0.04);
    --shadow-lg:     0 4px 16px rgba(15,23,42,0.10), 0 2px 6px rgba(15,23,42,0.06);
    --shadow-xl:     0 10px 40px rgba(15,23,42,0.12), 0 4px 12px rgba(15,23,42,0.06);
    --shadow-brand:  0 4px 16px rgba(15,118,110,0.20);

    /* Radii */
    --r-xs:  6px;
    --r-sm:  8px;
    --r-md:  12px;
    --r-lg:  16px;
    --r-xl:  20px;
    --r-2xl: 24px;
    --r-full: 9999px;

    /* Layout */
    --sidebar-w:  272px;
    --aside-w:    340px;
    --topbar-h:   56px;

    /* Code */
    --code-bg:      #0f1923;
    --code-border:  rgba(255,255,255,0.06);
    --code-ink:     #e2f0ff;
    --code-muted:   #7a9fc0;
    --code-key:     #79c0ff;
    --code-string:  #a5d6a7;
    --code-number:  #ffab70;
    --code-bool:    #d2a8ff;
    --code-null:    #56d364;

    /* Layout */
    --sidebar-bg:  #f7f8fa;

    /* HTTP methods — text colors */
    --m-get:    #1d4ed8;
    --m-post:   #15803d;
    --m-put:    #92400e;
    --m-patch:  #5b21b6;
    --m-delete: #991b1b;

    /* HTTP methods — soft backgrounds */
    --m-get-bg:    #eff6ff;
    --m-post-bg:   #f0fdf4;
    --m-put-bg:    #fffbeb;
    --m-patch-bg:  #f5f3ff;
    --m-delete-bg: #fef2f2;
}

html[data-theme="dark"] {
    color-scheme: dark;

    --bg:            #0d1117;
    --bg-subtle:     #161b22;
    --surface:       #161b22;
    --surface-solid: #161b22;
    --surface-raised: #1c2230;
    --surface-muted: #1a2030;
    --surface-hover: #1f2937;

    --ink:           #e6edf3;
    --ink-2:         #adbac7;
    --ink-3:         #768390;
    --ink-4:         #444c56;

    --brand:         #2dd4bf;
    --brand-2:       #5eead4;
    --brand-3:       #99f6e4;
    --brand-glow:    rgba(45,212,191,0.15);
    --brand-soft:    rgba(45,212,191,0.10);
    --brand-faint:   rgba(45,212,191,0.05);

    --accent:        #a78bfa;
    --accent-soft:   rgba(167,139,250,0.10);

    --success:       #3fb950;
    --success-soft:  rgba(63,185,80,0.10);
    --warning:       #f0883e;
    --warning-soft:  rgba(240,136,62,0.10);
    --danger:        #f85149;
    --danger-soft:   rgba(248,81,73,0.10);

    --line:          #21262d;
    --line-2:        #30363d;

    --shadow-sm:     0 1px 2px rgba(0,0,0,0.3);
    --shadow:        0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg:     0 4px 16px rgba(0,0,0,0.5);
    --shadow-xl:     0 10px 40px rgba(0,0,0,0.6);
    --shadow-brand:  0 4px 16px rgba(45,212,191,0.20);

    --code-bg:      #0d1117;
    --code-border:  #21262d;
    --code-ink:     #e6edf3;
    --code-muted:   #6e7681;
    --code-key:     #79c0ff;
    --code-string:  #a5d6a7;
    --code-number:  #ffab70;
    --code-bool:    #d2a8ff;
    --code-null:    #56d364;

    /* Layout — dark sidebar same as surface */
    --sidebar-bg:  #161b22;

    /* HTTP methods — dark text colors */
    --m-get:    #60a5fa;
    --m-post:   #4ade80;
    --m-put:    #fbbf24;
    --m-patch:  #c084fc;
    --m-delete: #f87171;

    /* HTTP methods — dark soft backgrounds */
    --m-get-bg:    rgba(96,165,250,0.12);
    --m-post-bg:   rgba(74,222,128,0.12);
    --m-put-bg:    rgba(251,191,36,0.12);
    --m-patch-bg:  rgba(192,132,252,0.12);
    --m-delete-bg: rgba(248,113,113,0.12);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: "Instrument Sans", system-ui, -apple-system, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--ink);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
}

code, pre, .mono {
    font-family: "JetBrains Mono", "Fira Code", ui-monospace, monospace;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
img, svg { display: block; }

/* ── Utilities ───────────────────────────────────────────── */
.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;
}

/* ── Page shell ──────────────────────────────────────────── */
.docs-page { min-height: 100vh; }

/* ── State screens (disabled / locked / no collection) ───── */
.docs-state-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 20px;
}

.docs-state-card {
    width: min(100%, 460px);
    padding: 36px;
    border-radius: var(--r-xl);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

/* ── Eyebrow pill ────────────────────────────────────────── */
.docs-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: var(--r-full);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.docs-eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

/* ── State card typography ───────────────────────────────── */
.docs-state-title {
    margin: 20px 0 10px;
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--ink);
}

.docs-state-copy {
    margin: 0;
    color: var(--ink-3);
    line-height: 1.75;
}

.docs-state-copy code {
    padding: 2px 6px;
    border-radius: var(--r-xs);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
}

/* ── Form elements ───────────────────────────────────────── */
.docs-field { margin-top: 20px; }

.docs-label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.docs-input,
.docs-select,
.docs-textarea,
.docs-search-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-md);
    background: var(--surface-solid);
    color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

.docs-input:focus,
.docs-select:focus,
.docs-textarea:focus,
.docs-search-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

.docs-input::placeholder,
.docs-search-input::placeholder { color: var(--ink-4); }

.docs-textarea {
    min-height: 220px;
    resize: vertical;
    font-size: 13px;
    line-height: 1.7;
}

.docs-error {
    margin-top: 6px;
    color: var(--danger);
    font-size: 12px;
    font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────── */
.docs-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, box-shadow 0.12s, transform 0.12s;
    white-space: nowrap;
}

.docs-button:hover {
    background: var(--brand-2);
    box-shadow: var(--shadow-brand);
    transform: translateY(-1px);
}

.docs-button:active { transform: translateY(0); box-shadow: none; }
.docs-button:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.docs-button.secondary {
    background: var(--surface);
    color: var(--ink-2);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-sm);
}

.docs-button.secondary:hover {
    background: var(--surface-hover);
    box-shadow: var(--shadow);
    color: var(--ink);
}

.docs-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 12px;
    height: 34px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface);
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
    white-space: nowrap;
}

.docs-icon-button:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand);
}

.docs-icon-button.secondary {
    background: var(--bg);
    border-color: var(--line);
}

.docs-icon-button svg { width: 14px; height: 14px; }

/* Focus rings */
.docs-button:focus-visible,
.docs-icon-button:focus-visible,
.docs-code-button:focus-visible,
.docs-group-toggle:focus-visible,
.docs-request-link:focus-visible,
.docs-tab:focus-visible,
.docs-section-header:focus-visible,
.docs-quicknav-link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* ── App layout ──────────────────────────────────────────── */
.docs-app {
    position: relative;
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.docs-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 40;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--sidebar-bg);
    overflow: hidden;
}

.docs-sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
    height: 100%;
    overflow: hidden;
}

/* Sidebar header */
.docs-sidebar-header {
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.docs-brand-title {
    margin: 10px 0 4px;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--ink);
}

.docs-brand-copy {
    margin: 0;
    color: var(--ink-4);
    font-size: 11.5px;
    line-height: 1.6;
}

/* Sidebar stats — compact single row */
.docs-sidebar-summary {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.docs-summary-card {
    flex: 1;
    padding: 10px 0;
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--line);
    background: transparent;
    text-align: center;
}

.docs-summary-card:last-child { border-right: none; }

.docs-summary-label {
    color: var(--ink-4);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.docs-summary-value {
    margin-top: 1px;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--ink);
}

/* Nav meta */
.docs-nav-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px 4px;
    flex-shrink: 0;
}

.docs-nav-caption {
    color: var(--ink-4);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Collection list */
.docs-collection-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 4px 8px 20px;
}

/* Scrollbars */
.docs-collection-list::-webkit-scrollbar,
.docs-aside-sticky::-webkit-scrollbar,
.docs-code-block::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.docs-collection-list::-webkit-scrollbar-track,
.docs-aside-sticky::-webkit-scrollbar-track,
.docs-code-block::-webkit-scrollbar-track {
    background: transparent;
}

.docs-collection-list::-webkit-scrollbar-thumb,
.docs-aside-sticky::-webkit-scrollbar-thumb,
.docs-code-block::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: var(--r-full);
}

/* ── Nav groups ──────────────────────────────────────────── */
.docs-group { padding: 0 0 4px; }

.docs-group-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 8px 6px;
    border: none;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    border-radius: var(--r-sm);
    transition: color 0.1s;
}

.docs-group-toggle:hover .docs-group-title { color: var(--brand); }

.docs-group-toggle-text {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.docs-group-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: color 0.1s;
}

.docs-group-subtitle { display: none; }

.docs-group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 16px;
    padding: 0 5px;
    border-radius: var(--r-full);
    background: var(--line);
    color: var(--ink-4);
    font-size: 9.5px;
    font-weight: 700;
    flex-shrink: 0;
}

.docs-group-chevron {
    width: 13px; height: 13px;
    flex-shrink: 0;
    color: var(--ink-4);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-group.is-collapsed .docs-group-chevron { transform: rotate(-90deg); }

.docs-group-list {
    display: grid;
    gap: 1px;
    padding: 0 0 2px;
}

.docs-group.is-collapsed .docs-group-list { display: none; }

/* ── Request links ───────────────────────────────────────── */
.docs-request-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px 6px 10px;
    border: none;
    border-left: 2px solid transparent;
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s, border-color 0.1s;
}

.docs-request-link:hover {
    background: var(--surface-hover);
    border-left-color: var(--line-2);
}

.docs-request-link.is-active {
    background: var(--brand-soft);
    border-left-color: var(--brand);
}

.docs-request-link-copy {
    min-width: 0;
    flex: 1;
    display: grid;
    gap: 2px;
}

.docs-request-link-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--ink-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.docs-request-link.is-active .docs-request-link-title {
    color: var(--brand);
    font-weight: 600;
}

.docs-request-link-path {
    color: var(--ink-4);
    font-size: 10.5px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: "JetBrains Mono", monospace;
}

/* ── Method chips ────────────────────────────────────────── */
.docs-method-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 46px;
    height: 20px;
    padding: 0 7px;
    border-radius: var(--r-xs);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    flex-shrink: 0;
    font-family: "JetBrains Mono", monospace;
}

.docs-method-chip.method-get    { background: var(--m-get-bg);    color: var(--m-get); }
.docs-method-chip.method-post   { background: var(--m-post-bg);   color: var(--m-post); }
.docs-method-chip.method-put    { background: var(--m-put-bg);    color: var(--m-put); }
.docs-method-chip.method-patch  { background: var(--m-patch-bg);  color: var(--m-patch); }
.docs-method-chip.method-delete { background: var(--m-delete-bg); color: var(--m-delete); }

/* Larger variant used in hero */
.docs-method-chip.lg {
    min-width: 60px;
    height: 26px;
    font-size: 11px;
    padding: 0 10px;
    border-radius: var(--r-sm);
}

/* ── Badges ──────────────────────────────────────────────── */
.docs-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: var(--r-full);
    font-size: 11px;
    font-weight: 600;
    background: var(--bg);
    color: var(--ink-3);
    border: 1px solid var(--line);
}

.docs-badge.success { background: var(--success-soft); color: var(--success); border-color: transparent; }
.docs-badge.warning { background: var(--warning-soft); color: var(--warning); border-color: transparent; }
.docs-badge.danger  { background: var(--danger-soft);  color: var(--danger);  border-color: transparent; }
.docs-badge.brand   { background: var(--brand-soft);   color: var(--brand);   border-color: transparent; }
.docs-badge.accent  { background: var(--accent-soft);  color: var(--accent);  border-color: transparent; }

/* ── Workspace ───────────────────────────────────────────── */
.docs-workspace {
    min-width: 0;
    display: grid;
    grid-template-rows: auto 1fr;
}

/* ── Topbar ──────────────────────────────────────────────── */
.docs-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 16px;
    height: 56px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.docs-topbar-left,
.docs-topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.docs-topbar-left { min-width: 0; flex-shrink: 0; }

.docs-topbar-title { min-width: 0; }

.docs-topbar-title h1 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.docs-topbar-subtitle {
    display: none;
}

/* Search */
.docs-search-shell {
    position: relative;
    flex: 1 1 200px;
    min-width: 0;
    max-width: 340px;
}

.docs-search-shell svg {
    position: absolute;
    left: 11px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px; height: 14px;
    color: var(--ink-4);
    pointer-events: none;
}

.docs-search-input {
    padding-left: 34px;
    padding-right: 12px;
    font-size: 13px;
    height: 36px;
    border-radius: var(--r-full);
    background: var(--bg);
    border: 1px solid var(--line-2);
    transition: border-color 0.12s, background 0.12s, box-shadow 0.12s;
}

.docs-search-input:focus {
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--brand-soft);
}

/* Selectors */
.docs-topbar-selectors {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.docs-inline-control {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.docs-inline-label {
    color: var(--ink-4);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.docs-inline-control .docs-select,
.docs-inline-control .docs-input {
    min-width: 130px;
    max-width: 200px;
    height: 32px;
    padding: 0 10px;
    font-size: 12px;
}

/* ── Main layout ─────────────────────────────────────────── */
.docs-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--aside-w);
    gap: 0;
    align-items: start;
}

.docs-main {
    min-width: 0;
    padding: 20px;
    border-right: 1px solid var(--line);
}

.docs-aside {
    min-width: 0;
    background: var(--surface-muted);
}

.docs-aside-sticky {
    position: sticky;
    top: 56px;
    display: grid;
    gap: 0;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
}

/* ── Cards / Sections ────────────────────────────────────── */
.docs-card,
.docs-section,
.docs-hero,
.docs-utility-card {
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

/* ── Hero ────────────────────────────────────────────────── */
.docs-hero {
    padding: 22px 22px 22px 26px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    border-left: 3px solid var(--brand);
}

.docs-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, var(--brand-faint) 0%, transparent 55%);
    pointer-events: none;
}

.docs-hero-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    position: relative;
}

.docs-hero-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.docs-hero-title {
    margin: 10px 0 6px;
    font-size: clamp(1.4rem, 2.5vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    color: var(--ink);
    position: relative;
}

.docs-hero-description {
    margin: 0;
    color: var(--ink-3);
    line-height: 1.7;
    max-width: 60ch;
    font-size: 13.5px;
    position: relative;
}

.docs-hero-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

/* URL stack */
.docs-url-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 16px;
    position: relative;
}

.docs-url-card {
    display: grid;
    gap: 4px;
    padding: 10px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--bg);
    overflow: hidden;
}

.docs-url-label {
    color: var(--ink-4);
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.docs-url-value {
    margin: 0;
    font-size: 11.5px;
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-2);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ── Quick nav ───────────────────────────────────────────── */
.docs-quicknav {
    position: sticky;
    top: 56px;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
    padding: 0 4px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow-x: auto;
    scrollbar-width: none;
}

.docs-quicknav::-webkit-scrollbar { display: none; }

.docs-quicknav-link {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: var(--ink-4);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: color 0.12s, border-color 0.12s;
    text-decoration: none;
}

.docs-quicknav-link:hover {
    color: var(--ink-2);
}

.docs-quicknav-link.is-active {
    color: var(--brand);
    border-bottom-color: var(--brand);
    font-weight: 600;
}

/* ── Sections ────────────────────────────────────────────── */
.docs-sections { display: grid; gap: 8px; }

.docs-section { overflow: clip; }

.docs-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border: none;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.1s;
}

.docs-section-header:hover { background: var(--surface-hover); }

.docs-section-kicker { display: none; }

.docs-section-title {
    margin: 0;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.docs-section-copy {
    margin: 2px 0 0;
    color: var(--ink-4);
    font-size: 12px;
    line-height: 1.5;
}

.docs-section-caret {
    width: 15px; height: 15px;
    flex-shrink: 0;
    color: var(--ink-4);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.docs-section.is-collapsed .docs-section-caret { transform: rotate(-90deg); }

.docs-section-body {
    padding: 0 18px 18px;
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
}

.docs-section.is-collapsed .docs-section-body { display: none; }

/* ── Grids ───────────────────────────────────────────────── */
.docs-grid-two,
.docs-meta-grid,
.docs-utility-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.docs-grid-three {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

/* ── Meta cards ──────────────────────────────────────────── */
.docs-meta-card {
    padding: 12px 14px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--bg);
    transition: border-color 0.12s;
}

.docs-meta-card:hover { border-color: var(--line-2); }

.docs-meta-card-title {
    color: var(--ink-4);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.docs-meta-card-value {
    margin-top: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    line-height: 1.5;
    word-break: break-word;
}

/* ── Table ───────────────────────────────────────────────── */
.docs-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    background: var(--surface-muted);
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 480px;
}

.docs-table th,
.docs-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.docs-table tr:last-child td { border-bottom: none; }

.docs-table th {
    color: var(--ink-4);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    background: var(--surface-muted);
}

.docs-table td {
    font-size: 13px;
    line-height: 1.6;
    color: var(--ink-2);
}

/* ── Pills ───────────────────────────────────────────────── */
.docs-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: var(--r-full);
    background: var(--surface-muted);
    color: var(--ink-3);
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--line);
}

.docs-pill.file    { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.docs-pill.variable { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.docs-mini-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: var(--r-full);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 10px;
    font-weight: 700;
}

/* ── Builder ─────────────────────────────────────────────── */
.docs-body-builder,
.docs-formdata-builder,
.docs-builder-meta {
    display: grid;
    gap: 12px;
}

.docs-formdata-row {
    padding: 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface-muted);
}

.docs-formdata-row-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.docs-builder-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Tabs ────────────────────────────────────────────────── */
.docs-tabs {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: var(--r-sm);
    background: var(--bg);
    padding: 3px;
    flex-wrap: wrap;
}

.docs-tab {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border: none;
    border-radius: var(--r-xs);
    background: transparent;
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.1s, color 0.1s;
    white-space: nowrap;
}

.docs-tab:hover { color: var(--ink); }

.docs-tab.is-active {
    background: var(--surface);
    color: var(--ink);
    font-weight: 600;
    box-shadow: var(--shadow-sm);
}

/* ── Code blocks ─────────────────────────────────────────── */
.docs-code-card {
    border-radius: var(--r-md);
    border: 1px solid var(--code-border);
    background: var(--code-bg);
    overflow: clip;
}

.docs-code-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--code-border);
    background: rgba(255,255,255,0.02);
}

.docs-code-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--code-muted);
    font-size: 11.5px;
    font-weight: 500;
    font-family: "JetBrains Mono", monospace;
    letter-spacing: 0;
    text-transform: none;
}

.docs-code-title::before {
    content: "";
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #4ade80;
    flex-shrink: 0;
}

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

.docs-code-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--r-xs);
    background: rgba(255,255,255,0.05);
    color: var(--code-muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}

.docs-code-button:hover {
    background: rgba(255,255,255,0.1);
    color: var(--code-ink);
}

.docs-code-frame { position: relative; }

.docs-code-block {
    margin: 0;
    padding: 16px;
    overflow: auto;
    color: var(--code-ink);
    font-size: 12.5px;
    line-height: 1.8;
}

.docs-code-frame.is-collapsible .docs-code-block { max-height: 320px; }
.docs-code-frame.is-expanded .docs-code-block { max-height: none; }

.docs-code-expand {
    display: none;
    width: 100%;
    padding: 10px 14px 14px;
    border: none;
    color: var(--code-muted);
    background: linear-gradient(180deg, transparent 0%, rgba(6,13,22,0.9) 50%);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    transition: color 0.12s;
}

.docs-code-expand:hover { color: var(--code-ink); }
.docs-code-frame.is-collapsible .docs-code-expand { display: block; }

/* Syntax tokens */
.token-key     { color: var(--code-key); }
.token-string  { color: var(--code-string); }
.token-number  { color: var(--code-number); }
.token-boolean { color: var(--code-bool); }
.token-null    { color: var(--code-null); }

/* ── Utility cards (aside) ───────────────────────────────── */
.docs-utility-card {
    padding: 16px;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    background: var(--sidebar-bg);
}

.docs-utility-card:last-child { border-bottom: none; }

.docs-utility-title {
    margin: 0;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.docs-utility-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.docs-utility-note {
    margin: 0;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.65;
}

.docs-utility-note code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11px;
}

/* ── Variables panel ─────────────────────────────────────── */
.docs-variable-list { display: grid; gap: 12px; }

.docs-variable-empty {
    padding: 14px;
    border-radius: var(--r-sm);
    background: var(--surface-muted);
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.65;
    border: 1px solid var(--line);
}

/* ── Runner ──────────────────────────────────────────────── */
.docs-runner-request {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    padding: 14px;
    border-radius: var(--r-md);
    border: 1px solid var(--line);
    background: var(--surface-muted);
}

.docs-runner-label {
    color: var(--ink-4);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.docs-runner-path {
    font-size: 12px;
    font-family: "JetBrains Mono", monospace;
    color: var(--ink-2);
    word-break: break-all;
    line-height: 1.5;
}

/* ── Live response ───────────────────────────────────────── */
.docs-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.docs-status-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: var(--r-full);
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 11px;
    font-weight: 700;
}

.docs-status-chip::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.docs-status-chip.error   { background: var(--danger-soft);  color: var(--danger); }
.docs-status-chip.pending { background: var(--warning-soft); color: var(--warning); }

.docs-response-meta {
    color: var(--ink-4);
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 10px;
}

/* ── Empty / no-results states ───────────────────────────── */
.docs-empty-state,
.docs-no-results {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 280px;
    padding: 32px;
    text-align: center;
    border-radius: var(--r-xl);
    border: 1px dashed var(--line-2);
    background: var(--surface-muted);
}

.docs-empty-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--ink);
}

.docs-empty-copy,
.docs-note {
    margin: 0;
    color: var(--ink-3);
    font-size: 12px;
    line-height: 1.7;
    max-width: 44ch;
}

/* ── Skeleton loaders ────────────────────────────────────── */
.docs-loading-grid { display: grid; gap: 14px; }

.docs-skeleton,
.docs-skeleton-line,
.docs-skeleton-block {
    position: relative;
    overflow: hidden;
    background: var(--surface-muted);
    border: 1px solid var(--line);
}

.docs-skeleton::after,
.docs-skeleton-line::after,
.docs-skeleton-block::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

.docs-skeleton       { height: 200px; border-radius: var(--r-xl); }
.docs-skeleton-line  { height: 12px;  border-radius: var(--r-full); }
.docs-skeleton-block { height: 140px; border-radius: var(--r-lg); }

.docs-skeleton-line.short  { width: 40%; }
.docs-skeleton-line.medium { width: 65%; }

@keyframes shimmer { 100% { transform: translateX(100%); } }

/* ── Toast ───────────────────────────────────────────────── */
.docs-toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 120;
    min-width: 180px;
    max-width: min(90vw, 320px);
    padding: 12px 16px;
    border-radius: var(--r-md);
    border: 1px solid var(--line-2);
    background: var(--surface-raised);
    color: var(--ink);
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.docs-toast.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.docs-toast.success { border-color: rgba(5,150,105,0.3); }
.docs-toast.error   { border-color: rgba(220,38,38,0.3); }

/* ── Mobile ──────────────────────────────────────────────── */
.docs-mobile-toggle,
.docs-mobile-backdrop { display: none; }

/* ── Responsive ──────────────────────────────────────────── */

/* Collapse aside panel below main content at medium screens */
@media (max-width: 1200px) {
    :root { --aside-w: 300px; }
}

@media (max-width: 1100px) {
    .docs-layout {
        grid-template-columns: 1fr;
    }

    .docs-main {
        border-right: none;
        border-bottom: 1px solid var(--line);
    }

    .docs-aside { background: transparent; }

    .docs-aside-sticky {
        position: static;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    }

    .docs-utility-card {
        border: 1px solid var(--line);
        border-radius: var(--r-lg);
        margin: 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--line);
    }

    .docs-utility-card:last-child { border-bottom: 1px solid var(--line); }

    .docs-grid-three {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Collapse sidebar to drawer at tablet */
@media (max-width: 1024px) {
    .docs-app { grid-template-columns: 1fr; }

    .docs-sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(82vw, 300px);
        transform: translateX(-105%);
        transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: var(--shadow-xl);
        z-index: 50;
    }

    .docs-app.is-sidebar-open .docs-sidebar { transform: translateX(0); }

    .docs-mobile-backdrop {
        position: fixed;
        inset: 0;
        z-index: 45;
        display: block;
        opacity: 0;
        pointer-events: none;
        background: rgba(0,0,0,0.45);
        transition: opacity 0.2s ease;
    }

    .docs-app.is-sidebar-open .docs-mobile-backdrop {
        opacity: 1;
        pointer-events: auto;
    }

    .docs-mobile-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
    .docs-topbar {
        height: auto;
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .docs-topbar-left {
        width: 100%;
        justify-content: space-between;
    }

    .docs-topbar-right {
        width: 100%;
        flex-wrap: wrap;
        gap: 6px;
    }

    .docs-search-shell { max-width: 100%; flex: 1 1 100%; }

    .docs-topbar-selectors { width: 100%; flex-wrap: wrap; gap: 6px; }

    .docs-inline-control { flex: 1 1 120px; }
    .docs-inline-control .docs-select,
    .docs-inline-control .docs-input { min-width: 0; width: 100%; max-width: 100%; }

    .docs-main { padding: 12px; }

    .docs-grid-two,
    .docs-meta-grid,
    .docs-utility-grid,
    .docs-grid-three,
    .docs-sidebar-summary { grid-template-columns: 1fr; }

    .docs-hero { padding: 16px; }
    .docs-section-body { padding: 0 14px 14px; }
    .docs-section-header { padding: 12px 14px; }

    .docs-utility-card { margin: 10px; }

    .docs-hero-title { font-size: 1.35rem; }
    .docs-state-card { padding: 24px 20px; }
}

@media (max-width: 480px) {
    .docs-button,
    .docs-icon-button { width: 100%; }
    .docs-hero-actions,
    .docs-builder-actions,
    .docs-status-row { flex-direction: column; align-items: stretch; }
    .docs-quicknav { display: none; }
    .docs-topbar-selectors { display: none; }
}

/* Responsive refinements for the interactive explorer. These live last so they
   deliberately correct the older, broad mobile rules above. */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
    overflow-x: clip;
}

.docs-skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 200;
    padding: 9px 12px;
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    transform: translateY(-160%);
    transition: transform 0.16s ease;
}

.docs-skip-link:focus {
    transform: translateY(0);
    outline: 3px solid var(--brand-soft);
    outline-offset: 2px;
}

.docs-sidebar-close,
.docs-mobile-controls {
    display: none;
}

.docs-topbar-right,
.docs-topbar-selectors,
.docs-inline-control {
    min-width: 0;
}

.docs-url-card,
.docs-runner-path,
.docs-request-path,
.docs-table td,
.docs-table th {
    overflow-wrap: anywhere;
}

[id^="section-"] {
    scroll-margin-top: 72px;
}

@media (max-width: 1024px) {
    body.docs-scroll-locked {
        overflow: hidden;
        overscroll-behavior: none;
    }

    .docs-sidebar-header {
        position: relative;
        padding-right: 58px;
    }

    .docs-sidebar-close {
        position: absolute;
        top: 14px;
        right: 12px;
        display: inline-flex;
        width: 34px;
        padding: 0;
    }

    .docs-sidebar-summary {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 0 12px;
    }

    .docs-summary-card {
        min-width: 0;
        padding: 9px 6px;
        border-right: 1px solid var(--line);
        border-bottom: 1px solid var(--line);
    }

    .docs-summary-card:nth-child(2n) {
        border-right: none;
    }

    .docs-summary-card:nth-last-child(-n + 2) {
        border-bottom: none;
    }
}

@media (max-width: 768px) {
    .docs-topbar {
        gap: 10px;
    }

    .docs-topbar-left {
        align-items: center;
        justify-content: flex-start;
        gap: 8px;
    }

    .docs-topbar-title {
        flex: 1 1 auto;
    }

    .docs-topbar-subtitle {
        display: block;
        overflow: hidden;
        color: var(--ink-4);
        font-size: 11px;
        line-height: 1.35;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .docs-topbar-right {
        align-items: stretch;
    }

    .docs-quicknav {
        position: static;
        top: auto;
    }

    .docs-aside-sticky {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-url-stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-utility-head {
        flex-wrap: wrap;
    }

    .docs-code-toolbar {
        gap: 8px;
        flex-wrap: wrap;
    }

    .docs-code-actions {
        margin-left: auto;
    }
}

@media (max-width: 640px) {
    .docs-topbar {
        padding: 10px 12px 12px;
    }

    .docs-mobile-controls {
        display: inline-flex;
        flex: 0 0 auto;
        width: auto;
    }

    .docs-topbar-selectors {
        display: none;
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        padding-top: 2px;
    }

    .docs-app.is-controls-open .docs-topbar-selectors {
        display: grid;
    }

    .docs-topbar-selectors .docs-inline-control {
        min-width: 0;
    }

    .docs-topbar-selectors #themeToggle {
        grid-column: 1 / -1;
        width: 100%;
    }

    .docs-inline-control .docs-input,
    .docs-inline-control .docs-select {
        min-height: 42px;
    }

    .docs-search-shell {
        min-width: 0;
    }
}

@media (max-width: 480px) {
    .docs-mobile-toggle,
    .docs-mobile-controls,
    .docs-sidebar-close {
        width: auto;
    }

    .docs-sidebar {
        width: min(88vw, 320px);
    }

    .docs-topbar-title h1 {
        font-size: 13px;
    }

    .docs-topbar-selectors {
        grid-template-columns: minmax(0, 1fr);
    }

    .docs-topbar-selectors #themeToggle {
        grid-column: auto;
    }

    .docs-main {
        padding: 10px;
    }

    .docs-hero {
        padding: 16px;
    }

    .docs-hero-actions,
    .docs-builder-actions {
        width: 100%;
    }

    .docs-hero-actions .docs-button,
    .docs-builder-actions .docs-button {
        width: 100%;
    }

    .docs-section-header,
    .docs-section-body {
        padding-left: 12px;
        padding-right: 12px;
    }

    .docs-code-toolbar,
    .docs-code-block {
        padding-left: 12px;
        padding-right: 12px;
    }

    .docs-code-title {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .docs-code-block,
    .docs-table-wrap {
        -webkit-overflow-scrolling: touch;
    }

    .docs-table {
        min-width: 420px;
    }

    .docs-state-shell {
        padding: 16px;
    }

    .docs-state-card {
        padding: 24px 18px;
    }

    .docs-empty-state,
    .docs-no-results {
        min-height: 220px;
        padding: 24px 16px;
    }

    .docs-toast {
        right: 12px;
        bottom: 12px;
        left: 12px;
        max-width: none;
    }
}

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