:root {
    --bg: #0a0a0f;
    --bg-card: #12121a;
    --text: #c8c8d0;
    --text-muted: #8a8a9a;
    --accent: #2ecc71;
    --accent-secondary: #e84393;
    --border: #1e1e2a;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Cascadia Code', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --success: #2ecc71;
    --warning: #f39c12;
    --error: #e74c3c;
    --info: #3498db;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-full: 9999px;
    --space-2xs: 2px;
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --title-shadow-opacity: 0.25;
}

[data-theme="light"] {
    --bg: #f5f5f7;
    --bg-card: #ffffff;
    --text: #1a1a2e;
    --text-muted: #5a5a6e;
    --accent: #157a3e;
    --accent-secondary: #c0357a;
    --border: #e0e0e5;
    --success: #157a3e;
    --warning: #c47f0a;
    --error: #c0392b;
    --info: #2471a3;
    --title-shadow-opacity: 0.08;
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg: #f5f5f7;
        --bg-card: #ffffff;
        --text: #1a1a2e;
        --text-muted: #5a5a6e;
        --accent: #157a3e;
        --accent-secondary: #c0357a;
        --border: #e0e0e5;
        --success: #157a3e;
        --warning: #c47f0a;
        --error: #c0392b;
        --info: #2471a3;
        --title-shadow-opacity: 0.08;
    }
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Shared nav */
.shared-nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.shared-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 3.5rem;
}

.shared-nav-brand {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.shared-nav-brand .brand-accent {
    color: var(--accent);
}

.shared-nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.shared-nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color 0.15s, background 0.15s;
}

.shared-nav-link:hover {
    color: var(--text);
    background: var(--border);
}

.shared-nav-link.active {
    color: var(--accent);
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 1rem;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-left: 0.5rem;
    line-height: 1;
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* Hamburger menu */
.hamburger-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
}

@media (max-width: 768px) {
    .hamburger-toggle { display: block; }

    .shared-nav-links {
        display: none;
        position: absolute;
        top: 3.5rem;
        left: 0;
        right: 0;
        background: var(--bg-card);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 0.5rem;
        gap: 0;
    }

    .shared-nav-links.open { display: flex; }

    .shared-nav-link {
        width: 100%;
        padding: 0.75rem 1rem;
    }

    .theme-toggle {
        margin: 0.5rem 1rem;
        width: calc(100% - 2rem);
    }
}

/* Breadcrumbs */
.breadcrumbs {
    padding: 0.5rem 1.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.breadcrumbs a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs .sep { margin: 0 0.4rem; }

/* Main content area */
.shared-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    padding: 1.5rem;
}

/* Footer */
.shared-footer {
    border-top: 1px solid var(--border);
    padding: 1rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: auto;
}

.shared-footer a {
    color: var(--accent);
    text-decoration: none;
}

.shared-footer a:hover { text-decoration: underline; }

.feedback-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Floating controls (view-as, admin toggles) */
.floating-controls {
    position: fixed;
    bottom: var(--space-md);
    left: var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    z-index: 200;
}

.floating-controls:empty { display: none; }

.btn-toggle {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.4rem 1rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.btn-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.btn-toggle.active {
    color: var(--accent);
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent), transparent 90%);
    font-weight: 600;
}

@media (max-width: 768px) {
    .floating-controls { bottom: 0.75rem; left: 0.75rem; }
}
