.wiki-container {
    min-height: calc(100vh - 200px);
    padding: 24px 0 60px;
}

.wiki-layout {
    display: grid;
    grid-template-columns: 270px 1fr;
    gap: 28px;
    align-items: start;
}

/* Sidebar navigation */
.wiki-sidebar {
    background: rgba(12, 12, 15, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-studio);
    position: sticky;
    top: 90px;
    z-index: 10;
}

.wiki-sidebar-header {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.wiki-sidebar-header i {
    color: var(--text-secondary);
}

.wiki-menu-section {
    margin-bottom: 20px;
}

.wiki-menu-section:last-child {
    margin-bottom: 0;
}

.wiki-menu-title {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.wiki-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wiki-menu-item a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.wiki-menu-item a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.wiki-menu-item.active a {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-left-color: #ffffff;
    font-weight: 600;
}

/* Wiki Content Card */
.wiki-card {
    background: rgba(12, 12, 15, 0.75);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-studio);
    box-sizing: border-box;
}

.wiki-card h1 {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.25;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 16px;
    letter-spacing: -0.03em;
}

.wiki-card h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 32px;
    margin-bottom: 14px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.wiki-card h3 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 22px;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.wiki-card p {
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.wiki-card ul,
.wiki-card ol {
    margin-bottom: 20px;
    padding-left: 22px;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.7;
}

.wiki-card li {
    margin-bottom: 6px;
}

.contact-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 22px;
    margin-top: 32px;
}

.contact-box h3 {
    margin-top: 0;
    color: var(--text-primary);
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.88rem;
    margin-bottom: 20px;
    transition: color 0.15s ease;
}

.back-link:hover {
    color: #ffffff;
}

/* Responsive styles */
@media (max-width: 900px) {
    .wiki-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .wiki-sidebar {
        position: static;
        padding: 16px;
    }

    .wiki-card {
        padding: 20px;
    }
}

/* Archived legal pages start with a version date. Preserve their signed-off HTML. */
.legal-content:not(.legal-document) > p:first-child:has(+ p + h2) {
    display: none;
}
