:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #21242f;
    --bg-hover: #2a2d3a;
    --border: #2e3140;
    --text-primary: #e4e6ef;
    --text-secondary: #8b8fa3;
    --text-muted: #5c5f73;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-dim: rgba(99, 102, 241, 0.12);
    --success: #22c55e;
    --success-dim: rgba(34, 197, 94, 0.12);
    --warning: #f59e0b;
    --warning-dim: rgba(245, 158, 11, 0.12);
    --yellow: #eab308;
    --yellow-dim: rgba(234, 179, 8, 0.12);
    --orange: #f97316;
    --orange-dim: rgba(249, 115, 22, 0.12);
    --danger: #ef4444;
    --danger-dim: rgba(239, 68, 68, 0.12);
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
    --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
    --progress-bg: #2e3140;
}

[data-theme="light"] {
    --bg-primary: #f5f6f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --bg-hover: #f0f1f4;
    --border: #e2e4ea;
    --text-primary: #1a1d27;
    --text-secondary: #5c5f73;
    --text-muted: #8b8fa3;
    --accent: #4f46e5;
    --accent-hover: #6366f1;
    --accent-dim: rgba(79, 70, 229, 0.08);
    --success: #16a34a;
    --success-dim: rgba(22, 163, 74, 0.08);
    --warning: #d97706;
    --warning-dim: rgba(217, 119, 6, 0.08);
    --yellow: #ca8a04;
    --yellow-dim: rgba(202, 138, 4, 0.08);
    --orange: #ea580c;
    --orange-dim: rgba(234, 88, 12, 0.08);
    --danger: #dc2626;
    --danger-dim: rgba(220, 38, 38, 0.08);
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.1);
    --progress-bg: #e2e4ea;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: background 0.2s, color 0.2s;
}

.app-content > * {
    flex-shrink: 0;
}

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

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

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

.app-header-session:has(.session-countdown) .stream-connection-chip {
    display: none;
}

.app-content:has(.explore-page-split) {
    max-width: none;
    overflow: visible;
    padding-left: 1rem;
    padding-right: 1rem;
}

.blazor-error-boundary {
    background: var(--danger-dim);
    border: 1px solid var(--danger);
    border-radius: var(--radius-sm);
    padding: 1rem;
    color: var(--danger);
    margin: 1rem 0;
}

#blazor-error-ui {
    display: none;
}

@media (max-width: 768px) {
    .app-nav .nav-link,
    .app-nav .nav-link-disabled {
        white-space: nowrap;
    }

    .app-header-session .session-countdown {
        display: none;
    }

    .app-header-session:has(.session-countdown) .stream-connection-chip {
        display: inline-flex;
    }
}
