:root {
    --bg: #0b1220;
    --panel: rgba(255, 255, 255, 0.72);
    --panel-strong: rgba(255, 255, 255, 0.9);
    --line: rgba(15, 23, 42, 0.1);
    --line-strong: rgba(15, 23, 42, 0.14);
    --text: #132033;
    --muted: #5d6b82;
    --brand: #3f6fff;
    --brand-soft: rgba(63, 111, 255, 0.12);
    --success: #0f9f6e;
    --shadow: 0 20px 60px rgba(12, 18, 28, 0.18);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --topbar-h: 78px;
    --content-width: 860px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, system-ui, sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, rgba(80, 120, 255, 0.22), transparent 28%), radial-gradient(circle at top right, rgba(36, 189, 180, 0.14), transparent 20%), linear-gradient(180deg, #eef3ff 0%, #f8fbff 44%, #eef4f7 100%);
}

a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

    a:hover,
    a:focus-visible {
        color: #315bde;
    }

.brand,
.topbar-link,
.tree-nav__group-link,
.tree-nav__item,
.toc-nav a,
.breadcrumb a,
.mini-card,
.primary-btn,
.secondary-btn,
.ghost-btn {
    text-decoration: none;
}

.brand,
.topbar-link,
.tree-nav__group-link,
.tree-nav__item,
.mini-card {
    color: var(--text);
}

.toc-nav a {
    color: var(--muted);
}

.breadcrumb a {
    color: var(--brand);
}

.feature-card h2 a {
    color: var(--text);
    text-decoration: none;
}

    .feature-card h2 a:hover,
    .feature-card h2 a:focus-visible {
        color: var(--brand);
        text-decoration: underline;
    }

img {
    display: block;
    max-width: 100%;
}

.app-shell {
    min-height: 100vh;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    height: var(--topbar-h);
    display: grid;
    grid-template-columns: 320px 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 14px 24px;
    backdrop-filter: blur(18px);
    background: rgba(255, 255, 255, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 30px rgba(20, 25, 40, 0.06);
}

.topbar__left,
.topbar__center,
.topbar__right {
    display: flex;
    align-items: center;
}

.topbar__right {
    justify-content: flex-end;
    gap: 10px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand__logo {
    width: 42px;
    height: 42px;
}

.brand__title {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.brand__subtitle {
    color: var(--muted);
    font-size: 0.78rem;
}

.searchbar {
    width: min(760px, 100%);
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--panel-strong);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 16px;
    box-shadow: 0 12px 28px rgba(30, 45, 90, 0.08);
}

    .searchbar svg {
        width: 18px;
        color: var(--muted);
    }

    .searchbar input {
        border: 0;
        outline: none;
        background: transparent;
        font: inherit;
        color: var(--text);
    }

.searchbar__hint {
    color: var(--muted);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.85rem;
}

.layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 26px;
    max-width: 1680px;
    padding: 26px;
    margin: 0 auto;
}

.article-layout {
    grid-template-columns: 280px minmax(0, var(--content-width)) 280px;
    justify-content: center;
}

.sidebar,
.right-panel,
.hero-card,
.content-card,
.feature-card,
.info-panel,
.doc-article,
.sidebar__card,
.mini-card,
.sticky-card {
    backdrop-filter: blur(18px);
}

.sidebar {
    position: sticky;
    top: calc(var(--topbar-h) + 18px);
    align-self: start;
    border: 1px solid rgba(255, 255, 255, 0.62);
    background: var(--panel);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 20px;
}

.sidebar__section + .sidebar__section {
    margin-top: 22px;
}

.sidebar__label {
    color: var(--muted);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 12px;
    font-weight: 700;
}

.tree-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tree-nav__folder {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tree-nav__group,
.tree-nav__group-link,
.tree-nav__item,
.tree-nav__group-label {
    display: block;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
}

.tree-nav__group,
.tree-nav__group-link,
.tree-nav__group-label {
    font-weight: 700;
}

.tree-nav__group {
    position: relative;
    width: 100%;
    cursor: pointer;
}

    .tree-nav__group::after {
        content: "+";
        position: absolute;
        right: 12px;
        color: var(--muted);
    }

    .tree-nav__group.open::after {
        content: "–";
    }

    .tree-nav__item:hover,
    .tree-nav__group:hover,
    .tree-nav__group-link:hover,
    .topbar-link:hover,
    .mini-card:hover,
    .toc-nav a:hover {
        background: rgba(255, 255, 255, 0.55);
    }

.tree-nav__group-link.active,
.tree-nav__item.active {
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
}

.tree-nav__children {
    display: none;
    margin: 4px 0 8px 8px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

    .tree-nav__children.visible {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

.sidebar__card {
    padding: 16px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 18px;
}

.mini-card {
    display: block;
    margin-top: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 14px;
}

    .mini-card span {
        display: block;
        margin-top: 5px;
        color: var(--muted);
        font-size: 0.92rem;
    }

.content {
    min-width: 0;
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.8fr);
    gap: 26px;
    padding: 34px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 255, 0.68));
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.hero-card h1,
.doc-article h1 {
    margin: 16px 0 12px;
    font-size: clamp(2rem, 3vw, 3.35rem);
    letter-spacing: -0.04em;
    line-height: 1.02;
}

.hero-card p,
.doc-article p,
.doc-article li {
    color: #31435f;
    font-size: 1.03rem;
    line-height: 1.75;
}

.hero-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.primary-btn,
.secondary-btn,
.ghost-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-weight: 700;
}

.primary-btn {
    color: white;
    background: linear-gradient(135deg, #4d75ff, #315bde);
    box-shadow: 0 14px 30px rgba(49, 91, 222, 0.28);
}

.secondary-btn,
.ghost-btn,
.topbar-link {
    color: var(--text);
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.68);
}

.topbar-link {
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 600;
}

.hero-card__panel,
.preview-panel,
.sticky-card {
    padding: 22px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 20px;
}

.status-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 18px;
    padding: 18px;
    background: linear-gradient(135deg, rgba(63, 111, 255, 0.12), rgba(36, 189, 180, 0.08));
    border-radius: 18px;
}

    .status-block span {
        color: var(--muted);
        font-size: 0.88rem;
    }

    .status-block strong {
        font-size: 1.03rem;
    }

.feature-list {
    margin: 0;
    padding-left: 18px;
    color: #31435f;
    line-height: 1.8;
}

.section-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.feature-card,
.content-card,
.doc-article,
.info-panel {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.7));
    border: 1px solid rgba(255, 255, 255, 0.68);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.feature-card {
    padding: 24px;
}

.feature-card__kicker {
    color: var(--brand);
    font-size: 0.84rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.feature-card h2,
.section-heading h2,
.doc-article h2 {
    letter-spacing: -0.03em;
}

.feature-card h2 {
    margin: 10px 0 8px;
    font-size: 1.45rem;
}

.feature-card p {
    margin: 0;
    color: var(--muted);
    line-height: 1.7;
}

.content-card {
    margin-top: 24px;
    padding: 28px;
}

.section-heading h2 {
    margin: 14px 0 10px;
    font-size: 2rem;
}

.section-heading + p {
    color: #31435f;
}

.info-panel__title {
    margin-bottom: 14px;
    font-weight: 800;
}

.meta-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

    .meta-list div {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding-bottom: 12px;
        border-bottom: 1px solid var(--line);
    }

    .meta-list dt {
        color: var(--muted);
    }

    .meta-list dd {
        margin: 0;
        font-weight: 700;
        text-align: right;
    }

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.92rem;
}

.doc-article {
    padding: 34px 38px;
}

.doc-article__header {
    margin-bottom: 26px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
}

.doc-article__body a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
}

    .doc-article__body a:hover,
    .doc-article__body a:focus-visible {
        color: #315bde;
    }

.lead {
    max-width: 64ch;
    font-size: 1.1rem;
}

.doc-article h2 {
    margin-top: 38px;
    margin-bottom: 12px;
    font-size: 1.9rem;
}

.doc-article h3 {
    margin-top: 20px;
    margin-bottom: 8px;
    font-size: 1.2rem;
}

.doc-article h4 {
    margin-top: 18px;
    margin-bottom: 8px;
    font-size: 1rem;
}

.doc-article ol,
.doc-article ul {
    padding-left: 22px;
}

.doc-article blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border-left: 4px solid rgba(63, 111, 255, 0.3);
    background: rgba(63, 111, 255, 0.07);
    border-radius: 0 16px 16px 0;
}

.doc-article table {
    width: 100%;
    margin: 18px 0;
    overflow: hidden;
    border-collapse: collapse;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.doc-article th,
.doc-article td {
    padding: 14px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.doc-article thead th {
    background: rgba(255, 255, 255, 0.75);
    font-weight: 800;
}

.doc-article hr {
    height: 1px;
    margin: 30px 0;
    border: 0;
    background: var(--line);
}

.callout {
    margin: 18px 0;
    padding: 16px 18px;
    border: 1px solid transparent;
    border-radius: 16px;
}

.callout--info {
    background: rgba(63, 111, 255, 0.1);
    border-color: rgba(63, 111, 255, 0.15);
}

pre {
    overflow-x: auto;
    padding: 18px;
    border-radius: 18px;
    background: #101725;
    color: #d9e4ff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.92rem;
}

:not(pre) > code {
    padding: 2px 6px;
    border-radius: 8px;
    background: rgba(16, 23, 37, 0.08);
    color: #20304e;
}

.right-panel {
    position: sticky;
    top: calc(var(--topbar-h) + 18px);
    align-self: start;
}

.sticky-card + .sticky-card {
    margin-top: 16px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .toc-nav a {
        padding: 10px 12px;
        border-radius: 12px;
        color: var(--muted);
    }

.icon-btn {
    display: inline-grid;
    place-items: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.65);
}

    .icon-btn span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--text);
        border-radius: 999px;
    }

.mobile-only {
    display: none;
}

@media (max-width: 1240px) {
    .article-layout {
        grid-template-columns: 260px minmax(0, 1fr);
    }

    .right-panel {
        display: none;
    }
}

@media (max-width: 1080px) {
    .topbar {
        grid-template-columns: 1fr;
        height: auto;
        gap: 14px;
    }

    .topbar__right {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .layout,
    .article-layout {
        grid-template-columns: 1fr;
    }

    .sidebar,
    .right-panel {
        position: static;
    }

    .hero-card,
    .section-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .mobile-only {
        display: inline-grid;
    }

    .sidebar {
        position: fixed;
        top: var(--topbar-h);
        left: 0;
        display: block;
        width: min(86vw, 320px);
        max-width: 320px;
        height: calc(100dvh - var(--topbar-h));
        z-index: 1100;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border-radius: 0 24px 24px 0;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

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

    .topbar {
        padding: 14px 16px;
    }

    .layout,
    .article-layout {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .right-panel {
        display: none;
    }

    .hero-card,
    .content-card,
    .doc-article {
        padding: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
