/* ============================================================
   assets/css/style.css — Main Stylesheet
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Default theme: Light ── */
:root {
    --bg:           #f4f5f7;
    --bg-card:      #ffffff;
    --bg-input:     #f0f1f3;
    --border:       #d1d5db;
    --accent:       #4a5ce0;
    --accent-hover: #3a4cd0;
    --accent-glow:  rgba(74,92,224,0.1);
    --text-primary: #111827;
    --text-muted:   #6b7280;
    --text-label:   #4b5563;
    --danger:       #dc2626;
    --success:      #16a34a;
    --radius:       10px;
    --radius-lg:    16px;
    --font:         'Inter', system-ui, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Dark ── */
:root[data-theme="dark"] {
    --bg:           #0f1117;
    --bg-card:      #1a1d27;
    --bg-input:     #13151f;
    --border:       #2a2d3d;
    --accent:       #5b6ef5;
    --accent-hover: #4a5ce0;
    --accent-glow:  rgba(91,110,245,0.18);
    --text-primary: #e8eaf6;
    --text-muted:   #7b7f9e;
    --text-label:   #9598b5;
    --danger:       #e05a5a;
    --success:      #4caf87;
}

/* ── Midnight ── */
:root[data-theme="midnight"] {
    --bg:           #000000;
    --bg-card:      #0d0d0d;
    --bg-input:     #111111;
    --border:       #222222;
    --accent:       #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow:  rgba(59,130,246,0.15);
    --text-primary: #f8fafc;
    --text-muted:   #64748b;
    --text-label:   #94a3b8;
    --danger:       #ef4444;
    --success:      #22c55e;
}

/* ── Dusk ── */
:root[data-theme="dusk"] {
    --bg:           #16101f;
    --bg-card:      #1e1530;
    --bg-input:     #160f26;
    --border:       #2e2040;
    --accent:       #a855f7;
    --accent-hover: #9333ea;
    --accent-glow:  rgba(168,85,247,0.15);
    --text-primary: #ede9f6;
    --text-muted:   #8b7aaa;
    --text-label:   #a89cc0;
    --danger:       #f43f5e;
    --success:      #34d399;
}

/* ── Forest ── */
:root[data-theme="forest"] {
    --bg:           #0d1611;
    --bg-card:      #131f18;
    --bg-input:     #0f1a14;
    --border:       #1e3528;
    --accent:       #10b981;
    --accent-hover: #059669;
    --accent-glow:  rgba(16,185,129,0.15);
    --text-primary: #e2f0e8;
    --text-muted:   #6b9a7a;
    --text-label:   #8ab89a;
    --danger:       #f87171;
    --success:      #34d399;
}

/* ── Arctic ── */
:root[data-theme="arctic"] {
    --bg:           #f0f7ff;
    --bg-card:      #ffffff;
    --bg-input:     #e3f0fb;
    --border:       #b8d8f0;
    --accent:       #3a9bd5;
    --accent-hover: #2a8bc5;
    --accent-glow:  rgba(58,155,213,0.12);
    --text-primary: #0d2d45;
    --text-muted:   #5a89a8;
    --text-label:   #4a7a99;
    --danger:       #e53935;
    --success:      #2e7d32;
}

/* ── Orange Crush ── */
:root[data-theme="orange-crush"] {
    --bg:           #fff8f3;
    --bg-card:      #ffffff;
    --bg-input:     #fdeee4;
    --border:       #f5c9a8;
    --accent:       #e8600a;
    --accent-hover: #d45008;
    --accent-glow:  rgba(232,96,10,0.12);
    --text-primary: #2d1505;
    --text-muted:   #a0623a;
    --text-label:   #8a5230;
    --danger:       #c62828;
    --success:      #2e7d32;
}

/* ── Amber ── */
:root[data-theme="amber"] {
    --bg:           #16110a;
    --bg-card:      #1e1710;
    --bg-input:     #180f08;
    --border:       #352a18;
    --accent:       #f59e0b;
    --accent-hover: #d97706;
    --accent-glow:  rgba(245,158,11,0.15);
    --text-primary: #fef3c7;
    --text-muted:   #92754a;
    --text-label:   #b8976a;
    --danger:       #f87171;
    --success:      #4ade80;
}

html, body {
    height: 100%;
}

body {
    font-family: var(--font);
    background-color: var(--bg);
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

a:hover {
    text-decoration: underline;
}

/* --- Login Page Layout --- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background:
        radial-gradient(ellipse 80% 60% at 50% -10%, rgba(91,110,245,0.15) 0%, transparent 70%),
        var(--bg);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2.25rem;
    width: 100%;
    max-width: 420px;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    background: var(--accent-glow);
    border: 1px solid rgba(91,110,245,0.35);
    border-radius: 14px;
    margin-bottom: 1.25rem;
}

.login-logo svg {
    width: 26px;
    height: 26px;
    stroke: var(--accent);
}

.login-header h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.login-header p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

/* --- Form Elements --- */
.form-group {
    margin-bottom: 1.1rem;
}

.form-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-label);
    margin-bottom: 0.45rem;
}

.form-group input {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
}

.form-group input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-group input::placeholder {
    color: var(--text-muted);
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: var(--accent);
    color: #fff;
    margin-top: 0.5rem;
}

.btn-primary:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fff;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-sm {
    padding: 0.4rem 0.85rem;
    font-size: 0.85rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--border);
}

.btn-danger:hover {
    background: rgba(224,90,90,0.1);
    text-decoration: none;
}

/* --- Alerts --- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.alert-error {
    background: rgba(224, 90, 90, 0.1);
    border: 1px solid rgba(224, 90, 90, 0.3);
    color: #f08080;
}

.alert-success {
    background: rgba(76, 175, 135, 0.1);
    border: 1px solid rgba(76, 175, 135, 0.3);
    color: #6ecba8;
}

.alert-info {
    background: rgba(91,110,245,0.1);
    border: 1px solid rgba(91,110,245,0.3);
    color: #8fa0f8;
}

/* --- Dashboard Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 230px;
    flex-shrink: 0;
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    padding: 1.5rem 0;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--accent-glow);
    border: 1px solid rgba(91,110,245,0.35);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo-icon svg {
    width: 18px;
    height: 18px;
    stroke: var(--accent);
}

.sidebar-logo span {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 0 0.75rem;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 0 0.6rem;
    margin-bottom: 0.4rem;
    margin-top: 1rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.75rem;
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 450;
    transition: background 0.12s, color 0.12s;
    text-decoration: none;
    margin-bottom: 2px;
}

.nav-link svg {
    width: 17px;
    height: 17px;
    stroke: currentColor;
    flex-shrink: 0;
}

.nav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.nav-link.active {
    background: var(--accent-glow);
    color: var(--accent);
    font-weight: 500;
}

.sidebar-footer {
    padding: 1.25rem 1.25rem 0;
    border-top: 1px solid var(--border);
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-bottom: 0.75rem;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 1px solid rgba(91,110,245,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
}

.user-info {
    overflow: hidden;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    margin-left: 230px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    height: 58px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 2rem;
    gap: 1rem;
    background: var(--bg-card);
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    flex: 1;
}

.page-body {
    padding: 2rem;
    flex: 1;
}

/* --- Cards / Stats --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.4rem;
}

.stat-label {
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 600;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.stat-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
}

.stat-sub.up   { color: var(--success); }
.stat-sub.down { color: var(--danger); }

/* --- Content Card --- */
.content-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.content-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Welcome Banner --- */
.welcome-banner {
    background: linear-gradient(135deg, rgba(91,110,245,0.15) 0%, rgba(91,110,245,0.04) 100%);
    border: 1px solid rgba(91,110,245,0.25);
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
}

.welcome-banner h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.35rem;
}

.welcome-banner p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* --- Activity List --- */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-text {
    font-size: 0.875rem;
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Utilities --- */
.text-muted  { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-danger { color: var(--danger); }
.text-success{ color: var(--success); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-2 { gap: 0.5rem; }
.justify-between { justify-content: space-between; }

/* ============================================================
   Landing Page — Navigation & Hero
   ============================================================ */

/* --- Top Navigation Bar --- */
.topnav {
    position: sticky;
    top: 0;
    z-index: 200;
    height: 66px;
    display: flex;
    align-items: center;
    padding: 0 2.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}

.topnav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
}

.topnav-logo-box {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: var(--accent-glow);
    border: 1px solid rgba(91,110,245,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.topnav-logo-box svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
}

.topnav-wordmark {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1;
}

.topnav-wordmark span {
    color: var(--accent);
}

.topnav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 2.5rem;
    flex: 1;
}

.topnav-link {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 450;
    color: var(--text-muted);
    text-decoration: none;
    transition: background 0.12s, color 0.12s;
    white-space: nowrap;
}

.topnav-link:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
    text-decoration: none;
}

.topnav-link.active {
    color: var(--text-primary);
    background: rgba(255,255,255,0.06);
}

.topnav-actions {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    margin-left: auto;
}

.btn-nav-outline {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-nav-outline:hover {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.2);
    text-decoration: none;
    color: var(--text-primary);
}

.btn-nav-primary {
    padding: 0.45rem 1.1rem;
    border-radius: var(--radius);
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, transform 0.1s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-nav-primary:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fff;
}

.btn-nav-primary:active {
    transform: scale(0.97);
}

/* --- Hero Section --- */
.hero {
    min-height: calc(100vh - 66px);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 2rem;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(91,110,245,0.18) 0%, transparent 65%),
        radial-gradient(ellipse 40% 30% at 20% 80%, rgba(138,91,245,0.08) 0%, transparent 60%),
        var(--bg);
    position: relative;
    overflow: hidden;
}

/* Subtle music wave lines in background */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 59px,
            rgba(255,255,255,0.018) 60px
        );
    pointer-events: none;
}

.hero-inner {
    position: relative;
    max-width: 720px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 99px;
    border: 1px solid rgba(91,110,245,0.35);
    background: rgba(91,110,245,0.1);
    font-size: 0.78rem;
    font-weight: 500;
    color: #8fa0f8;
    letter-spacing: 0.03em;
    margin-bottom: 1.75rem;
}

.hero-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 3.75rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

.hero h1 em {
    font-style: normal;
    color: var(--accent);
}

.hero-sub {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto 2.25rem;
    line-height: 1.7;
}

.hero-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius);
    background: var(--accent);
    color: #fff;
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 0 0 0 rgba(91,110,245,0);
}

.btn-hero-primary:hover {
    background: var(--accent-hover);
    text-decoration: none;
    color: #fff;
    box-shadow: 0 4px 24px rgba(91,110,245,0.35);
    transform: translateY(-1px);
}

.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.6rem;
    border-radius: var(--radius);
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.btn-hero-secondary:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.2);
    text-decoration: none;
    color: var(--text-primary);
}

/* --- Features Strip --- */
.features {
    padding: 5rem 2.5rem;
    max-width: 1100px;
    margin: 0 auto;
}

.features-heading {
    text-align: center;
    margin-bottom: 3rem;
}

.features-heading h2 {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.6rem;
}

.features-heading p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
    border-color: rgba(91,110,245,0.35);
    transform: translateY(-2px);
}

.feature-icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: var(--accent-glow);
    border: 1px solid rgba(91,110,245,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent);
}

.feature-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* --- Site Footer --- */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 1.75rem 2.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.12s;
}

.footer-links a:hover {
    color: var(--text-primary);
}

/* --- Login: back link & footer text --- */
.login-back-link {
    position: absolute;
    top: 1.5rem;
    left: 1.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.12s;
}

.login-back-link:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.login-page {
    position: relative; /* needed for absolute back link */
}

.login-footer-text {
    text-align: center;
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-footer-text a {
    color: var(--accent);
    font-weight: 500;
}

/* --- Password strength indicator --- */
.password-strength {
    margin-top: 0.5rem;
    height: 3px;
    border-radius: 99px;
    background: var(--border);
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    border-radius: 99px;
    transition: width 0.25s ease, background 0.25s ease;
}

.strength-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
    min-height: 1em;
}

/* --- Input with icon (e.g. show/hide password) --- */
.input-wrap {
    position: relative;
}

.input-wrap input {
    padding-right: 2.75rem;
}

.input-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.12s;
}

.input-toggle:hover {
    color: var(--text-primary);
}

/* --- Form field hints and inline errors --- */
.field-hint {
    font-size: 0.775rem;
    color: var(--text-muted);
    margin-top: 0.35rem;
}

.field-error {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.form-group input.is-error {
    border-color: var(--danger);
}

/* ============================================================
   Settings Page
   ============================================================ */

/* --- Tab nav --- */
.settings-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.settings-tab {
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.12s, border-color 0.12s;
}

.settings-tab:hover {
    color: var(--text-primary);
    text-decoration: none;
}

.settings-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* --- Avatar display --- */
.settings-avatar-display {
    flex-shrink: 0;
}

.settings-avatar-img {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.settings-avatar-initials {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 2px solid rgba(91,110,245,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent);
}

/* --- Role badge --- */
.role-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

/* --- Avatar creator placeholder --- */
.avatar-creator-placeholder {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.coming-soon-badge {
    margin-left: auto;
    flex-shrink: 0;
    padding: 0.2rem 0.65rem;
    border-radius: 99px;
    border: 1px solid var(--border);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* ============================================================
   Admin — Manage Users
   ============================================================ */

/* --- Users table --- */
.users-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.users-table thead tr {
    border-bottom: 1px solid var(--border);
}

.users-table th {
    padding: 0.75rem 1.1rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.users-table td {
    padding: 0.8rem 1.1rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.users-table tbody tr:last-child td {
    border-bottom: none;
}

.users-table tbody tr:hover td {
    background: rgba(255,255,255,0.02);
}

.users-table tr.row-suspended td {
    opacity: 0.6;
}

/* --- Inline form (no block layout) --- */
.inline-form {
    display: inline;
}

/* --- Role select dropdown --- */
.role-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.12s;
}

.role-select:focus {
    border-color: var(--accent);
}

/* --- Filter select --- */
.filter-select {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.875rem;
    padding: 0.55rem 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.12s;
    min-width: 130px;
}

.filter-select:focus {
    border-color: var(--accent);
}

/* --- Table action buttons --- */
.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.65rem;
    border-radius: 6px;
    border: 1px solid transparent;
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.12s, opacity 0.12s;
    white-space: nowrap;
}

.btn-warn {
    background: rgba(224, 176, 90, 0.1);
    border-color: rgba(224, 176, 90, 0.25);
    color: #e0b45a;
}
.btn-warn:hover { background: rgba(224, 176, 90, 0.2); }

.btn-success {
    background: rgba(76, 175, 135, 0.1);
    border-color: rgba(76, 175, 135, 0.25);
    color: var(--success);
}
.btn-success:hover { background: rgba(76, 175, 135, 0.2); }

.btn-delete {
    background: rgba(224, 90, 90, 0.08);
    border-color: rgba(224, 90, 90, 0.2);
    color: var(--danger);
}
.btn-delete:hover { background: rgba(224, 90, 90, 0.18); }

/* --- Status / role badges --- */
.table-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.badge-admin {
    background: rgba(91,110,245,0.12);
    color: var(--accent);
    border: 1px solid rgba(91,110,245,0.3);
}

.badge-active {
    background: rgba(76,175,135,0.1);
    color: var(--success);
    border: 1px solid rgba(76,175,135,0.25);
}

.badge-suspended {
    background: rgba(224,90,90,0.1);
    color: var(--danger);
    border: 1px solid rgba(224,90,90,0.25);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 1.1rem;
    border-top: 1px solid var(--border);
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.12s, color 0.12s;
}

.page-btn:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    text-decoration: none;
}

.page-btn.active {
    background: var(--accent-glow);
    border-color: rgba(91,110,245,0.35);
    color: var(--accent);
}

/* ============================================================
   Public Profile Page
   ============================================================ */

.profile-page {
    min-height: calc(100vh - 66px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 3rem 1.5rem;
    background:
        radial-gradient(ellipse 60% 40% at 50% 0%, rgba(91,110,245,0.1) 0%, transparent 60%),
        var(--bg);
}

.profile-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    width: 100%;
    max-width: 560px;
    text-align: center;
}

/* Avatar */
.profile-avatar-wrap {
    margin: 0 auto 1.25rem;
    width: 96px;
    height: 96px;
}

.profile-avatar-img {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border);
}

.profile-avatar-initials {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 3px solid rgba(91,110,245,0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
}

.profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.profile-role-badge {
    margin-top: 0;
    margin-bottom: 1.25rem;
}

/* Bio */
.profile-bio {
    font-size: 0.925rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    white-space: pre-wrap;
}

.profile-bio-empty {
    font-style: italic;
    font-size: 0.875rem;
}

/* Meta row */
.profile-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.profile-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.82rem;
    color: var(--text-muted);
}

/* Placeholder content sections */
.profile-sections {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.75rem;
    text-align: left;
}

.profile-section-placeholder {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.9rem 1rem;
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
}

.placeholder-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.placeholder-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Action buttons row */
.profile-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* Not found state */
.profile-not-found {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 400px;
}

.profile-404-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    color: var(--text-muted);
}

.profile-not-found h1 {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.profile-not-found p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* Bio textarea in settings */
.bio-textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.bio-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.bio-textarea::placeholder {
    color: var(--text-muted);
}

/* ============================================================
   Phase 1 — Studio & Stems
   ============================================================ */

/* Track status badges */
.track-badge {
    display: inline-block;
    padding: .18rem .55rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 500;
    white-space: nowrap;
    vertical-align: middle;
    margin-left: .35rem;
}
.badge-draft    { background:rgba(123,127,158,.12); color:var(--text-muted);  border:1px solid rgba(123,127,158,.25); }
.badge-demo     { background:rgba(91,110,245,.12);  color:var(--accent);      border:1px solid rgba(91,110,245,.3);  }
.badge-released { background:rgba(76,175,135,.12);  color:var(--success);     border:1px solid rgba(76,175,135,.3);  }

/* Drop zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
}
.drop-zone:hover, .drop-zone.drag-over {
    border-color: var(--accent);
    background: var(--accent-glow);
}

/* Track mode buttons */
.track-mode-btn {
    padding: .38rem .9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: .82rem;
    cursor: pointer;
    background: var(--bg-input);
    color: var(--text-muted);
    font-family: var(--font);
    transition: all .1s;
}
.track-mode-btn:hover { color: var(--text-primary); }
.track-mode-btn.on {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(91,110,245,.4);
    font-weight: 500;
}

/* Stem rows in track view */
.stem-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid var(--border);
}
.stem-row:last-child { border-bottom: none; }

.stem-instrument-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* Instrument tag pills on profiles */
.instrument-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .5rem;
}
.instrument-tag {
    padding: .22rem .65rem;
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 500;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(91,110,245,.3);
}

/* ============================================================
   Phase 2 — Stage, Takes, Notifications
   ============================================================ */

/* ── Stage page layout ── */
.stage-page {
    min-height: 100vh;
    background: var(--bg);
}

.stage-header {
    background: linear-gradient(180deg, rgba(91,110,245,.08) 0%, transparent 100%);
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 0 2rem;
}

.stage-header-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 2rem;
}

.stage-title {
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -.03em;
    color: var(--text-primary);
    line-height: 1.15;
}

.stage-body {
    max-width: 820px;
    margin: 0 auto;
    padding: 2rem;
}

/* ── Stage player ── */
.stage-player-card { margin-bottom: 1.5rem; }

.stage-player {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.25rem;
}

.player-play-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .12s, transform .1s;
}
.player-play-btn:hover:not(:disabled) { background: var(--accent-hover); }
.player-play-btn:active { transform: scale(.96); }
.player-play-btn:disabled { background: var(--border); cursor: not-allowed; }

.player-progress-track {
    height: 5px;
    background: var(--border);
    border-radius: 99px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.player-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 99px;
    width: 0%;
    transition: width .1s linear;
}

.player-time {
    font-size: .75rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* ── Stem breakdown ── */
.stem-breakdown { display: flex; flex-direction: column; gap: .5rem; }

.stem-breakdown-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .4rem 0;
}

.stem-breakdown-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}

/* ── Stage floor (avatar grid) ── */
.stage-floor {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: .5rem 0;
    justify-content: center;
}

.stage-floor-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .4rem;
    text-align: center;
    transition: transform .15s;
}

.stage-floor-avatar:hover { transform: translateY(-3px); }

.stage-floor-img {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
}

.stage-floor-initials {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 2px solid rgba(91,110,245,.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.stage-floor-name {
    font-size: .82rem;
    font-weight: 500;
    color: var(--text-primary);
}

.stage-floor-instrument {
    font-size: .72rem;
    color: var(--text-muted);
}

.stage-floor-badge {
    font-size: .68rem;
    font-weight: 500;
    padding: .12rem .5rem;
    border-radius: 99px;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(91,110,245,.3);
}

.stage-floor-badge-contrib {
    background: rgba(76,175,135,.1);
    color: var(--success);
    border-color: rgba(76,175,135,.3);
}

/* ── Like button ── */
.like-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .4rem .85rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: none;
    color: var(--text-muted);
    font-size: .84rem;
    cursor: pointer;
    transition: all .12s;
    font-family: var(--font);
}
.like-btn:hover { border-color: #e05a5a; color: #e05a5a; }
.like-btn.liked  { border-color: #e05a5a; color: #e05a5a; background: rgba(224,90,90,.08); }

/* ── Comments ── */
.comments-list { display: flex; flex-direction: column; }

.comment-row {
    display: flex;
    gap: .75rem;
    padding: .85rem 0;
    border-bottom: 1px solid var(--border);
}
.comment-row:last-child { border-bottom: none; }

/* ── Take review rows in Studio ── */
.take-review-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}
.take-review-row:last-child { border-bottom: none; }

/* ── Notification badge ── */
.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    background: var(--danger);
    color: #fff;
    border-radius: 99px;
    font-size: .65rem;
    font-weight: 700;
    line-height: 1;
    margin-left: .3rem;
}

/* ── Notification rows ── */
.notif-row {
    display: flex;
    align-items: flex-start;
    gap: .85rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.notif-row:last-child { border-bottom: none; }
.notif-row:hover { background: rgba(255,255,255,.02); }

.notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--accent-glow);
    color: var(--accent);
    border: 1px solid rgba(91,110,245,.25);
}

.notif-icon-take_committed { background: rgba(76,175,135,.1); color: var(--success); border-color: rgba(76,175,135,.25); }
.notif-icon-take_discarded { background: rgba(224,90,90,.1);  color: var(--danger);  border-color: rgba(224,90,90,.25);  }
.notif-icon-stage_comment  { background: rgba(91,110,245,.1); color: var(--accent);  border-color: rgba(91,110,245,.25); }

/* ============================================================
   Studio Mix Player — Stem mixer strips + Take preview
   ============================================================ */

.stem-mixer-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .55rem 0;
    border-bottom: 1px solid var(--border);
}
.stem-mixer-row:last-child { border-bottom: none; }

.stem-mixer-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
    transition: opacity .15s;
}

.stem-mixer-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .12s;
    font-family: var(--font);
}
.stem-mixer-btn:hover:not(:disabled) {
    border-color: rgba(91,110,245,.4);
    color: var(--text-primary);
}
.stem-mixer-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.stem-mixer-btn.stem-btn-active {
    background: var(--accent-glow);
    border-color: rgba(91,110,245,.4);
    color: var(--accent);
}

/* Take previewing highlight */
.take-previewing {
    background: rgba(224,176,90,.06);
    border-radius: var(--radius);
    outline: 1px solid rgba(224,176,90,.25);
}

/* ============================================================
   Feed & Charts
   ============================================================ */

/* ── Feed ── */
.feed-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    transition: border-color .15s;
}
.feed-card:hover { border-color: rgba(91,110,245,.3); }

.feed-event-badge {
    display: inline-block;
    padding: .18rem .6rem;
    border-radius: 99px;
    font-size: .72rem;
    font-weight: 500;
    white-space: nowrap;
}

/* ── Charts ── */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .charts-grid { grid-template-columns: 1fr; }
}

.chart-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background .12s;
    color: inherit;
}
.chart-row:last-child { border-bottom: none; }
.chart-row:hover { background: rgba(255,255,255,.02); }

.chart-rank {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    width: 28px;
    text-align: center;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.chart-bar-track {
    height: 3px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}

.chart-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), rgba(91,110,245,.5));
    border-radius: 99px;
    transition: width .3s ease;
    min-width: 3px;
}

/* ============================================================
   Homepage — Destination Cards (Feed + Charts)
   ============================================================ */

.destination-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 0;
}

@media (max-width: 700px) {
    .destination-grid { grid-template-columns: 1fr; }
}

/* Base card */
.destination-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    min-height: 280px;
    isolation: isolate;
    transition: transform .2s ease, box-shadow .2s ease;
}

.destination-card:hover {
    transform: translateY(-4px);
    text-decoration: none;
}

/* Shared backgrounds */
.destination-card-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.destination-card-glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: 0;
    transition: opacity .3s;
}

.destination-card:hover .destination-card-glow { opacity: 1; }

/* ── Feed card — deep indigo / electric blue ── */
.destination-feed {
    background: linear-gradient(135deg, #0d1035 0%, #1a1f6e 50%, #0d2060 100%);
    border: 1px solid rgba(91,110,245,.4);
    box-shadow: 0 8px 40px rgba(91,110,245,.2);
}

.destination-feed:hover {
    box-shadow: 0 16px 60px rgba(91,110,245,.35);
}

.destination-feed .destination-card-glow {
    background: radial-gradient(ellipse at 30% 50%, rgba(91,110,245,.25) 0%, transparent 70%);
}

/* ── Charts card — deep amber / gold ── */
.destination-charts {
    background: linear-gradient(135deg, #1a0e00 0%, #3d2000 50%, #1a1000 100%);
    border: 1px solid rgba(224,176,90,.35);
    box-shadow: 0 8px 40px rgba(224,176,90,.15);
}

.destination-charts:hover {
    box-shadow: 0 16px 60px rgba(224,176,90,.28);
}

.destination-charts .destination-card-glow {
    background: radial-gradient(ellipse at 70% 40%, rgba(224,176,90,.2) 0%, transparent 65%);
}

/* Card inner content */
.destination-card-inner {
    position: relative;
    z-index: 3;
    padding: 1.75rem 1.75rem 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Icon */
.destination-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.1rem;
    flex-shrink: 0;
}

.destination-feed .destination-icon {
    background: rgba(91,110,245,.2);
    border: 1px solid rgba(91,110,245,.4);
}
.destination-feed .destination-icon svg { stroke: #7b8fff; width: 22px; height: 22px; }

.destination-charts .destination-icon {
    background: rgba(224,176,90,.15);
    border: 1px solid rgba(224,176,90,.35);
}
.destination-charts .destination-icon svg { stroke: #e0b45a; width: 22px; height: 22px; }

/* Label pill */
.destination-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
    margin-bottom: .5rem;
}
.destination-feed    .destination-label { color: #7b8fff; }
.destination-charts  .destination-label { color: #e0b45a; }

/* Title */
.destination-title {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -.025em;
    color: #ffffff;
    margin-bottom: .65rem;
    line-height: 1.25;
}

/* Description */
.destination-desc {
    font-size: .875rem;
    line-height: 1.65;
    flex: 1;
    margin-bottom: 1.25rem;
}
.destination-feed   .destination-desc { color: rgba(200,210,255,.7); }
.destination-charts .destination-desc { color: rgba(255,230,160,.65); }

/* CTA row */
.destination-cta {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .875rem;
    font-weight: 600;
    transition: gap .15s;
}
.destination-card:hover .destination-cta { gap: .7rem; }

.destination-feed   .destination-cta { color: #a0aaff; }
.destination-charts .destination-cta { color: #f0c060; }

/* ── Animated waveform bars (Feed card) ── */
.feed-bars {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 0 1.25rem 1.25rem 0;
    opacity: .18;
    transition: opacity .3s;
}

.destination-feed:hover .feed-bars { opacity: .32; }

.feed-bars span {
    display: block;
    width: 4px;
    border-radius: 99px;
    background: #7b8fff;
    animation: wavebar 1.2s ease-in-out infinite;
}

.feed-bars span:nth-child(1)  { animation-delay: 0s;    animation-duration: 1.0s; }
.feed-bars span:nth-child(2)  { animation-delay: .1s;   animation-duration: 1.3s; }
.feed-bars span:nth-child(3)  { animation-delay: .2s;   animation-duration: 0.9s; }
.feed-bars span:nth-child(4)  { animation-delay: .05s;  animation-duration: 1.1s; }
.feed-bars span:nth-child(5)  { animation-delay: .3s;   animation-duration: 1.4s; }
.feed-bars span:nth-child(6)  { animation-delay: .15s;  animation-duration: 1.0s; }
.feed-bars span:nth-child(7)  { animation-delay: .25s;  animation-duration: 1.2s; }
.feed-bars span:nth-child(8)  { animation-delay: .4s;   animation-duration: 0.8s; }
.feed-bars span:nth-child(9)  { animation-delay: .1s;   animation-duration: 1.3s; }
.feed-bars span:nth-child(10) { animation-delay: .35s;  animation-duration: 1.1s; }
.feed-bars span:nth-child(11) { animation-delay: .2s;   animation-duration: 0.9s; }
.feed-bars span:nth-child(12) { animation-delay: .45s;  animation-duration: 1.2s; }

@keyframes wavebar {
    0%, 100% { height: 12px; }
    50%       { height: 48px; }
}

/* ── Static chart bars (Charts card) ── */
.chart-bars-deco {
    position: absolute;
    bottom: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    gap: 6px;
    padding: 0 1.25rem 1.25rem 0;
    opacity: .18;
    transition: opacity .3s;
}

.destination-charts:hover .chart-bars-deco { opacity: .3; }

.chart-bars-deco span {
    display: block;
    width: 14px;
    height: var(--h, 50%);
    max-height: 80px;
    border-radius: 4px 4px 0 0;
    background: linear-gradient(180deg, #e0b45a 0%, #a07020 100%);
    transition: height .4s ease;
}

.destination-charts:hover .chart-bars-deco span {
    transition: height .4s ease;
}

/* ============================================================
   Phase 3 — Messaging & Profile
   ============================================================ */

/* ── Inbox ── */
.inbox-thread {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .9rem 1.25rem;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    transition: background .1s;
}
.inbox-thread:last-child { border-bottom: none; }
.inbox-thread:hover { background: rgba(255,255,255,.025); }
.inbox-thread-unread { background: rgba(91,110,245,.04); }
.inbox-thread-unread:hover { background: rgba(91,110,245,.07); }

/* ── Conversation ── */
.message-thread {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    min-height: 0;
}

.message-date-divider {
    text-align: center;
    font-size: .72rem;
    color: var(--text-muted);
    margin: .5rem 0;
    position: relative;
}
.message-date-divider::before,
.message-date-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 40%;
    height: 1px;
    background: var(--border);
}
.message-date-divider::before { left: 0; }
.message-date-divider::after  { right: 0; }

.message-row {
    display: flex;
    align-items: flex-end;
    gap: .55rem;
    max-width: 75%;
}
.message-mine   { align-self: flex-end;   flex-direction: row-reverse; }
.message-theirs { align-self: flex-start; }

.message-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}
.message-avatar-initials {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-glow);
    border: 1px solid rgba(91,110,245,.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 600;
    color: var(--accent);
    flex-shrink: 0;
}

.message-bubble-wrap {
    display: flex;
    flex-direction: column;
    gap: .2rem;
}
.message-mine .message-bubble-wrap { align-items: flex-end; }

.message-bubble {
    padding: .6rem .9rem;
    border-radius: 16px;
    font-size: .875rem;
    line-height: 1.55;
    max-width: 100%;
    word-break: break-word;
}
.bubble-mine {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.bubble-theirs {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
}

.message-meta {
    font-size: .7rem;
    color: var(--text-muted);
    padding: 0 .25rem;
}

/* ── Compose box ── */
.compose-box {
    padding: .85rem 1.5rem 1rem;
    border-top: 1px solid var(--border);
    background: var(--bg);
    flex-shrink: 0;
}

.compose-textarea {
    width: 100%;
    padding: .6rem .9rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .9rem;
    line-height: 1.5;
    resize: none;
    outline: none;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s;
}
.compose-textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.compose-textarea::placeholder { color: var(--text-muted); }

/* ── Profile My Tracks rows ── */
.my-track-row {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
    color: inherit;
}
.my-track-row:last-child { border-bottom: none; }
.my-track-row:hover { background: rgba(255,255,255,.025); }

/* ============================================================
   Remix System
   ============================================================ */

.badge-remix {
    background: rgba(138,91,245,.12);
    color: #8a5bf5;
    border: 1px solid rgba(138,91,245,.3);
}

.notif-icon-remix_requested { background: rgba(138,91,245,.1); color: #8a5bf5; border-color: rgba(138,91,245,.25); }
.notif-icon-remix_approved  { background: rgba(76,175,135,.1); color: var(--success); border-color: rgba(76,175,135,.25); }
.notif-icon-remix_declined  { background: rgba(224,90,90,.1);  color: var(--danger);  border-color: rgba(224,90,90,.25); }
.notif-icon-remix_created   { background: rgba(138,91,245,.1); color: #8a5bf5; border-color: rgba(138,91,245,.25); }

/* ============================================================
   Light Theme
   ============================================================ */
/* light is now the :root default — see top */

[data-theme="light"] .sidebar {
    background: #ffffff;
    border-right-color: #e5e7eb;
}
/* topbar and topnav use var(--bg-card) automatically */
[data-theme="light"] .welcome-banner {
    background: linear-gradient(135deg, rgba(74,92,224,.08) 0%, rgba(74,92,224,.02) 100%);
}
[data-theme="light"] .hero {
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(74,92,224,.1) 0%, transparent 65%),
        var(--bg);
}
[data-theme="light"] .bubble-theirs {
    background: #f3f4f6;
    border-color: #e5e7eb;
}
[data-theme="light"] .message-thread { background: #f9fafb; }
[data-theme="light"] .compose-box    { background: #f4f5f7; }
[data-theme="light"] .drop-zone      { border-color: #d1d5db; }
[data-theme="light"] .drop-zone:hover { background: rgba(74,92,224,.05); }

/* Theme toggle button */
.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s, color .12s;
    flex-shrink: 0;
}
.theme-toggle:hover {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(91,110,245,.3);
}

.notif-icon-new_follower { background: rgba(91,110,245,.1); color: var(--accent); border-color: rgba(91,110,245,.25); }

/* ── Stem source badges (remix context) ── */
.stem-source-badge {
    display: inline-block;
    font-size: .65rem;
    font-weight: 600;
    padding: .1rem .45rem;
    border-radius: 99px;
    white-space: nowrap;
    vertical-align: middle;
    letter-spacing: .02em;
    text-transform: uppercase;
}
.stem-source-original {
    background: rgba(91,110,245,.1);
    color: var(--accent);
    border: 1px solid rgba(91,110,245,.25);
}
.stem-source-new {
    background: rgba(76,175,135,.1);
    color: var(--success);
    border: 1px solid rgba(76,175,135,.3);
}

/* ============================================================
   Track Studio — Multi-stem session upload
   ============================================================ */

.ts-stem-row {
    display: flex;
    align-items: center;
    gap: .85rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background .1s;
}
.ts-stem-row:last-child { border-bottom: none; }
.ts-stem-row:hover { background: rgba(255,255,255,.02); }

.ts-stem-draft {
    background: rgba(224,176,90,.04);
    border-left: 3px solid rgba(224,176,90,.5);
}
.ts-stem-draft:hover { background: rgba(224,176,90,.07); }

.ts-stem-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ts-draft-badge {
    font-size: .65rem;
    font-weight: 600;
    padding: .1rem .45rem;
    border-radius: 99px;
    background: rgba(224,176,90,.15);
    color: #e0b45a;
    border: 1px solid rgba(224,176,90,.35);
    text-transform: uppercase;
    letter-spacing: .04em;
}

.btn-ghost-sm {
    background: var(--bg-input);
    border: 1px solid var(--border);
    color: var(--text-muted);
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font);
    font-size: .78rem;
    padding: .28rem .65rem;
    transition: all .12s;
}
.btn-ghost-sm:hover {
    color: var(--text-primary);
    border-color: rgba(91,110,245,.3);
}

/* ============================================================
   Mobile Responsiveness — Full pass
   Breakpoints:
     768px — tablet and below (sidebar collapses)
     480px — phone (single column everything)
   ============================================================ */

/* ── Shared mobile utilities ── */
@media (max-width: 768px) {

    /* ── App layout — sidebar becomes drawer ── */
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 300;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,.35);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 299;
        backdrop-filter: blur(2px);
    }

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

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    /* ── Topbar — add hamburger ── */
    .topbar {
        padding: 0 1rem;
        height: 54px;
    }

    .topbar-hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        background: var(--bg-input);
        cursor: pointer;
        flex-shrink: 0;
        margin-right: .5rem;
        color: var(--text-muted);
    }

    .topbar-title {
        font-size: .9rem;
    }

    /* ── Page body padding ── */
    .page-body {
        padding: 1rem;
    }

    /* ── Stats grid — 2 columns on tablet ── */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .75rem;
    }

    /* ── Tables — make scrollable ── */
    .users-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        font-size: .82rem;
    }

    /* ── Content cards ── */
    .content-card-header {
        flex-wrap: wrap;
        gap: .5rem;
    }

    /* ── Take review rows ── */
    .take-review-row {
        flex-wrap: wrap;
        gap: .65rem;
    }

    .take-review-row audio {
        width: 100%;
        max-width: 100% !important;
    }

    /* ── Stage page ── */
    .stage-header-inner {
        padding: 0 1rem;
    }

    .stage-body {
        padding: 1rem;
    }

    .stage-title {
        font-size: 1.5rem;
    }

    .stage-floor {
        gap: 1rem;
    }

    .stage-floor-img,
    .stage-floor-initials {
        width: 56px;
        height: 56px;
    }

    /* ── Charts grid — stack ── */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* ── Track studio — stack columns ── */
    .track-studio-grid {
        grid-template-columns: 1fr !important;
    }

    /* ── Destination cards — stack ── */
    .destination-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .destination-card {
        min-height: 220px;
    }

    /* ── Features grid — 1 column ── */
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* ── Feed cards ── */
    .feed-card {
        padding: .85rem 1rem;
    }

    /* ── Stem rows ── */
    .stem-row {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .stem-row audio {
        width: 100%;
        max-width: 100% !important;
    }

    /* ── Mix player ── */
    .stage-player {
        padding-bottom: 1rem;
    }

    .player-play-btn {
        width: 42px;
        height: 42px;
    }

    /* ── Message thread ── */
    .message-row {
        max-width: 88%;
    }

    /* ── Inbox threads ── */
    .inbox-thread {
        padding: .75rem 1rem;
    }

    /* ── Profile stats ── */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* ── Topnav public pages ── */
    .topnav {
        padding: 0 1rem;
        height: 58px;
    }

    .topnav-links {
        display: none;
    }

    .topnav-actions .btn-nav-outline {
        display: none;
    }

    /* ── Track studio upload panel — full width on mobile ── */
    .ts-stem-row {
        flex-wrap: wrap;
        gap: .5rem;
    }

    .ts-stem-row audio {
        width: 100%;
        max-width: 100% !important;
    }

    /* ── Form groups ── */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* prevents iOS zoom on focus */
    }

    /* ── Hero ── */
    .hero {
        padding: 3rem 1.25rem;
        min-height: auto;
    }

    .hero h1 {
        font-size: clamp(1.8rem, 8vw, 2.5rem);
    }

    .hero-sub {
        font-size: .95rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    /* ── Notifications ── */
    .notif-row {
        padding: .85rem 1rem;
    }

}

/* ── Phone — 480px and below ── */
@media (max-width: 480px) {

    /* Stats grid — 2 col still but tighter */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: .5rem;
    }

    .stat-card {
        padding: .85rem 1rem;
    }

    .stat-value {
        font-size: 1.6rem;
    }

    /* Charts rank number smaller */
    .chart-rank {
        font-size: .875rem;
        width: 20px;
    }

    /* Feed event badge wraps */
    .feed-card {
        gap: .65rem;
    }

    /* Stage floor — smaller avatars */
    .stage-floor-img,
    .stage-floor-initials {
        width: 48px;
        height: 48px;
    }

    .stage-floor-name {
        font-size: .72rem;
    }

    .stage-floor-instrument {
        font-size: .65rem;
    }

    /* Topbar title truncate */
    .topbar-title {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 180px;
    }

    /* Page body tighter */
    .page-body {
        padding: .75rem;
    }

    /* Content card padding */
    .content-card {
        border-radius: var(--radius);
    }

    /* Buttons full width in forms */
    .compose-box .btn {
        padding: .55rem .75rem;
    }

    /* Welcome banner */
    .welcome-banner {
        padding: 1.25rem;
    }

    .welcome-banner h2 {
        font-size: 1.1rem;
    }

    /* Destination cards */
    .destination-title {
        font-size: 1.1rem;
    }

    .destination-desc {
        font-size: .82rem;
    }
}

/* ── Hamburger button — hidden on desktop ── */
.topbar-hamburger {
    display: none;
}

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

/* ── Mobile nav menu for public pages ── */
.mobile-menu {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 400;
    background: var(--bg-card);
    flex-direction: column;
    padding: 1.5rem;
}

.mobile-menu.open { display: flex; }

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: .25rem;
}

.mobile-menu-link {
    padding: .9rem 1rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid transparent;
    transition: all .12s;
}

.mobile-menu-link:hover,
.mobile-menu-link.active {
    background: var(--accent-glow);
    color: var(--accent);
    border-color: rgba(91,110,245,.25);
}

.mobile-menu-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

/* Mobile menu trigger button in topnav */
.topnav-mobile-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .topnav-mobile-btn { display: flex; }
}

/* ============================================================
   Studio Tools — Volume Faders, Loop Region, Waveform Scrub
   ============================================================ */

/* ── Studio tool buttons (loop etc.) ── */
.studio-tool-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    padding: .32rem .75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-input);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: .78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .12s;
}
.studio-tool-btn:hover:not(:disabled) {
    border-color: rgba(91,110,245,.4);
    color: var(--accent);
}
.studio-tool-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.studio-tool-btn-active {
    background: var(--accent-glow);
    border-color: rgba(91,110,245,.4);
    color: var(--accent);
}

/* ── Volume fader ── */
.stem-fader-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 80px;
    flex-shrink: 0;
}

.stem-fader {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    outline: none;
    cursor: pointer;
    transition: opacity .12s;
}
.stem-fader:disabled { opacity: .35; cursor: not-allowed; }

.stem-fader::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 1px 3px rgba(0,0,0,.3);
    transition: transform .1s;
}
.stem-fader::-webkit-slider-thumb:hover { transform: scale(1.2); }
.stem-fader::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-card);
}

.stem-fader-val {
    font-size: .65rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    text-align: center;
}

/* ── Waveform scrub cursor ── */
.stem-waveform-scrub { cursor: pointer; }
.stem-waveform-scrub:hover { opacity: .85; }

/* ============================================================
   DAW Timeline Editor
   ============================================================ */

.daw-card { overflow: hidden; }

/* ── Transport bar ── */
.daw-transport {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .65rem 1rem;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.daw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: .78rem;
    transition: all .1s;
    flex-shrink: 0;
}
.daw-btn:hover:not(:disabled) { color: var(--text-primary); border-color: rgba(91,110,245,.4); }
.daw-btn:disabled { opacity: .35; cursor: not-allowed; }
.daw-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    width: 36px;
    height: 36px;
}
.daw-btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

.daw-btn-rec {
    color: #ef4444;
    border-color: rgba(239,68,68,.35);
}
.daw-btn-rec:hover { background: rgba(239,68,68,.1); }
.daw-rec-active {
    background: #ef4444 !important;
    border-color: #ef4444 !important;
    color: #fff !important;
    animation: rec-pulse 1s ease infinite;
}

@keyframes rec-pulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.4); }
    50%      { box-shadow: 0 0 0 5px rgba(239,68,68,0); }
}

.daw-btn-active {
    background: var(--accent-glow);
    border-color: rgba(91,110,245,.4);
    color: var(--accent);
}

.daw-btn-load {
    width: auto;
    padding: 0 .75rem;
    gap: .4rem;
}

.daw-time {
    font-size: .82rem;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: .02em;
    min-width: 80px;
}

.daw-bpm-input {
    width: 54px;
    padding: .3rem .4rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .82rem;
    text-align: center;
}
.daw-bpm-input:focus { outline: none; border-color: var(--accent); }

/* ── Timeline ── */
.daw-timeline-wrap {
    display: flex;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.daw-label-canvas {
    flex-shrink: 0;
    display: block;
    position: sticky;
    left: 0;
    z-index: 10;
}

.daw-scroll-area {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
    min-width: 0;
    max-width: 100%;
}

.daw-scroll-area canvas {
    display: block;
}

/* ── Fader strip ── */
.daw-fader-strip {
    display: flex;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    min-height: 72px;
}

.daw-fader-label-col {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
    border-right: 1px solid var(--border);
}

.daw-fader-lanes {
    flex: 1;
    display: flex;
    overflow-x: auto;
}

.daw-fader-lane {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: .5rem .75rem;
    min-width: 90px;
    border-right: 1px solid var(--border);
}

/* ── Status bar ── */
.daw-status {
    padding: .45rem 1rem;
    font-size: .75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ── DAW HTML label column (replaces label canvas) ── */
.daw-label-col {
    width: 200px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--border);
    background: var(--bg-card);
    position: sticky;
    left: 0;
    z-index: 20;
}

.daw-label-ruler-spacer {
    height: 32px; /* matches RULER_H */
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: var(--bg-card);
}

.daw-lane-ctrl {
    height: 96px; /* matches LANE_H */
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .5rem .85rem;
    border-bottom: 1px solid var(--border);
    transition: opacity .15s;
    flex-shrink: 0;
}

.daw-lane-ctrl:nth-child(odd) { background: var(--bg-card); }
.daw-lane-ctrl:nth-child(even) { background: var(--bg); }

.daw-lane-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background .15s;
}

.daw-lane-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.daw-lane-title {
    font-size: .84rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daw-lane-inst {
    font-size: .74rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.daw-lane-fader-row {
    display: flex;
    align-items: center;
    gap: .3rem;
    margin-top: 2px;
}

.daw-fader-input {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 3px;
    border-radius: 99px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}
.daw-fader-input:disabled { opacity: .4; cursor: not-allowed; }
.daw-fader-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 1px solid var(--bg-card);
}

.daw-fader-pct {
    font-size: .7rem;
    color: var(--text-muted);
    min-width: 26px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.daw-lane-btn-row {
    display: flex;
    gap: 3px;
    margin-top: 2px;
}

.daw-ms-btn {
    width: 26px;
    height: 20px;
    border: 1px solid var(--border);
    border-radius: 3px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: .6rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font);
    line-height: 1;
    transition: all .1s;
}
.daw-ms-btn:hover:not(:disabled) { color: var(--text-primary); border-color: rgba(91,110,245,.4); }
.daw-ms-btn:disabled { opacity: .35; cursor: not-allowed; }
.daw-ms-btn.stem-btn-active { background: var(--accent-glow); border-color: rgba(91,110,245,.4); color: var(--accent); }

/* ============================================================
   The Recording Deck
   ============================================================ */

.rd-overlay {
    position: fixed;
    inset: 0;
    z-index: 600;
    background: rgba(0,0,0,.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.rd-deck {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 680px;
    overflow: hidden;
    box-shadow: 0 24px 80px rgba(0,0,0,.5);
    display: flex;
    flex-direction: column;
}

/* ── Header ── */
.rd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg);
    gap: 1rem;
}

.rd-title {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .82rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.rd-header-controls {
    display: flex;
    align-items: center;
    gap: .6rem;
}

.rd-control-group {
    display: flex;
    align-items: center;
    gap: .4rem;
}

.rd-label {
    font-size: .72rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: .04em;
}

.rd-bpm-input {
    width: 54px;
    padding: .3rem .4rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .84rem;
    text-align: center;
    transition: border-color .15s, background .3s;
}
.rd-bpm-input:focus { outline: none; border-color: var(--accent); }

.rd-icon-btn {
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .12s;
    flex-shrink: 0;
}
.rd-icon-btn:hover { color: var(--text-primary); border-color: rgba(91,110,245,.4); }
.rd-btn-active {
    background: var(--accent-glow);
    border-color: rgba(91,110,245,.4);
    color: var(--accent);
}
.rd-close-btn:hover { background: rgba(239,68,68,.1); border-color: rgba(239,68,68,.4); color: #ef4444; }

/* ── Panels ── */
.rd-panel {
    border-bottom: 1px solid var(--border);
    padding: 1rem 1.25rem;
}

.rd-panel-label {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: .65rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

/* ── Mix panel ── */
.rd-mix-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rd-mix-canvas {
    flex: 1;
    border-radius: 6px;
    background: var(--bg-input);
    display: block;
    min-height: 72px;
}

.rd-mix-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
}

.rd-vol-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    height: 4px;
    border-radius: 99px;
    background: var(--border);
    outline: none;
    cursor: pointer;
}
.rd-vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: 2px solid var(--bg-card);
}

/* ── Recording panel ── */
.rd-rec-panel { background: rgba(239,68,68,.03); }

.rd-rec-body {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rd-live-canvas {
    flex: 1;
    border-radius: 6px;
    background: rgba(239,68,68,.06);
    border: 1px solid rgba(239,68,68,.15);
    display: block;
    min-height: 72px;
}

.rd-rec-btn {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: 3px solid rgba(239,68,68,.4);
    background: rgba(239,68,68,.1);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all .15s;
}
.rd-rec-btn:hover {
    background: rgba(239,68,68,.2);
    border-color: #ef4444;
    transform: scale(1.05);
}
.rd-rec-btn-active {
    background: #ef4444;
    border-color: #ef4444;
    color: #fff;
    animation: rec-pulse 1s ease infinite;
}

/* ── Countoff overlay ── */
.rd-countoff {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    z-index: 10;
}

#rd-count-num {
    font-size: 7rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    transition: transform .1s ease;
    text-shadow: 0 0 40px rgba(91,110,245,.8);
}

/* ── Save panel ── */
.rd-save-panel {
    padding: .85rem 1.25rem;
    display: flex;
    gap: .65rem;
    align-items: center;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--border);
    background: rgba(76,175,135,.04);
}

.rd-take-title-input {
    flex: 1;
    min-width: 140px;
    padding: .55rem .85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .875rem;
}
.rd-take-title-input:focus { outline: none; border-color: var(--accent); }

.rd-instrument-select {
    padding: .55rem .85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: .875rem;
    cursor: pointer;
}

.rd-save-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.1rem;
    background: var(--success);
    border: none;
    border-radius: var(--radius);
    color: #fff;
    font-family: var(--font);
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .12s;
    flex-shrink: 0;
}
.rd-save-btn:hover:not(:disabled) { opacity: .88; }
.rd-save-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Instructions bar ── */
.rd-instructions {
    padding: .65rem 1.25rem;
    font-size: .78rem;
    color: var(--text-muted);
    line-height: 1.5;
    background: var(--bg);
}

/* Make deck position relative for countoff overlay */
.rd-deck { position: relative; }

/* ── Recording Deck setup panel ── */
.rd-setup-panel {
    background: rgba(91,110,245,.04);
    border-bottom: 1px solid var(--border);
}

.rd-setup-body {
    display: flex;
    gap: .65rem;
    align-items: center;
    flex-wrap: wrap;
}

.rd-setup-body .rd-take-title-input {
    flex: 1;
    min-width: 160px;
}

/* ── Favorite button ── */
.stage-action-fav {
    color: #f59e0b !important;
    border-color: rgba(245,158,11,.35) !important;
    background: rgba(245,158,11,.08) !important;
}

/* Favorite button active state */
.like-btn.fav-active {
    color: #f59e0b;
    border-color: rgba(245,158,11,.35);
    background: rgba(245,158,11,.08);
}
.like-btn.fav-active svg { color: #f59e0b; }

/* ============================================================
   Search
   ============================================================ */
.search-result-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color .12s, background .12s;
}
.search-result-row:hover {
    border-color: rgba(91,110,245,.35);
    background: var(--accent-glow);
}

.search-tab {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .32rem .75rem;
    border: 1px solid var(--border);
    border-radius: 99px;
    font-size: .78rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    background: var(--bg-input);
    transition: all .12s;
}
.search-tab:hover { color: var(--text-primary); border-color: rgba(91,110,245,.3); }
.search-tab-active {
    background: var(--accent-glow);
    border-color: rgba(91,110,245,.4);
    color: var(--accent);
}
.search-tab-count {
    background: rgba(91,110,245,.15);
    color: var(--accent);
    border-radius: 99px;
    padding: .05rem .4rem;
    font-size: .68rem;
}

/* ============================================================
   Theme Switcher Dropdown
   ============================================================ */
.theme-switcher {
    position: relative;
    width: 100%;
}

.theme-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .45rem .75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 500;
    transition: all .12s;
    text-align: left;
}
.theme-dropdown-btn:hover {
    color: var(--text-primary);
    border-color: rgba(91,110,245,.3);
}

.theme-dropdown-panel {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.2);
    overflow: hidden;
    z-index: 200;
    min-width: 160px;
}

/* For topnav (public pages) — panel opens downward */
.topnav-actions .theme-dropdown-panel,
.topnav-actions .theme-switcher .theme-dropdown-panel {
    top: calc(100% + 6px);
    bottom: auto;
    left: auto;
    right: 0;
    min-width: 150px;
}

.topnav-actions .theme-switcher {
    width: auto;
}

.topnav-actions .theme-dropdown-btn {
    width: auto;
    padding: .32rem .65rem;
    font-size: .78rem;
}

.theme-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .85rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: .84rem;
    text-align: left;
    transition: background .1s, color .1s;
}
.theme-option:hover {
    background: var(--accent-glow);
    color: var(--text-primary);
}
.theme-option-active {
    color: var(--accent);
    font-weight: 600;
}
.theme-option-active::after {
    content: '✓';
    margin-left: auto;
    font-size: .78rem;
}

/* Light theme overrides for sidebar/topbar since default is now light */
.sidebar {
    background: var(--bg-card);
    border-right: 1px solid var(--border);
}
:root[data-theme="dark"] .sidebar,
:root[data-theme="midnight"] .sidebar,
:root[data-theme="dusk"] .sidebar,
:root[data-theme="forest"] .sidebar,
:root[data-theme="amber"] .sidebar {
    background: var(--bg-card);
}

/* ── Theme details dropdown ── */
.theme-details { list-style: none; }
.theme-details-btn {
    display: flex;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .45rem .75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 500;
    list-style: none;
    user-select: none;
    transition: all .12s;
}
.theme-details-btn:hover { color: var(--text-primary); border-color: rgba(91,110,245,.3); }
.theme-details-btn::-webkit-details-marker { display: none; }

.theme-details-panel {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(0,0,0,.15);
    z-index: 300;
    overflow: hidden;
}

.theme-details-panel .theme-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .85rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: .84rem;
    text-align: left;
    transition: background .1s, color .1s;
}
.theme-details-panel .theme-option:hover { background: var(--accent-glow); color: var(--text-primary); }
.theme-details-panel .theme-option.theme-option-active { color: var(--accent); font-weight: 600; }

/* ============================================================
   Badges & Achievements
   ============================================================ */

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

/* ── Base badge card ── */
.badge-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.25rem .75rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    background: var(--bg-card);
    cursor: default;
    transition: transform .15s, box-shadow .15s;
    overflow: hidden;
}

/* ── Locked state — transparent / dim ── */
.badge-locked {
    opacity: .38;
    filter: grayscale(0.4);
}
.badge-locked .badge-icon {
    filter: grayscale(1) opacity(0.5);
}

/* ── Earned state — bright, medal quality ── */
.badge-earned {
    opacity: 1;
    border-color: rgba(91,110,245,.3);
    background: var(--bg-card);
    box-shadow:
        0 2px 8px rgba(91,110,245,.12),
        0 1px 2px rgba(0,0,0,.08);
}

.badge-earned:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 20px rgba(91,110,245,.2),
        0 2px 6px rgba(0,0,0,.1);
}

/* Medal sheen — diagonal light sweep */
.badge-earned::before {
    content: '';
    position: absolute;
    top: -60%;
    left: -60%;
    width: 60%;
    height: 220%;
    background: linear-gradient(
        105deg,
        transparent 30%,
        rgba(255,255,255,0.18) 50%,
        transparent 70%
    );
    transform: skewX(-15deg);
    pointer-events: none;
}

/* Subtle gold top border on earned badges */
.badge-earned::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        rgba(245,180,50,.6) 30%,
        rgba(255,220,80,.9) 50%,
        rgba(245,180,50,.6) 70%,
        transparent
    );
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.badge-icon {
    font-size: 2.25rem;
    line-height: 1;
    margin-bottom: .6rem;
    display: block;
    /* Slight drop shadow on earned icons */
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.15));
}

.badge-locked .badge-icon {
    filter: grayscale(1) opacity(0.45);
}

.badge-name {
    font-size: .8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: .3rem;
    line-height: 1.3;
}

.badge-desc {
    font-size: .7rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: .5rem;
}

.badge-date {
    font-size: .65rem;
    color: var(--accent);
    font-weight: 600;
    margin-top: auto;
}

.badge-locked-label {
    font-size: .65rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: auto;
    letter-spacing: .04em;
    text-transform: uppercase;
}

/* Mobile */
@media (max-width: 480px) {
    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
        gap: .65rem;
    }
    .badge-icon { font-size: 1.75rem; }
    .badge-name { font-size: .72rem; }
    .badge-desc { font-size: .65rem; }
}

/* ── Badge toast notification ── */
.badge-toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1.1rem;
    background: var(--bg-card);
    border: 1px solid rgba(91,110,245,.35);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0,0,0,.2), 0 0 0 1px rgba(91,110,245,.1);
    animation: toast-in .35s cubic-bezier(.34,1.56,.64,1) forwards;
    max-width: 300px;
}

.badge-toast-icon { font-size: 1.75rem; line-height: 1; }
.badge-toast-text { flex: 1; min-width: 0; }
.badge-toast-label { font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: .15rem; }
.badge-toast-name  { font-size: .9rem; font-weight: 600; color: var(--text-primary); }
.badge-toast-desc  { font-size: .74rem; color: var(--text-muted); margin-top: .1rem; }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(16px) scale(.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toast-out {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(8px) scale(.96); }
}

/* ── Settings tabs ── */
.settings-tab {
    display: inline-flex;
    align-items: center;
    padding: .55rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color .12s, border-color .12s;
    white-space: nowrap;
}
.settings-tab:hover { color: var(--text-primary); text-decoration: none; }
.settings-tab-active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Site toggle switch ── */
.site-toggle { position: relative; display: inline-block; width: 40px; height: 22px; cursor: pointer; flex-shrink: 0; }
.site-toggle input { opacity: 0; width: 0; height: 0; }
.site-toggle-track {
    position: absolute; inset: 0;
    background: var(--border);
    border-radius: 99px;
    transition: background .2s;
}
.site-toggle input:checked + .site-toggle-track { background: var(--accent); }
.site-toggle-track::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.site-toggle input:checked + .site-toggle-track::after { transform: translateX(18px); }

/* ── Stage reaction buttons ── */
.like-btn.fire-active {
    color: #ef4444;
    border-color: rgba(239,68,68,.35);
    background: rgba(239,68,68,.08);
}
.like-btn.vibe-active {
    color: var(--accent);
    border-color: rgba(91,110,245,.35);
    background: var(--accent-glow);
}

/* ── Share dropdown options ── */
.share-option {
    width: 100%;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .6rem .9rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: var(--font);
    font-size: .84rem;
    text-align: left;
    transition: background .1s, color .1s;
}
.share-option:hover {
    background: var(--accent-glow);
    color: var(--text-primary);
}

/* ── Stage Visualizer ── */
#viz-waveform,
#viz-spectrum {
    display: block;
    image-rendering: crisp-edges;
}
#viz-playhead {
    will-change: left;
    transition: left 0.05s linear;
}
.stage-floor-img,
.stage-floor-initials {
    transition: transform 0.05s ease, box-shadow 0.1s ease;
    will-change: transform;
}

/* ── Analytics stat cards ── */
.stat-card-sm {
    padding: .65rem .85rem;
}
.stat-card-sm .stat-label {
    font-size: .68rem;
    margin-bottom: .2rem;
}
.stat-value-sm {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-card-feature {
    padding: .9rem 1.1rem;
}
.stat-card-feature .stat-label {
    font-size: .72rem;
    margin-bottom: .3rem;
}
.stat-value-lg {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: .2rem;
}

/* ── @ Mention autocomplete ── */
.mention-item.active,
.mention-item:hover {
    background: var(--accent-glow) !important;
    color: var(--text-primary) !important;
}

/* ── Comment action buttons (like, report) ── */
.comment-action-btn {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .5rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 99px;
    cursor: pointer;
    font-family: var(--font);
    font-size: .72rem;
    color: var(--text-muted);
    transition: all .12s;
}
.comment-action-btn:hover {
    background: var(--bg-input);
    border-color: var(--border);
    color: var(--text-primary);
}
.comment-action-btn.comment-liked {
    color: #e05a5a;
    border-color: rgba(224,90,90,.25);
    background: rgba(224,90,90,.06);
}

/* Report badge on sidebar */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 .35rem;
    background: var(--danger);
    color: #fff;
    border-radius: 99px;
    font-size: .65rem;
    font-weight: 700;
    margin-left: .35rem;
}

/* ============================================================
   Shiny / Holographic Badge Effect — Full Card Foil
   ============================================================ */

.badge-shiny {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    cursor: default;
    box-shadow: 0 2px 12px rgba(91,110,245,.3), 0 1px 3px rgba(0,0,0,.15) !important;
    background: var(--bg-card) !important;
}

/* Base foil — always-on animated rainbow covering the whole card */
.badge-shiny .badge-foil-base {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        var(--holo-angle, 125deg),
        rgba(255,0,128,0.55)   0%,
        rgba(255,100,0,0.55)  14%,
        rgba(255,220,0,0.55)  28%,
        rgba(0,255,120,0.55)  42%,
        rgba(0,180,255,0.55)  57%,
        rgba(100,0,255,0.55)  71%,
        rgba(255,0,200,0.55)  85%,
        rgba(255,0,128,0.55) 100%
    );
    mix-blend-mode: screen;
    opacity: 0.4;
    animation: holo-idle 4s ease-in-out infinite;
    transition: opacity .2s;
}
.badge-shiny:hover .badge-foil-base {
    opacity: 0.75;
    animation-play-state: paused;
}

/* On light themes, screen is too bright — use overlay instead */
:root .badge-shiny .badge-foil-base,
:root[data-theme="light"] .badge-shiny .badge-foil-base,
:root[data-theme="arctic"] .badge-shiny .badge-foil-base,
:root[data-theme="orange-crush"] .badge-shiny .badge-foil-base {
    mix-blend-mode: multiply;
    opacity: 0.28;
}
:root .badge-shiny:hover .badge-foil-base,
:root[data-theme="light"] .badge-shiny:hover .badge-foil-base,
:root[data-theme="arctic"] .badge-shiny:hover .badge-foil-base,
:root[data-theme="orange-crush"] .badge-shiny:hover .badge-foil-base {
    opacity: 0.5;
}

/* Glitter dot grid — shifts with mouse */
.badge-shiny .badge-foil-glitter {
    position: absolute;
    inset: 0;
    z-index: 2;
    border-radius: inherit;
    pointer-events: none;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.95) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,200,100,0.9)  1px, transparent 1px),
        radial-gradient(circle, rgba(150,220,255,0.9)  1px, transparent 1px);
    background-size: 16px 16px, 10px 10px, 22px 22px;
    background-position:
        var(--glitter-x, 2px) var(--glitter-y, 2px),
        calc(var(--glitter-x, 2px) + 5px) calc(var(--glitter-y, 2px) + 3px),
        calc(var(--glitter-x, 2px) - 4px) calc(var(--glitter-y, 2px) + 7px);
    mix-blend-mode: screen;
    opacity: 0.5;
    transition: opacity .15s, background-position .05s;
}
.badge-shiny:hover .badge-foil-glitter { opacity: 1; }

/* Sweep highlight — follows mouse across full card */
.badge-shiny .badge-foil-sweep {
    position: absolute;
    inset: 0;
    z-index: 3;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(
        var(--holo-angle, 125deg),
        transparent 0%,
        rgba(255,255,255,0.0) 35%,
        rgba(255,255,255,0.5) 50%,
        rgba(255,255,255,0.0) 65%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity .15s;
}
.badge-shiny:hover .badge-foil-sweep { opacity: 1; }

/* Idle animation — hue rotation */
@keyframes holo-idle {
    0%   { filter: hue-rotate(0deg)   saturate(1.2); }
    25%  { filter: hue-rotate(90deg)  saturate(1.5); }
    50%  { filter: hue-rotate(180deg) saturate(1.2); }
    75%  { filter: hue-rotate(270deg) saturate(1.5); }
    100% { filter: hue-rotate(360deg) saturate(1.2); }
}

/* Rainbow top border */
.badge-shiny .badge-earned-bar {
    background: linear-gradient(90deg,
        #ff0055, #ff6600, #ffdd00,
        #00ee66, #0099ff, #8800ff, #ff0099, #ff0055
    ) !important;
    background-size: 200% 100% !important;
    animation: rainbow-shift 2.5s linear infinite !important;
}
@keyframes rainbow-shift {
    0%   { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

/* Sparkle particles */
@keyframes sparkle-float {
    0%   { transform: translateY(0) scale(0) rotate(0deg); opacity: 0; }
    20%  { opacity: 1; transform: translateY(-5px) scale(1) rotate(45deg); }
    80%  { opacity: .8; }
    100% { transform: translateY(-16px) scale(.1) rotate(120deg); opacity: 0; }
}
.badge-sparkle {
    position: absolute;
    z-index: 10;
    pointer-events: none;
    animation: sparkle-float 1.5s ease-out forwards;
}

/* Hover lift */
.badge-shiny:hover {
    transform: translateY(-3px) scale(1.04) !important;
    box-shadow:
        0 10px 32px rgba(130,80,255,.35),
        0 4px 12px rgba(0,0,0,.2) !important;
}

/* ── Shiny gem variants ── */
/* On dark themes, gem foil uses screen blend for visibility */
:root[data-theme="dark"] .badge-shiny .badge-foil-base,
:root[data-theme="midnight"] .badge-shiny .badge-foil-base,
:root[data-theme="dusk"] .badge-shiny .badge-foil-base,
:root[data-theme="forest"] .badge-shiny .badge-foil-base,
:root[data-theme="amber"] .badge-shiny .badge-foil-base {
    mix-blend-mode: screen !important;
    opacity: 0.55 !important;
}
:root[data-theme="dark"] .badge-shiny:hover .badge-foil-base,
:root[data-theme="midnight"] .badge-shiny:hover .badge-foil-base,
:root[data-theme="dusk"] .badge-shiny:hover .badge-foil-base,
:root[data-theme="forest"] .badge-shiny:hover .badge-foil-base,
:root[data-theme="amber"] .badge-shiny:hover .badge-foil-base {
    opacity: 0.85 !important;
}

/* Diamond — white/silver prismatic, subtle rainbow on white */
.badge-shiny-diamond .badge-foil-base {
    background: linear-gradient(
        var(--holo-angle, 125deg),
        rgba(220,230,255,0.7)  0%,
        rgba(255,255,255,0.9) 20%,
        rgba(200,240,255,0.7) 35%,
        rgba(240,220,255,0.7) 50%,
        rgba(255,240,200,0.7) 65%,
        rgba(200,255,230,0.7) 80%,
        rgba(220,230,255,0.7) 100%
    ) !important;
}
.badge-shiny-diamond .badge-foil-glitter {
    background-image:
        radial-gradient(circle, rgba(255,255,255,1.0) 1px, transparent 1px),
        radial-gradient(circle, rgba(220,240,255,0.9) 1px, transparent 1px),
        radial-gradient(circle, rgba(240,220,255,0.8) 1px, transparent 1px) !important;
}
.badge-shiny-diamond .badge-earned-bar {
    background: linear-gradient(90deg,
        #e0e8ff, #ffffff, #c8f0ff,
        #f0d8ff, #ffe8c0, #c8ffe8, #e0e8ff
    ) !important;
}

/* Sapphire — deep blue to cyan */
.badge-shiny-sapphire .badge-foil-base {
    background: linear-gradient(
        var(--holo-angle, 125deg),
        rgba(0,40,180,0.6)   0%,
        rgba(0,120,255,0.7) 20%,
        rgba(0,200,255,0.7) 40%,
        rgba(0,240,220,0.6) 55%,
        rgba(0,160,255,0.7) 70%,
        rgba(30,80,220,0.6) 85%,
        rgba(0,40,180,0.6) 100%
    ) !important;
}
.badge-shiny-sapphire .badge-foil-glitter {
    background-image:
        radial-gradient(circle, rgba(180,220,255,1.0) 1px, transparent 1px),
        radial-gradient(circle, rgba(0,200,255,0.9)   1px, transparent 1px),
        radial-gradient(circle, rgba(100,180,255,0.8) 1px, transparent 1px) !important;
}
.badge-shiny-sapphire .badge-earned-bar {
    background: linear-gradient(90deg,
        #0028b4, #0078ff, #00c8ff,
        #00f0dc, #00a0ff, #1e50dc, #0028b4
    ) !important;
}

/* Emerald — deep green to teal */
.badge-shiny-emerald .badge-foil-base {
    background: linear-gradient(
        var(--holo-angle, 125deg),
        rgba(0,80,20,0.6)    0%,
        rgba(0,180,80,0.7)  20%,
        rgba(0,220,120,0.7) 40%,
        rgba(0,200,160,0.6) 55%,
        rgba(0,160,80,0.7)  70%,
        rgba(0,100,40,0.6)  85%,
        rgba(0,80,20,0.6)  100%
    ) !important;
}
.badge-shiny-emerald .badge-foil-glitter {
    background-image:
        radial-gradient(circle, rgba(180,255,200,1.0) 1px, transparent 1px),
        radial-gradient(circle, rgba(0,220,120,0.9)   1px, transparent 1px),
        radial-gradient(circle, rgba(100,255,180,0.8) 1px, transparent 1px) !important;
}
.badge-shiny-emerald .badge-earned-bar {
    background: linear-gradient(90deg,
        #005014, #00b450, #00dc78,
        #00c8a0, #00a050, #006428, #005014
    ) !important;
}

/* Ruby — deep red to pink/magenta */
.badge-shiny-ruby .badge-foil-base {
    background: linear-gradient(
        var(--holo-angle, 125deg),
        rgba(160,0,20,0.6)   0%,
        rgba(220,0,60,0.7)  20%,
        rgba(255,40,100,0.7) 40%,
        rgba(255,0,160,0.6) 55%,
        rgba(220,20,80,0.7)  70%,
        rgba(180,0,40,0.6)   85%,
        rgba(160,0,20,0.6)  100%
    ) !important;
}
.badge-shiny-ruby .badge-foil-glitter {
    background-image:
        radial-gradient(circle, rgba(255,180,200,1.0) 1px, transparent 1px),
        radial-gradient(circle, rgba(255,40,100,0.9)  1px, transparent 1px),
        radial-gradient(circle, rgba(255,120,160,0.8) 1px, transparent 1px) !important;
}
.badge-shiny-ruby .badge-earned-bar {
    background: linear-gradient(90deg,
        #a00014, #dc003c, #ff2864,
        #ff00a0, #dc1450, #b40028, #a00014
    ) !important;
}

/* ── Onboarding Tour ── */
#tour-overlay {
    animation: tour-fade-in .2s ease forwards;
}
#tour-tooltip {
    animation: tour-slide-in .25s cubic-bezier(.34,1.56,.64,1) forwards;
}
@keyframes tour-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes tour-slide-in {
    from { opacity: 0; transform: scale(.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
#tour-next:hover { opacity: .9; }
#tour-back:hover { background: var(--bg-card); }
#tour-skip:hover { color: var(--text-primary); }

/* ── Profile Personalisation ── */
.banner-swatch { cursor: pointer; transition: all .12s; }
.banner-swatch:hover { border-color: var(--accent) !important; transform: scale(1.03); }
.banner-swatch-active { border-color: var(--accent) !important; box-shadow: 0 0 0 2px var(--accent); }

/* Profile accent colour — applied via --profile-accent CSS var on parent */
.content-card:has([style*="--profile-accent"]) .btn-primary,
[style*="--profile-accent"] .btn-primary {
    background: var(--profile-accent, var(--accent)) !important;
}
[style*="--profile-accent"] a[style*="color:var(--accent)"] {
    color: var(--profile-accent, var(--accent)) !important;
}

/* Director's Note on stage */

/* ============================================================
   Mobile Pass — Comprehensive fixes for small screens
   ============================================================ */

/* ── Global ── */
@media (max-width: 600px) {
    /* Prevent horizontal overflow */
    body { overflow-x: hidden; }

    /* Page body padding */
    .page-body { padding: 1rem !important; }

    /* Content cards */
    .content-card { padding: 1rem !important; }
    .content-card-header { flex-wrap: wrap; gap: .5rem; }

    /* Topbar title truncation */
    .topbar-title { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

    /* Buttons — don't overflow */
    .btn { white-space: nowrap; }

    /* ── Studio analytics ── */
    .stat-card-sm .stat-value-sm { font-size: 1.1rem; }
    .stat-card-feature .stat-value-lg { font-size: 1.5rem; }

    /* ── Stage player ── */
    .stage-player { flex-direction: column; }
    .stage-player > div:first-child { flex-wrap: wrap; }
    #viz-waveform { max-height: 120px !important; }
    #viz-spectrum { height: 44px !important; }

    /* Stage engagement bar */
    .stage-engagement { flex-wrap: wrap; gap: .4rem; }

    /* Stage floor — scroll horizontally */
    .stage-floor { overflow-x: auto; padding-bottom: .5rem; }

    /* Stem mixer rows */
    .stem-mixer-row { flex-wrap: wrap; gap: .35rem; }

    /* ── Comments ── */
    .comment-row { gap: .5rem; }
    .comment-row img,
    .comment-row > div:first-child { width: 28px !important; height: 28px !important; min-width: 28px; }

    /* ── Charts ── */
    .chart-row { gap: .5rem; padding: .65rem .85rem; }
    .chart-rank { font-size: 1rem; min-width: 24px; }

    /* ── Profile header ── */
    .profile-header-inner { flex-direction: column; align-items: flex-start; gap: 1rem; }

    /* ── Badges grid — 2 cols on small screens ── */
    .badges-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: .65rem !important;
    }
    .badge-card { padding: .85rem .5rem .75rem; }
    .badge-icon { font-size: 1.5rem !important; }
    .badge-name { font-size: .72rem !important; }
    .badge-desc { display: none; } /* hide desc on mobile to save space */
    .badge-date { font-size: .65rem !important; }

    /* ── Profile stats grid ── */
    .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }

    /* ── Feed track cards ── */
    .feed-card-meta { flex-wrap: wrap; gap: .3rem; }

    /* ── Track table rows ── */
    .my-track-row { flex-wrap: wrap; }

    /* ── Inbox/conversation ── */
    .message-bubble { max-width: 85% !important; }

    /* ── Settings tabs ── */
    .settings-tabs { overflow-x: auto; white-space: nowrap; }

    /* ── Tour tooltip ── */
    #tour-tooltip { padding: 1rem 1.1rem !important; }

    /* ── Report modal ── */
    #report-modal > div { padding: 1.1rem !important; }

    /* ── Mention dropdown ── */
    #mention-dropdown { font-size: .8rem; }

    /* ── Admin pages ── */
    .admin-row { flex-wrap: wrap; }
}

/* ── Medium screens (tablets) ── */
@media (max-width: 768px) {
    /* Studio analytics rows */
    .stat-card-sm .stat-label { font-size: .65rem; }

    /* Profile banner */
    .profile-banner { height: 80px !important; }

    /* Stage visualizer */
    #viz-waveform { max-height: 160px !important; }

    /* Charts tab labels */
    .chart-tab-label { font-size: .78rem; }

    /* Badges grid — 3 cols on tablet */
    .badges-grid { grid-template-columns: repeat(3, 1fr) !important; }

    /* Share menu alignment */
    #share-menu { right: auto !important; left: 0 !important; }
}

/* ── Very small screens ── */
@media (max-width: 380px) {
    .badges-grid { grid-template-columns: repeat(2, 1fr) !important; }
    .stats-grid  { grid-template-columns: repeat(2, 1fr) !important; }
    .content-card { padding: .75rem !important; }
    .topbar { padding: 0 .75rem; }
    .page-body { padding: .75rem !important; }
}

/* Studio analytics grid collapse */
@media (max-width: 600px) {
    .studio-stats-row-4 { grid-template-columns: repeat(2, 1fr) !important; }
    .studio-stats-row-3 { grid-template-columns: repeat(1, 1fr) !important; }
}
@media (max-width: 768px) {
    .studio-stats-row-3 { grid-template-columns: repeat(2, 1fr) !important; }
}

/* Chart tabs scroll on mobile */
@media (max-width: 600px) {
    .chart-tabs-row {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
        display: flex !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
    }
    .chart-tabs-row::-webkit-scrollbar { display: none; }
    .chart-tabs-row a { flex-shrink: 0; }
}

/* Profile banner height on mobile */
@media (max-width: 600px) {
    .profile-banner-inner { height: 75px !important; margin: -1rem -1rem 1rem !important; }
}

/* Public topnav mobile */
@media (max-width: 600px) {
    .topnav { padding: 0 1rem; }
    .topnav-links { gap: .75rem; }
    .topnav-link { font-size: .8rem; }
    .topnav-actions .btn { padding: .38rem .75rem; font-size: .78rem; }

    /* Feed cards */
    .feed-track-card { padding: .85rem 1rem; }

    /* Inbox */
    .inbox-row { flex-wrap: wrap; gap: .5rem; }

    /* Notification rows */
    .notif-row { gap: .5rem; }

    /* Search */
    .search-result-row { flex-wrap: wrap; }

    /* DAW timeline — hide on very small (non-functional anyway) */
    @media (max-width: 480px) {
        #daw-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    }
}
