/* Legal pages — documentation-page layout, lifted from views/docs.ejs. */
/* --- core: topbar, sidebar, content, hero, sections --- */
        /* Layout */
        .docs-layout {
            display: grid;
            grid-template-columns: 240px 1fr;
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 2rem;
            gap: 3rem;
            position: relative;
            z-index: 1;
        }

        /* Top bar */
        .docs-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            max-width: 1200px;
            margin: 0 auto;
            padding: 1.5rem 2rem;
            position: relative;
            z-index: 10;
        }

        .back-home {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.95rem;
            padding: 0.5rem 0.75rem;
            border-radius: 8px;
            transition: all var(--transition-fast);
        }

        .back-home:hover {
            color: var(--color-headline);
            background: rgba(127, 90, 240, 0.1);
        }

        .back-home svg {
            width: 18px;
            height: 18px;
        }

        /* Sidebar */
        .docs-sidebar {
            position: sticky;
            top: 2rem;
            height: fit-content;
            max-height: calc(100vh - 4rem);
            overflow-y: auto;
            padding: 1.5rem 0;
        }

        .sidebar-label {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 0.85rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            color: var(--text-secondary);
            margin-top: 0.25rem;
            margin-bottom: 0.25rem;
            padding: 0.5rem 0.75rem;
        }

        .sidebar-nav-group {
            margin-bottom: 0.25rem;
        }

        .sidebar-nav {
            list-style: none;
            padding: 0;
            margin: 0 0 1.5rem 0;
        }

        .sidebar-nav li a {
            display: block;
            padding: 0.45rem 0.75rem;
            color: var(--text-secondary);
            text-decoration: none;
            font-size: 0.85rem;
            border-left: 2px solid transparent;
            border-radius: 0 6px 6px 0;
            transition: all var(--transition-fast);
        }

        .sidebar-nav li a:hover {
            color: var(--text-primary);
            background: rgba(var(--tree-accent-rgb, 127, 90, 240), 0.06);
        }

        .sidebar-nav li a.active {
            color: var(--tree-accent, var(--color-highlight));
            border-left-color: var(--tree-accent, var(--color-highlight));
            background: rgba(var(--tree-accent-rgb, 127, 90, 240), 0.08);
            font-weight: 500;
        }

        /* Main content */
        .docs-content {
            padding: 1.5rem 0 4rem;
            min-width: 0;
        }

        /* Hero */
        .docs-hero {
            margin-bottom: 3rem;
        }

        .docs-hero h1 {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 2rem;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 0.75rem;
        }

        .docs-hero .lead {
            font-size: 1.05rem;
            color: var(--text-secondary);
            line-height: 1.8;
            max-width: 700px;
        }

        /* Section headings */
        .docs-section {
            margin-bottom: 3rem;
            scroll-margin-top: 2rem;
        }

        .section-label {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.2em;
            color: var(--tree-accent, var(--color-highlight));
            margin-bottom: 0.5rem;
        }

        .section-title {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 1.5rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 1rem;
        }
/* --- header tab switcher --- */
        /* Header tab switcher */
        .docs-tabs {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            gap: 0.25rem;
            background: rgba(255,255,255,0.03);
            border-radius: 10px;
            padding: 4px;
            border: 1px solid rgba(255,255,255,0.06);
        }

        .docs-tab {
            padding: 0.5rem 1rem;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            border-radius: 7px;
            transition: all var(--transition-fast);
            border: none;
            background: none;
            font-family: inherit;
        }

        /* Per-theme accent colors */
        .docs-tab[data-tree="experiments"] { --tab-accent: #7f5af0; --tab-accent-rgb: 127, 90, 240; }
        .docs-tab[data-tree="annotator"]   { --tab-accent: #2cb67d; --tab-accent-rgb: 44, 182, 125; }
        .docs-tab[data-tree="workspaces"]  { --tab-accent: #d97706; --tab-accent-rgb: 217, 119, 6; }

        .docs-tab:hover {
            color: var(--tab-accent);
        }

        .docs-tab.active {
            background: rgba(var(--tab-accent-rgb), 0.15);
            color: var(--tab-accent);
        }
/* --- prose inside .docs-section --- */
        /* Prose styling for guide content inside .docs-section */
        .docs-section p {
            color: var(--text-secondary);
            line-height: 1.8;
            font-size: 0.95rem;
            margin-bottom: 1rem;
        }

        .docs-section p:last-child {
            margin-bottom: 0;
        }

        .docs-section h3 {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 1.1rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-top: 2rem;
            margin-bottom: 0.75rem;
        }

        .docs-section h4 {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 0.95rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-top: 1.5rem;
            margin-bottom: 0.5rem;
        }

        .docs-section ul,
        .docs-section ol {
            color: var(--text-secondary);
            line-height: 1.8;
            font-size: 0.95rem;
            padding-left: 1.5rem;
            margin: 0.5rem 0 1.25rem;
        }

        .docs-section li {
            margin-bottom: 0.4rem;
        }

        .docs-section li > strong:first-child {
            color: var(--text-primary);
        }

        .docs-section blockquote {
            border-left: 3px solid rgba(127, 90, 240, 0.4);
            background: rgba(127, 90, 240, 0.04);
            padding: 0.9rem 1.1rem;
            border-radius: 0 8px 8px 0;
            margin: 1.25rem 0;
            color: var(--text-secondary);
            font-size: 0.92rem;
            line-height: 1.7;
        }

        .docs-section blockquote p {
            margin-bottom: 0.6rem;
        }

        .docs-section blockquote p:last-child {
            margin-bottom: 0;
        }

        .docs-section blockquote em {
            color: var(--text-muted);
        }

        .docs-section :not(pre) > code {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.83em;
            background: rgba(127, 90, 240, 0.08);
            color: var(--color-highlight);
            padding: 0.12rem 0.38rem;
            border-radius: 4px;
        }

        .docs-section pre {
            background: #1a1b1f;
            border: 1px solid rgba(255, 255, 254, 0.06);
            border-radius: 10px;
            padding: 1rem 1.2rem;
            overflow-x: auto;
            margin: 1rem 0 1.25rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            line-height: 1.7;
            color: #c9d1d9;
        }

        [data-theme="light"] .docs-section pre {
            background: #f6f8fa;
            border-color: rgba(22, 22, 26, 0.1);
            color: #24292e;
        }

        .docs-section pre code {
            background: none;
            padding: 0;
            color: inherit;
            font-size: inherit;
        }

        .docs-section table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            margin: 1rem 0 1.5rem;
            border: 1px solid var(--border-light);
            border-radius: 12px;
            overflow: hidden;
            font-size: 0.9rem;
        }

        .docs-section thead th {
            font-family: 'Space Grotesk', sans-serif;
            font-size: 0.72rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--color-highlight);
            background: rgba(127, 90, 240, 0.06);
            padding: 0.7rem 1rem;
            text-align: left;
            border-bottom: 1px solid var(--border-light);
            vertical-align: top;
        }

        .docs-section tbody td {
            padding: 0.7rem 1rem;
            border-bottom: 1px solid var(--border-light);
            color: var(--text-secondary);
            line-height: 1.6;
            vertical-align: top;
        }

        .docs-section tbody tr:last-child td {
            border-bottom: none;
        }

        .docs-section tbody tr:hover {
            background: rgba(127, 90, 240, 0.03);
        }

        .docs-section tbody td strong,
        .docs-section tbody td code {
            color: var(--text-primary);
        }

        .docs-section figure {
            margin: 1.5rem 0;
        }

        .docs-section figcaption {
            margin-top: 0.6rem;
            font-size: 0.78rem;
            color: var(--text-muted);
            font-style: italic;
            text-align: center;
        }

        .docs-section hr {
            border: 0;
            border-top: 1px dashed var(--border-light);
            margin: 2rem 0;
        }
/* --- responsive --- */
        /* Responsive */
        @media (max-width: 900px) {
            .docs-layout {
                grid-template-columns: 1fr;
                padding: 0 1.25rem;
                gap: 0;
            }

            .docs-topbar {
                padding: 1.25rem 1.25rem;
                flex-wrap: wrap;
                gap: 0.75rem;
            }

            .docs-tabs {
                position: static;
                transform: none;
                margin: 0 auto;
            }

            .docs-sidebar {
                position: fixed;
                top: 0;
                left: 0;
                width: 280px;
                height: 100vh;
                max-height: 100vh;
                background: var(--bg-secondary);
                border-right: 1px solid var(--border-light);
                z-index: 200;
                padding: 2rem 1.5rem;
                transform: translateX(-100%);
                transition: transform var(--transition-medium);
                box-shadow: var(--shadow-lg);
            }

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

            .sidebar-overlay {
                display: none;
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 199;
            }

            .sidebar-overlay.open {
                display: block;
            }

            .sidebar-toggle {
                display: flex;
            }

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

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

            .docs-hero h1 {
                font-size: 1.6rem;
            }
        }

/* --- legal-specific additions --- */
.docs-tab { text-decoration: none; }
.docs-section a {
    color: var(--color-highlight);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 1px;
}
.docs-section a:hover { opacity: 0.82; }
.docs-hero .legal-tags {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 16px;
    font-family: 'Space Grotesk', sans-serif;
}
.legal-pill {
    font-size: 0.75rem; font-weight: 600;
    color: var(--color-highlight);
    background: color-mix(in srgb, var(--color-highlight) 14%, transparent);
    padding: 5px 11px; border-radius: 999px;
}
.legal-effective { font-size: 0.85rem; color: var(--text-muted); }

@media print {
    .theme-toggle, .docs-topbar, .docs-sidebar { display: none !important; }
    .docs-layout { display: block; max-width: none; }
    .docs-content { padding: 0; }
    body { background: #fff; }
}
