/* =========================================================
   SERVERGUARD — DOCUMENTATION SHELL
   Depends on css/tokens.css (loaded first).

   Dense, functional reading layout: grouped sidebar, hairline
   section dividers, expressive headings and open component
   layouts instead of a stack of rounded cards.
   ========================================================= */


/* =========================================================
   TOPBAR
   ========================================================= */

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    height: var(--header-h);

    z-index: 1000;

    background: rgba(8, 6, 15, 0.82);

    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);

    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    width: 100%;
    height: 100%;

    margin: 0 auto;
    padding-inline: var(--page-gutter);

    display: flex;
    align-items: center;
    gap: var(--sp-5);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 9px;

    flex: none;

    font-size: var(--fs-md);
    font-weight: 750;
    letter-spacing: -0.02em;
}

.brand span {
    color: var(--accent-text);
}

.brand-icon {
    display: grid;
    place-items: center;

    width: 30px;
    height: 30px;

    border-radius: var(--r-md);

    background: var(--gradient-accent);
    color: #fff;

    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
}

.brand-icon .icon {
    font-size: 17px;
    stroke-width: 1.9;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: var(--sp-2);

    flex: none;
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: var(--sp-5);

    margin-left: var(--sp-5);

    flex: none;

    font-size: var(--fs-sm);
    font-weight: 500;
}

.topbar-nav a {
    color: var(--text-secondary);
    transition: color var(--t);
}

.topbar-nav a:hover,
.topbar-nav a:focus-visible {
    color: var(--text);
}

.topbar-nav a.is-active {
    color: var(--text);
}

.topbar-download {
    min-height: 34px;
    padding: 0 var(--sp-4);
}

.help-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 7px 12px;

    white-space: nowrap;

    border-radius: var(--r-md);
    border: 1px solid var(--border);

    background: transparent;
    color: var(--text-secondary);

    font-size: var(--fs-sm);
    font-weight: 500;

    transition: background var(--t), color var(--t), border-color var(--t);
}

.help-button:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--border-strong);
}

.help-button .icon {
    font-size: 15px;
}


/* =========================================================
   SEARCH
   ========================================================= */

.doc-search {
    position: relative;

    flex: 1 1 auto;
    min-width: 0;
    max-width: 340px;
    margin-left: auto;
}

.doc-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;

    transform: translateY(-50%);

    color: var(--text-muted);
    font-size: 15px;

    pointer-events: none;
}

.doc-search-input {
    width: 100%;
    min-width: 0;

    padding: 7px 40px 7px 31px;

    border-radius: var(--r-md);
    border: 1px solid var(--border);

    background: var(--surface-2);
    color: var(--text);

    font-family: inherit;
    font-size: var(--fs-sm);

    transition: border-color var(--t), background var(--t), box-shadow var(--t);
}

.doc-search-input::placeholder {
    color: var(--text-muted);
}

.doc-search-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--surface-3);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.doc-search-kbd {
    position: absolute;
    right: 8px;
    top: 50%;

    transform: translateY(-50%);

    padding: 1px 6px;

    border-radius: var(--r-sm);
    border: 1px solid var(--border-strong);

    background: var(--surface-3);
    color: var(--text-muted);

    font-family: var(--font-mono);
    font-size: 11px;

    pointer-events: none;
}

.doc-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;

    z-index: 1200;

    max-height: 340px;
    overflow-y: auto;

    padding: 6px;

    border-radius: var(--r-lg);
    border: 1px solid var(--border-strong);

    background: var(--surface-2);
    box-shadow: var(--shadow-lg);
}

.doc-search-item {
    display: block;

    padding: 9px 11px;

    border-radius: var(--r-md);

    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.4;

    cursor: pointer;
}

.doc-search-item:hover,
.doc-search-item.is-active {
    background: var(--accent-soft);
    color: var(--text);
}

.doc-search-item span {
    display: block;
    margin-top: 2px;

    color: var(--text-muted);
    font-size: 11px;
}

.doc-search-empty {
    padding: 14px 12px;

    color: var(--text-muted);
    font-size: var(--fs-sm);
}


/* =========================================================
   LAYOUT
   ========================================================= */

/* =========================================================
   SIDEBAR
   ========================================================= */

.sidebar {
    position: sticky;
    top: var(--header-h);

    align-self: start;

    height: calc(100vh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;

    display: flex;
    flex-direction: column;

    padding: var(--sp-6) var(--sp-3) var(--sp-5);

    border-right: 1px solid var(--border);
}

.sidebar-header {
    padding: 0 var(--sp-2) var(--sp-4);

    border-bottom: 1px solid var(--border);
}

.sidebar-label {
    color: var(--text-faint);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
}

.sidebar-title {
    margin-top: 3px;

    font-size: var(--fs-base);
    font-weight: 650;
    letter-spacing: -0.01em;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1px;

    margin-top: var(--sp-4);

    overflow-y: auto;

    scrollbar-width: thin;
}

.sidebar-group {
    margin: var(--sp-5) var(--sp-2) 0;
}

.sidebar-group:first-child {
    margin-top: 0;
}

.sidebar-group-title {
    display: block;

    margin-bottom: 8px;
    padding-left: 2px;

    color: var(--text-faint);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 1px;

    padding-left: 8px;

    border-left: 1px solid var(--border);
}

.sidebar-nav a {
    position: relative;

    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: 8px;

    padding: 7px 9px;

    border-radius: var(--r-md);

    color: var(--text-secondary);

    font-size: var(--fs-sm);
    font-weight: 500;

    transition: color var(--t), background var(--t);
}

.sidebar-nav a span {
    display: grid;
    place-items: center;

    color: var(--text-faint);

    font-family: var(--font-mono);
    font-size: 10px;
}

.sidebar-nav a span .icon {
    font-size: 14px;
}

.sidebar-nav a:hover {
    color: var(--text);
    background: var(--surface-2);
}

.sidebar-nav a.active,
.sidebar-nav a.current {
    color: var(--text);
    background: var(--accent-soft);
}

.sidebar-nav a.active span,
.sidebar-nav a.current span {
    color: var(--accent-text);
}

.sidebar-nav a.active::before,
.sidebar-nav a.current::before {
    content: "";

    position: absolute;
    left: -9px;
    top: 6px;
    bottom: 6px;

    width: 2px;

    border-radius: 2px;

    background: linear-gradient(var(--accent), var(--accent-2));
}

.sidebar-footer {
    margin-top: auto;
    padding: var(--sp-4) var(--sp-2) 0;

    border-top: 1px solid var(--border);

    display: flex;
    align-items: center;
    gap: 7px;

    color: var(--text-faint);
    font-size: 11px;
}

.status-dot {
    width: 6px;
    height: 6px;

    border-radius: 50%;

    background: var(--success);
}


/* =========================================================
   MOBILE MENU BUTTON
   ========================================================= */

.mobile-menu-button {
    display: none;

    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    flex: none;

    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);

    background: var(--surface-2);
    color: var(--text);

    cursor: pointer;
}

.mobile-menu-button .icon-close {
    display: none;
}

.mobile-menu-button.is-open .icon-menu {
    display: none;
}

.mobile-menu-button.is-open .icon-close {
    display: inline-block;
}


/* =========================================================
   CONTENT — SHARED
   ========================================================= */

.doc-section {
    padding: 56px 0;

    border-top: 1px solid var(--border);

    scroll-margin-top: calc(var(--header-h) + 24px);
}

.doc-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.eyebrow {
    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    margin-bottom: 14px;
}

.doc-section h1 {
    max-width: 20ch;

    font-size: clamp(34px, 4.4vw, 52px);
    line-height: 1.04;
    letter-spacing: -0.04em;
    font-weight: 800;

    margin-bottom: 18px;
}

.doc-section h1 span {
    display: block;
    color: var(--accent-text);
}

.doc-section h2 {
    position: relative;

    padding-left: 18px;

    font-size: clamp(24px, 2.6vw, 32px);
    letter-spacing: -0.03em;

    margin-bottom: 14px;
}

.doc-section h2::before {
    content: "";

    position: absolute;
    left: 0;
    top: 0.16em;
    bottom: 0.16em;

    width: 3px;

    border-radius: 2px;

    background: linear-gradient(var(--accent), var(--accent-2));
}

.doc-section h3 {
    font-size: var(--fs-lg);
    line-height: var(--lh-snug);
    font-weight: 650;
}

.lead {
    max-width: 76ch;

    margin-bottom: 32px;

    color: var(--text-secondary);
    font-size: var(--fs-md);
    line-height: 1.72;
}

.section-description {
    max-width: 76ch;

    margin-bottom: 30px;

    color: var(--text-secondary);
    font-size: var(--fs-base);
    line-height: 1.72;
}

.doc-section code {
    color: var(--accent-text);
    font-size: 0.9em;
}

/* Prose keeps a readable measure even though the section now
   spans the full article column; wide elements (screenshots,
   grids, tables) use the whole width. */
.step-content p,
.timeline-item p,
.faq-content,
.info-card p,
.notice p,
.requirement-card p,
.module-card p,
.command-card span {
    max-width: 78ch;
}


/* =========================================================
   INFO CARD — open, left-accent
   ========================================================= */

.info-card {
    display: flex;
    gap: var(--sp-4);

    padding: var(--sp-5);

    margin-bottom: var(--sp-7);

    border-left: 2px solid var(--accent);

    border-radius: 0 var(--r-lg) var(--r-lg) 0;

    background: var(--surface);
}

.info-icon {
    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    flex: none;

    border-radius: var(--r-md);

    background: var(--gradient-accent-soft);
    color: var(--accent-text);

    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.16);
}

.info-icon .icon {
    font-size: 19px;
}

.info-card h3 {
    margin-bottom: 6px;
}

.info-card p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.7;
}


/* =========================================================
   ARCHITECTURE
   ========================================================= */

.architecture {
    display: flex;
    align-items: center;
    gap: var(--sp-4);

    padding: var(--sp-6);

    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    background: var(--surface);
}

.architecture-node {
    flex: 1;

    padding: var(--sp-5);

    border-radius: var(--r-lg);
    border: 1px solid var(--border-strong);

    text-align: center;
}

.architecture-node strong {
    display: block;
    font-size: var(--fs-base);
}

.architecture-node span {
    display: block;
    margin-top: 3px;

    color: var(--text-muted);
    font-size: var(--fs-xs);
}

.user-node {
    border-color: rgba(74, 222, 128, 0.28);
}

.server-node {
    border-color: var(--border-accent);
}

.architecture-line {
    position: relative;

    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: 11px;
}

.architecture-line::before,
.architecture-line::after {
    content: "";

    position: absolute;
    top: 50%;

    width: 16px;
    height: 1px;

    background: var(--border-accent);
}

.architecture-line::before {
    right: calc(100% + 5px);
}

.architecture-line::after {
    left: calc(100% + 5px);
}


/* =========================================================
   BORDERED GRID (requirements, modules, commands)
   ========================================================= */

.requirements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 1px;

    background: var(--border);

    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    overflow: hidden;
}

.requirement-card {
    padding: var(--sp-5);

    background: var(--surface);
}

.card-number {
    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: 11px;

    margin-bottom: 14px;
}

.requirement-card h3 {
    margin-bottom: 6px;
    font-size: var(--fs-base);
    font-weight: 650;
}

.requirement-card p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.65;
}


/* =========================================================
   STEPS — open rows with dividers
   ========================================================= */

.step-list {
    display: flex;
    flex-direction: column;
}

.instruction-step {
    display: grid;
    grid-template-columns: 40px 1fr;
    gap: var(--sp-5);

    padding: var(--sp-6) 0;

    border-bottom: 1px solid var(--border);
}

.instruction-step:first-child {
    padding-top: 0;
}

.instruction-step.compact {
    padding: var(--sp-5) 0;
}

.step-badge {
    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;

    border-radius: var(--r-md);
    border: 1px solid var(--border-accent);

    background: var(--accent-soft);
    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

.step-content h3 {
    margin-bottom: 6px;
    font-weight: 650;
}

.step-content p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.7;
}

.inline-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    margin-top: 14px;
    padding: 8px 13px;

    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);

    background: var(--surface-2);
    color: var(--text);

    font-size: var(--fs-sm);
    font-weight: 600;

    transition: background var(--t), border-color var(--t);
}

.inline-button:hover {
    background: var(--surface-3);
    border-color: var(--border-accent);
}


/* =========================================================
   SCREENSHOTS
   ========================================================= */

.screenshot {
    margin-top: 20px;
}

.screenshot.large {
    margin-top: 28px;
}

.screenshot img {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    margin-inline: auto;

    border-radius: var(--r-lg);
    border: 1px solid var(--border-strong);

    background: var(--bg-deep);

    box-shadow: var(--shadow-md);

    cursor: zoom-in;

    transition: border-color var(--t);
}

.screenshot img:hover {
    border-color: var(--border-accent);
}

.screenshot figcaption {
    padding-top: 10px;

    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 11px;
    text-align: center;
}


/* =========================================================
   CONNECTION FIELDS — bordered grid
   ========================================================= */

.connection-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 1px;

    margin-bottom: var(--sp-5);

    background: var(--border);

    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    overflow: hidden;
}

.field {
    display: flex;
    align-items: center;
    gap: var(--sp-4);

    padding: var(--sp-4) var(--sp-5);

    background: var(--surface);
}

.field code {
    min-width: 70px;

    color: var(--accent-text);
    font-size: 12px;
}

.field span {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}


/* =========================================================
   NOTICES — semantic, restrained
   ========================================================= */

.notice {
    position: relative;

    padding: var(--sp-4) var(--sp-5);

    margin: var(--sp-5) 0;

    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);

    border-radius: 0 var(--r-lg) var(--r-lg) 0;

    background: var(--surface);
}

.notice strong {
    display: block;

    margin-bottom: 5px;

    color: var(--accent-text);
    font-size: var(--fs-sm);
    font-weight: 650;
}

.notice p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.65;
}

.notice.warning {
    border-left-color: var(--warning);
}

.notice.warning strong {
    color: var(--warning);
}

.notice.security {
    border-left-color: var(--danger);
}

.notice.security strong {
    color: var(--danger);
}


/* =========================================================
   TERMINAL
   ========================================================= */

.terminal {
    position: relative;

    margin: var(--sp-5) 0;

    border-radius: var(--r-lg);
    border: 1px solid var(--border-strong);

    overflow: hidden;

    background: var(--bg-deep);
}

.terminal::before {
    content: "ServerGuard terminal";

    display: block;

    padding: 8px 14px;

    color: var(--text-muted);

    font-family: var(--font-mono);
    font-size: 11px;

    border-bottom: 1px solid var(--border);

    background: var(--surface-2);
}

.terminal pre {
    margin: 0;
    padding: var(--sp-5);

    overflow-x: auto;
}

.terminal code {
    color: #c2cad9;
    font-size: 12.5px;
    line-height: 1.8;

    white-space: pre;
}


/* =========================================================
   COMMAND GRID
   ========================================================= */

.command-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);

    gap: 1px;

    background: var(--border);

    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    overflow: hidden;
}

.command-card {
    display: flex;
    flex-direction: column;
    gap: 3px;

    padding: var(--sp-4) var(--sp-5);

    background: var(--surface);
}

.command-card code {
    color: var(--accent-text);
    font-size: 12.5px;
}

.command-card span {
    color: var(--text-muted);
    font-size: var(--fs-xs);
}


/* =========================================================
   MODULE GRID
   ========================================================= */

.module-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);

    gap: 1px;

    background: var(--border);

    border: 1px solid var(--border);
    border-radius: var(--r-xl);

    overflow: hidden;
}

.module-card {
    padding: var(--sp-5);

    background: var(--surface);
}

.module-number {
    display: block;

    margin-bottom: 14px;

    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: 11px;
}

.module-card h3 {
    margin-bottom: 6px;
    font-size: var(--fs-base);
    font-weight: 650;
}

.module-card p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.65;
}


/* =========================================================
   MODULE TABLE
   ========================================================= */

.module-table {
    border-radius: var(--r-lg);
    border: 1px solid var(--border);

    overflow: hidden;
}

.table-row {
    display: grid;
    grid-template-columns: 190px 1fr;
    gap: var(--sp-5);

    padding: 12px 16px;

    border-bottom: 1px solid var(--border);

    background: var(--surface);
}

.table-row:last-child {
    border-bottom: 0;
}

.table-row div:first-child {
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.table-row div:last-child {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}

.table-head {
    background: var(--surface-2);
}

.table-head div {
    color: var(--text-faint) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}


/* =========================================================
   FEATURE LIST — rows with dividers
   ========================================================= */

.feature-list {
    display: flex;
    flex-direction: column;

    margin-top: var(--sp-5);

    border-top: 1px solid var(--border);
}

.feature-list > div {
    display: flex;
    justify-content: space-between;
    gap: var(--sp-5);

    padding: 14px 2px;

    border-bottom: 1px solid var(--border);
}

.feature-list strong {
    color: var(--text);
    font-size: var(--fs-sm);
    font-weight: 600;
}

.feature-list span {
    color: var(--text-muted);
    font-size: var(--fs-sm);
    text-align: right;
}


/* =========================================================
   TEST TIMELINE
   ========================================================= */

.test-timeline {
    position: relative;

    display: flex;
    flex-direction: column;
}

.timeline-item {
    position: relative;

    display: grid;
    grid-template-columns: 40px 1fr;
    gap: var(--sp-5);

    padding: var(--sp-5) 0;

    border-bottom: 1px solid var(--border);
}

.timeline-number {
    position: relative;
    z-index: 1;

    display: grid;
    place-items: center;

    width: 38px;
    height: 38px;

    border-radius: var(--r-md);
    border: 1px solid var(--border-accent);

    background: var(--accent-soft);
    color: var(--accent-text);

    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 700;
}

.timeline-item h3 {
    margin-bottom: 4px;
    font-weight: 650;
}

.timeline-item p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.65;
}


/* =========================================================
   FAQ — dividers, not cards
   ========================================================= */

.faq {
    display: flex;
    flex-direction: column;

    border-top: 1px solid var(--border);
}

.faq details {
    border-bottom: 1px solid var(--border);
}

.faq summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);

    padding: 16px 2px;

    cursor: pointer;

    color: var(--text);
    font-size: var(--fs-base);
    font-weight: 600;

    list-style: none;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";

    color: var(--accent-text);
    font-size: 18px;
    line-height: 1;
}

.faq details[open] summary::after {
    content: "−";
}

.faq-content {
    padding: 0 2px 18px;

    color: var(--text-secondary);
    font-size: var(--fs-sm);
    line-height: 1.75;
}


/* =========================================================
   FINAL CARD
   ========================================================= */

.final-card {
    display: flex;
    align-items: center;
    gap: var(--sp-5);

    margin-top: var(--sp-7);
    padding: var(--sp-6);

    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);

    background:
        linear-gradient(150deg, var(--accent-soft), transparent 60%),
        radial-gradient(circle at 100% 0%, var(--magenta-soft), transparent 55%),
        var(--surface);

    box-shadow: var(--shadow-glow);
}

.final-icon {
    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;

    flex: none;

    border-radius: var(--r-md);

    background: var(--gradient-accent-soft);
    color: var(--accent-text);

    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.16);
}

.final-icon .icon {
    font-size: 22px;
}

.final-card h2 {
    font-size: var(--fs-xl);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}

.final-card h2::before {
    display: none;
}

.final-card p {
    color: var(--text-secondary);
    font-size: var(--fs-sm);
}


/* =========================================================
   FOOTER
   ========================================================= */

.docs-footer {
    border-top: 1px solid var(--border);

    padding: var(--sp-6) 0;
}

.footer-inner {
    width: 100%;

    margin: 0 auto;
    padding-inline: var(--page-gutter);

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-4);

    color: var(--text-faint);
    font-size: var(--fs-xs);
}

.footer-inner a {
    color: var(--text-secondary);
    transition: color var(--t);
}

.footer-inner a:hover {
    color: var(--text);
}


/* =========================================================
   IMAGE LIGHTBOX
   ========================================================= */

.image-lightbox {
    position: fixed;
    inset: 0;

    z-index: 5000;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: var(--sp-7);

    background: rgba(3, 4, 7, 0.92);

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    opacity: 0;
    visibility: hidden;

    transition: opacity var(--t), visibility var(--t);
}

.image-lightbox.active {
    opacity: 1;
    visibility: visible;
}

.image-lightbox img {
    max-width: 95vw;
    max-height: 90vh;

    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);

    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: fixed;
    top: var(--sp-5);
    right: var(--sp-6);

    display: grid;
    place-items: center;

    width: 40px;
    height: 40px;

    border-radius: var(--r-md);
    border: 1px solid var(--border-strong);

    background: var(--surface-2);
    color: var(--text);

    cursor: pointer;

    font-size: 20px;
}


/* =========================================================
   RESPONSIVE — TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .module-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* The primary nav links need the horizontal room; below this width
   the sidebar, search and download action take priority. */
@media (max-width: 1000px) {

    .topbar-nav {
        display: none;
    }
}


/* =========================================================
   VERY WIDE — densify bordered grids so the wide canvas is
   used by more compact cells instead of sparse ones.
   ========================================================= */

@media (min-width: 1500px) {

    .requirements-grid,
    .connection-fields {
        grid-template-columns: repeat(4, 1fr);
    }

    .command-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .module-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media (max-width: 820px) {

    .sidebar {
        position: fixed;

        top: var(--header-h);
        left: 0;

        width: min(300px, 84vw);
        height: calc(100vh - var(--header-h));

        z-index: 1050;

        background: var(--bg);

        border-right: 1px solid var(--border-strong);

        transform: translateX(-102%);

        transition: transform var(--t);
    }

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

    .mobile-menu-button {
        display: inline-flex;
    }

    .requirements-grid,
    .connection-fields,
    .command-grid {
        grid-template-columns: 1fr;
    }
}

/* Final interaction states shared by the compact documentation shell. */
.sidebar-nav a { transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast); }
.sidebar-nav a:hover { background: rgba(139,92,246,.09); color: var(--text); }
.sidebar-nav a.active, .sidebar-nav a.current,
.sidebar-nav a.active:hover, .sidebar-nav a.current:hover { background: var(--surface-nav-active); color: var(--text); }
.sidebar-nav a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sidebar-group-title[aria-expanded="true"] { color: var(--text-secondary); }
.sidebar-group-title[aria-expanded="false"] { color: var(--text-muted); }

@media (prefers-reduced-motion: reduce) {
    .sidebar-links, .sidebar-backdrop, .sidebar-group-title::after { transition: none; }
}

/* =========================================================
   REFERENCE SHELL — 70px icon rail / compact tree / article
   ========================================================= */

.topbar { height: 68px; }
.topbar-inner { padding-inline: 22px; gap: 22px; }
.brand { gap: 11px; min-width: 188px; }
.brand-icon { width: 28px; height: 30px; border-radius: 7px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word { font-size: 17px; font-weight: 750; }
.brand-copy small { margin-top: 4px; color: var(--text-muted); font-size: 10px; letter-spacing: .02em; }
.topbar-nav { gap: 5px; margin-left: 0; }
.topbar-nav a { padding: 8px 12px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; }
.topbar-nav a.is-active, .topbar-nav a:hover { border-color: rgba(167,139,250,.2); background: var(--accent-soft); color: var(--text); }
.nav-notice { display: inline-block; width: 5px; height: 5px; margin: 0 0 2px 4px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px rgba(217,70,239,.7); }
.topbar-actions { gap: 8px; }
.help-button { padding: 7px 9px; border: 0; }
.topbar-download { min-width: 104px; justify-content: center; }

.module-layout {
    max-width: none;
    width: 100%;
    padding-inline: 0;
    grid-template-columns: 70px 205px minmax(0, 1fr) 210px;
    gap: 0;
    background: var(--bg);
}
.icon-rail {
    position: sticky;
    top: var(--header-h);
    z-index: 3;
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    height: calc(100vh - var(--header-h));
    padding-top: 22px;
    border-right: 1px solid var(--border);
    background: #090812;
}
.icon-rail a { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid transparent; border-radius: 9px; color: #b4abc8; transition: color var(--t), background var(--t), border-color var(--t); }
.icon-rail a:hover { color: var(--text); background: var(--surface-2); }
.icon-rail a.is-active { border-color: rgba(184,75,250,.3); background: rgba(184,75,250,.14); color: var(--accent-text); box-shadow: 0 0 18px rgba(184,75,250,.16); }
.icon-rail .icon { font-size: 18px; }
.sidebar { grid-column: 2; grid-row: 1; width: auto; height: calc(100vh - var(--header-h)); padding: 20px 13px 15px 16px; border-right: 1px solid var(--border); border-left: 0; background: #0b0a17; }
.sidebar-header { padding: 0 4px 14px; }
.sidebar-label { color: #e2dcec; font-size: 11px; letter-spacing: .12em; }
.sidebar-title { display: none; }
.sidebar-nav { margin-top: 12px; gap: 0; }
.sidebar-group { margin: 0; padding: 12px 0; border-top: 1px solid var(--border); }
.sidebar-group:first-child { padding-top: 0; border-top: 0; }
.sidebar-group-title { margin-bottom: 7px; padding: 0 4px; color: var(--text-secondary); font-size: 11px; letter-spacing: .08em; text-transform: none; }
.sidebar-nav a { min-height: 28px; padding: 5px 7px; border-radius: 5px; font-size: 12px; }
.sidebar-links { padding-left: 8px; border-left-color: #30263f; }
.sidebar-nav a.active, .sidebar-nav a.current { background: #21152f; box-shadow: none; }
.sidebar-nav a.active::before, .sidebar-nav a.current::before { left: -9px; top: 0; bottom: 0; width: 3px; border-radius: 0 2px 2px 0; }
.sidebar-footer { padding: 12px 4px 0; font-size: 10px; }
.module-content { grid-column: 3; grid-row: 1; min-width: 0; padding: 17px 18px 60px; }
.page-toc { grid-column: 4; grid-row: 1; padding: 52px 18px 0 0; }

/* The introduction mirrors the compact reference: title + notice, then two
   substantial technical panels and a dense quick-start strip. */
.doc-intro { max-width: none; padding-bottom: 30px; }
.doc-intro > .breadcrumb { margin-bottom: 10px; }
.intro-top-grid { grid-template-columns: minmax(0, 1fr) 324px; gap: 16px; margin-bottom: 16px; }
.intro-top-grid .doc-hero { min-height: 88px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.intro-top-grid .doc-hero .eyebrow { display: none; }
.doc-hero h1, .doc-section h1 { max-width: none; margin-bottom: 7px; font-size: clamp(29px, 2.5vw, 31px); line-height: 1.15; letter-spacing: -.035em; }
.doc-section h1 span { display: inline; color: inherit; }
.doc-hero-lead { max-width: 650px; margin: 0; color: #d0c9df; font-size: 12.5px; line-height: 1.5; }
.intro-top-grid .doc-hero-actions { display: none; }
.intro-top-grid .intro-card { min-height: 88px; padding: 15px 17px; flex-direction: row; gap: 13px; border: 1px solid #282039; border-left: 3px solid var(--accent); border-radius: 9px; background: #0d0b19; box-shadow: 0 0 16px rgba(184,75,250,.08); }
.intro-top-grid .intro-card .panel-icon { width: 38px; height: 42px; background: none; border: 0; box-shadow: none; }
.intro-top-grid .intro-card h3 { margin: 0 0 5px; font-size: 13px; }
.intro-top-grid .intro-card p { max-width: 250px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.intro-top-grid .intro-meta { display: none; }
.doc-intro > .feature-cards, .doc-intro > .architecture { display: none; }
.intro-workbench { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 13px; }
.intro-workbench > .feature-panel { display: block; grid-column: 1; min-width: 0; padding: 13px; border: 1px solid #2b243a; border-radius: 10px; background: #0c0b18; box-shadow: none; }
.intro-workbench > .feature-panel .feature-panel-copy { padding: 0; border: 0; background: none; }
.intro-workbench > .feature-panel .feature-panel-copy .eyebrow { margin-bottom: 7px; }
.intro-workbench > .feature-panel .feature-panel-copy h3 { margin-bottom: 7px; font-size: 16px; }
.intro-workbench > .feature-panel .feature-panel-copy > p { margin-bottom: 10px; color: #d1cadd; font-size: 12px; line-height: 1.45; }
.intro-workbench > .feature-panel .mini-list { display: none; }
.intro-workbench > .feature-panel .inline-button { display: none; }
.intro-workbench > .feature-panel .code-panel { margin: 10px 0 0; }
.intro-workbench > .panel { grid-column: 2; grid-row: 1; min-width: 0; border: 1px solid #2b243a; border-radius: 10px; background: #0c0b18; box-shadow: none; }
.intro-workbench > .panel .panel-head { padding: 13px; }
.intro-workbench > .panel .panel-head-text h3 { font-size: 16px; }
.intro-workbench > .panel .panel-head-text p { font-size: 12px; }
.intro-workbench .module-links { grid-template-columns: 1fr; gap: 8px; padding: 0 13px 13px; }
.intro-workbench .module-link { min-height: 54px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 10px 12px; }
.intro-workbench .module-link .icon { font-size: 22px; }
.intro-workbench .module-link strong { font-size: 12px; }
.intro-workbench .module-link span:not(.module-link-go) { font-size: 10px; line-height: 1.35; }
.intro-workbench .module-link-go { padding: 0; font-size: 0; }
.intro-workbench .module-link-go::after { content: "→"; font-size: 17px; color: var(--accent-text); }
.quickstart { margin-top: 14px; padding: 14px; border: 1px solid #292237; border-radius: 10px; background: #0c0a17; }
.quickstart .eyebrow { margin-bottom: 10px; }
.quickstart .qs-steps { margin-top: 0; }
.quickstart + .code-panel { margin-top: 10px; }
.doc-intro > .code-panel { margin-top: 10px; }

@media (max-width: 1350px) {
    .module-layout { grid-template-columns: 70px 205px minmax(0, 1fr); }
    .page-toc { display: none; }
}
@media (max-width: 900px) {
    .topbar-nav { display: none; }
    .intro-top-grid, .intro-workbench { grid-template-columns: 1fr; }
    .intro-workbench > .feature-panel, .intro-workbench > .panel { grid-column: 1; grid-row: auto; }
}
@media (max-width: 820px) {
    .module-layout { display: flex; flex-direction: column; }
    .icon-rail { display: none; }
    .module-content { order: 2; padding: 14px 16px 50px; }
    .sidebar { order: 1; width: min(300px, 84vw); }
    .intro-top-grid .intro-card { min-height: 88px; }
    .brand { min-width: 0; }
    .brand-copy small { display: none; }
}
@media (max-width: 560px) {
    .topbar-inner { padding-inline: 16px; gap: 8px; }
    .doc-search { max-width: none; }
    .topbar-actions .help-button { display: none; }
    .intro-top-grid .doc-hero-lead { font-size: 12px; }
    .qs-steps { grid-template-columns: 1fr; }
}

/* =========================================================
   DOCUMENTATION APP SHELL — NAVIGATION & COMMAND REFERENCE
   ========================================================= */

.sidebar {
    width: var(--sidebar-w);
    min-width: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--surface-3) transparent;
}
.sidebar-header { position: sticky; top: 0; z-index: 2; background: var(--bg); }
.sidebar-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 0;
    background: none;
    cursor: pointer;
    text-align: left;
}
.sidebar-group-title::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    transition: transform var(--t);
}
.sidebar-group:not(.is-collapsed) .sidebar-group-title::after { transform: rotate(225deg) translate(-1px, -1px); }
.sidebar-group.is-collapsed .sidebar-links { display: none; }
.sidebar-group-title:hover, .sidebar-group-title:focus-visible { color: var(--text-secondary); }
.sidebar-group-title:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.sidebar-links { height: auto; overflow: hidden; opacity: 1; transition: height var(--t-slow), opacity var(--t); }
.sidebar-group.is-collapsed .sidebar-links { display: block; opacity: 0; pointer-events: none; }
.sidebar-nav a { position: relative; }
.sidebar-nav a[href*="#"] { padding-left: 14px; font-size: 12px; color: var(--text-muted); }
.sidebar-nav a[href*="#"] span { color: var(--text-faint); }
.sidebar-nav a[href*="#"]::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; background: var(--border); }
.sidebar-footer { position: sticky; bottom: 0; background: var(--bg); }
.sidebar-backdrop { display: none; }

.doc-search-results { min-width: 360px; }
.doc-search-item { padding: 11px 12px; }
.doc-search-item strong { display: block; color: var(--text); font-size: 13px; }
.doc-search-item span { color: var(--accent-text); }
.doc-search-item small { display: block; margin-top: 4px; overflow: hidden; color: var(--text-muted); font-size: 11px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.doc-search-item.is-active small, .doc-search-item:hover small { color: var(--text-secondary); }

.terminal-reference {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 1px;
    margin: 24px 0;
    overflow: hidden;
    border: 1px solid var(--border-strong);
    border-radius: var(--r-xl);
    background: var(--border);
    box-shadow: 0 20px 50px rgba(0,0,0,.24);
}
.terminal-reference-nav { padding: 14px; background: var(--surface); }
.terminal-reference-label { margin: 2px 6px 10px; color: var(--text-faint); font: 700 10px var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.terminal-ref-category { margin: 12px 6px 4px; color: var(--accent-text); font: 700 9px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }
.terminal-ref-category:first-of-type { margin-top: 0; }
.command-ref-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: var(--r-md);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    text-align: left;
    transition: background var(--t), border-color var(--t), color var(--t);
}
.command-ref-item:hover, .command-ref-item.is-active { border-color: var(--border-accent); background: var(--accent-soft); color: var(--text); }
.command-ref-item code { color: var(--accent-text); font-size: 12px; }
.command-ref-item span { color: var(--text-muted); font-size: 11px; line-height: 1.35; }
.terminal-reference-detail { min-width: 0; padding: 18px 20px 20px; background: linear-gradient(145deg, #0d0a18, #08060f); }
.terminal-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.terminal-detail-head .copy-btn { position: static; opacity: 1; }
.terminal-detail-kicker { color: var(--text-muted); font: 11px var(--font-mono); }
.terminal-detail-command { margin-top: 30px; padding: 13px 15px; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-md); background: #05040a; font: 13px/1.6 var(--font-mono); white-space: nowrap; }
.terminal-detail-command .prompt { color: var(--success); }
.terminal-detail-command code { color: #e5d5ff; }
.terminal-detail-description, #commandReferenceDescription { max-width: 64ch; margin-top: 18px; color: var(--text-secondary); font-size: var(--fs-sm); line-height: 1.7; }
.terminal-detail-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 28px; color: var(--text-faint); font: 11px var(--font-mono); }
.terminal-detail-meta span:first-child { color: var(--accent-text); }

@media (max-width: 900px) {
    .terminal-reference { grid-template-columns: 1fr; }
    .terminal-reference-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
    .terminal-reference-label { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
    .sidebar-backdrop { position: fixed; inset: var(--header-h) 0 0; z-index: 1040; display: block; border: 0; background: rgba(3,2,8,.68); opacity: 0; pointer-events: none; transition: opacity var(--t); }
    .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
    body.sidebar-is-open { overflow: hidden; }
    .sidebar { border-radius: 0 var(--r-lg) var(--r-lg) 0; }
    .sidebar-header, .sidebar-footer { background: var(--bg); }
    .doc-search-results { min-width: 0; }
}
@media (max-width: 520px) {
    .terminal-reference-nav { grid-template-columns: 1fr; }
    .terminal-detail-command { margin-top: 20px; }
}

/* =========================================================
   PASS 2 — DOCUMENTATION DEPTH
   ========================================================= */

.module-layout {
    max-width: var(--docs-max);
    margin-inline: auto;
    grid-template-columns: 232px minmax(0, 1fr) 208px;
    gap: clamp(26px, 3.4vw, 54px);
}

.module-content { padding-top: 44px; }
.sidebar { border-right: 0; border-left: 1px solid var(--border); padding-left: 20px; }
.sidebar-header { padding-bottom: 18px; }
.sidebar-nav a { min-height: 36px; }
.sidebar-nav a.active, .sidebar-nav a.current { box-shadow: inset 0 0 0 1px rgba(167,139,250,.08); }

.doc-intro {
    padding: 0 0 48px;
    border: 0;
}

.doc-hero {
    position: relative;
    margin-bottom: 28px;
    padding: 30px 32px 32px;
    border: 1px solid rgba(167,139,250,.2);
    border-radius: 18px;
    background: radial-gradient(circle at 100% 0, rgba(217,70,239,.14), transparent 38%), radial-gradient(circle at 0 0, rgba(139,92,246,.2), transparent 46%), rgba(13,11,24,.9);
    box-shadow: 0 20px 60px rgba(0,0,0,.22);
}

.doc-hero h1 { max-width: 15ch; font-size: clamp(40px, 5vw, 60px); }
.doc-hero-lead { max-width: 62ch; color: #c4bdd7; }
.doc-hero-actions { margin-top: 24px; }
.intro-card { border-color: rgba(167,139,250,.16); background: linear-gradient(135deg, rgba(26,21,48,.82), rgba(13,11,24,.84)); }
.feature-cards { gap: 12px; }
.feature-cards .feature-card { min-height: 190px; }
.architecture { margin: 28px 0; border-color: rgba(167,139,250,.16); background: rgba(13,11,24,.72); }
.feature-panel { border-color: rgba(167,139,250,.16); box-shadow: 0 18px 45px rgba(0,0,0,.2); }
.module-links { gap: 10px; }
.module-link { border-color: rgba(167,139,250,.13); background: linear-gradient(145deg, rgba(26,21,48,.72), rgba(13,11,24,.9)); }
.module-link:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0,0,0,.24); }
.quickstart { margin-top: 34px; padding-top: 34px; border-top: 1px solid var(--border); }
.page-toc { padding-top: 44px; }
.page-toc-list { padding-left: 4px; border-left: 1px solid var(--border); }
.page-toc a.active, .page-toc a.active.toc-h3 { box-shadow: inset 0 0 0 1px rgba(167,139,250,.08); }

@media (max-width: 1250px) {
    .module-layout { max-width: 1080px; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
    .sidebar { border-left: 0; border-right: 1px solid var(--border); padding-left: 12px; }
}

@media (max-width: 820px) {
    .module-layout { max-width: none; }
    .sidebar { border: 1px solid var(--border); }
    .doc-hero { padding: 24px 20px; }
    .doc-hero h1 { font-size: clamp(36px, 11vw, 52px); }
}

/* Introduction dashboard: deliberately uneven panels echo the product's
   Windows-client / Linux-server relationship and use the full reading width. */
.intro-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr);
    gap: 14px;
    align-items: stretch;
    margin-bottom: 14px;
}
.intro-top-grid .doc-hero { margin: 0; min-height: 322px; display: flex; flex-direction: column; justify-content: center; }
.intro-top-grid .intro-card { margin: 0; min-height: 322px; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 24px; border: 1px solid rgba(167,139,250,.2); border-radius: 18px; background: linear-gradient(150deg, rgba(30,23,57,.94), rgba(13,11,24,.94)); }
.intro-top-grid .intro-card .panel-icon { width: 46px; height: 46px; }
.intro-top-grid .intro-card h3 { font-size: 20px; margin-top: 30px; }
.intro-top-grid .intro-card p { color: #c4bdd7; }
.intro-top-grid .intro-meta { margin-top: 20px; }
.doc-intro > .feature-cards { grid-template-columns: repeat(2, minmax(0,1fr)); margin-bottom: 14px; }
.doc-intro > .feature-cards .feature-card { min-height: 150px; }
.doc-intro > .architecture { margin: 14px 0; }
.intro-workbench { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 14px; align-items: stretch; }
.intro-workbench > .feature-panel { display: contents; }
.intro-workbench > .feature-panel .feature-panel-copy { grid-column: 1; grid-row: 1; padding: 24px; border: 1px solid rgba(167,139,250,.16); border-radius: 18px; background: rgba(19,16,34,.84); }
.intro-workbench > .feature-panel .code-panel { grid-column: 2; grid-row: 1; align-self: stretch; margin: 0; }
.intro-workbench > .panel { grid-column: 1 / -1; margin-top: 0; }
.intro-workbench .module-links { grid-template-columns: repeat(5, minmax(0,1fr)); }
.quickstart { margin-top: 18px; padding: 24px; border: 1px solid var(--border); border-radius: 18px; background: rgba(13,11,24,.62); }
.quickstart + .code-panel { margin-top: 14px; }

@media (max-width: 900px) {
    .intro-top-grid, .intro-workbench { grid-template-columns: 1fr; }
    .intro-top-grid .doc-hero, .intro-top-grid .intro-card { min-height: 0; }
    .intro-workbench > .feature-panel .feature-panel-copy, .intro-workbench > .feature-panel .code-panel { grid-column: 1; }
    .intro-workbench > .feature-panel .code-panel { grid-row: 2; }
    .intro-workbench > .panel { grid-column: 1; }
    .intro-workbench .module-links { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
    .doc-intro > .feature-cards { grid-template-columns: 1fr; }
    .intro-workbench .module-links { grid-template-columns: 1fr; }
    .quickstart { padding: 16px; }
}


/* =========================================================
   RESPONSIVE — SMALL
   ========================================================= */

@media (max-width: 620px) {

    :root {
        --gutter: 16px;
        --page-gutter: 16px;
    }

    .topbar-inner {
        gap: var(--sp-2);
    }

    .brand-word {
        display: none;
    }

    .doc-search {
        margin-left: var(--sp-2);
    }

    .doc-search-kbd {
        display: none;
    }

    .doc-search-input {
        padding-right: 12px;
    }

    .help-button {
        display: none;
    }

    .module-grid {
        grid-template-columns: 1fr;
    }

    .doc-section h1 {
        font-size: 34px;
    }

    .architecture {
        flex-direction: column;
    }

    .architecture-node {
        width: 100%;
    }

    .architecture-line::before,
    .architecture-line::after {
        display: none;
    }

    .instruction-step {
        grid-template-columns: 1fr;
    }

    .module-table {
        overflow-x: auto;
    }

    .table-row {
        min-width: 540px;
    }

    .feature-list > div {
        flex-direction: column;
        gap: var(--sp-1);
    }

    .feature-list span {
        text-align: left;
    }

    .final-card {
        flex-direction: column;
        align-items: flex-start;
    }
}


/* =========================================================
   RESPONSIVE — VERY SMALL
   ========================================================= */

@media (max-width: 520px) {

    .topbar-download {
        padding: 0 var(--sp-3);
    }
}


/* =========================================================
   PERFORMANCE — SMALL SCREENS
   A blurred fixed topbar is expensive to repaint while a long
   article scrolls. On phones use a near-opaque background.
   ========================================================= */

@media (max-width: 820px) {

    .topbar {
        background: rgba(8, 6, 15, 0.96);
        backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
}

/* Final reference geometry overrides (kept last so the legacy responsive
   rules above cannot expand the documentation shell again). */
.topbar { height: 68px; }
.topbar-inner { padding-inline: 22px; gap: 22px; }
.brand { gap: 11px; min-width: 188px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.05; }
.brand-word { font-size: 17px; font-weight: 750; }
.brand-copy small { margin-top: 4px; color: var(--text-muted); font-size: 10px; }
.topbar-nav { gap: 5px; margin-left: 0; }
.topbar-nav a { padding: 8px 12px; border: 1px solid transparent; border-radius: 7px; font-size: 12px; }
.topbar-nav a.is-active, .topbar-nav a:hover { border-color: rgba(167,139,250,.2); background: var(--accent-soft); color: var(--text); }
.nav-notice { display: inline-block; width: 5px; height: 5px; margin: 0 0 2px 4px; border-radius: 50%; background: var(--accent-2); }
.module-layout { max-width: none; width: 100%; padding-inline: 0; grid-template-columns: 70px 205px minmax(0,1fr) 210px; gap: 0; }
.icon-rail { position: sticky; top: var(--header-h); z-index: 3; grid-column: 1; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 14px; height: calc(100vh - var(--header-h)); padding-top: 22px; border-right: 1px solid var(--border); background: #090812; }
.icon-rail a { display: grid; place-items: center; width: 35px; height: 35px; border: 1px solid transparent; border-radius: 9px; color: #b4abc8; }
.icon-rail a.is-active { border-color: rgba(184,75,250,.3); background: rgba(184,75,250,.14); color: var(--accent-text); box-shadow: 0 0 18px rgba(184,75,250,.16); }
.icon-rail .icon { font-size: 18px; }
.sidebar { grid-column: 2; grid-row: 1; width: auto; height: calc(100vh - var(--header-h)); padding: 20px 13px 15px 16px; border-right: 1px solid var(--border); border-left: 0; background: #0b0a17; }
.sidebar-header { padding: 0 4px 14px; background: #0b0a17; }
.sidebar-title { display: none; }
.sidebar-group { margin: 0; padding: 12px 0; border-top: 1px solid var(--border); }
.sidebar-group:first-child { padding-top: 0; border-top: 0; }
.sidebar-group-title { margin-bottom: 7px; padding: 0 4px; font-size: 11px; letter-spacing: .08em; text-transform: none; }
.sidebar-nav a { min-height: 28px; padding: 5px 7px; border-radius: 5px; font-size: 12px; }
.sidebar-nav a.active, .sidebar-nav a.current { background: #21152f; box-shadow: none; }
.sidebar-nav a.active::before, .sidebar-nav a.current::before { left: -9px; top: 0; bottom: 0; width: 3px; }
.module-content { grid-column: 3; grid-row: 1; min-width: 0; padding: 17px 18px 60px; }
.page-toc { grid-column: 4; grid-row: 1; padding: 52px 18px 0 0; }
.doc-intro { max-width: none; padding-bottom: 30px; }
.doc-intro > .breadcrumb { margin-bottom: 10px; }
.intro-top-grid { grid-template-columns: minmax(0,1fr) 324px; gap: 16px; margin-bottom: 16px; }
.intro-top-grid .doc-hero { min-height: 88px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; }
.intro-top-grid .doc-hero .eyebrow { display: none; }
.doc-hero h1, .doc-section h1 { max-width: none; margin-bottom: 7px; font-size: clamp(29px,2.5vw,31px); line-height: 1.15; }
.doc-section h1 span { display: inline; color: inherit; }
.doc-hero-lead { max-width: 650px; margin: 0; color: #d0c9df; font-size: 12.5px; line-height: 1.5; }
.intro-top-grid .doc-hero-actions { display: none; }
.intro-top-grid .intro-card { min-height: 88px; padding: 15px 17px; flex-direction: row; gap: 13px; border: 1px solid #282039; border-left: 3px solid var(--accent); border-radius: 9px; background: #0d0b19; box-shadow: 0 0 16px rgba(184,75,250,.08); }
.intro-top-grid .intro-card .panel-icon { width: 38px; height: 42px; background: none; border: 0; box-shadow: none; }
.intro-top-grid .intro-card h3 { margin: 0 0 5px; font-size: 13px; }
.intro-top-grid .intro-card p { max-width: 250px; color: var(--text-secondary); font-size: 11px; line-height: 1.45; }
.intro-top-grid .intro-meta { display: none; }
.doc-intro > .feature-cards, .doc-intro > .architecture { display: none; }
.intro-workbench { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 13px; }
.intro-workbench > .feature-panel { display: block; grid-column: 1; min-width: 0; padding: 13px; border: 1px solid #2b243a; border-radius: 10px; background: #0c0b18; box-shadow: none; }
.intro-workbench > .feature-panel .feature-panel-copy { padding: 0; border: 0; background: none; }
.intro-workbench > .feature-panel .feature-panel-copy h3 { margin-bottom: 7px; font-size: 16px; }
.intro-workbench > .feature-panel .feature-panel-copy > p { margin-bottom: 10px; color: #d1cadd; font-size: 12px; line-height: 1.45; }
.intro-workbench > .feature-panel .mini-list, .intro-workbench > .feature-panel .inline-button { display: none; }
.intro-workbench > .feature-panel .code-panel { margin: 10px 0 0; }
.intro-workbench > .panel { grid-column: 2; grid-row: 1; min-width: 0; border: 1px solid #2b243a; border-radius: 10px; background: #0c0b18; box-shadow: none; }
.intro-workbench > .panel .panel-head { padding: 13px; }
.intro-workbench .module-links { grid-template-columns: 1fr; gap: 8px; padding: 0 13px 13px; }
.intro-workbench .module-link { min-height: 54px; display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 9px; padding: 10px 12px; }
.intro-workbench .module-link-go { padding: 0; font-size: 0; }
.intro-workbench .module-link-go::after { content: "→"; font-size: 17px; color: var(--accent-text); }
.quickstart { margin-top: 14px; padding: 14px; border: 1px solid #292237; border-radius: 10px; background: #0c0a17; }

@media (max-width: 1350px) {
    .module-layout { grid-template-columns: 70px 205px minmax(0,1fr); }
    .page-toc { display: none; }
}
@media (max-width: 900px) {
    .topbar-nav { display: none; }
    .intro-top-grid, .intro-workbench { grid-template-columns: 1fr; }
    .intro-workbench > .feature-panel, .intro-workbench > .panel { grid-column: 1; grid-row: auto; }
}
@media (max-width: 820px) {
    .module-layout { display: flex; flex-direction: column; }
    .icon-rail { display: none; }
    .module-content { order: 2; padding: 14px 16px 50px; }
    .sidebar { order: 1; width: min(300px,84vw); }
    .brand { min-width: 0; }
    .brand-copy small { display: none; }
}
