.doc-container {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.doc-sidebar {
    width: 280px;
    flex-shrink: 0;
}

.doc-sidebar-sticky {
    position: sticky;
    top: 2rem;
}

.doc-content {
    flex: 1;
    min-width: 0;
}

.doc-sidebar-section {
    background: rgba(22, 16, 58, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.doc-sidebar-title {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    letter-spacing: 0.5px;
}

.doc-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.doc-nav-item {
    margin-bottom: 0.5rem;
}

.doc-nav-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.doc-nav-link:hover {
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
}

.doc-nav-link.active {
    background: #fbbf24;
    color: #1a1a2e;
    font-weight: 600;
}

.doc-article {
    background: rgba(22, 16, 58, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 3rem;
}

.doc-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.doc-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.doc-breadcrumb a {
    color: #fbbf24;
    text-decoration: none;
}

.doc-breadcrumb a:hover {
    text-decoration: underline;
}

.doc-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.doc-body {
    line-height: 1.8;
    color: var(--text-primary);
}

/* ─── Material Design heading hierarchy ─── */
.doc-body h1, .doc-body h2, .doc-body h3, .doc-body h4, .doc-body h5, .doc-body h6 {
    font-weight: 700;
    scroll-margin-top: 90px;
    line-height: 1.3;
}

.doc-body h1 {
    font-size: 2.25rem;
    color: #FFB300;
    border-bottom: 3px solid rgba(255, 179, 0, 0.35);
    padding-bottom: 0.6rem;
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    letter-spacing: -0.5px;
}

.doc-body h2 {
    font-size: 1.75rem;
    color: #B388FF;
    border-left: 4px solid #7C4DFF;
    padding-left: 1rem;
    margin-top: 2.75rem;
    margin-bottom: 1.25rem;
}

.doc-body h3 {
    font-size: 1.4rem;
    color: #4DD0E1;
    margin-top: 2.25rem;
    margin-bottom: 0.85rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.doc-body h3::before {
    content: "▸";
    color: #4DD0E1;
    font-size: 0.85em;
    opacity: 0.75;
    flex-shrink: 0;
}

.doc-body h4 {
    font-size: 1.05rem;
    color: #FF8A65;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-top: 1.75rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
}

.doc-body h5, .doc-body h6 {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Smooth highlight when an anchor link target lands on this heading */
.doc-body :target {
    animation: target-flash 1.6s ease-out;
    border-radius: 6px;
}

@keyframes target-flash {
    0%   { background: rgba(255, 179, 0, 0.18); box-shadow: 0 0 0 8px rgba(255, 179, 0, 0.18); }
    100% { background: transparent; box-shadow: 0 0 0 8px transparent; }
}

/* Light-mode overrides */
:root[data-theme="light"] .doc-body h1 { color: #F57C00; border-bottom-color: rgba(245, 124, 0, 0.4); }
:root[data-theme="light"] .doc-body h2 { color: #5E35B1; border-left-color: #5E35B1; }
:root[data-theme="light"] .doc-body h3 { color: #00838F; }
:root[data-theme="light"] .doc-body h3::before { color: #00838F; }
:root[data-theme="light"] .doc-body h4 { color: #E64A19; }

.doc-body p {
    margin-bottom: 1rem;
}

.doc-body pre {
    background: var(--gray-900);
    color: var(--gray-100);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.doc-body code {
    background: rgba(255, 255, 255, 0.08);
    color: #fbbf24;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'Courier New', monospace;
}

.doc-body pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.doc-body ul, .doc-body ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.doc-body li {
    margin-bottom: 0.5rem;
}

.doc-body a {
    color: #fbbf24;
    text-decoration: none;
}

.doc-body a:hover {
    text-decoration: underline;
}

.doc-body blockquote {
    border-left: 4px solid #fbbf24;
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.doc-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.doc-body th, .doc-body td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.doc-body th {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 600;
}

@media (max-width: 768px) {
    .doc-container {
        flex-direction: column;
    }

    .doc-sidebar {
        display: none !important;
    }

    .doc-content {
        width: 100% !important;
    }

    .doc-article {
        padding: 1rem;
    }

    .doc-title {
        font-size: 1.75rem;
    }
}
