html { scroll-padding-top: 100px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
:focus-visible { outline: 2px solid var(--accent-main); outline-offset: 2px; }

.doc-hub-head { padding-top: 150px; }
.doc-hub-title {
    margin-bottom: 14px;
    font-size: 3em;
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -1.5px;
    background: linear-gradient(135deg, var(--accent-text), var(--accent-main));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.doc-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 28px 0 22px; }
.doc-tools .filters { margin: 0; }

.doc-search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 280px;
    max-width: 420px;
    padding: 0 16px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-text);
    transition: border-color 0.25s ease, background 0.25s ease;
}
.doc-search:focus-within { border-color: rgba(var(--accent-rgb), 0.5); background: rgba(var(--accent-rgb), 0.06); }
.doc-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 14px;
}
.doc-search input::placeholder { color: rgba(255, 255, 255, 0.4); }

.bento-stretch { color: inherit; text-decoration: none; }
.bento-stretch::after { content: ''; position: absolute; inset: 0; z-index: 0; }

.doc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; list-style: none; position: relative; z-index: 1; }
.doc-chips a,
.doc-chips span {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--accent-text);
    font-size: 0.8em;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.doc-chips a:hover { background: rgba(var(--accent-rgb), 0.12); border-color: rgba(var(--accent-rgb), 0.35); color: #fff; }
.doc-chips--static { margin-top: 8px; }

.doc-empty { margin-top: 24px; color: var(--accent-text); opacity: 0.8; }
.doc-empty a { color: var(--accent-main); }

.callout {
    display: flex;
    gap: 14px;
    margin: 20px 0;
    padding: 14px 16px;
    border-left: 4px solid var(--callout, #3b82f6);
    border-radius: 0 10px 10px 0;
    background: color-mix(in srgb, var(--callout, #3b82f6) 9%, transparent);
    color: #d1d5db;
    font-size: 0.95em;
    line-height: 1.6;
}
.callout strong { display: block; margin-bottom: 4px; color: var(--callout, #3b82f6); font-size: 1.02em; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }
.callout .doc-list { margin-top: 8px; }
.callout-icon { flex-shrink: 0; font-size: 1.2em; line-height: 1.5; }
.callout--info   { --callout: #60a5fa; }
.callout--warn   { --callout: var(--warn-main); }
.callout--dev    { --callout: var(--warn-main); }
.callout--danger { --callout: #f87171; }

.callout-icon {
    color: var(--callout);
    display: flex;
    align-items: center;
}

.doc-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr) 220px;
    gap: 32px;
    align-items: start;
    max-width: 1320px;
    margin: 0 auto;
    padding: 120px 24px 96px;
}

.doc-sidebar {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 120px);
    overflow: hidden;
    background: rgba(12, 12, 12, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 16px;
}

.doc-sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.1);
}
.doc-sidebar-title { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; text-decoration: none; }
.doc-sidebar-title svg { color: var(--accent-main); }
.doc-sidebar-close { display: none; }

.doc-nav { flex: 1; padding: 14px 0; overflow-y: auto; }
.doc-nav::-webkit-scrollbar { width: 6px; }
.doc-nav::-webkit-scrollbar-thumb { background: rgba(var(--accent-rgb), 0.3); border-radius: 3px; }

.doc-nav-section { margin-bottom: 18px; }
.doc-nav-title {
    padding: 0 20px 8px;
    color: rgba(var(--accent-rgb), 0.6);
    font-size: 0.72em;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.doc-nav-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--accent-text);
    font-size: 0.93em;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease;
}
.doc-nav-item span:not(.doc-dot) { flex: 1; min-width: 0; }
.doc-nav-item svg { flex-shrink: 0; opacity: 0.85; }
.doc-nav-item::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--accent-main);
    transform: scaleY(0);
    transition: transform 0.25s ease;
}
.doc-nav-item:hover { background: rgba(var(--accent-rgb), 0.05); }
.doc-nav-item.active { background: rgba(var(--accent-rgb), 0.1); color: var(--accent-main); font-weight: 600; }
.doc-nav-item.active::before { transform: scaleY(1); }

.doc-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.doc-dot--dev { background: var(--warn-main); box-shadow: 0 0 8px rgba(var(--warn-rgb), 0.7); }

.doc-sidebar-foot { padding: 16px 20px; border-top: 1px solid rgba(var(--accent-rgb), 0.1); }
.doc-sidebar-foot .btn { width: 100%; }

.doc-overlay, .doc-mobilebar { display: none; }

.doc-main { min-width: 0; }

.doc-crumbs { display: flex; gap: 8px; margin-bottom: 18px; color: var(--accent-text); font-size: 0.85em; opacity: 0.7; }
.doc-crumbs a { color: inherit; text-decoration: none; }
.doc-crumbs a:hover { color: #fff; }

.doc-header .bento-icon svg {
    color: var(--accent-main);
}
.doc-nav-item svg {
    color: var(--accent-text);
    opacity: 0.7;
}
.doc-nav-item.active svg {
    color: var(--accent-main);
    opacity: 1;
}

.doc-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.doc-header .bento-icon { width: 56px; height: 56px; flex-shrink: 0; }
.doc-header > div { flex: 1; min-width: 0; }
.doc-header h1 { margin-bottom: 6px; color: #fff; font-size: 2.2em; line-height: 1.1; letter-spacing: -1px; }
.doc-header p { max-width: 60ch; color: var(--accent-text); line-height: 1.55; opacity: 0.8; }

.doc-content { color: #d1d5db; line-height: 1.7; }
.doc-content > * + * { margin-top: 14px; }

.doc-content h2 {
    margin-top: 44px;
    margin-bottom: 4px;
    color: #fff;
    font-size: 1.55em;
    letter-spacing: -0.3px;
}
.doc-content h2::after {
    content: '';
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 8px;
    border-radius: 3px;
    background: var(--accent-main);
}
.doc-content h2:first-child { margin-top: 0; }
.doc-content h3 { margin-top: 28px; color: var(--accent-text); font-size: 1.15em; }
.doc-content p { max-width: 74ch; }
.doc-content a { color: var(--accent-text); text-underline-offset: 3px; }
.doc-content a:hover { color: var(--accent-text); }
.doc-content a.btn { text-decoration: none; }
.doc-content strong { color: #fff; }
.doc-content [id] { scroll-margin-top: 100px; }

.doc-lead { font-size: 1.15em; }
.doc-muted { color: rgba(255, 255, 255, 0.45); font-style: italic; }
.doc-sign { margin-top: 28px; }

.doc-list, .doc-steps { padding-left: 22px; }
.doc-list li, .doc-steps li { margin-bottom: 6px; max-width: 74ch; }
.doc-list li::marker, .doc-steps li::marker { color: var(--accent-main); font-weight: 700; }

.doc-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }

.cmd {
    padding: 2px 7px;
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: 6px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent-text);
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.88em;
    white-space: nowrap;
}

.cmd-list { list-style: none; border: 1px solid rgba(255, 255, 255, 0.07); border-radius: 12px; overflow: hidden; }
.cmd-list li {
    display: grid;
    grid-template-columns: minmax(150px, max-content) 1fr;
    align-items: baseline;
    gap: 6px 20px;
    padding: 12px 16px;
    background: rgba(30, 30, 30, 0.35);
}
.cmd-list li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.cmd-list .cmd { justify-self: start; }

.doc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.doc-card {
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(30, 30, 30, 0.4);
}
.doc-card h3 { margin: 0 0 8px; color: #fff; font-size: 1.05em; }
.doc-card p { margin: 0; font-size: 0.95em; }
.doc-card .doc-list { margin-top: 4px; font-size: 0.95em; }

.doc-demo {
    padding: 10px 0;
    border: 1px solid rgba(var(--accent-rgb), 0.15);
    border-radius: 14px;
    background: rgba(18, 18, 18, 0.7);
}

.doc-faq { display: flex; flex-direction: column; gap: 10px; }
.doc-faq details {
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(30, 30, 30, 0.4);
    transition: border-color 0.25s ease;
}
.doc-faq details[open] { border-color: rgba(var(--accent-rgb), 0.35); }
.doc-faq summary { padding: 16px 20px; color: #fff; font-weight: 600; cursor: pointer; }
.doc-faq summary:hover { color: var(--accent-text); }
.doc-faq p { padding: 0 20px 16px; }

.table-wrap { overflow-x: auto; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 12px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
.doc-table th {
    padding: 12px 16px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--accent-text);
    font-size: 0.85em;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
}
.doc-table td { padding: 12px 16px; vertical-align: top; background: rgba(30, 30, 30, 0.35); }
.doc-table tr + tr td { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.doc-table--api td:nth-child(4) { line-height: 2; }
.doc-table .cmd { white-space: normal; word-break: break-word; }

.method, .http {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 6px;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.8em;
    font-weight: 700;
}
.method--get   { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.method--post  { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.method--patch { background: rgba(var(--warn-rgb), 0.15); color: var(--warn-main); border: 1px solid rgba(var(--warn-rgb), 0.3); }
.http--ok   { background: rgba(16, 185, 129, 0.12); color: #34d399; }
.http--err  { background: rgba(248, 113, 113, 0.12); color: #f87171; }
.http--info { background: rgba(96, 165, 250, 0.12); color: #60a5fa; }
.doc-codes { list-style: none; }
.doc-codes li { margin-bottom: 8px; }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; }
.doc-pager-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    background: rgba(30, 30, 30, 0.4);
    text-decoration: none;
    transition: border-color 0.25s ease, background 0.25s ease;
}
.doc-pager-link:hover { border-color: rgba(var(--accent-rgb), 0.4); background: rgba(var(--accent-rgb), 0.06); }
.doc-pager-link small { color: var(--accent-text); opacity: 0.6; }
.doc-pager-link strong { color: #fff; }
.doc-pager-link--next { grid-column: 2; text-align: right; }

.doc-toc { position: sticky; top: 100px; max-height: calc(100vh - 120px); overflow-y: auto; font-size: 0.88em; }
.doc-toc h4 {
    margin-bottom: 12px;
    color: rgba(var(--accent-rgb), 0.6);
    font-size: 0.78em;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.doc-toc ul { list-style: none; border-left: 1px solid rgba(255, 255, 255, 0.1); }
.doc-toc a {
    display: block;
    margin-left: -1px;
    padding: 6px 14px;
    border-left: 2px solid transparent;
    color: var(--accent-text);
    opacity: 0.7;
    text-decoration: none;
    transition: opacity 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.doc-toc a:hover { opacity: 1; }
.doc-toc a.active { border-left-color: var(--accent-main); color: var(--accent-main); opacity: 1; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .doc-layout { grid-template-columns: 260px minmax(0, 1fr); }
    .doc-toc { display: none; }
}

@media (max-width: 992px) {
    .doc-layout { grid-template-columns: minmax(0, 1fr); padding-top: 100px; }

    .doc-sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        z-index: 1100;
        width: 290px;
        max-height: none;
        border-radius: 0 16px 16px 0;
        transform: translateX(-105%);
        transition: transform 0.3s ease;
    }
    .doc-sidebar.is-open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5); }
    .doc-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 32px; height: 32px;
        border: 1px solid rgba(var(--accent-rgb), 0.3);
        border-radius: 8px;
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent-text);
        cursor: pointer;
    }

    .doc-overlay {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1090;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(4px);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    .doc-overlay.is-open { opacity: 1; visibility: visible; }
    body.doc-drawer-open { overflow: hidden; }

    .doc-mobilebar {
        display: flex;
        align-items: center;
        gap: 14px;
        position: sticky;
        top: 92px;
        z-index: 90;
        margin-bottom: 20px;
        padding: 10px 14px;
        border: 1px solid rgba(var(--accent-rgb), 0.2);
        border-radius: 14px;
        background: rgba(12, 12, 12, 0.92);
        backdrop-filter: blur(15px);
        color: #fff;
        font-weight: 600;
    }
    .doc-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px; height: 40px;
        border: 1px solid rgba(var(--accent-rgb), 0.3);
        border-radius: 8px;
        background: rgba(var(--accent-rgb), 0.1);
        color: var(--accent-text);
        cursor: pointer;
    }
}

@media (max-width: 620px) {
    .doc-layout { padding: 90px 16px 72px; }
    .doc-hub-title { font-size: 2.2em; }
    .doc-header { flex-direction: column; gap: 14px; }
    .doc-header h1 { font-size: 1.8em; }
    .doc-grid { grid-template-columns: 1fr; }
    .cmd-list li { grid-template-columns: 1fr; }
    .doc-pager { grid-template-columns: 1fr; }
    .doc-pager-link--next { grid-column: 1; text-align: left; }
}