/* ============================================
   Ecomail API Docs - Stripe-style Split Panel
   ============================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --sidebar-width: 260px;
    --doc-bg: #ffffff;
    --code-bg: #0e1b33;
    --code-panel-bg: #10213a;
    --code-text: #dbeafe;
    --code-muted: #7f95b6;
    --code-key: #8fb7ff;
    --code-string: #5eead4;
    --code-number: #f6c76f;
    --code-constant: #c4b5fd;
    --code-tag: #7dd3fc;
    --code-attribute: #a7f3d0;
    --code-operator: #93c5fd;
    --code-variable: #f0abfc;
    --code-comment: #7890af;
    --border-color: #e5e7eb;
    --text-primary: #1a1a2e;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --accent-blue: #2563eb;
    --accent-navy: #163b63;
    --accent-soft: #edf3f8;
    --accent-soft-border: rgba(148, 163, 184, 0.24);
    --panel-shadow: 0 24px 48px rgba(15, 23, 42, 0.08);
    --get-color: #22c55e;
    --post-color: #3b82f6;
    --put-color: #f59e0b;
    --delete-color: #ef4444;
    --get-bg: rgba(34, 197, 94, 0.1);
    --post-bg: rgba(59, 130, 246, 0.1);
    --put-bg: rgba(245, 158, 11, 0.1);
    --delete-bg: rgba(239, 68, 68, 0.1);
    --font-sans: 'Cabin', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
    --radius: 8px;
    --transition: 0.2s ease;
}

/* --- Dark theme --- */
[data-theme="dark"] {
    --doc-bg: #0f1117;
    --code-bg: #0e1b33;
    --code-panel-bg: #10213a;
    --border-color: #2a2d3a;
    --text-primary: #e8ecf0;
    --text-secondary: #a0aec0;
    --text-muted: #718096;
}
[data-theme="dark"] .api-sidebar {
    background: #13151c;
}
[data-theme="dark"] .api-sidebar::-webkit-scrollbar-thumb {
    background: #3a3d4a;
}
[data-theme="dark"] .api-main::-webkit-scrollbar-thumb {
    background: #3a3d4a;
}
[data-theme="dark"] .sidebar-link {
    color: #94a3b8;
}
[data-theme="dark"] .sidebar-link:hover {
    background: rgba(255,255,255,0.05);
    color: #e2e8f0;
}
[data-theme="dark"] .sidebar-link.active {
    background: rgba(0, 123, 255, 0.15);
    color: #60a5fa;
}
[data-theme="dark"] .sidebar-section-title {
    color: #4a5568;
}
[data-theme="dark"] .endpoint-url {
    background: #161922;
    border-color: #2a2d3a;
    color: #a0aec0;
}
[data-theme="dark"] .endpoint-path {
    color: #a0aec0;
}
[data-theme="dark"] .endpoint-desc {
    color: #a0aec0;
}
[data-theme="dark"] .endpoint-title {
    color: #e8ecf0;
}
[data-theme="dark"] .group-title {
    color: #e8ecf0;
}
[data-theme="dark"] .group-description {
    color: #a0aec0;
}
[data-theme="dark"] .params-table th {
    border-bottom-color: #2a2d3a;
    color: #64748b;
}
[data-theme="dark"] .params-table td {
    border-bottom-color: #1e2130;
}
[data-theme="dark"] .params-table tr:hover td {
    background: rgba(255,255,255,0.02);
}
[data-theme="dark"] .param-name {
    color: #e2e8f0;
}
[data-theme="dark"] .param-desc {
    color: #94a3b8;
}
[data-theme="dark"] .param-type {
    background: rgba(0,123,255,0.14);
    color: #60a5fa;
}
[data-theme="dark"] .param-default {
    background: rgba(96, 165, 250, 0.16);
    color: #93c5fd;
}
[data-theme="dark"] .params-title {
    color: #4a5568;
}
[data-theme="dark"] .api-note.info {
    background: rgba(59, 130, 246, 0.1);
    border-left-color: #3b82f6;
    color: #93c5fd;
}
[data-theme="dark"] .api-note.warning {
    background: rgba(245, 158, 11, 0.1);
    border-left-color: #f59e0b;
    color: #fcd34d;
}
[data-theme="dark"] .api-note.danger {
    background: rgba(239, 68, 68, 0.1);
    border-left-color: #ef4444;
    color: #fca5a5;
}
[data-theme="dark"] code {
    background: #1e2130;
    color: #f472b6;
}
[data-theme="dark"] .status-item {
    background: #1e2130;
    color: #94a3b8;
}
[data-theme="dark"] .intro-subtitle {
    color: #a0aec0;
}
[data-theme="dark"] .intro-section {
    background: #0f1117;
}
[data-theme="dark"] .intro-info {
    background: #13151c;
    border-color: #2a2d3a;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.24);
}
[data-theme="dark"] .intro-info::before {
    background: rgba(96, 165, 250, 0.14);
    color: #93c5fd;
}
[data-theme="dark"] .intro-title {
    color: #e8ecf0;
}
[data-theme="dark"] .feature-list li {
    color: #94a3b8;
    background: #161922;
    border-color: #2a2d3a;
}
[data-theme="dark"] .feature-list li::before {
    background: #60a5fa;
}
[data-theme="dark"] .response-status {
    color: #e2e8f0;
}
[data-theme="dark"] .code-section-title {
    color: #718096;
}
[data-theme="dark"] .mobile-menu-btn {
    background: rgba(255,255,255,0.08);
}
[data-theme="dark"] .group-header-code,
[data-theme="dark"] .endpoint-code,
[data-theme="dark"] .intro-code {
    background: #0a0c10;
    border-left: 1px solid #1e2130;
}

body {
    font-family: var(--font-sans);
    background: var(--doc-bg);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
}

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

/* --- Top Bar --- */
.api-topbar {
    background: var(--accent-navy);
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    z-index: 100;
    flex-shrink: 0;
    gap: 16px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.api-topbar .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.api-topbar .back-link {
    color: rgba(255,255,255,0.85);
    font-weight: 400;
    font-size: 13px;
    margin-left: auto;
    transition: color var(--transition);
}
.api-topbar .back-link:hover {
    color: #fff;
    text-decoration: none;
}

.api-topbar .search-box {
    margin-left: auto;
    position: relative;
}
.api-topbar .search-box input {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px;
    padding: 5px 12px 5px 32px;
    color: #fff;
    font-size: 13px;
    width: 220px;
    outline: none;
    transition: all var(--transition);
    font-family: var(--font-sans);
}
.api-topbar .search-box input::placeholder {
    color: rgba(255,255,255,0.5);
}
.api-topbar .search-box input:focus {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.5);
    width: 280px;
}
.api-topbar .search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0.5;
    font-size: 13px;
}

/* --- Layout --- */
.api-layout {
    display: flex;
    height: calc(100vh - 48px);
}

/* --- Sidebar --- */
.api-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: #fafbfc;
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 16px 0;
    flex-shrink: 0;
    scrollbar-width: thin;
}
.api-sidebar::-webkit-scrollbar {
    width: 5px;
}
.api-sidebar::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    font-size: 10px;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 8px 20px 4px;
    font-weight: 700;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 20px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition);
    border-left: 3px solid transparent;
}
.sidebar-link:hover {
    color: var(--text-primary);
    background: rgba(0, 123, 255, 0.04);
    text-decoration: none;
}
.sidebar-link.active {
    color: var(--accent-blue);
    background: rgba(0, 123, 255, 0.08);
    border-left-color: var(--accent-blue);
    font-weight: 600;
}

.sidebar-method {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 1px 5px;
    border-radius: 3px;
    flex-shrink: 0;
    font-family: var(--font-mono);
}
.sidebar-method.get { color: var(--get-color); background: var(--get-bg); }
.sidebar-method.post { color: var(--post-color); background: var(--post-bg); }
.sidebar-method.put { color: var(--put-color); background: var(--put-bg); }
.sidebar-method.delete { color: var(--delete-color); background: var(--delete-bg); }

/* --- Main Content (split panel) --- */
.api-main {
    flex: 1;
    overflow-y: auto;
    scroll-behavior: smooth;
    scrollbar-width: thin;
}
.api-main::-webkit-scrollbar {
    width: 6px;
}
.api-main::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 3px;
}

/* --- Endpoint Section --- */
.endpoint-section {
    display: flex;
    min-height: 100px;
    border-bottom: 1px solid var(--border-color);
}

/* Left: description */
.endpoint-info {
    flex: 1;
    padding: 40px 48px;
    max-width: 55%;
}

/* Right: code examples */
.endpoint-code {
    flex: 1;
    background: var(--code-bg);
    padding: 40px 32px;
    max-width: 45%;
    min-width: 45%;
    color: #e2e8f0;
    overflow-x: hidden;
}

/* --- Section header (group separators) --- */
.group-header {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}
.group-header-info {
    flex: 1;
    padding: 48px;
    max-width: 55%;
}
.group-header-code {
    flex: 1;
    background: var(--code-bg);
    max-width: 45%;
    min-width: 45%;
    padding: 48px 32px;
}

.group-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}
.group-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.7;
}

/* --- Endpoint header --- */
.endpoint-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.endpoint-url {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 8px 14px;
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-x: auto;
}

.method-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}
.method-badge.get { color: #fff; background: var(--get-color); }
.method-badge.post { color: #fff; background: var(--post-color); }
.method-badge.put { color: #fff; background: var(--put-color); }
.method-badge.delete { color: #fff; background: var(--delete-color); }

.endpoint-path {
    color: var(--text-secondary);
    word-break: break-all;
}

.endpoint-desc {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.7;
}

/* --- Parameters table --- */
.params-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 24px 0 12px;
}

.params-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.params-table th {
    text-align: left;
    padding: 8px 12px;
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    border-bottom: 2px solid var(--border-color);
    font-weight: 600;
}
.params-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.params-table tr:last-child td {
    border-bottom: none;
}

.param-name {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12.5px;
}
.param-required {
    color: var(--delete-color);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}
.param-optional {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 600;
}
.param-type {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent-blue);
    background: rgba(0,123,255,0.06);
    padding: 1px 6px;
    border-radius: 3px;
}
.param-desc {
    color: var(--text-secondary);
    font-size: 12.5px;
    line-height: 1.5;
}
.param-default {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #1d4ed8;
    background: rgba(37, 99, 235, 0.08);
    padding: 1px 5px;
    border-radius: 3px;
}

/* --- Notes / warnings --- */
.api-note {
    font-size: 13px;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin: 16px 0;
    line-height: 1.6;
}
.api-note.info {
    background: rgba(59, 130, 246, 0.06);
    border-left: 3px solid var(--post-color);
    color: #1e40af;
}
.api-note.warning {
    background: rgba(245, 158, 11, 0.06);
    border-left: 3px solid var(--put-color);
    color: #92400e;
}
.api-note.danger {
    background: rgba(239, 68, 68, 0.06);
    border-left: 3px solid var(--delete-color);
    color: #991b1b;
}

/* --- Response status badges --- */
.response-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 8px;
}
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.status-dot.success { background: var(--get-color); }
.status-dot.error { background: var(--delete-color); }
.status-dot.warning { background: var(--put-color); }

/* --- Code panel elements --- */
.code-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
    margin-top: 24px;
}
.code-section-title:first-child {
    margin-top: 0;
}

.code-block {
    background: var(--code-panel-bg);
    color: var(--code-text);
    border-radius: var(--radius);
    padding: 16px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
    margin-bottom: 16px;
    white-space: pre;
    tab-size: 2;
    position: relative;
}

.code-block .copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: var(--code-muted);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--transition);
    opacity: 0;
}
.code-block:hover .copy-btn {
    opacity: 1;
}
.code-block .copy-btn:hover {
    background: rgba(255,255,255,0.15);
    color: #e2e8f0;
}

.code-header-line {
    color: var(--code-muted);
    margin-bottom: 4px;
}

/* Token colors for JSON highlighting */
.tk-key { color: var(--code-key); }      /* keys */
.tk-str { color: var(--code-string); }      /* string values */
.tk-num { color: var(--code-number); }      /* numbers */
.tk-bool { color: var(--code-constant); }     /* true/false */
.tk-null { color: var(--code-constant); }     /* null */
.tk-brace { color: var(--code-text); }    /* {} [] */
.tk-punct { color: var(--code-muted); }    /* : , */

/* Token colors for code language highlighting (cURL / PHP / JS / Python) */
/* Palette: toolbox blue-violet with teal data accents */
.hl-cmd     { color: var(--code-tag); font-weight: 600; }   /* curl command */
.hl-flag    { color: var(--code-variable); }                     /* -X -H -d flags */
.hl-url     { color: var(--code-string); text-decoration: underline; text-underline-offset: 2px; } /* URLs */
.hl-kw      { color: var(--code-constant); font-weight: 600; }   /* keywords */
.hl-fn      { color: var(--code-tag); }                     /* function names */
.hl-str     { color: var(--code-string); }                     /* strings */
.hl-num     { color: var(--code-number); }                     /* numbers */
.hl-var     { color: var(--code-variable); }                     /* PHP $vars */
.hl-const   { color: var(--code-number); font-weight: 600; }   /* PHP CURLOPT_ constants */
.hl-tag     { color: var(--code-key); }                     /* <?php ?> tags */
.hl-punct   { color: var(--code-muted); }                     /* punctuation */
.hl-comment { color: var(--code-comment); font-style: italic; } /* comments */

/* Response tabs */
.response-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
    margin-top: 24px;
}
.response-tab {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    border: 1px solid transparent;
    transition: all var(--transition);
    font-family: var(--font-sans);
}
.response-tab:hover {
    background: rgba(255,255,255,0.1);
    color: #e2e8f0;
}
.response-tab.active {
    background: rgba(255,255,255,0.12);
    color: #fff;
    border-color: rgba(255,255,255,0.15);
}
.response-tab.success { border-left: 2px solid var(--get-color); }
.response-tab.error { border-left: 2px solid var(--delete-color); }
.response-tab.warning { border-left: 2px solid var(--put-color); }

.response-body {
    display: none;
}
.response-body.active {
    display: block;
}

/* --- Intro section --- */
.intro-section {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(320px, 0.82fr);
    gap: 20px;
    padding: 28px;
    background: var(--accent-soft);
    border-bottom: 1px solid var(--border-color);
}
.intro-info {
    flex: 1;
    padding: 36px 38px;
    max-width: none;
    background: #ffffff;
    border: 1px solid var(--accent-soft-border);
    border-radius: 28px;
    box-shadow: var(--panel-shadow);
    position: relative;
    overflow: hidden;
}
.intro-code {
    flex: 1;
    background: #0f172a;
    padding: 36px 32px;
    max-width: none;
    min-width: 0;
    color: #e2e8f0;
    border-radius: 28px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    box-shadow: var(--panel-shadow);
}

.intro-info::before {
    content: 'API Reference';
    display: inline-flex;
    align-items: center;
    margin-bottom: 16px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

.intro-info::after {
    content: '';
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: #2563eb;
}

.intro-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
    color: var(--accent-navy);
    line-height: 1.08;
}
.intro-subtitle {
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
    max-width: 58ch;
}

.feature-list {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 10px;
}
.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    font-size: 14px;
    color: #334155;
    background: #f7fafd;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
}
.feature-list li::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #2563eb;
    font-weight: 700;
    flex: 0 0 auto;
    margin-top: 8px;
}

/* --- Try It Sandbox Panel --- */
.try-it-trigger {
    margin-bottom: 20px;
}
.try-it-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #94a3b8;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
}
.try-it-btn:hover {
    background: rgba(59,130,246,0.2);
    border-color: rgba(59,130,246,0.4);
    color: #e2e8f0;
}
.try-it-btn.active {
    background: rgba(59,130,246,0.25);
    border-color: var(--accent-blue);
    color: #fff;
}
.try-it-panel {
    margin-bottom: 20px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: var(--radius);
    overflow: hidden;
}
.try-it-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: rgba(255,255,255,0.04);
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.try-it-title {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
}
.try-it-badge {
    font-size: 9px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(59,130,246,0.2);
    color: #60a5fa;
    text-transform: uppercase;
}
.try-it-close {
    margin-left: auto;
    background: none;
    border: none;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all var(--transition);
}
.try-it-close:hover { color: #e2e8f0; background: rgba(255,255,255,0.08); }

/* Mode toggle */
.try-it-mode-toggle {
    display: flex;
    gap: 0;
    margin-left: auto;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.try-it-mode-btn {
    padding: 4px 12px;
    font-size: 10px;
    font-weight: 600;
    font-family: var(--font-sans);
    text-transform: uppercase;
    background: transparent;
    color: #64748b;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
}
.try-it-mode-btn:hover { color: #94a3b8; background: rgba(255,255,255,0.04); }
.try-it-mode-btn.active { background: rgba(255,255,255,0.1); color: #e2e8f0; }
.try-it-mode-btn[data-mode="live"].active { background: rgba(239,68,68,0.2); color: #f87171; }
.try-it-badge-live { background: rgba(239,68,68,0.25) !important; color: #f87171 !important; }
.try-it-panel.try-it-live { border-color: rgba(239,68,68,0.25); }
.try-it-panel.try-it-live .try-it-header { border-bottom-color: rgba(239,68,68,0.15); }
/* API key input row */
.try-it-apikey-row {
    padding: 10px 14px 0;
}
.try-it-apikey-row .try-it-label {
    margin-bottom: 6px;
}
.try-it-apikey-row .try-it-field {
    margin: 0;
}
.try-it-apikey {
    width: 100%;
    padding: 7px 10px;
    font-size: 12px;
    font-family: var(--font-mono);
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: 5px;
    color: #e2e8f0;
    box-sizing: border-box;
}
.try-it-apikey:focus {
    outline: none;
    border-color: rgba(239,68,68,0.5);
    box-shadow: 0 0 0 2px rgba(239,68,68,0.1);
}
.try-it-apikey::placeholder {
    color: #64748b;
}
.try-it-live-indicator {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(239,68,68,0.2);
    color: #f87171;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
}

.try-it-section {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.try-it-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 10px;
}
.try-it-field {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.try-it-field label {
    flex-shrink: 0;
    min-width: 100px;
    font-size: 12px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: #89b4fa;
}
.try-it-req {
    color: var(--delete-color);
    font-size: 10px;
}
.try-it-field input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: all var(--transition);
    background: rgba(0,0,0,0.25);
    color: #e2e8f0;
}
.try-it-field input::placeholder { color: #4a5568; }
.try-it-field input:focus {
    border-color: rgba(59,130,246,0.5);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: rgba(0,0,0,0.35);
}
.try-it-field select {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-sans);
    outline: none;
    transition: all var(--transition);
    background: rgba(0,0,0,0.25);
    color: #e2e8f0;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2364748b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}
.try-it-field select:focus {
    border-color: rgba(59,130,246,0.5);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background-color: rgba(0,0,0,0.35);
}
.try-it-field select option {
    background: #1e293b;
    color: #e2e8f0;
}
.try-it-hint {
    display: block;
    font-size: 11px;
    color: #64748b;
    margin-top: 4px;
    line-height: 1.4;
}
/* Code editor: overlay textarea over highlighted pre */
.try-it-editor-wrap {
    position: relative;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 6px;
    overflow: hidden;
    background: rgba(0,0,0,0.25);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.try-it-editor-wrap:focus-within {
    border-color: rgba(59,130,246,0.5);
    box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
    background: rgba(0,0,0,0.35);
}
.try-it-editor-highlight,
.try-it-body {
    margin: 0;
    padding: 12px 14px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-height: 120px;
    box-sizing: border-box;
    width: 100%;
    tab-size: 2;
}
.try-it-editor-highlight {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    color: #e2e8f0;
    overflow: auto;
}
.try-it-body {
    position: relative;
    background: transparent;
    color: transparent;
    caret-color: #e2e8f0;
    border: none;
    outline: none;
    resize: vertical;
    z-index: 1;
}
.try-it-body::placeholder { color: #4a5568; }
.try-it-body.try-it-body-error {
    caret-color: #f87171;
}
.try-it-editor-wrap:has(.try-it-body-error) {
    border-color: rgba(239,68,68,0.4);
}
.try-it-json-error {
    padding: 6px 14px;
    font-size: 11px;
    font-family: var(--font-mono);
    color: #f87171;
    background: rgba(239,68,68,0.08);
    border-top: 1px solid rgba(239,68,68,0.15);
}
.try-it-actions {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.try-it-send {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-sans);
    background: rgba(59,130,246,0.12);
    color: #7ba4f0;
    border: 1px solid rgba(59,130,246,0.3);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.try-it-send:hover { background: rgba(59,130,246,0.22); border-color: rgba(59,130,246,0.5); color: #93b8f7; }
.try-it-send:disabled { opacity: 0.5; cursor: default; }
.try-it-send-icon { font-size: 10px; }
.try-it-spinner {
    display: inline-block;
    width: 12px; height: 12px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tryit-spin 0.6s linear infinite;
}
@keyframes tryit-spin { to { transform: rotate(360deg); } }
.try-it-status-code {
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-mono);
    padding: 3px 10px;
    border-radius: 4px;
}
.try-it-status-code.success { color: #fff; background: var(--get-color); }
.try-it-status-code.error { color: #fff; background: var(--delete-color); }
.try-it-status-code.warning { color: #fff; background: var(--put-color); }
.try-it-result {
    padding: 12px 16px 16px;
}
.try-it-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.try-it-result-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: #94a3b8;
}
.try-it-latency {
    font-size: 11px;
    font-family: var(--font-mono);
    color: #64748b;
}
.try-it-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 10px;
}
.try-it-meta-item {
    font-size: 12px;
    color: #94a3b8;
    font-family: var(--font-mono);
}
.try-it-meta-item strong {
    color: #e2e8f0;
}
.try-it-response {
    background: var(--code-panel-bg);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: var(--radius);
    padding: 14px 16px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    tab-size: 2;
    color: #e2e8f0;
    max-height: 400px;
    overflow-y: auto;
    margin: 0;
}

/* --- Mobile Responsive --- */
@media (max-width: 1024px) {
    .api-sidebar {
        display: none;
    }
    .mobile-menu-btn {
        display: flex !important;
    }
    .api-sidebar.mobile-open {
        display: block;
        position: fixed;
        top: 48px;
        left: 0;
        bottom: 0;
        z-index: 999;
        box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    }
}

@media (max-width: 768px) {
    .endpoint-section,
    .group-header {
        flex-direction: column;
    }
    .intro-section {
        grid-template-columns: 1fr;
        padding: 18px 16px;
    }
    .endpoint-info,
    .endpoint-code,
    .intro-info,
    .intro-code,
    .group-header-info,
    .group-header-code {
        max-width: 100%;
        min-width: 100%;
    }
    .endpoint-info,
    .intro-info,
    .group-header-info {
        padding: 24px 20px;
    }
    .endpoint-code,
    .intro-code,
    .group-header-code {
        padding: 24px 20px;
    }
    .api-topbar .search-box {
        display: none;
    }
    .api-topbar .topbar-auth-link {
        display: none;
    }
    .api-topbar .back-link {
        font-size: 0;
        margin-left: auto;
    }
    .api-topbar .back-link::before {
        content: '\2190';
        font-size: 16px;
    }
}

.mobile-menu-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* --- Theme toggle --- */
.theme-toggle {
    background: rgba(255,255,255,0.12);
    border: none;
    border-radius: 6px;
    color: #fff;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 15px;
    transition: background var(--transition);
    flex-shrink: 0;
    line-height: 1;
}
.theme-toggle:hover {
    background: rgba(255,255,255,0.22);
}
.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
}
.mobile-overlay.active {
    display: block;
}

/* --- Anchor links --- */
.anchor-link {
    display: inline-flex;
    align-items: center;
    font-size: 0.7em;
    font-weight: 400;
    color: var(--text-muted);
    opacity: 0;
    margin-left: 8px;
    vertical-align: middle;
    text-decoration: none;
    transition: opacity var(--transition), color var(--transition);
    user-select: none;
    font-family: var(--font-mono);
}
.endpoint-title:hover .anchor-link,
.group-title:hover .anchor-link,
.intro-title:hover .anchor-link {
    opacity: 1;
}
.anchor-link:hover {
    color: var(--accent-blue);
    text-decoration: none;
}
.anchor-link.anchor-copied {
    color: var(--get-color);
    opacity: 1;
    font-family: var(--font-sans);
    font-size: 0.6em;
}
[data-theme="dark"] .anchor-link {
    color: #4a5568;
}
[data-theme="dark"] .anchor-link:hover {
    color: #60a5fa;
}
[data-theme="dark"] .anchor-link.anchor-copied {
    color: var(--get-color);
}

/* --- Scrollspy active highlight --- */
.api-main .endpoint-section:target {
    animation: highlight-fade 1.5s ease;
}
@keyframes highlight-fade {
    0% { background: rgba(0, 123, 255, 0.03); }
    100% { background: transparent; }
}

/* --- Status codes inline --- */
code {
    font-family: var(--font-mono);
    font-size: 12px;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 3px;
    color: #e11d48;
}

/* Inline list of statuses */
.status-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}
.status-item {
    font-size: 11px;
    font-family: var(--font-mono);
    padding: 2px 8px;
    border-radius: 4px;
    background: #f1f5f9;
    color: var(--text-secondary);
}

/* ============================================
   Feature: Deprecation + Version badges
   ============================================ */
.ep-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    vertical-align: middle;
    text-transform: uppercase;
    font-family: var(--font-sans);
    margin-left: 6px;
}
.ep-badge-deprecated {
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.ep-badge-version {
    background: rgba(59, 130, 246, 0.1);
    color: #1d4ed8;
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.ep-badge-updated {
    background: rgba(139, 92, 246, 0.1);
    color: #5b21b6;
    border: 1px solid rgba(139, 92, 246, 0.25);
}
[data-theme="dark"] .ep-badge-deprecated { color: #fcd34d; background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.25); }
[data-theme="dark"] .ep-badge-version    { color: #60a5fa; background: rgba(59,130,246,0.12); border-color: rgba(59,130,246,0.25); }
[data-theme="dark"] .ep-badge-updated    { color: #c4b5fd; background: rgba(139,92,246,0.12); border-color: rgba(139,92,246,0.25); }

/* Deprecated endpoint styling */
.ep-deprecated .endpoint-info {
    opacity: 0.75;
}
.ep-deprecated .endpoint-url {
    border-style: dashed;
}
.ep-deprecation-note {
    margin-bottom: 16px;
}
/* Sidebar deprecated */
.sidebar-link-deprecated {
    text-decoration: line-through;
    opacity: 0.7;
}
.sidebar-link-deprecated:hover {
    opacity: 0.9;
    text-decoration: line-through;
}
.sidebar-badge-deprecated {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(245, 158, 11, 0.12);
    color: #92400e;
    text-transform: uppercase;
    margin-left: 4px;
}
.sidebar-badge-new {
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 3px;
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
    text-transform: uppercase;
    margin-left: 4px;
}
[data-theme="dark"] .sidebar-badge-deprecated { color: #fcd34d; background: rgba(245,158,11,0.14); }
[data-theme="dark"] .sidebar-badge-new        { color: #86efac; background: rgba(34,197,94,0.12); }

/* ============================================
   Feature: Code language tabs
   ============================================ */
.lang-tabs-wrap {
    margin-bottom: 16px;
}
.lang-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    padding-bottom: 0;
}
.lang-tab {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-sans);
    background: transparent;
    color: #64748b;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: -1px;
}
.lang-tab:hover {
    color: #94a3b8;
    background: rgba(255,255,255,0.04);
}
.lang-tab.active {
    color: #e2e8f0;
    border-bottom-color: var(--accent-blue);
}
.lang-tab-content {
    display: none;
}
.lang-tab-content.active {
    display: block;
}
.lang-tab-content .code-block {
    border-radius: 0 0 var(--radius) var(--radius);
    margin-top: 0;
}

/* ============================================
   Feature: Params required-only toggle
   ============================================ */
.params-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 24px 0 12px;
}
.params-title-row .params-title {
    margin: 0;
}
.params-req-toggle {
    font-size: 11px;
    font-weight: 600;
    color: var(--accent-blue);
    background: none;
    border: 1px solid rgba(0, 123, 255, 0.2);
    border-radius: 4px;
    padding: 3px 10px;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all var(--transition);
    white-space: nowrap;
}
.params-req-toggle:hover {
    background: rgba(0, 123, 255, 0.06);
    border-color: rgba(0, 123, 255, 0.4);
}
[data-theme="dark"] .params-req-toggle {
    color: #60a5fa;
    border-color: rgba(96, 165, 250, 0.25);
}
[data-theme="dark"] .params-req-toggle:hover {
    background: rgba(96, 165, 250, 0.08);
    border-color: rgba(96, 165, 250, 0.4);
}

/* ============================================
   Feature: Collapsible JSON
   ============================================ */
.cj-toggle {
    cursor: pointer;
    user-select: none;
}
.cj-toggle:hover > .tk-brace {
    text-decoration: underline dotted;
}
.cj-preview {
    font-style: italic;
    color: #a6adc8;
    opacity: 0.7;
    margin-left: 4px;
}
.cj-preview.cj-hidden {
    display: none;
}
.cj-body {
    display: inline;
}
.cj-indent {
    display: block;
    padding-left: 1.5em;
}

/* ============================================
   Feature: Sticky group bar
   ============================================ */
.sticky-group-bar {
    pointer-events: none;
    z-index: 50;
}
.sticky-group-label {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    background: var(--doc-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 6px 48px;
    width: 55%;
    box-sizing: border-box;
}
[data-theme="dark"] .sticky-group-label {
    background: var(--doc-bg);
    color: #4a5568;
}

/* ============================================
   Feature: Keyboard nav hint in search
   ============================================ */
.api-topbar .search-box::after {
    content: 'Ctrl+K';
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: 600;
    color: rgba(255,255,255,0.35);
    pointer-events: none;
    font-family: var(--font-mono);
    opacity: 1;
    transition: opacity var(--transition);
}
.api-topbar .search-box input:focus ~ *,
.api-topbar .search-box:focus-within::after {
    opacity: 0;
}
