* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ============ Design tokens ============ */
:root {
    --font-display: 'Space Grotesk', 'Inter', sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', 'Monaco', monospace;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 20px;
    --ease: cubic-bezier(.22,.9,.32,1);

    --success: #4ade80;
    --danger: #f2685b;
    --warning: #e0a83e;
    --accent: var(--brass-bright);

    /* Theme mode flag for conditional styles (0 = dark, 1 = light) */
    --is-light: 0;
    --overlay-bg: rgba(6,9,16,0.65);
    --dropdown-bg: rgba(18, 20, 26, 0.97);
    --card-bg: rgba(17, 24, 39, 0.92);
    --card-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(201, 161, 94, 0.15);
    --footer-bg: rgba(0, 0, 0, 0.08);
    --progress-bg: rgba(0, 0, 0, 0.12);
    --bar-bg: var(--surface);
    --bar-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--brass-dim);
    --shadow-color: rgba(0,0,0,0.35);
    --auth-brand-bg: radial-gradient(120% 140% at 15% 0%, #16203a 0%, var(--bg-elev) 55%, var(--bg) 100%);
    --code-editor-bg: #0d1117;
    --code-editor-text: #d4d8e2;
}

/* ============ THEME 1: Obsidiana Dorada (Dark) ============ */
[data-theme="obsidian-gold"], :root {
    --bg: #0a0e16;
    --bg-elev: #0d1220;
    --surface: #111827;
    --surface-2: #1a2233;
    --surface-3: #212b40;
    --line: rgba(255,255,255,0.08);
    --line-strong: rgba(255,255,255,0.16);

    --brass: #c9a15e;
    --brass-bright: #e7c077;
    --brass-dim: #8a6f42;
    --brass-wash: rgba(201,161,94,0.12);

    --text: #eaedf3;
    --text-dim: #8992a6;
    --text-faint: #5c6479;
}

/* ============ THEME 2: Océano Profundo (Dark) ============ */
[data-theme="ocean-deep"] {
    --bg: #080e17;
    --bg-elev: #0b1422;
    --surface: #0f1a2e;
    --surface-2: #152238;
    --surface-3: #1c2d48;
    --line: rgba(100,180,255,0.08);
    --line-strong: rgba(100,180,255,0.16);

    --brass: #5eafc9;
    --brass-bright: #7ecde8;
    --brass-dim: #3e7f99;
    --brass-wash: rgba(94,175,201,0.12);

    --text: #e0eaf5;
    --text-dim: #7e95b2;
    --text-faint: #4e6580;
}

/* ============ THEME 3: Bosque Nocturno (Dark) ============ */
[data-theme="forest-night"] {
    --bg: #080f0d;
    --bg-elev: #0c1612;
    --surface: #11201a;
    --surface-2: #182c24;
    --surface-3: #1f3830;
    --line: rgba(100,220,150,0.08);
    --line-strong: rgba(100,220,150,0.16);

    --brass: #5ec98a;
    --brass-bright: #7ee8a8;
    --brass-dim: #3e9968;
    --brass-wash: rgba(94,201,138,0.12);

    --text: #e0f5ea;
    --text-dim: #7eb29a;
    --text-faint: #4e806a;
}

/* ============ THEME 4: Nebulosa (Dark) ============ */
[data-theme="nebula"] {
    --bg: #0d0a16;
    --bg-elev: #120d20;
    --surface: #181228;
    --surface-2: #221a36;
    --surface-3: #2c2244;
    --line: rgba(180,140,255,0.08);
    --line-strong: rgba(180,140,255,0.16);

    --brass: #a07ce0;
    --brass-bright: #bf9af5;
    --brass-dim: #7758b0;
    --brass-wash: rgba(160,124,224,0.12);

    --text: #eae4f5;
    --text-dim: #9488b2;
    --text-faint: #6c5e8a;
}

/* ============ THEME 5: Arena Cálida (Light) ============ */
[data-theme="warm-sand"] {
    --is-light: 1;
    --bg: #f5f0e8;
    --bg-elev: #faf6ef;
    --surface: #ffffff;
    --surface-2: #f7f2ea;
    --surface-3: #ede6da;
    --line: #e0d6c6;
    --line-strong: #cfc3ae;

    --brass: #b8860b;
    --brass-bright: #d4a017;
    --brass-dim: #8b6914;
    --brass-wash: rgba(184,134,11,0.10);

    --text: #2c2416;
    --text-dim: #6b5d4a;
    --text-faint: #9a8e7c;

    --overlay-bg: rgba(44,36,22,0.45);
    --dropdown-bg: rgba(255,255,255,0.97);
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--line);
    --footer-bg: rgba(0, 0, 0, 0.02);
    --progress-bg: rgba(0, 0, 0, 0.03);
    --bar-bg: rgba(255, 255, 255, 0.95);
    --bar-shadow: 0 16px 40px rgba(0, 0, 0, 0.12), 0 0 0 1px var(--brass-wash);
    --shadow-color: rgba(0,0,0,0.08);
    --auth-brand-bg: radial-gradient(120% 140% at 15% 0%, #ffffff 0%, #faf6ef 60%, #f5f0e8 100%);
    --code-editor-bg: #1a1f2b;
    --code-editor-text: #e6e9f0;
}

/* ============ THEME 6: Cielo Abierto (Light) ============ */
[data-theme="open-sky"] {
    --is-light: 1;
    --bg: #eef2f8;
    --bg-elev: #f4f7fc;
    --surface: #ffffff;
    --surface-2: #f0f4fa;
    --surface-3: #e2e8f2;
    --line: #d4dce8;
    --line-strong: #bcc6d6;

    --brass: #3b7dd8;
    --brass-bright: #5a9bf0;
    --brass-dim: #2c5fa6;
    --brass-wash: rgba(59,125,216,0.10);

    --text: #111827;
    --text-dim: #4b5e7a;
    --text-faint: #8694ab;

    --overlay-bg: rgba(17,24,39,0.40);
    --dropdown-bg: rgba(255,255,255,0.97);
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--line);
    --footer-bg: rgba(0, 0, 0, 0.02);
    --progress-bg: rgba(0, 0, 0, 0.03);
    --bar-bg: rgba(255, 255, 255, 0.95);
    --bar-shadow: 0 16px 40px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--brass-wash);
    --shadow-color: rgba(0,0,0,0.06);
    --auth-brand-bg: radial-gradient(120% 140% at 15% 0%, #ffffff 0%, #f4f7fc 60%, #eef2f8 100%);
    --code-editor-bg: #1a1f2b;
    --code-editor-text: #e6e9f0;
}

/* ============ THEME 7: Jardín (Light) ============ */
[data-theme="garden"] {
    --is-light: 1;
    --bg: #ecf5f0;
    --bg-elev: #f3faf6;
    --surface: #ffffff;
    --surface-2: #eef7f2;
    --surface-3: #dff0e6;
    --line: #c8e0d2;
    --line-strong: #aecfbc;

    --brass: #2a9d6f;
    --brass-bright: #3cc08a;
    --brass-dim: #1e7a55;
    --brass-wash: rgba(42,157,111,0.10);

    --text: #0f1f18;
    --text-dim: #3d6b55;
    --text-faint: #7da592;

    --overlay-bg: rgba(15,31,24,0.40);
    --dropdown-bg: rgba(255,255,255,0.97);
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--line);
    --footer-bg: rgba(0, 0, 0, 0.02);
    --progress-bg: rgba(0, 0, 0, 0.03);
    --bar-bg: rgba(255, 255, 255, 0.95);
    --bar-shadow: 0 16px 40px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--brass-wash);
    --shadow-color: rgba(0,0,0,0.06);
    --auth-brand-bg: radial-gradient(120% 140% at 15% 0%, #ffffff 0%, #f3faf6 60%, #ecf5f0 100%);
    --code-editor-bg: #1a1f2b;
    --code-editor-text: #e6e9f0;
}

/* ============ THEME 8: Atardecer (Light) ============ */
[data-theme="sunset"] {
    --is-light: 1;
    --bg: #f8eff2;
    --bg-elev: #fdf5f7;
    --surface: #ffffff;
    --surface-2: #faf0f3;
    --surface-3: #f0e2e7;
    --line: #e8d0d8;
    --line-strong: #d8b8c2;

    --brass: #d46b8c;
    --brass-bright: #e88aa8;
    --brass-dim: #a85070;
    --brass-wash: rgba(212,107,140,0.10);

    --text: #1f0f15;
    --text-dim: #7a5060;
    --text-faint: #ab8a96;

    --overlay-bg: rgba(31,15,21,0.40);
    --dropdown-bg: rgba(255,255,255,0.97);
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-shadow: 0 24px 56px -12px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--line);
    --footer-bg: rgba(0, 0, 0, 0.02);
    --progress-bg: rgba(0, 0, 0, 0.03);
    --bar-bg: rgba(255, 255, 255, 0.95);
    --bar-shadow: 0 16px 40px rgba(0, 0, 0, 0.10), 0 0 0 1px var(--brass-wash);
    --shadow-color: rgba(0,0,0,0.06);
    --auth-brand-bg: radial-gradient(120% 140% at 15% 0%, #ffffff 0%, #fdf5f7 60%, #f8eff2 100%);
    --code-editor-bg: #1a1f2b;
    --code-editor-text: #e6e9f0;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.01em; }

/* faint isometric grid texture behind everything */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 64px 64px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 0%, transparent 75%);
    pointer-events: none;
    z-index: 0;
}

#app { position: relative; z-index: 1; }

/* ============ Screens (crossfade instead of hard swap) ============ */
.screen {
    position: fixed;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    overflow-y: auto;
    transition: opacity 0.45s var(--ease), visibility 0s linear 0.45s;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.45s var(--ease);
}

/* ============ Cube brand mark ============ */
.cube-mark {
    position: relative;
    width: 56px;
    height: 56px;
    transform-style: preserve-3d;
    flex-shrink: 0;
}
.cube-mark .face {
    position: absolute;
    inset: 0;
    clip-path: polygon(50% 0%, 100% 25%, 50% 50%, 0% 25%);
}
.cube-mark .face-top { background: var(--brass-bright); transform: translateY(0); }
.cube-mark .face-left { background: var(--brass); clip-path: polygon(0% 25%, 50% 50%, 50% 100%, 0% 75%); }
.cube-mark .face-right { background: var(--brass-dim); clip-path: polygon(100% 25%, 50% 50%, 50% 100%, 100% 75%); }

.cube-mark--sm { width: 46px; height: 46px; }
.cube-mark--lg { width: 96px; height: 96px; margin-bottom: 28px; }

.spin-slow { animation: cube-drift 9s ease-in-out infinite; }
@keyframes cube-drift {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(4deg); }
}

/* ============ Auth screens ============ */
.auth-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    background: var(--bg);
}
.auth-shell--single { grid-template-columns: 1fr; }

.auth-panel-brand {
    position: relative;
    background: radial-gradient(120% 120% at 20% 20%, var(--brass-wash) 0%, transparent 65%), radial-gradient(100% 100% at 80% 80%, rgba(0,0,0,0.4) 0%, transparent 70%), var(--auth-brand-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 64px 48px;
    overflow: hidden;
    border-right: 1px solid var(--line);
}

.cube-field { position: absolute; inset: 0; pointer-events: none; }
.cube-mark--ghost { position: absolute; opacity: 0.22; filter: saturate(0.7); }
.cube-mark--ghost.cube-1 { width: 260px; height: 260px; top: -80px; right: -50px; animation: cube-drift 14s ease-in-out infinite; }
.cube-mark--ghost.cube-2 { width: 160px; height: 160px; bottom: 30px; left: -40px; animation: cube-drift 11s ease-in-out infinite reverse; }

.auth-panel-content { position: relative; max-width: 440px; animation: rise-in 0.7s var(--ease) both; }
.brand-word { font-family: var(--font-display); font-size: 42px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin-bottom: 12px; }
.brand-tagline { color: var(--text-dim); font-size: 15.5px; line-height: 1.6; max-width: 400px; margin-bottom: 32px; }
.brand-points { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.brand-points li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
    padding: 12px 16px;
    background: color-mix(in srgb, var(--surface) 60%, transparent);
    backdrop-filter: blur(12px);
    border: 1px solid var(--line);
    border-radius: 12px;
    transition: all 0.2s var(--ease);
}
.brand-points li:hover { border-color: var(--brass-dim); transform: translateX(4px); }
.brand-points .icon { width: 18px; height: 18px; color: var(--brass-bright); flex-shrink: 0; }

.auth-panel-form {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: radial-gradient(circle at 50% 50%, var(--brass-wash) 0%, transparent 70%), var(--bg);
}

.auth-card {
    width: 100%;
    max-width: 430px;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(28px) saturate(180%);
    border: 1px solid var(--line-strong);
    border-radius: 24px;
    padding: 36px 32px;
    box-shadow: 0 28px 72px -16px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--brass-wash);
    animation: rise-in 0.6s var(--ease) 0.08s both;
}

.auth-card-head { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }
.auth-card-head h2 { font-family: var(--font-display); font-size: 24px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.muted { color: var(--text-dim); font-size: 13.5px; margin-top: 2px; }

@keyframes rise-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ============ Forms ============ */
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.input-row { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 11.5px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.06em; }

.input-shell {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    transition: all 0.2s var(--ease);
}
.input-shell:focus-within {
    border-color: var(--brass-bright);
    box-shadow: 0 0 0 3px var(--brass-wash);
    background: var(--surface);
}
.input-shell .input-icon { margin-left: 14px; width: 17px; height: 17px; color: var(--text-faint); }

input[type="text"], input[type="password"], input[type="email"] {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text);
    padding: 12px 14px;
    font-size: 14.5px;
    font-family: var(--font-body);
}
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus { outline: none; }
input::placeholder { color: var(--text-faint); }

.input-with-toggle input { padding-right: 44px; }
.input-with-toggle .btn-icon.small { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; padding: 0; display: flex; align-items: center; justify-content: center; border: none; background: transparent; }
.input-with-toggle .btn-icon.small:hover { background: var(--surface-3); }

.field-error { color: var(--danger); font-size: 12.5px; min-height: 16px; }

/* Spotlight Search Area in Topbar */
.search-area {
    position: relative;
    display: flex;
    align-items: center;
    width: 460px;
    max-width: 560px;
    transition: width 0.25s var(--ease);
}
.search-area:focus-within {
    width: 540px;
}
.search-area .input-icon {
    position: absolute;
    left: 14px;
    width: 16px;
    height: 16px;
    color: var(--text-faint);
    pointer-events: none;
    transition: color 0.2s;
}
.search-area:focus-within .input-icon {
    color: var(--brass-bright);
}
#search-input {
    width: 100%;
    height: 38px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 75px 0 38px;
    font-size: 13.5px;
    color: var(--text);
    transition: all 0.2s var(--ease);
}
#search-input:focus {
    outline: none;
    border-color: var(--brass-bright);
    box-shadow: 0 0 0 3px var(--brass-wash);
    background: var(--surface);
}
.search-shortcut {
    position: absolute;
    right: 12px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    pointer-events: none;
    transition: opacity 0.2s;
}
.search-shortcut kbd {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 4px;
    background: var(--surface-3);
    color: var(--text-faint);
    border: 1px solid var(--line);
}
.search-area:focus-within .search-shortcut {
    opacity: 0;
}

/* ============ Buttons ============ */
.btn-primary {
    background: var(--surface-3);
    color: var(--text);
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-display);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.btn-primary .icon { width: 16px; height: 16px; }

.btn-gradient {
    background: linear-gradient(135deg, var(--brass-bright), var(--brass) 65%, var(--brass-dim));
    color: #110e08;
    box-shadow: 0 8px 22px -6px rgba(201,161,94,0.45);
}
.btn-gradient:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 12px 28px -8px rgba(201,161,94,0.6); }
.btn-gradient:active { transform: translateY(0); }

.btn-block { width: 100%; padding: 13px; }

.btn-secondary {
    background: var(--surface-2);
    color: var(--text);
    padding: 8px 16px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s var(--ease);
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.btn-secondary:hover { border-color: var(--brass-dim); background: var(--surface-3); color: var(--text); transform: translateY(-1px); }

.btn-icon {
    background: var(--surface-2);
    border: 1px solid var(--line);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: all 0.18s var(--ease);
}
.btn-icon:hover { color: var(--brass-bright); border-color: var(--brass-dim); background: var(--brass-wash); transform: translateY(-1px); }
.btn-icon.small { width: 32px; height: 32px; border-radius: 8px; }
.btn-icon .icon { width: 17px; height: 17px; }

.btn-success {
    background: var(--success);
    color: #0a2214;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    transition: filter 0.2s var(--ease);
}
.btn-success:hover { filter: brightness(1.08); }

.icon { width: 20px; height: 20px; display: inline-block; vertical-align: middle; fill: currentColor; stroke: currentColor; }

.link { text-align: center; margin-top: 22px; color: var(--text-dim); font-size: 14px; cursor: pointer; }
.link a { color: var(--brass-bright); font-weight: 600; text-decoration: none; }
.link:hover a { text-decoration: underline; }

/* ============ Topbar ============ */
.topbar {
    height: 64px;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: blur(18px) saturate(180%);
    border-bottom: 1px solid var(--line);
    z-index: 40;
    display: flex;
    align-items: center;
    width: 100%;
}
.topbar-inner {
    width: 100%;
    max-width: 100%;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.brand { display: flex; gap: 12px; align-items: center; flex-shrink: 0; text-decoration: none; }
.brand-link { cursor: pointer; }
.brand-text .title { font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -0.02em; color: var(--text); }
.brand-text .subtitle { font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; }

.header-actions { display: flex; gap: 12px; align-items: center; margin-left: auto; }

.storage-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
}
.storage-bar { width: 96px; height: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.storage-bar-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--brass), var(--brass-bright)); border-radius: 999px; transition: width 0.5s var(--ease), background 0.3s; }
.storage-bar-fill.warning { background: linear-gradient(90deg, var(--warning), #f0c060); }
.storage-bar-fill.danger { background: linear-gradient(90deg, var(--danger), #ff8a7d); }
.storage-text { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); white-space: nowrap; }

/* ============ User Menu & Dropdown Subpanel ============ */
.user-menu-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.user-chip-btn {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    padding: 6px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    font-family: inherit;
    line-height: 1;
    transition: all 0.2s var(--ease);
    user-select: none;
    position: relative;
}

.user-chip-btn:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.user-chip-btn:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.user-chip-btn[aria-expanded="true"] {
    background: var(--surface-3);
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}

.user-avatar-indicator {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    box-shadow: none;
    flex-shrink: 0;
    display: inline-block;
    margin: 0;
}

.user-avatar-indicator.has-image { overflow: hidden; border: 1px solid var(--line-strong); }
.user-avatar-indicator img, .user-dropdown-avatar img, .profile-avatar-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.user-avatar-indicator .icon { width: 17px; height: 17px; color: var(--accent); display: block; margin: 5px; }

.user-chip-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    letter-spacing: -0.01em;
}

.user-chip-notify-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4.5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 10px rgba(244, 63, 94, 0.55), 0 2px 4px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
    animation: notify-pulse 2.2s infinite;
}

.user-chip-notify-dot[hidden] {
    display: none !important;
}

@keyframes notify-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(244, 63, 94, 0.5);
    }
    50% {
        transform: scale(1.08);
        box-shadow: 0 0 14px rgba(244, 63, 94, 0.85);
    }
}

.chevron-down-icon {
    width: 14px;
    height: 14px;
    color: var(--text-dim);
    transition: transform 0.22s var(--ease), color 0.2s var(--ease);
    flex-shrink: 0;
}

.user-chip-btn[aria-expanded="true"] .chevron-down-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

/* User Subpanel Dropdown Panel */
.user-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg, 16px);
    box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    padding: 8px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    pointer-events: none;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0s linear 0.2s;
}

.user-dropdown-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.user-dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
}

.user-dropdown-avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 25%, transparent), color-mix(in srgb, var(--accent) 10%, transparent));
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.user-dropdown-avatar .icon {
    width: 20px;
    height: 20px;
}

.profile-avatar-editor { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.profile-avatar-preview { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); border: 1px solid var(--line-strong); flex-shrink: 0; }
.profile-avatar-preview .icon { width: 24px; height: 24px; }
.profile-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.profile-file-picker { min-height: 46px; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: color-mix(in srgb, var(--surface-3) 82%, transparent); cursor: pointer; transition: border-color 0.2s ease, background 0.2s ease; }
.profile-file-picker:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-3)); }
.profile-file-picker:focus-within { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 2px; }
.profile-file-button { display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 6px; background: var(--accent); color: var(--surface); font-size: 12px; font-weight: 700; white-space: nowrap; }
.profile-file-button .icon { width: 15px; height: 15px; }
.profile-file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-dim); font-size: 12px; }
.profile-remove-avatar { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; color: var(--text-dim); background: transparent; font: inherit; font-size: 11px; cursor: pointer; }
.profile-remove-avatar:hover { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.profile-remove-avatar .icon { width: 13px; height: 13px; }

.user-dropdown-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 2px;
}

.user-dropdown-name {
    font-weight: 700;
    font-size: 13.5px;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-role {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.user-dropdown-divider {
    height: 1px;
    background: var(--line);
    margin: 6px 4px;
}

.user-dropdown-label {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-faint);
    text-transform: uppercase;
    padding: 6px 12px 4px;
}

.user-dropdown-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-dropdown-section[hidden],
.admin-section[hidden],
.admin-section.is-hidden,
#admin-menu-section[hidden],
#admin-menu-section.is-hidden {
    display: none !important;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm, 8px);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.user-dropdown-item .item-icon {
    width: 16px;
    height: 16px;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: color 0.15s var(--ease);
}

.user-dropdown-item:hover {
    background: var(--surface-2);
    color: var(--text);
}

.user-dropdown-item:hover .item-icon {
    color: var(--accent);
}

.user-dropdown-item.logout-item {
    color: var(--text-dim);
}

.user-dropdown-item.logout-item:hover {
    background: color-mix(in srgb, var(--danger) 15%, transparent);
    color: var(--danger);
}

.user-dropdown-item.logout-item:hover .item-icon {
    color: var(--danger);
}

.user-menu-badge {
    margin-left: auto;
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 999px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 0 8px rgba(244, 63, 94, 0.45);
}

.admin-badge-pill {
    margin-left: auto;
    font-size: 9.5px;
    font-weight: 600;
    color: var(--text-dim);
    background: var(--surface-3);
    padding: 1px 6px;
    border-radius: 4px;
    border: 1px solid var(--line);
}

/* ============ Layout ============ */
#main-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.main-container.layout-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
    gap: 0;
    height: calc(100vh - 64px);
    height: calc(100dvh - 64px);
    overflow: hidden;
}

.sidebar {
    height: 100%;
    width: 260px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(14px);
    border-right: 1px solid var(--line);
    border-top: none;
    border-bottom: none;
    border-left: none;
    border-radius: 0;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: relative;
    z-index: 30;
    overflow: visible;
}
.sidebar-label {
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-faint);
    margin: 0 0 6px 8px;
    display: block;
}
.sidebar-section { display: flex; flex-direction: column; gap: 4px; }

.sidebar-btn {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    height: 38px;
    text-align: left;
    padding: 0 12px;
    border-radius: 10px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s var(--ease);
}
.sidebar-btn:hover {
    background: var(--surface-2);
    color: var(--text);
    border-color: var(--line);
    transform: translateX(3px);
}
.sidebar-btn.active {
    background: color-mix(in srgb, var(--brass) 12%, var(--surface-2));
    color: var(--brass-bright);
    font-weight: 600;
    border-color: color-mix(in srgb, var(--brass) 30%, transparent);
    box-shadow: inset 3px 0 0 var(--brass-bright);
}
.sidebar-btn .icon { width: 17px; height: 17px; flex-shrink: 0; }

.sidebar-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 12px;
}
.sidebar-footer .icon { width: 16px; height: 16px; color: var(--success); flex-shrink: 0; }

.content {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    padding: 24px 32px 120px 32px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    background: var(--bg);
}

.toolbar {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: 12px 18px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: 0 4px 16px -4px rgba(0,0,0,0.12);
}
#current-path {
    font-family: var(--font-mono);
    padding: 6px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 12.5px;
    color: var(--text-dim);
}
.toolbar-actions { display: flex; align-items: center; gap: 8px; }

/* ============ File grid ============ */
.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}
.content.drop-target {
    outline: 2px dashed var(--brass-bright);
    outline-offset: -10px;
    background: color-mix(in srgb, var(--brass) 4%, transparent);
}

.file-item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
    user-select: none;
}
.file-item:hover {
    transform: translateY(-3px);
    border-color: var(--brass);
    box-shadow: 0 12px 28px -8px rgba(0,0,0,0.35), 0 0 0 1px var(--brass-wash);
}
.file-item.selected {
    border-color: var(--brass-bright);
    background: color-mix(in srgb, var(--brass) 9%, var(--surface));
    box-shadow: 0 0 0 1.5px var(--brass-bright), 0 8px 24px -6px var(--brass-wash);
}
.file-item.drop-target, .file-grid.drop-target {
    border-color: var(--success);
    box-shadow: 0 0 0 2px rgba(74,222,128,0.25);
}

/* File Selection Checkbox */
.file-select-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    width: 22px;
    height: 22px;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.18s var(--ease), transform 0.18s var(--ease);
}

.file-item:hover .file-select-checkbox,
.file-item.selected .file-select-checkbox,
.has-selection .file-select-checkbox {
    opacity: 1;
    transform: scale(1);
}

.file-select-checkbox input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
    z-index: 2;
}

.file-select-checkbox .custom-check {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1.5px solid var(--line-strong);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.file-select-checkbox input:checked + .custom-check {
    background: var(--brass-bright);
    border-color: var(--brass-bright);
    color: #12100e;
    box-shadow: 0 0 10px rgba(201, 161, 94, 0.45);
}

.file-select-checkbox .custom-check .icon {
    width: 13px;
    height: 13px;
    stroke-width: 2.5;
}

.file-info { display: flex; align-items: center; gap: 14px; flex: 1; min-width: 0; cursor: pointer; }
.file-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--brass-wash);
    color: var(--brass-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brass) 20%, transparent);
    transition: transform 0.2s;
}
.file-item:hover .file-icon { transform: scale(1.06); }
.file-icon .icon { width: 22px; height: 22px; }
.file-details { flex: 1; min-width: 0; }
.file-name { font-weight: 600; font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shared-file-badge { display: inline-flex; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: var(--brass-wash); border: 1px solid var(--brass-dim); color: var(--brass-bright); font-size: 10px; font-weight: 700; vertical-align: middle; }
.file-meta { font-family: var(--font-mono); color: var(--text-faint); font-size: 11.5px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.file-actions { display: flex; gap: 6px; justify-content: flex-end; opacity: 0.85; transition: opacity 0.15s; }
.file-item:hover .file-actions { opacity: 1; }
.file-actions button {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    background: var(--surface-2);
    color: var(--text-dim);
    transition: all 0.15s var(--ease);
}
.file-actions button .icon { width: 15px; height: 15px; }
.file-actions button:hover { color: var(--text); background: var(--surface-3); border-color: var(--line-strong); transform: translateY(-1px); }
.btn-download:hover { color: var(--success); border-color: var(--success); background: rgba(74,222,128,0.12); }
.btn-delete:hover { color: var(--danger); border-color: var(--danger); background: rgba(242,104,91,0.12); }

/* Folder Specific Card Highlights */
.file-item[data-type="directory"] {
    background: color-mix(in srgb, var(--surface) 95%, var(--brass-wash));
    border-color: color-mix(in srgb, var(--line) 85%, var(--brass-dim));
}
.file-item[data-type="directory"] .file-icon {
    background: color-mix(in srgb, var(--brass) 18%, transparent);
    color: var(--brass-bright);
}

/* Distinctive File Extension Badges */
.file-item[data-ext="pdf"] .file-icon {
    background: rgba(239, 68, 68, 0.14);
    color: #f87171;
    box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.25);
}
.file-item[data-ext="zip"] .file-icon,
.file-item[data-ext="rar"] .file-icon,
.file-item[data-ext="tar"] .file-icon,
.file-item[data-ext="gz"] .file-icon {
    background: rgba(168, 85, 247, 0.14);
    color: #c084fc;
    box-shadow: inset 0 0 0 1px rgba(168, 85, 247, 0.25);
}
.file-item[data-ext="jpg"] .file-icon,
.file-item[data-ext="jpeg"] .file-icon,
.file-item[data-ext="png"] .file-icon,
.file-item[data-ext="gif"] .file-icon,
.file-item[data-ext="webp"] .file-icon,
.file-item[data-ext="svg"] .file-icon {
    background: rgba(249, 115, 22, 0.14);
    color: #fb923c;
    box-shadow: inset 0 0 0 1px rgba(249, 115, 22, 0.25);
}
.file-item[data-ext="js"] .file-icon,
.file-item[data-ext="ts"] .file-icon,
.file-item[data-ext="json"] .file-icon,
.file-item[data-ext="html"] .file-icon,
.file-item[data-ext="css"] .file-icon,
.file-item[data-ext="py"] .file-icon,
.file-item[data-ext="sql"] .file-icon {
    background: rgba(20, 184, 166, 0.14);
    color: #2dd4bf;
    box-shadow: inset 0 0 0 1px rgba(20, 184, 166, 0.25);
}
.file-item[data-ext="mp4"] .file-icon,
.file-item[data-ext="mkv"] .file-icon,
.file-item[data-ext="webm"] .file-icon {
    background: rgba(236, 72, 153, 0.14);
    color: #f472b6;
    box-shadow: inset 0 0 0 1px rgba(236, 72, 153, 0.25);
}
.file-item[data-ext="mp3"] .file-icon,
.file-item[data-ext="wav"] .file-icon {
    background: rgba(139, 92, 246, 0.14);
    color: #a78bfa;
    box-shadow: inset 0 0 0 1px rgba(139, 92, 246, 0.25);
}

/* Staggered Entrance */
.animate-pop { animation: pop 0.4s var(--ease); }
@keyframes pop {
    0% { transform: translateY(12px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* List view mode */
.file-grid.list-mode { display: flex; flex-direction: column; gap: 6px; }
.file-grid.list-mode .file-item {
    flex-direction: row;
    align-items: center;
    padding: 10px 16px 10px 44px;
    min-height: 52px;
    border-radius: 10px;
    gap: 16px;
}
.file-grid.list-mode .file-select-checkbox { top: 50%; left: 14px; transform: translateY(-50%) scale(0.9); }
.file-grid.list-mode .file-item:hover .file-select-checkbox,
.file-grid.list-mode .file-item.selected .file-select-checkbox,
.has-selection .file-grid.list-mode .file-select-checkbox { transform: translateY(-50%) scale(1); }
.file-grid.list-mode .file-icon { width: 34px; height: 34px; border-radius: 8px; }
.file-grid.list-mode .file-icon .icon { width: 17px; height: 17px; }
.file-grid.list-mode .file-info { flex: 1; }
.file-grid.list-mode .file-details { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex: 1; }
.file-grid.list-mode .file-meta { margin-top: 0; min-width: 220px; text-align: right; }
.file-grid.list-mode .file-actions { justify-content: flex-end; }

/* Toolbar Select All Button Active State */
#select-all-btn.active {
    background: var(--brass-bright);
    color: #12100e;
    border-color: var(--brass-bright);
    font-weight: 600;
}

/* ============ Empty / loading states ============ */
.empty-state, .loading {
    text-align: center;
    padding: 56px 20px;
    color: var(--text-dim);
    grid-column: 1 / -1;
}

/* Interactive Dropzone Empty State */
.empty-state.dropzone-prompt {
    border: 2px dashed var(--line-strong);
    border-radius: 20px;
    padding: 56px 28px;
    background: color-mix(in srgb, var(--surface) 50%, transparent);
    transition: all 0.25s var(--ease);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 12px 0;
}
.empty-state.dropzone-prompt:hover, .empty-state.dropzone-prompt.drag-over {
    border-color: var(--brass-bright);
    background: color-mix(in srgb, var(--brass) 6%, var(--surface));
    box-shadow: 0 0 32px var(--brass-wash);
}
.empty-state-badge {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    background: var(--brass-wash);
    color: var(--brass-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px var(--brass-wash);
    margin-bottom: 4px;
}
.empty-state-badge .icon { width: 36px; height: 36px; }
.empty-state-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}
.empty-state-desc {
    color: var(--text-dim);
    font-size: 14px;
    max-width: 440px;
    line-height: 1.5;
    margin: 0 auto;
}
.empty-state-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.empty-state-icon { margin-bottom: 16px; opacity: 0.6; color: var(--brass-bright); }
.empty-state-icon .icon { width: 44px; height: 44px; }
.loading { animation: pulse-text 1.6s ease-in-out infinite; font-family: var(--font-mono); font-size: 13px; letter-spacing: 0.04em; }
.loading-dots {
    display: inline-block;
    width: 18px;
    text-align: left;
    animation: loading-dots 1.4s steps(4, end) infinite;
}
@keyframes loading-dots {
    0%, 20% { clip-path: inset(0 12px 0 0); }
    45% { clip-path: inset(0 8px 0 0); }
    70% { clip-path: inset(0 4px 0 0); }
    100% { clip-path: inset(0 0 0 0); }
}
@keyframes pulse-text { 0%, 100% { opacity: 0.5; } 50% { opacity: 1; } }

.error-message { background: rgba(242,104,91,0.12); color: var(--danger); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid rgba(242,104,91,0.3); }
.success-message { background: rgba(74,222,128,0.12); color: var(--success); padding: 12px 16px; border-radius: var(--radius-sm); margin-bottom: 16px; border: 1px solid rgba(74,222,128,0.3); }

/* ============ Toasts ============ */
#toast-container { position: fixed; right: 20px; bottom: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 16px 40px -12px rgba(0,0,0,0.5);
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 220px;
    font-size: 14px;
    transition: opacity 0.3s var(--ease);
    animation: toast-in 0.35s var(--ease);
    pointer-events: auto;
}
@keyframes toast-in { from { transform: translateX(24px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast .icon { width: 18px; height: 18px; flex-shrink: 0; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }

/* ============ Modal ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 620px;
    max-height: 88vh;
    overflow: auto;
    animation: modal-in 0.3s var(--ease);
}
@keyframes modal-in { from { transform: translateY(16px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}
.modal-header h2 { font-size: 17px; color: var(--text); }
.modal-close {
    background: var(--surface-2);
    border: 1px solid var(--line);
    width: 32px; height: 32px;
    border-radius: 8px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-dim);
    transition: all 0.18s var(--ease);
}
.modal-close:hover { color: var(--danger); border-color: var(--danger); }
.modal-body { padding: 24px; }

.modal-body input, .modal-body textarea {
    width: 100%;
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14.5px;
    font-family: var(--font-body);
    color: var(--text);
    margin-bottom: 16px;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.modal-body input:focus, .modal-body textarea:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 4px var(--brass-wash); }
.modal-body textarea { min-height: 280px; resize: vertical; font-family: var(--font-mono); }

.code-editor {
    font-family: var(--font-mono) !important;
    font-size: 13.5px;
    line-height: 1.6;
    tab-size: 4;
    background: var(--code-editor-bg) !important;
    color: var(--code-editor-text) !important;
    padding: 18px !important;
    min-height: 380px !important;
    border: 1px solid var(--line) !important;
}
/* light code-editor is now handled via --code-editor-bg/text theme variables */

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 4px; }

.users-list { display: flex; flex-direction: column; gap: 8px; }
.user-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.user-row strong, .user-row small { display: block; }
.user-row small { color: var(--text-dim); font-size: 12px; }
.user-actions { display: flex; gap: 8px; }
.action-menu { display: flex; flex-direction: column; gap: 8px; }
.action-menu button { justify-content: flex-start; }
.breadcrumbs { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; padding: 3px; }
.breadcrumb { border: 0; background: transparent; color: var(--text-dim); padding: 7px 9px; border-radius: var(--radius-sm); cursor: pointer; white-space: nowrap; font-family: var(--font-mono); }
.breadcrumb:hover, .breadcrumb.drop-target { color: var(--brass-bright); background: var(--brass-wash); }
.breadcrumb-separator { color: var(--text-faint); }
.user-actions .btn-admin-active { color: var(--brass); background: rgba(200, 150, 60, 0.12); border-color: rgba(200, 150, 60, 0.3); }
.admin-toolbar { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.check-row { display: flex; align-items: center; gap: 8px; margin: 12px 0; color: var(--text-dim); }
.check-row input { accent-color: var(--brass); }
.privacy-consent { display: flex; align-items: flex-start; gap: 8px; color: var(--text-dim); font-size: 12px; }
.privacy-consent input { margin-top: 4px; accent-color: var(--brass); }
.privacy-consent a { color: var(--brass-bright); }
.attach-menu { display: flex; flex-direction: column; gap: 10px; }
.attach-menu button { justify-content: flex-start; }
.privacy-page { overflow: auto; }
.privacy-content { max-width: 820px; margin: 48px auto; padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.privacy-content h1 { margin-bottom: 12px; }
.privacy-content h2 { margin-top: 26px; margin-bottom: 8px; font-size: 18px; }
.privacy-content p { color: var(--text-dim); margin-bottom: 12px; }
.privacy-warning { margin-top: 30px; padding: 14px; border-left: 3px solid var(--warning); background: rgba(224,168,62,.1); }
.form-help { color: var(--text-dim); font-size: 13px; margin-bottom: 18px; }
.setting-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px; margin-bottom: 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.setting-card strong, .setting-card small { display: block; }
.setting-card small { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.admin-assignment { margin: 12px 0 18px; }
.limit-fields { display: flex; gap: 8px; margin-bottom: 8px; }
.limit-fields input { flex: 1; margin-bottom: 0; }
.limit-fields select { width: 90px; background: var(--surface-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0 10px; }
.limit-presets { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.preset-btn { background: var(--surface-2); border: 1px solid var(--line); color: var(--text-dim); border-radius: var(--radius-sm); font-size: 11px; font-weight: 500; padding: 4px 10px; cursor: pointer; transition: all .2s ease; }
.preset-btn:hover { background: var(--surface-3); color: var(--text); border-color: var(--brass); transform: translateY(-1px); }
.switch { position: relative; width: 44px; height: 24px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; cursor: pointer; background: var(--surface-3); border-radius: 20px; transition: background .25s var(--ease); }
.switch span::before { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: var(--text); border-radius: 50%; transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--brass); }
.switch input:checked + span::before { transform: translateX(20px); }
.badge-self { font-size: 11px; color: var(--brass); background: rgba(200, 150, 60, 0.15); border: 1px solid rgba(200, 150, 60, 0.3); padding: 1px 6px; border-radius: 4px; font-weight: normal; margin-left: 6px; }

.image-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    max-height: 65vh;
    overflow: auto;
    margin-bottom: 16px;
}
.image-preview img { max-width: 100%; height: auto; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

/* ============ Responsive ============ */
/* Main responsive rules moved to end of file for proper cascade */

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.btn-share:hover { color: var(--brass-bright); border-color: var(--brass); background: var(--brass-wash); }
.sidebar-btn.active { background: var(--brass-wash); color: var(--brass-bright); border-color: var(--brass); font-weight: 600; }

/* ============ Share Modal Styles ============ */
.share-modal-container { display: flex; flex-direction: column; gap: 20px; }
.share-target-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.share-target-icon {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: var(--brass-wash);
    color: var(--brass);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.share-target-icon svg { width: 20px; height: 20px; }
.share-target-info { flex: 1; min-width: 0; }
.share-target-name { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.share-target-path { color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); }

.share-tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    gap: 8px;
    margin-bottom: 4px;
}
.share-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s var(--ease);
}
.share-tab-btn svg { width: 16px; height: 16px; }
.share-tab-btn:hover { color: var(--text); }
.share-tab-btn.active {
    color: var(--brass-bright);
    border-bottom-color: var(--brass-bright);
}

.share-tab-pane { display: none; flex-direction: column; gap: 16px; animation: modal-in 0.25s var(--ease); }
.share-tab-pane.active { display: flex; }

.notification-button { position: relative; }
.notification-button #notifications-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--danger);
    color: #fff;
    font: 700 10px/16px var(--font-mono);
}
.notifications-list { display: flex; flex-direction: column; gap: 8px; }
.notification-toolbar { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.notification-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.notification-row.unread { border-color: var(--brass); background: var(--brass-wash); }
.notification-row strong, .notification-row small, .notification-row em { display: block; }
.notification-row small { color: var(--text-dim); margin: 3px 0; }
.notification-row em { color: var(--text-faint); font-size: 11px; font-style: normal; }
.notification-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }
.notification-delete { width: 30px; height: 30px; }
.permission-select {
    width: 100%;
    min-width: 0;
    margin-bottom: 0;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    color-scheme: dark;
}
.permission-quota { width: 100%; min-width: 0; margin-bottom: 0; }
/* permission-select color-scheme now handled dynamically */

.internal-share-form {
    display: flex;
    flex-direction: column;
    gap: 9px;
}
.internal-share-main-row {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 170px auto;
    gap: 8px;
    align-items: stretch;
}
.internal-share-main-row > .btn-primary {
    min-width: 124px;
    white-space: nowrap;
}
.internal-user-picker { position: relative; min-width: 0; }
.internal-user-picker > input { width: 100%; margin-bottom: 0; }
.internal-quota-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: min(100%, 310px);
}
.internal-quota-row label {
    color: var(--text-dim);
    font-size: 11px;
    white-space: nowrap;
}
.internal-quota-row .permission-quota { width: 104px; }
.quota-unit-select {
    width: 68px;
    margin-bottom: 0;
    padding: 7px 8px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    color-scheme: dark;
}
/* quota-unit-select color-scheme now handled dynamically */
.internal-user-suggestions {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 20;
    padding: 4px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.35);
}
.internal-user-suggestion {
    display: flex;
    align-items: baseline;
    gap: 8px;
    width: 100%;
    padding: 9px 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.internal-user-suggestion:hover, .internal-user-suggestion:focus-visible { background: var(--brass-wash); outline: none; }
.internal-user-suggestion strong { color: var(--brass-bright); }
.internal-user-suggestion small { color: var(--text-dim); }

@media (max-width: 720px) {
    .internal-share-main-row { grid-template-columns: 1fr 1fr; }
    .internal-user-picker { grid-column: 1 / -1; }
    .internal-share-main-row > .btn-primary { width: 100%; }
}

.segment-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    gap: 4px;
}
.segment-btn {
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.18s var(--ease);
}
.segment-btn svg { width: 15px; height: 15px; }
.segment-btn.active {
    background: var(--surface-3);
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.slug-preview-box {
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    overflow: hidden;
    transition: border-color 0.2s var(--ease);
}
.slug-preview-box:focus-within { border-color: var(--brass); }
.slug-prefix {
    padding: 10px 12px;
    background: var(--surface-3);
    color: var(--text-dim);
    font-size: 12.5px;
    font-family: var(--font-mono);
    border-right: 1px solid var(--line);
    white-space: nowrap;
}
.slug-input {
    flex: 1;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 10px 12px !important;
    margin-bottom: 0 !important;
    font-family: var(--font-mono);
    font-size: 13.5px;
    color: var(--text);
}
.slug-input:focus { outline: none !important; box-shadow: none !important; }
.slug-status {
    padding: 0 12px;
    font-size: 11.5px;
    font-weight: 600;
}
.slug-status.available { color: var(--success); }
.slug-status.taken { color: var(--danger); }

.share-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
.share-option-field { display: flex; flex-direction: column; gap: 6px; }
.share-option-field label { font-size: 12px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
.share-option-field select, .share-option-field input {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    padding: 9px 12px;
    font-size: 13px;
}

/* Access Mode Selector in Share Modal */
.access-mode-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}
.access-mode-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    text-align: left;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s var(--ease);
    color: var(--text);
    position: relative;
    font-family: inherit;
}
.access-mode-card:hover {
    border-color: var(--line-strong);
    background: var(--surface-3);
}
.access-mode-card.active {
    border-color: var(--brass);
    background: var(--brass-wash);
    box-shadow: 0 0 0 1px var(--brass-dim);
}
.mode-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--surface-3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brass-bright);
    flex-shrink: 0;
}
.access-mode-card.active .mode-icon-circle {
    background: var(--brass);
    color: #0b0f17;
}
.mode-icon-circle svg { width: 16px; height: 16px; }
.mode-text-group {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.mode-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--text);
}
.mode-desc {
    font-size: 11px;
    color: var(--text-dim);
    line-height: 1.35;
}
.mode-badge-pill {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 9.5px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    background: var(--surface-3);
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.access-mode-card.active .mode-badge-pill {
    background: var(--brass-wash);
    border: 1px solid var(--brass-dim);
    color: var(--brass-bright);
}
@media (max-width: 600px) {
    .access-mode-grid { grid-template-columns: 1fr; }
}

.share-result-card {
    background: var(--brass-wash);
    border: 1px solid var(--brass);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: modal-in 0.3s var(--ease);
}
.share-result-title { font-size: 12px; text-transform: uppercase; color: var(--brass-bright); font-weight: 600; letter-spacing: 0.05em; }
.share-result-link-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
.share-result-input {
    flex: 1;
    background: var(--surface) !important;
    border: 1px solid var(--line) !important;
    font-family: var(--font-mono);
    font-size: 12.5px;
    padding: 8px 12px !important;
    margin-bottom: 0 !important;
    color: var(--text);
    border-radius: var(--radius-sm) !important;
}

.file-grid.table-mode {
    display: block;
    width: 100%;
    min-width: 0;
}

.shares-table-container {
    grid-column: 1 / -1;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    position: relative;
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) var(--surface-2);
}

.modal .shares-table-container {
    max-height: 320px;
    overflow-y: auto;
}

/* Custom WebKit Scrollbar for Horizontal & Vertical Overflow */
.shares-table-container::-webkit-scrollbar {
    height: 7px;
    width: 7px;
}
.shares-table-container::-webkit-scrollbar-track {
    background: var(--surface-2);
    border-radius: 10px;
    margin: 0 8px;
}
.shares-table-container::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 10px;
    border: 1px solid var(--surface-2);
    transition: background 0.2s var(--ease);
}
.shares-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--brass);
}

.shares-table {
    width: 100%;
    min-width: 820px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13px;
    text-align: left;
    table-layout: auto;
}

.shares-table thead {
    background: var(--surface-3);
    position: sticky;
    top: 0;
    z-index: 2;
}

.shares-table th {
    background: var(--surface-3);
    padding: 12px 16px;
    color: var(--text-dim);
    font-weight: 700;
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.shares-table td {
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    color: var(--text);
    vertical-align: middle;
    transition: background 0.15s var(--ease);
}

.shares-table tbody tr:hover td {
    background: var(--surface-2);
}

.shares-table tbody tr:last-child td {
    border-bottom: none;
}

/* Tight horizontal column adjustments (Apura en horizontal) */
.shares-table .col-item {
    width: 30%;
    min-width: 180px;
}
.shares-table .col-type {
    width: 1%;
    white-space: nowrap;
}
.shares-table .col-destination {
    width: 35%;
    min-width: 200px;
}
.shares-table .col-uses {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}
.shares-table .col-exp {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}
.shares-table .col-status {
    width: 1%;
    white-space: nowrap;
    text-align: center;
}
.shares-table .col-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.share-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.share-item-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    background: var(--brass-wash);
    color: var(--brass);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.share-item-icon svg { width: 16px; height: 16px; }
.share-item-text {
    flex: 1;
    min-width: 0;
}
.share-item-name {
    font-weight: 600;
    font-size: 13.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}
.share-item-path {
    font-size: 11px;
    color: var(--text-faint);
    font-family: var(--font-mono);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    margin-top: 1px;
}

.share-link-cell {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 4px 8px 4px 10px;
    transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}
.share-link-cell:hover {
    border-color: var(--brass);
    background: var(--surface-3);
}
.share-link-text {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--brass-bright);
    text-decoration: none;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.share-link-text:hover {
    text-decoration: underline;
}
.share-permission-label {
    display: block;
    margin-top: 4px;
    color: var(--text-faint);
    font-size: 11px;
}
.btn-copy-chip {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 3px 5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.15s var(--ease), background-color 0.15s var(--ease);
}
.btn-copy-chip svg { width: 13px; height: 13px; }
.btn-copy-chip:hover {
    color: var(--brass-bright);
    background: var(--brass-wash);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-success { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-danger { background: rgba(242,104,91,0.15); color: var(--danger); }
.badge-warning { background: rgba(224,168,62,0.15); color: var(--warning); }
.badge-info { background: var(--brass-wash); color: var(--brass-bright); }
.badge-neutral { background: var(--surface-3); color: var(--text-dim); }

.owner-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-3);
    color: var(--text);
    padding: 3px 9px;
    border-radius: 12px;
    font-size: 11.5px;
    font-weight: 600;
}

/* ============ Remember Session Container & Popover ============ */
.remember-session-wrapper {
    position: relative;
    margin: 12px 0 20px;
}

.remember-trigger-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.22s var(--ease);
    user-select: none;
}

.remember-session-wrapper:hover .remember-trigger-bar,
.remember-session-wrapper:focus-within .remember-trigger-bar {
    border-color: var(--brass);
    background: var(--surface-3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.remember-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    flex: 1;
}

.remember-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.remember-checkbox-custom {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--line-strong);
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
}

.remember-checkbox-custom svg {
    width: 12px;
    height: 12px;
    transform: scale(0.6);
    transition: transform 0.2s var(--ease), color 0.2s var(--ease);
}

.remember-checkbox:checked + .remember-checkbox-custom {
    background: var(--brass);
    border-color: var(--brass-bright);
    color: #1a1408;
}

.remember-checkbox:checked + .remember-checkbox-custom svg {
    transform: scale(1);
    color: #1a1408;
}

.remember-main-title {
    font-size: 13.5px;
    font-weight: 500;
    color: var(--text);
}

.remember-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    background: var(--surface-3);
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    transition: all 0.2s var(--ease);
}

.remember-badge-pill .chevron-icon {
    width: 10px;
    height: 10px;
    transform: rotate(-90deg);
    transition: transform 0.22s var(--ease);
}

.remember-session-wrapper:hover .remember-badge-pill .chevron-icon {
    transform: rotate(90deg);
    color: var(--brass-bright);
}

.remember-badge-pill.active-session {
    background: var(--brass-wash);
    color: var(--brass-bright);
    border-color: var(--brass);
}

.remember-badge-pill.active-permanent {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
    border-color: var(--success);
}

/* Floating Popover */
.remember-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1.5px solid var(--brass);
    border-radius: var(--radius);
    padding: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--brass-wash);
    backdrop-filter: blur(12px);
    z-index: 10;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s var(--ease);
}

/* Invisible Bridge for smooth hover transition without losing hover state */
.remember-popover::after {
    content: '';
    position: absolute;
    bottom: -16px;
    left: 0;
    right: 0;
    height: 20px;
    background: transparent;
    pointer-events: auto;
}

/* Open on hover, focus-within, or locked open */
.remember-session-wrapper:hover .remember-popover,
.remember-session-wrapper:focus-within .remember-popover,
.remember-session-wrapper.is-open .remember-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.remember-popover-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.remember-popover-header span {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brass-bright);
}

.remember-options-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.remember-option-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s var(--ease);
}

.remember-option-card:hover {
    background: var(--surface-3);
    border-color: var(--brass);
    transform: translateX(2px);
}

.remember-option-card.selected {
    background: var(--brass-wash);
    border-color: var(--brass-bright);
    box-shadow: 0 0 0 1px var(--brass);
}

.remember-radio {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

.remember-radio-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1.5px solid var(--line-strong);
    background: var(--surface);
    margin-top: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
}

.remember-radio-indicator::after {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: transparent;
    transition: background-color 0.2s var(--ease);
}

.remember-option-card.selected .remember-radio-indicator {
    border-color: var(--brass-bright);
    background: var(--surface);
}

.remember-option-card.selected .remember-radio-indicator::after {
    background: var(--brass-bright);
}

.remember-option-body {
    flex: 1;
    min-width: 0;
}

.remember-option-head {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 3px;
}

.remember-option-head .option-icon {
    width: 14px;
    height: 14px;
    color: var(--brass);
}

.remember-option-head strong {
    font-weight: 600;
}

.remember-option-body p {
    font-size: 11.5px;
    color: var(--text-dim);
    line-height: 1.4;
    margin: 0;
}

/* ============ System Configuration Modal & JSON Editor ============ */
.config-modal-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 4px;
}

.config-modal-container::-webkit-scrollbar {
    width: 6px;
}
.config-modal-container::-webkit-scrollbar-track {
    background: var(--surface-2);
    border-radius: 4px;
}
.config-modal-container::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 4px;
}
.config-modal-container::-webkit-scrollbar-thumb:hover {
    background: var(--brass);
}

.config-tabs-nav {
    display: flex;
    gap: 8px;
    background: var(--surface-2);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.config-tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--ease);
}

.config-tab-btn:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.config-tab-btn.active {
    background: var(--surface-3);
    color: var(--text);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.config-section-card {
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.config-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brass-bright);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.config-fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.config-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.config-field-group label {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.config-field-group input,
.config-field-group select {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    color: var(--text);
    font-size: 13px;
    font-family: var(--font-body);
    transition: border-color 0.2s var(--ease);
}

.config-field-group input:focus,
.config-field-group select:focus {
    outline: none;
    border-color: var(--brass);
}

.config-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.config-toggle-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.config-toggle-info strong {
    font-size: 13px;
    color: var(--text);
}

.config-toggle-info small {
    font-size: 11px;
    color: var(--text-faint);
}

/* JSON Code Editor View */
.config-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.config-json-textarea {
    width: 100%;
    min-height: 360px;
    background: #0d0e12;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: #e2e8f0;
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    padding: 14px;
    resize: vertical;
    white-space: pre;
    tab-size: 2;
    box-sizing: border-box;
    transition: border-color 0.2s var(--ease);
}

.config-json-textarea:focus {
    outline: none;
    border-color: var(--brass);
    box-shadow: 0 0 0 3px var(--brass-wash);
}

.config-json-status {
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
}
.config-json-status.valid { color: var(--success); }
.config-json-status.invalid { color: var(--danger); }

.config-notice-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background: var(--brass-wash);
    border: 1px solid var(--brass);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.45;
}

.config-notice-box .icon {
    width: 18px;
    height: 18px;
    color: var(--brass-bright);
    flex-shrink: 0;
    margin-top: 1px;
}

/* ============ Multi-Level Cascading Create & Upload Menu ============ */
.create-menu-wrapper {
    position: relative;
    width: 100%;
}

.create-main-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 13.5px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 14px var(--shadow-color);
}

.create-btn-left {
    display: flex;
    align-items: center;
    gap: 9px;
}

.chevron-main {
    width: 14px;
    height: 14px;
    transition: transform 0.22s var(--ease);
    opacity: 0.8;
}

.create-menu-wrapper:hover .chevron-main,
.create-menu-wrapper.is-open .chevron-main {
    transform: rotate(90deg);
}

/* Base Dropdown and Submenus */
.create-dropdown,
.create-submenu {
    background: var(--dropdown-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 5px;
    display: none;
    flex-direction: column;
    gap: 2px;
    z-index: 500;
    animation: menu-pop 0.18s var(--ease) forwards;
}

@keyframes menu-pop {
    from {
        opacity: 0;
        transform: translateY(4px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Level 1 */
.create-dropdown.level-1 {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    margin-top: 6px;
    z-index: 500;
}

/* Invisible Bridge between main button and dropdown */
.create-dropdown.level-1::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 14px;
    background: transparent;
    pointer-events: auto;
}

.create-menu-wrapper:hover > .create-dropdown,
.create-menu-wrapper.is-open > .create-dropdown {
    display: flex;
}

/* Menu Items */
.create-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8.5px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    position: relative;
    user-select: none;
}

.create-menu-item .item-content {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.create-menu-item .item-icon {
    width: 15px;
    height: 15px;
    color: var(--brass-bright);
    flex-shrink: 0;
}

.create-menu-item .chevron-sub {
    width: 12px;
    height: 12px;
    color: var(--text-dim);
    flex-shrink: 0;
    transition: transform 0.15s var(--ease), color 0.15s var(--ease);
}

.create-menu-item:hover,
.create-menu-item.is-hovered,
.create-menu-item.is-open {
    background: var(--surface-3);
    color: #fff;
}

.create-menu-item:hover > .chevron-sub,
.create-menu-item.is-hovered > .chevron-sub,
.create-menu-item.is-open > .chevron-sub {
    color: var(--brass-bright);
    transform: translateX(2px);
}

/* Level 2 Submenu */
.create-submenu.level-2 {
    position: absolute;
    top: -5px;
    left: calc(100% + 6px);
    min-width: 165px;
    z-index: 510;
}

/* Invisible Bridge between parent item and level 2 submenu */
.create-submenu.level-2::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: -14px;
    width: 16px;
    background: transparent;
    pointer-events: auto;
}

.create-menu-item.has-submenu:hover > .create-submenu.level-2,
.create-menu-item.has-submenu.is-hovered > .create-submenu.level-2,
.create-menu-item.has-submenu.is-open > .create-submenu.level-2 {
    display: flex;
}

/* Level 3 Formats Submenu */
.create-submenu.level-3.formats-submenu {
    position: absolute;
    bottom: -10px;
    top: auto;
    left: calc(100% + 6px);
    min-width: 235px;
    max-height: min(400px, calc(100vh - 120px));
    overflow-y: auto;
    z-index: 520;
}

/* Invisible Bridge between parent item and level 3 submenu */
.create-submenu.level-3.formats-submenu::before {
    content: '';
    position: absolute;
    top: -10px;
    bottom: -10px;
    left: -14px;
    width: 16px;
    background: transparent;
    pointer-events: auto;
}

.create-menu-item.has-submenu:hover > .create-submenu.level-3,
.create-menu-item.has-submenu.is-hovered > .create-submenu.level-3,
.create-menu-item.has-submenu.is-open > .create-submenu.level-3 {
    display: flex;
}

.formats-submenu::-webkit-scrollbar {
    width: 5px;
}
.formats-submenu::-webkit-scrollbar-track {
    background: var(--surface-2);
    border-radius: 3px;
}
.formats-submenu::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 3px;
}
.formats-submenu::-webkit-scrollbar-thumb:hover {
    background: var(--brass);
}

/* Section Header inside Submenu */
.format-section-header {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brass);
    padding: 6px 10px 3px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.format-divider {
    height: 1px;
    background: var(--line);
    margin: 4px 6px;
}

.format-chip-ext {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--brass-bright);
    background: var(--surface);
    padding: 1.5px 6px;
    border-radius: 4px;
    border: 1px solid var(--line);
    margin-left: auto;
}

.star-badge-icon {
    width: 12px;
    height: 12px;
    color: #f59e0b;
    fill: #f59e0b;
    flex-shrink: 0;
}

/* Favorite Formats Manager in Profile Modal */
.favorite-formats-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-top: 6px;
}

.favorite-formats-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brass-bright);
    display: flex;
    align-items: center;
    gap: 6px;
}

.favorite-formats-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.format-pill-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.18s var(--ease);
    user-select: none;
}

.format-pill-tag:hover {
    border-color: var(--brass);
    color: var(--text);
}

.format-pill-tag.selected {
    background: var(--brass-wash);
    border-color: var(--brass);
    color: var(--brass-bright);
    font-weight: 600;
}

.format-pill-tag .pill-star {
    width: 11px;
    height: 11px;
    color: #f59e0b;
    fill: #f59e0b;
}

.add-custom-format-row {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.add-custom-format-row input {
    flex: 1;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text);
}

/* ============ Integrated PDF Viewer ============ */
.pdf-viewer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 5, 8, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modal-fade-in 0.22s var(--ease);
}

.pdf-viewer-container {
    width: 95vw;
    max-width: 1100px;
    height: 92vh;
    background: #0d0f14;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.pdf-viewer-container.fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
    border: none;
}

.pdf-viewer-container:fullscreen {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    border: none;
    border-radius: 0;
}
.pdf-viewer-container:fullscreen .pdf-viewer-toolbar,
.pdf-viewer-container.fullscreen .pdf-viewer-toolbar {
    display: none;
}

.media-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 240px;
    padding: 24px;
    background: linear-gradient(145deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 12px 30px rgba(0,0,0,0.22);
}
/* ============ MODERN MULTIMEDIA PLAYER UI ============ */
.modal.modal-media,
.modal:has(.media-player-card) {
    max-width: min(94vw, 880px);
    width: 100%;
    background: rgba(14, 19, 31, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--line-strong);
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.modal.modal-media.modal-audio,
.modal:has(.media-player-card.is-audio) {
    max-width: min(92vw, 680px);
}

.media-modal-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 82%;
    overflow: hidden;
}
.media-modal-header-title .icon {
    width: 20px;
    height: 20px;
    color: var(--brass-bright);
    flex-shrink: 0;
}
.media-modal-filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.media-player-card {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    user-select: none;
}

/* --- AUDIO HERO & STAGE --- */
.media-audio-hero {
    position: relative;
    width: 100%;
    min-height: 200px;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 24px 28px;
    background: radial-gradient(circle at 20% 50%, rgba(201, 161, 94, 0.12), transparent 70%),
                linear-gradient(145deg, rgba(22, 30, 48, 0.7), rgba(11, 15, 25, 0.95));
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06), 0 12px 30px rgba(0,0,0,0.3);
}
.media-audio-hero audio {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}
.media-audio-ambient-glow {
    position: absolute;
    width: 240px;
    height: 240px;
    left: -40px;
    top: -30px;
    background: radial-gradient(circle, var(--brass-wash) 0%, transparent 70%);
    filter: blur(45px);
    pointer-events: none;
    opacity: 0.5;
    transition: opacity 0.5s ease;
}
.media-player-card.is-playing .media-audio-ambient-glow {
    opacity: 1;
}

/* Vinyl Record Graphic */
.media-vinyl-wrap {
    position: relative;
    flex: 0 0 130px;
    width: 130px;
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.media-vinyl {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center,
        #1c1d22 0%, #15161a 18%,
        #2a2b30 19%, #101114 20%,
        #1c1d22 35%, #0d0e11 36%,
        #25262c 48%, #121316 50%,
        #1c1d22 65%, #0b0c0e 67%,
        #222328 80%, #08090b 82%,
        #111215 100%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.65), 0 0 0 2px rgba(255, 255, 255, 0.08);
    animation: vinyl-spin 7s linear infinite;
    animation-play-state: paused;
}
.media-player-card.is-playing .media-vinyl {
    animation-play-state: running;
}
.media-vinyl::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 45deg,
        rgba(255, 255, 255, 0.12) 0deg,
        transparent 60deg,
        rgba(255, 255, 255, 0.06) 120deg,
        transparent 180deg,
        rgba(255, 255, 255, 0.12) 240deg,
        transparent 300deg,
        rgba(255, 255, 255, 0.06) 360deg);
    pointer-events: none;
}
@keyframes vinyl-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.media-vinyl-label {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brass), var(--brass-dim));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #17130d;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.4);
    z-index: 2;
}
.media-vinyl-label .icon {
    width: 20px;
    height: 20px;
}
.media-vinyl-center {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #080a0f;
    border: 2px solid var(--brass-bright);
    z-index: 3;
}

/* Audio Track Info & Spectrum Visualizer */
.media-audio-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.media-audio-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.media-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.media-badge-format {
    background: var(--brass-wash);
    color: var(--brass-bright);
    border: 1px solid var(--brass-dim);
}
.media-badge-tech {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-dim);
    border: 1px solid var(--line);
}
.media-badge-status {
    background: rgba(74, 222, 128, 0.12);
    color: var(--success);
    border: 1px solid rgba(74, 222, 128, 0.25);
    transition: all 0.2s ease;
}
.media-badge-status.is-buffering {
    background: rgba(224, 168, 62, 0.12);
    color: var(--warning);
    border-color: rgba(224, 168, 62, 0.3);
}
.media-audio-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}
.media-audio-visualizer {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 32px;
    padding: 4px 0;
}
.viz-bar {
    flex: 0 0 4px;
    height: 100%;
    background: linear-gradient(to top, var(--brass-dim), var(--brass-bright));
    border-radius: 2px;
    transform-origin: bottom;
    transform: scaleY(0.15);
    transition: transform 0.15s ease;
    animation: bar-bounce 0.8s ease-in-out infinite alternate;
    animation-play-state: paused;
}
.media-player-card.is-playing .viz-bar {
    animation-play-state: running;
}
.viz-bar:nth-child(1)  { animation-duration: 0.65s; animation-delay: 0.05s; }
.viz-bar:nth-child(2)  { animation-duration: 0.50s; animation-delay: 0.15s; }
.viz-bar:nth-child(3)  { animation-duration: 0.75s; animation-delay: 0.25s; }
.viz-bar:nth-child(4)  { animation-duration: 0.60s; animation-delay: 0.10s; }
.viz-bar:nth-child(5)  { animation-duration: 0.85s; animation-delay: 0.30s; }
.viz-bar:nth-child(6)  { animation-duration: 0.55s; animation-delay: 0.05s; }
.viz-bar:nth-child(7)  { animation-duration: 0.70s; animation-delay: 0.20s; }
.viz-bar:nth-child(8)  { animation-duration: 0.90s; animation-delay: 0.35s; }
.viz-bar:nth-child(9)  { animation-duration: 0.60s; animation-delay: 0.15s; }
.viz-bar:nth-child(10) { animation-duration: 0.75s; animation-delay: 0.25s; }
.viz-bar:nth-child(11) { animation-duration: 0.50s; animation-delay: 0.05s; }
.viz-bar:nth-child(12) { animation-duration: 0.80s; animation-delay: 0.30s; }
.viz-bar:nth-child(13) { animation-duration: 0.65s; animation-delay: 0.10s; }
.viz-bar:nth-child(14) { animation-duration: 0.55s; animation-delay: 0.20s; }
.viz-bar:nth-child(15) { animation-duration: 0.70s; animation-delay: 0.05s; }
.viz-bar:nth-child(16) { animation-duration: 0.85s; animation-delay: 0.25s; }
.viz-bar:nth-child(17) { animation-duration: 0.60s; animation-delay: 0.15s; }
.viz-bar:nth-child(18) { animation-duration: 0.75s; animation-delay: 0.30s; }
@keyframes bar-bounce {
    0% { transform: scaleY(0.18); }
    50% { transform: scaleY(0.85); }
    100% { transform: scaleY(0.35); }
}

/* --- VIDEO STAGE --- */
.media-video-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 60vh;
    background: #030407;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
}
.media-video-stage video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Central Ripple Indicator on Video */
.media-video-ripple {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    z-index: 6;
}
.media-video-ripple.is-animating {
    animation: ripplePulse 0.5s ease-out forwards;
}
.media-video-ripple-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: rgba(18, 24, 38, 0.85);
    backdrop-filter: blur(8px);
    border: 1.5px solid var(--brass-bright);
    color: var(--brass-bright);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}
.media-video-ripple-icon .icon {
    width: 28px;
    height: 28px;
}
@keyframes ripplePulse {
    0% { transform: scale(0.65); opacity: 0; }
    40% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1.25); opacity: 0; }
}

/* Loading Overlay */
.media-loading {
    position: absolute;
    inset: 0;
    background: rgba(10, 14, 22, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    z-index: 10;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}
.media-loading[hidden] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.media-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255,255,255,0.12);
    border-top-color: var(--brass-bright);
    border-radius: 50%;
    animation: media-spin 0.8s linear infinite;
}
@keyframes media-spin {
    to { transform: rotate(360deg); }
}

/* --- UNIFIED CONTROLS BAR --- */
.media-controls-wrapper {
    width: 100%;
    background: rgba(17, 24, 39, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    padding: 14px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

/* Scrubber / Progress Row */
.media-progress-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.media-time {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    min-width: 42px;
    text-align: center;
    user-select: none;
}
.media-progress-container {
    position: relative;
    flex: 1;
    height: 24px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.media-progress-track {
    position: relative;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    overflow: visible;
    transition: height 0.15s ease;
}
.media-progress-container:hover .media-progress-track {
    height: 7px;
}
.media-progress-buffered {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    pointer-events: none;
    transition: width 0.2s ease;
}
.media-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, var(--brass), var(--brass-bright));
    border-radius: 4px;
    pointer-events: none;
}
.media-progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--brass-bright);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s var(--ease);
    pointer-events: none;
}
.media-progress-container:hover .media-progress-thumb,
.media-progress-container:active .media-progress-thumb {
    transform: translate(-50%, -50%) scale(1);
}
.media-progress-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    cursor: pointer;
    z-index: 2;
}
.media-progress-tooltip {
    position: absolute;
    bottom: calc(100% + 6px);
    left: 0;
    transform: translateX(-50%);
    background: rgba(10, 14, 22, 0.92);
    backdrop-filter: blur(8px);
    color: var(--text);
    border: 1px solid var(--line-strong);
    padding: 3px 7px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 11px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease;
    white-space: nowrap;
    z-index: 5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.media-progress-container:hover .media-progress-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Controls Dock */
.media-controls-dock {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: 100%;
}
.media-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Control Buttons */
.media-control-button {
    border: none;
    outline: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.18s var(--ease);
    color: var(--text);
}
.media-control-button .icon {
    width: 18px;
    height: 18px;
}
.btn-primary-media {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--brass-bright), var(--brass));
    color: #17130d;
    box-shadow: 0 4px 14px rgba(201, 161, 94, 0.35);
}
.btn-primary-media:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 20px rgba(201, 161, 94, 0.5);
}
.btn-primary-media:active {
    transform: scale(0.96);
}
.btn-secondary-media {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--text-dim);
}
.btn-secondary-media:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
    border-color: var(--line-strong);
    transform: scale(1.04);
}
.btn-secondary-media.active {
    background: var(--brass-wash);
    color: var(--brass-bright);
    border-color: var(--brass-dim);
}

/* Volume Slider */
.media-volume-slider-wrap {
    position: relative;
    width: 80px;
    height: 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.media-volume-track {
    position: relative;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
    overflow: hidden;
}
.media-volume-fill {
    height: 100%;
    background: var(--brass-bright);
    border-radius: 3px;
}
.media-volume-slider-wrap input[type="range"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    margin: 0;
    cursor: pointer;
}

/* Speed Selector Popover */
.media-speed-container {
    position: relative;
}
.media-speed-btn {
    border-radius: 8px;
    width: auto;
    min-width: 38px;
    padding: 0 8px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    font-weight: 600;
}
.media-speed-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    background: rgba(14, 19, 31, 0.95);
    backdrop-filter: blur(14px);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
    white-space: nowrap;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    z-index: 100;
}
.media-speed-menu[hidden] {
    display: none;
}
.media-speed-opt {
    background: transparent;
    border: none;
    color: var(--text-dim);
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-family: var(--font-mono);
    text-align: left;
    cursor: pointer;
    transition: all 0.15s ease;
}
.media-speed-opt:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
}
.media-speed-opt.active {
    background: var(--brass-wash);
    color: var(--brass-bright);
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 580px) {
    .media-audio-hero {
        flex-direction: column;
        text-align: center;
        padding: 20px 16px;
    }
    .media-audio-info {
        align-items: center;
    }
    .media-controls-dock {
        flex-wrap: wrap;
        justify-content: center;
    }
    .media-controls-group {
        justify-content: center;
    }
    .media-volume-slider-wrap {
        width: 60px;
    }
}

/* PDF Header / Toolbar */
.pdf-viewer-toolbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    z-index: 20;
}

.pdf-toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pdf-doc-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 260px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pdf-doc-title .pdf-icon-badge {
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.02em;
    font-family: var(--font-mono);
}

.pdf-page-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--surface-2);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.pdf-page-input {
    width: 42px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 3px 4px;
    text-align: center;
    font-size: 12.5px;
    font-family: var(--font-mono);
    color: var(--text);
}

.pdf-page-input:focus {
    outline: none;
    border-color: var(--brass);
}

.pdf-page-total {
    font-size: 12px;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

.pdf-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-2);
    padding: 3px 6px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.pdf-zoom-select {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 12px;
    color: var(--text);
    font-family: var(--font-mono);
    cursor: pointer;
}

.pdf-zoom-select:focus {
    outline: none;
    border-color: var(--brass);
}

/* PDF Scroll & Canvas Area */
.pdf-scroll-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: auto;
    background: #08090d;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    position: relative;
}

.pdf-scroll-viewport::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.pdf-scroll-viewport::-webkit-scrollbar-track {
    background: #0c0d12;
}
.pdf-scroll-viewport::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 4px;
}
.pdf-scroll-viewport::-webkit-scrollbar-thumb:hover {
    background: var(--brass);
}

.pdf-page-card {
    background: #ffffff;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    position: relative;
    transition: transform 0.15s ease-out;
}

.pdf-page-canvas {
    display: block;
    max-width: 100%;
    height: auto;
    background: #ffffff;
}

.pdf-fallback-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #0d0f14;
}

.pdf-loader-box {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(13, 15, 20, 0.85);
    z-index: 10;
    color: var(--text);
}

button, input, select, textarea, .file-item, .sidebar, .topbar, .modal, .toast {
    transition: transform 0.22s var(--ease), opacity 0.22s var(--ease), background-color 0.22s var(--ease), border-color 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
button:active { transform: scale(0.97); }
.content { animation: content-in 0.5s var(--ease) both; }
@keyframes content-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ============ Upload Status Floating Manager Widget ============ */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin-icon {
    animation: spin 1s linear infinite;
    transform-origin: center;
}

.transfer-icon {
    animation: spin 0.9s linear infinite;
    transform-origin: center;
    filter: drop-shadow(0 0 3px currentColor);
}

.transfer-icon.paused {
    animation-play-state: paused;
    opacity: 0.68;
}

.upload-manager {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    font-family: var(--font-body);
    transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.upload-manager[hidden] {
    display: none !important;
}

/* --- Collapsed Pill Mode --- */
.upload-pill {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border: 1px solid var(--brass-wash);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--brass-dim);
    border-radius: 999px;
    cursor: pointer;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.upload-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 0 1.5px var(--brass);
}

.upload-manager.minimized .upload-pill {
    display: flex;
}

.upload-manager.minimized .upload-card {
    display: none !important;
}

.upload-pill-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brass-bright);
}

.upload-pill-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.upload-pill-text {
    font-weight: 500;
    color: var(--text);
}

.upload-pill-pct {
    font-weight: 700;
    color: var(--brass-bright);
    font-family: var(--font-mono);
}

.upload-pill-btn {
    padding: 2px;
    color: var(--text-dim);
}

/* --- Expanded Card Mode --- */
.upload-card {
    display: flex;
    flex-direction: column;
    width: 390px;
    max-width: calc(100vw - 32px);
    max-height: 520px;
    background: var(--card-bg);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    overflow: hidden;
    animation: upload-card-slide-in 0.3s var(--ease) both;
}

/* upload-card light override now handled via --card-bg/--card-shadow theme variables */

@keyframes upload-card-slide-in {
    from {
        opacity: 0;
        transform: translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.upload-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.upload-card-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.upload-indicator-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brass-wash);
    color: var(--brass-bright);
    flex-shrink: 0;
}

.upload-indicator-spinner.completed {
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.upload-indicator-spinner.error {
    background: rgba(242, 104, 91, 0.15);
    color: var(--danger);
}

.upload-indicator-spinner.transferring {
    color: var(--brass-bright);
}

.upload-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

.upload-card-subtitle {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 2px;
}

.upload-card-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Overall Progress Track */
.upload-overall-progress {
    padding: 12px 18px;
    background: var(--progress-bg);
    border-bottom: 1px solid var(--line);
}

/* upload-overall-progress light override now handled via --progress-bg theme variable */

.upload-progress-track {
    width: 100%;
    height: 6px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.upload-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brass), var(--brass-bright));
    border-radius: 999px;
    transition: width 0.25s ease-out;
    box-shadow: 0 0 10px rgba(201, 161, 94, 0.4);
}

.upload-progress-bar.completed {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.4);
}

.upload-overall-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--text-dim);
    font-family: var(--font-mono);
}

#upload-overall-pct {
    font-weight: 600;
    color: var(--brass-bright);
}

/* File List Queue */
.upload-file-list {
    flex: 1;
    max-height: 250px;
    overflow-y: auto;
    padding: 6px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upload-file-list::-webkit-scrollbar {
    width: 5px;
}

.upload-file-list::-webkit-scrollbar-thumb {
    background: var(--surface-3);
    border-radius: 10px;
}

.upload-file-list::-webkit-scrollbar-thumb:hover {
    background: var(--brass-dim);
}

/* Single File Item */
.upload-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    gap: 6px;
    position: relative;
    transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}

.upload-item:hover {
    background: var(--surface-3);
    border-color: var(--line-strong);
}

.upload-item.status-uploading {
    border-color: rgba(201, 161, 94, 0.3);
    background: rgba(201, 161, 94, 0.04);
}

.upload-item.status-completed {
    border-color: rgba(74, 222, 128, 0.2);
}

.upload-item.status-error {
    border-color: rgba(242, 104, 91, 0.3);
    background: rgba(242, 104, 91, 0.05);
}

.upload-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.upload-item-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

.upload-item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    flex-shrink: 0;
}

.upload-item-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.upload-item-name {
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.upload-item-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.upload-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

/* Status Badges */
.upload-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    line-height: 1.4;
}

.upload-badge.queued {
    background: var(--surface-3);
    color: var(--text-dim);
}

.upload-badge.uploading {
    background: var(--brass-wash);
    color: var(--brass-bright);
    border: 1px solid rgba(201, 161, 94, 0.3);
}

.upload-badge.downloading {
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
}

.upload-item.status-downloading {
    border-color: rgba(56, 189, 248, 0.3);
    background: rgba(56, 189, 248, 0.04);
}

.upload-badge.completed {
    background: rgba(74, 222, 128, 0.12);
    color: var(--success);
    border: 1px solid rgba(74, 222, 128, 0.25);
}

.upload-badge.error {
    background: rgba(242, 104, 91, 0.12);
    color: var(--danger);
    border: 1px solid rgba(242, 104, 91, 0.3);
}

.upload-badge.cancelled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-faint);
}

.upload-badge.paused {
    background: rgba(251, 191, 36, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.upload-item.status-paused {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.04);
}

.upload-item-pause-btn {
    padding: 3px;
    color: var(--text-dim);
    border-radius: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
}

.upload-item-pause-btn:hover {
    color: var(--brass-bright);
    background: var(--brass-wash);
}

.upload-item-cancel-btn {
    padding: 3px;
    color: var(--text-dim);
    border-radius: 4px;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background-color 0.15s;
}

.upload-item-cancel-btn:hover {
    color: var(--danger);
    background: rgba(242, 104, 91, 0.15);
}

/* Mini Progress inside item */
.upload-item-progress-track {
    width: 100%;
    height: 4px;
    background: var(--surface-3);
    border-radius: 999px;
    overflow: hidden;
}

.upload-item-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--brass), var(--brass-bright));
    border-radius: 999px;
    transition: width 0.15s linear;
}

.upload-item.status-completed .upload-item-progress-bar {
    background: var(--success);
}

.upload-item.status-error .upload-item-progress-bar {
    background: var(--danger);
}

.upload-item-error-msg {
    font-size: 0.72rem;
    color: var(--danger);
    line-height: 1.2;
    margin-top: 2px;
}

/* Card Footer */
.upload-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-top: 1px solid var(--line);
    background: var(--footer-bg);
}

/* upload-card-footer light override now handled via --footer-bg theme variable */

.upload-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease, color 0.15s ease;
}

.upload-action-btn:hover {
    background: rgba(255, 255, 255, 0.06);
}

#upload-pause-resume-btn {
    background: var(--brass-bright);
    color: #17130d;
    border: 1px solid var(--brass-bright);
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(201, 161, 94, 0.22);
}

#upload-pause-resume-btn:hover {
    background: #f0cf8b;
    border-color: #f0cf8b;
    box-shadow: 0 6px 18px rgba(201, 161, 94, 0.34);
}

#upload-pause-resume-btn.paused {
    background: var(--success);
    border-color: var(--success);
    color: #092014;
    box-shadow: 0 4px 14px rgba(74, 222, 128, 0.22);
}

#upload-pause-resume-btn.paused:hover {
    background: #86efac;
    border-color: #86efac;
    box-shadow: 0 6px 18px rgba(74, 222, 128, 0.34);
}

#upload-pause-resume-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.upload-action-btn.text-danger {
    color: var(--danger);
}

.upload-action-btn.text-danger:hover {
    background: rgba(242, 104, 91, 0.12);
}

.upload-action-btn.text-dim {
    color: var(--text-dim);
}

.upload-action-btn.text-dim:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================
   FLOATING BULK ACTIONS BAR
   ========================================== */
.bulk-actions-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 950;
    transition: transform 0.28s var(--ease), opacity 0.28s var(--ease);
    animation: bulkBarSlideUp 0.28s var(--ease);
}

.bulk-actions-bar[hidden] {
    display: none !important;
}

@keyframes bulkBarSlideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(24px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.bulk-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--bar-bg);
    border: 1px solid var(--brass-wash);
    box-shadow: var(--bar-shadow);
    border-radius: 999px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* bulk-bar-inner light override now handled via --bar-bg/--bar-shadow theme variables */

.bulk-count-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--brass-wash);
    color: var(--brass-bright);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid rgba(201, 161, 94, 0.25);
    white-space: nowrap;
}

#bulk-count {
    font-family: var(--font-mono);
    font-weight: 700;
}

.bulk-actions-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bulk-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--text);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
    white-space: nowrap;
}

.bulk-action-btn .icon {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.bulk-action-btn:hover {
    background: var(--surface-3);
    border-color: var(--brass);
    color: var(--brass-bright);
    transform: translateY(-1px);
}

.bulk-action-btn.bulk-btn-danger {
    color: var(--danger);
    border-color: rgba(242, 104, 91, 0.25);
    background: rgba(242, 104, 91, 0.06);
}

.bulk-action-btn.bulk-btn-danger:hover {
    background: rgba(242, 104, 91, 0.18);
    border-color: var(--danger);
    color: var(--danger);
}

.bulk-close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 2px;
    transition: background 0.15s, color 0.15s;
}

.bulk-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

.bulk-close-btn .icon {
    width: 14px;
    height: 14px;
}

@media (max-width: 680px) {
    .bulk-actions-bar {
        bottom: 16px;
        left: 12px;
        right: 12px;
        transform: none;
        max-width: calc(100vw - 24px);
    }
    .bulk-bar-inner {
        width: 100%;
        overflow-x: auto;
        padding: 6px 10px;
    }
    .bulk-action-btn span {
        display: none;
    }
    .bulk-action-btn {
        padding: 8px;
    }
    .upload-manager {
        bottom: 76px !important;
    }
}

@media (max-width: 480px) {
    .upload-manager {
        bottom: 16px;
        right: 16px;
        left: 16px;
    }
    .upload-card {
        width: 100%;
        max-height: 70vh;
    }
}

/* ============ BRAND LOGO CONTAINERS ============ */
.brand-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-logo-container--sm {
    width: 48px;
    height: 48px;
}

.brand-logo-container--lg {
    width: 90px;
    height: 90px;
    margin-bottom: 8px;
}

.brand-logo-img {
    display: block;
    object-fit: contain;
    border-radius: 8px;
}

.brand-logo-container--sm .brand-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 6px;
}

.brand-logo-container--lg .brand-logo-img {
    width: 90px;
    height: 90px;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}

/* Admin logo upload area */
.logo-upload-area {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.logo-preview-container {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo-preview-box {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
    border: 1.5px dashed rgba(255,255,255,0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.logo-preview-box img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.logo-upload-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.logo-upload-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    background: rgba(109,142,247,0.15);
    border: 1px solid rgba(109,142,247,0.35);
    color: var(--accent);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.18s;
}
.logo-upload-label:hover {
    background: rgba(109,142,247,0.28);
}

.logo-upload-info {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* ============ GLOBAL SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--surface-2); }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid var(--surface-2); }
::-webkit-scrollbar-thumb:hover { background: var(--brass); }
html { scrollbar-width: thin; scrollbar-color: var(--line-strong) var(--surface-2); }

/* ============ THEME SELECTOR PANEL ============ */
.theme-selector-wrapper { position: relative; }

.theme-selector-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 340px;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: 0 20px 48px -12px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.04);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 16px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0s linear 0.22s;
}

.theme-selector-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.theme-selector-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.theme-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-faint);
    margin: 12px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.theme-section-label:first-of-type { margin-top: 0; }
.theme-section-label .icon { width: 12px; height: 12px; }

.theme-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.theme-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.18s var(--ease);
    position: relative;
}

.theme-card:hover {
    border-color: var(--brass);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--shadow-color);
}

.theme-card.active {
    border-color: var(--brass-bright);
    background: var(--brass-wash);
    box-shadow: 0 0 0 1px var(--brass);
}

.theme-card.active::after {
    content: '';
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--brass-bright);
    box-shadow: 0 0 6px var(--brass);
}

.theme-preview {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid rgba(128,128,128,0.2);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
}

.theme-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.2;
}

/* ============ HAMBURGER MENU (MOBILE) ============ */
.hamburger-btn {
    display: none;
    background: var(--surface-2);
    border: 1.5px solid var(--line);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: all 0.2s var(--ease);
    flex-shrink: 0;
}

.hamburger-btn:hover { color: var(--brass); border-color: var(--brass); }
.hamburger-btn .icon { width: 20px; height: 20px; }

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    backdrop-filter: blur(4px);
    z-index: 49;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ============ IMPROVED RESPONSIVE ============ */

/* Tablet Landscape */
@media (max-width: 1024px) {
    .topbar-inner { padding: 12px 20px; }
    .main-container.layout-grid { padding: 20px; gap: 18px; grid-template-columns: 210px 1fr; }
    .sidebar { padding: 16px; }
}

/* Tablet / Small Laptop */
@media (max-width: 980px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-panel-brand { display: none; }
    .main-container.layout-grid { grid-template-columns: 1fr; }

    .hamburger-btn { display: inline-flex; }

    /* Sidebar becomes a slide-out drawer */
    .sidebar {
        position: fixed;
        top: 64px;
        left: 0;
        bottom: 0;
        width: min(300px, 86vw);
        max-width: 86vw;
        z-index: 50;
        border-radius: 0;
        border: none;
        border-right: 1px solid var(--line);
        background: var(--surface);
        transform: translateX(-100%);
        transition: transform 0.3s var(--ease);
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
        gap: 16px;
    }

    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 12px 0 40px rgba(0,0,0,0.3);
    }

    .sidebar-footer { padding-bottom: 24px; }

    /* Mobile Accordion Create Menu */
    .create-menu-wrapper {
        width: 100%;
    }

    .create-dropdown.level-1 {
        position: static;
        width: 100%;
        margin-top: 6px;
        box-shadow: none;
        border: 1px solid var(--line);
        background: color-mix(in srgb, var(--surface-2) 90%, transparent);
        animation: none;
    }

    .create-dropdown.level-1::before,
    .create-submenu.level-2::before,
    .create-submenu.level-3.formats-submenu::before {
        display: none !important;
    }

    .create-menu-item.has-submenu {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
        position: relative;
    }

    .create-menu-item.has-submenu > .item-content {
        padding: 8.5px 12px;
        padding-right: 32px;
        display: flex;
        align-items: center;
        width: 100%;
    }

    .create-menu-item.has-submenu > .chevron-sub {
        position: absolute;
        right: 12px;
        top: 11px;
        transition: transform 0.2s var(--ease);
    }

    .create-menu-item.has-submenu.is-open > .chevron-sub {
        transform: rotate(90deg) !important;
        color: var(--brass-bright);
    }

    .create-submenu.level-2,
    .create-submenu.level-3.formats-submenu {
        position: static;
        top: auto;
        bottom: auto;
        left: auto;
        width: calc(100% - 6px);
        min-width: 0;
        margin: 2px 0 4px 6px;
        padding: 4px 6px;
        border: none;
        border-left: 2px solid var(--brass);
        border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        background: color-mix(in srgb, var(--surface-3) 80%, transparent);
        box-shadow: none;
        animation: none;
        display: none;
    }

    .create-submenu.level-3.formats-submenu {
        max-height: 260px;
        overflow-y: auto;
        margin-left: 6px;
        width: calc(100% - 6px);
    }

    .create-submenu.level-3.formats-submenu .create-menu-item {
        padding: 7px 8px;
        gap: 6px;
    }

    .create-submenu.level-3.formats-submenu .item-content {
        font-size: 12.5px;
        gap: 6px;
        flex: 1;
        min-width: 0;
        white-space: normal;
        line-height: 1.25;
    }

    .create-submenu.level-3.formats-submenu .format-chip-ext {
        font-size: 10px;
        padding: 1.5px 5px;
        flex-shrink: 0;
    }

    .create-menu-item.has-submenu.is-open > .create-submenu.level-2,
    .create-menu-item.has-submenu.is-open > .create-submenu.level-3 {
        display: flex;
    }
}

/* Mobile */
@media (max-width: 720px) {
    .topbar {
        height: auto;
        min-height: 64px;
    }

    .topbar-inner {
        flex-wrap: wrap;
        padding: 10px 14px;
        gap: 10px;
    }
    .hamburger-btn { display: inline-flex; }
    .brand { min-width: 0; flex: 1 1 auto; }
    .brand-text { min-width: 0; }
    .brand-text .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .header-actions { margin-left: 0; flex-shrink: 0; }
    .brand-text .title { font-size: 15px; }
    .brand-text .subtitle { display: none; }
    .search-area { order: 3; max-width: 100%; flex-basis: 100%; }
    .storage-info { display: none; }
    .header-actions { gap: 8px; }
    .header-actions .btn-secondary {
        padding: 8px;
        font-size: 0;
        gap: 0;
    }
    .header-actions .btn-secondary .icon { width: 16px; height: 16px; }
    .main-container.layout-grid {
        height: auto;
        min-height: 0;
        padding: 0;
        gap: 0;
    }

    .content { padding: 16px 14px 96px; }

    .sidebar { top: 0; padding: 18px 14px 24px; }

    .file-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
    .file-item { padding: 14px; gap: 10px; }
    .file-icon { width: 38px; height: 38px; }
    .file-name { font-size: 13px; }
    .file-actions button { width: 30px; height: 30px; }

    .toolbar { padding: 10px 14px; }

    /* Modal full width on mobile */
    .modal { width: 95%; max-width: none; border-radius: var(--radius); }

    /* Theme selector opens as a centered dialog on mobile */
    .theme-selector-panel {
        position: fixed !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        width: min(340px, calc(100vw - 28px));
        height: auto;
        max-height: calc(100dvh - 24px);
        min-height: 0;
        overflow-y: auto;
        border-radius: var(--radius);
        transform: translate(-50%, -48%) scale(0.96) !important;
        box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), 0 0 0 100vmax var(--overlay-bg);
    }
    .theme-selector-panel.open { transform: translate(-50%, -50%) scale(1) !important; }

    .theme-selector-panel .theme-grid { gap: 6px; }
    .theme-selector-panel .theme-card { min-height: 58px; padding: 8px 10px; }
    .theme-selector-panel .theme-card-name { font-size: 11.5px; }
}

/* Small Mobile */
@media (max-width: 480px) {
    .file-grid { grid-template-columns: 1fr; }
    .file-item { padding: 12px; }

    .topbar-inner {
        flex-wrap: wrap;
        padding: 8px 10px;
        gap: 6px;
    }
    .hamburger-btn {
        width: 34px;
        height: 34px;
    }
    .hamburger-btn .icon { width: 18px; height: 18px; }
    .brand { gap: 6px; }
    .brand-logo-container--sm,
    .cube-mark--sm { width: 34px; height: 34px; }
    .brand-text .title { font-size: 14px; }
    .header-actions { gap: 5px; }
    .header-actions .btn-icon,
    .header-actions .user-chip-btn { height: 34px; }
    .header-actions .btn-icon { width: 34px; }
    .user-chip-btn { padding: 4px 7px; gap: 4px; }
    .user-chip-name { display: none; }
    .user-avatar-indicator { width: 25px; height: 25px; }
    .user-chip-btn .chevron-down-icon { width: 14px; height: 14px; }
    .auth-card { padding: 0 8px; }
    .auth-panel-form { padding: 24px 16px; }
    .brand-word { font-size: 28px; }

    .modal-body { padding: 16px; }
    .modal-header { padding: 14px 16px; }

    .upload-manager {
        bottom: 12px;
        right: 12px;
        left: 12px;
    }
    .upload-card {
        width: 100%;
        max-height: 60vh;
    }

    .breadcrumbs { font-size: 12px; }
    .breadcrumb { padding: 5px 7px; }
}

/* ============ VISUAL ENHANCEMENTS ============ */

/* Improved sidebar btn active indicator */
.sidebar-btn.active {
    position: relative;
}
.sidebar-btn.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--brass-bright);
    border-radius: 0 2px 2px 0;
}

/* Topbar gradient accent line */
.topbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--brass-wash), var(--brass), var(--brass-wash), transparent);
    opacity: 0.5;
}
