:root {
    color-scheme: dark;
    --bg-color: #080b11;
    --card-bg: rgba(255, 255, 255, .03);
    --card-border: rgba(255, 255, 255, .1);
    --border-strong: rgba(255, 255, 255, .2);
    --text-primary: #f3f4f6;
    --text-secondary: #a1a8b8;
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, .25);
    --accent-text: #b7b9ff;
    --accent-bg: rgba(99, 102, 241, .14);
    --accent-border: rgba(129, 140, 248, .5);
    --plus-gradient: linear-gradient(135deg, #7c3aed 0%, #db2777 100%);
    --pro-gradient: linear-gradient(135deg, #b45309 0%, #dc2626 100%);
    --emerald: #10b981;
    --rose-color: #ef4444;
    --amber: #f59e0b;
    --surface-bg: rgba(15, 23, 42, .55);
    --surface-muted: rgba(255, 255, 255, .035);
    --surface-raised: #141b2b;
    --surface-hover: rgba(255, 255, 255, .07);
    --input-bg: rgba(255, 255, 255, .035);
    --nav-bg: rgba(8, 11, 17, .85);
    --footer-bg: rgba(8, 11, 17, .5);
    --panel-shadow: 0 16px 40px -16px rgba(0, 0, 0, .45);
    --success-text: #6ee7b7;
    --success-bg: rgba(16, 185, 129, .12);
    --success-border: rgba(16, 185, 129, .3);
    --danger-text: #fca5a5;
    --danger-bg: rgba(239, 68, 68, .1);
    --danger-border: rgba(248, 113, 113, .4);
    --warning-text: #fcd34d;
    --warning-bg: rgba(245, 158, 11, .12);
    --info-text: #93c5fd;
    --info-bg: rgba(59, 130, 246, .08);
    --info-border: rgba(96, 165, 250, .3);
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg-color: #f5f6fb;
    --card-bg: rgba(255, 255, 255, .8);
    --card-border: rgba(31, 41, 55, .12);
    --border-strong: rgba(31, 41, 55, .24);
    --text-primary: #1c2335;
    --text-secondary: #5b6478;
    --primary: #4f46e5;
    --primary-glow: rgba(99, 102, 241, .16);
    --accent-text: #5040b8;
    --accent-bg: rgba(99, 102, 241, .08);
    --accent-border: rgba(99, 102, 241, .35);
    --emerald: #087443;
    --rose-color: #b42336;
    --amber: #895209;
    --surface-bg: rgba(255, 255, 255, .85);
    --surface-muted: rgba(99, 102, 241, .035);
    --surface-raised: #fff;
    --surface-hover: rgba(99, 102, 241, .07);
    --input-bg: #fff;
    --nav-bg: rgba(245, 246, 251, .9);
    --footer-bg: rgba(245, 246, 251, .65);
    --panel-shadow: 0 16px 40px -16px rgba(31, 41, 75, .14);
    --success-text: #087443;
    --success-bg: rgba(16, 185, 129, .07);
    --success-border: rgba(8, 116, 67, .25);
    --danger-text: #b42336;
    --danger-bg: rgba(239, 68, 68, .055);
    --danger-border: rgba(180, 35, 54, .35);
    --warning-text: #895209;
    --warning-bg: rgba(245, 158, 11, .09);
    --info-text: #245da8;
    --info-bg: rgba(59, 130, 246, .05);
    --info-border: rgba(37, 93, 168, .25);
}

.nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    min-width: 0;
}

.theme-switcher {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 3px;
    padding: 4px;
    border: 1px solid var(--card-border);
    border-radius: 12px;
    background: var(--surface-muted);
}

.theme-switcher button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 9px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: .75rem;
    font-weight: 600;
    cursor: pointer;
}

.theme-switcher button:hover {
    background: var(--surface-hover);
    color: var(--text-primary);
}

.theme-switcher button[aria-pressed="true"] {
    background: var(--accent-bg);
    color: var(--accent-text);
    box-shadow: inset 0 0 0 1px var(--accent-border);
}

.theme-switcher svg {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

:where(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

@media (max-width: 1000px) {
    .nav-actions { gap: 10px; }
    .theme-switcher button { gap: 4px; padding-inline: 7px; }
}

@media (max-width: 768px) {
    .nav-actions { order: 2; flex-wrap: wrap; }
}

@media (max-width: 520px) {
    .nav-actions { width: 100%; justify-content: space-between; gap: 8px; }
    .nav-user-status { width: 100%; gap: 8px; }
    .nav-user-status .nav-btn { flex-shrink: 0; }
    .nav-user-status .username-display { flex: 1; max-width: none; }
    .theme-switcher button { padding-inline: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
