:root {
    --black: #050505;
    --panel: #0b0b0b;
    --panel-hover: #131313;
    --white: #f1f1ef;
    --muted: #8c8c89;
    --dim: #838388;
    --line: #232323;
    --line-light: #3a3a3a;
    --warning: #e7c46a;
    --danger: #ef7777;
    --sidebar-w: 280px;
    --topbar-h: 60px;
}

@keyframes xenith-page-enter {
    from { opacity: 0; transform: translateY(10px); filter: blur(3px); }
    to { opacity: 1; transform: none; filter: none; }
}

@keyframes xenith-page-exit {
    from { opacity: 1; transform: none; filter: none; }
    to { opacity: 0; transform: translateY(-7px); filter: blur(2px); }
}

body.page-transition {
    animation: xenith-page-enter 440ms cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

body.page-transition.page-leaving {
    animation: xenith-page-exit 280ms cubic-bezier(0.4, 0, 1, 1) both;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    body.page-transition,
    body.page-transition.page-leaving {
        animation: none;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

[hidden] {
    display: none !important;
}

::selection {
    background: var(--white);
    color: var(--black);
}

html {
    scroll-behavior: smooth;
    scrollbar-color: #333 var(--black);
    scrollbar-width: thin;
}

::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--black);
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border: 3px solid var(--black);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

body {
    min-width: 320px;
    overflow-x: hidden;
    background: var(--black);
    color: var(--white);
    font-family: 'Inter', Arial, sans-serif;
    line-height: 1.55;
}

button,
input {
    color: inherit;
    font: inherit;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 2000;
    padding: 9px 12px;
    background: var(--white);
    color: var(--black);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: none;
}

/* ---------- shell ---------- */

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

.docs-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 200;
    display: flex;
    width: var(--sidebar-w);
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: var(--panel);
}

.docs-sidebar-top {
    display: flex;
    min-height: 60px;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
}

.docs-brand {
    color: var(--white);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: -0.03em;
    text-decoration: none;
}

.docs-sidebar-close {
    display: none;
    color: var(--dim);
    background: none;
    border: 0;
    cursor: pointer;
    padding: 4px;
}

.docs-nav-home {
    display: block;
    margin: 14px 12px 4px;
    padding: 8px 10px;
    border-radius: 7px;
    color: #9a9a97;
    font-size: 13px;
    font-weight: 650;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

.docs-nav-home:hover {
    color: var(--white);
    background: var(--panel-hover);
}

.docs-nav-home.active {
    color: var(--black);
    background: var(--white);
}

.docs-nav {
    flex: 1;
    overflow-y: auto;
    padding: 6px 12px 20px;
}

.docs-nav-group + .docs-nav-group {
    margin-top: 20px;
}

.docs-nav-heading {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    color: var(--dim);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.docs-nav-heading span {
    color: #4c4c4a;
}

.docs-nav-list {
    list-style: none;
}

.docs-nav-list a {
    display: block;
    padding: 7px 10px;
    border-radius: 7px;
    color: #9a9a97;
    font-size: 13px;
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

.docs-nav-list a:hover {
    color: var(--white);
    background: var(--panel-hover);
}

.docs-nav-list a.active {
    color: var(--black);
    background: var(--white);
    font-weight: 650;
}

.docs-sidebar-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    padding: 16px 20px;
    border-top: 1px solid var(--line);
}

.docs-sidebar-foot a {
    color: var(--dim);
    font-size: 11px;
    text-decoration: none;
    transition: color 150ms ease;
}

.docs-sidebar-foot a:hover {
    color: var(--white);
}

.docs-sidebar-foot p {
    width: 100%;
    margin-top: 2px;
    color: #4c4c4a;
    font-size: 10px;
}

.docs-overlay {
    position: fixed;
    inset: 0;
    z-index: 150;
    background: rgba(0, 0, 0, 0.6);
}

/* ---------- main ---------- */

.docs-main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
}

.docs-menu-btn {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 100;
    color: var(--white);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 9px;
    cursor: pointer;
    padding: 8px;
}

.docs-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 56px 32px 140px;
    outline: none;
}

.docs-article-category {
    margin-bottom: 10px;
    color: var(--dim);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.docs-article-head h1 {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    font-size: clamp(32px, 4.2vw, 46px);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: var(--white);
}

.docs-article-lead {
    max-width: 620px;
    margin-top: 14px;
    color: #ababaa;
    font-size: 15.5px;
    line-height: 1.7;
}

.docs-divider {
    margin: 28px 0 26px;
    border: 0;
    border-top: 1px solid var(--line);
}

.docs-overview-note {
    max-width: 620px;
    margin-bottom: 36px;
    padding: 14px 16px;
    border: 1px solid var(--line-light);
    border-radius: 10px;
    background: var(--panel);
    color: var(--dim);
    font-size: 13px;
    line-height: 1.65;
}

.docs-overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    max-width: 620px;
}

.docs-overview-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    color: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.docs-overview-card:hover {
    border-color: var(--line-light);
    background: var(--panel-hover);
    transform: translateY(-2px);
}

.docs-overview-card h3 {
    margin-bottom: 4px;
    color: var(--white);
    font-size: 16px;
    font-weight: 700;
}

.docs-overview-card p {
    color: var(--dim);
    font-size: 12px;
}

.risk-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid currentColor;
    border-radius: 20px;
    color: var(--warning);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.risk-pill.high {
    color: var(--danger);
}

.risk-warning {
    display: flex;
    gap: 12px;
    max-width: 620px;
    margin-bottom: 32px;
    padding: 16px 18px;
    border: 1px solid rgba(231, 196, 106, 0.32);
    border-radius: 10px;
    background: rgba(231, 196, 106, 0.08);
}

.risk-warning svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--warning);
}

.risk-warning strong {
    display: block;
    margin-bottom: 4px;
    color: #f0dca0;
    font-size: 12.5px;
}

.risk-warning p {
    color: #cdbb8e;
    font-size: 12.5px;
    line-height: 1.6;
}

.risk-warning.high {
    border-color: rgba(239, 119, 119, 0.32);
    background: rgba(239, 119, 119, 0.08);
}

.risk-warning.high svg {
    color: var(--danger);
}

.risk-warning.high strong {
    color: #f2b9b9;
}

.risk-warning.high p {
    color: #dba8a8;
}

.settings-heading {
    margin-bottom: 14px;
    color: var(--dim);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.settings-table {
    max-width: 620px;
    border-top: 1px solid var(--line);
}

.setting-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
}

.setting-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 6px;
}

.setting-name {
    color: #ececeb;
    font-size: 14px;
    font-weight: 650;
}

.setting-value {
    flex-shrink: 0;
    color: #9a9a97;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-size: 11.5px;
    text-align: right;
}

.setting-help {
    max-width: 620px;
    color: #8c8c89;
    font-size: 13px;
    line-height: 1.65;
}

.no-settings {
    max-width: 620px;
    padding: 18px 0;
    border-top: 1px solid var(--line);
    color: #8c8c89;
    font-size: 13px;
}

.empty-state {
    padding: 70px 32px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 980px) {
    .docs-sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
        transition: transform 220ms ease;
    }

    .docs-sidebar.open {
        transform: none;
    }

    .docs-sidebar-close {
        display: flex;
    }

    .docs-main {
        margin-left: 0;
    }

    .docs-menu-btn {
        display: flex;
    }

    .docs-content {
        padding-top: 84px;
    }

    body.docs-sidebar-locked {
        overflow: hidden;
    }
}

@media (max-width: 680px) {
    .docs-content {
        padding: 84px 20px 100px;
    }

    .docs-overview-grid {
        grid-template-columns: 1fr;
    }

    .setting-item-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .setting-value {
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    * {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }
}
