
:root {
    /* Base Obsidian Palette */
    --bg-base: #080b11;
    --bg-surface: #0e1422;
    --bg-surface-elevated: #151d2f;
    --bg-card: rgba(18, 26, 44, 0.72);
    --bg-card-hover: rgba(26, 38, 64, 0.88);
    --bg-glass: rgba(14, 20, 34, 0.82);

    /* Subtle Borders & Dividers */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(56, 189, 248, 0.4);
    --border-strong: rgba(255, 255, 255, 0.16);
    --border-focus: rgba(56, 189, 248, 0.65);

    /* Electric Cyan & Brand Accents */
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #38bdf8;
    --primary-glow: rgba(56, 189, 248, 0.28);
    --primary-gradient: linear-gradient(135deg, #38bdf8 0%, #3b82f6 50%, #8b5cf6 100%);
    --accent-gradient: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
    --card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.008) 100%);

    /* Category Badges & File Accents */
    --cat-folder: #38bdf8;
    --cat-image: #c084fc;
    --cat-video: #fb7185;
    --cat-audio: #34d399;
    --cat-doc: #60a5fa;
    --cat-code: #2dd4bf;
    --cat-archive: #fbbf24;
    --cat-starred: #f59e0b;
    --cat-other: #94a3b8;

    --cat-folder-rgb: 56, 189, 248;
    --cat-image-rgb: 192, 132, 252;
    --cat-video-rgb: 251, 113, 133;
    --cat-audio-rgb: 52, 211, 153;
    --cat-doc-rgb: 96, 165, 250;
    --cat-code-rgb: 45, 212, 191;
    --cat-archive-rgb: 251, 191, 36;
    --cat-starred-rgb: 245, 158, 11;
    --cat-other-rgb: 148, 163, 184;

    /* Text Colors */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-faint: #64748b;
    --danger: #f43f5e;
    --danger-hover: #e11d48;
    --success: #10b981;
    --warning: #f59e0b;

    /* Typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    /* Interactive State Helpers */
    --bg-hover-subtle: rgba(255, 255, 255, 0.08);
    --nav-active-bg: rgba(2, 132, 199, 0.16);
    --nav-active-text: #e0f2fe;
    --nav-active-border: rgba(56, 189, 248, 0.35);

    /* Layout & Shadows */
    --header-height: 68px;
    --sidebar-width: 240px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --shadow-soft: 0 12px 36px -10px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 30px -5px rgba(56, 189, 248, 0.22);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    /* Base Daylight Surfaces */
    --bg-base: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.94);
    --bg-card-hover: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.88);

    /* Clean Borders & Dividers */
    --border-subtle: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(2, 132, 199, 0.4);
    --border-strong: rgba(15, 23, 42, 0.14);
    --border-focus: rgba(2, 132, 199, 0.6);

    /* Electric Cyan & Brand Accents (optimized for high contrast on light backgrounds) */
    --primary: #0284c7;
    --primary-hover: #0369a1;
    --primary-light: #0284c7;
    --primary-glow: rgba(2, 132, 199, 0.18);
    --primary-gradient: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #7c3aed 100%);
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
    --card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.85) 100%);

    /* Category Badges & File Accents (Calibrated for WCAG contrast on light surfaces) */
    --cat-folder: #0284c7;
    --cat-image: #9333ea;
    --cat-video: #e11d48;
    --cat-audio: #059669;
    --cat-doc: #2563eb;
    --cat-code: #0d9488;
    --cat-archive: #d97706;
    --cat-starred: #d97706;
    --cat-other: #64748b;

    --cat-folder-rgb: 2, 132, 199;
    --cat-image-rgb: 147, 51, 234;
    --cat-video-rgb: 225, 29, 72;
    --cat-audio-rgb: 5, 150, 105;
    --cat-doc-rgb: 37, 99, 235;
    --cat-code-rgb: 13, 148, 136;
    --cat-archive-rgb: 217, 119, 6;
    --cat-starred-rgb: 217, 119, 6;
    --cat-other-rgb: 100, 116, 139;

    /* Text Colors */
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-faint: #94a3b8;
    --danger: #e11d48;
    --danger-hover: #be123c;
    --success: #059669;
    --warning: #d97706;

    /* Interactive State Helpers */
    --bg-hover-subtle: rgba(15, 23, 42, 0.05);
    --nav-active-bg: rgba(2, 132, 199, 0.1);
    --nav-active-text: #0284c7;
    --nav-active-border: rgba(2, 132, 199, 0.3);

    /* Shadows */
    --shadow-soft: 0 10px 30px -8px rgba(15, 23, 42, 0.09), 0 4px 12px -2px rgba(15, 23, 42, 0.05);
    --shadow-glow: 0 0 25px -5px rgba(2, 132, 199, 0.15);
}

/* Reset & Global */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
    font-family: inherit;
    color: inherit;
}

::placeholder {
    color: var(--text-faint);
    opacity: 0.85;
}

#app {
    width: 100vw;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    overflow-x: hidden;
}

.screen {
    display: none;
    width: 100%;
    min-height: 100vh;
}
.screen.active {
    display: flex;
}

/* ========================================== */
/* Authentication Screen                      */
/* ========================================== */
#auth-screen {
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 50% 15%, rgba(56, 189, 248, 0.15), transparent 60%),
                radial-gradient(circle at 80% 80%, rgba(99, 102, 241, 0.12), transparent 50%),
                var(--bg-base);
    padding: 24px;
}

.auth-card-backdrop {
    width: 100%;
    max-width: 440px;
    background: var(--card-gradient);
    border-radius: var(--radius-lg);
    padding: 1px;
    box-shadow: var(--shadow-soft), var(--shadow-glow);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 40px 32px;
    backdrop-filter: blur(16px);
}

.brand {
    text-align: center;
    margin-bottom: 28px;
}

.logo-badge {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
}

.brand-app-icon {
    display: inline-block;
    vertical-align: middle;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), 0 0 16px rgba(56, 189, 248, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform var(--transition-fast);
}
.brand-app-icon:hover {
    transform: scale(1.04);
}
.brand-app-icon.lg {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    margin-bottom: 6px;
}
.brand-app-icon.sm {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.brand h1 {
    font-family: var(--font-heading);
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
}

.brand .subtitle {
    font-size: 14px;
    color: var(--text-muted);
}

.tabs {
    display: flex;
    background: var(--bg-surface-elevated);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-subtle);
}

.tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.tab-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 14px;
    color: var(--text-main);
    transition: var(--transition-fast);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.alert-error {
    margin-top: 14px;
    padding: 10px 14px;
    background: rgba(244, 63, 94, 0.15);
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-radius: var(--radius-sm);
    color: #fecdd3;
    font-size: 13px;
    text-align: center;
}

.features-pill-row {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pill-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-mono);
}
.pill-item .svg-icon {
    color: var(--primary-light);
}

.svg-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    flex-shrink: 0;
}
.svg-icon.cat-folder-icon { color: var(--cat-folder); }
.svg-icon.cat-desktop-icon { color: var(--cat-folder); }
.svg-icon.cat-image-icon { color: var(--cat-image); }
.svg-icon.cat-video-icon { color: var(--cat-video); }
.svg-icon.cat-audio-icon { color: var(--cat-audio); }
.svg-icon.cat-doc-icon { color: var(--cat-doc); }
.svg-icon.cat-downloads-icon { color: var(--cat-audio); }
.svg-icon.cat-code-icon { color: var(--cat-code); }
.svg-icon.cat-archive-icon { color: var(--cat-archive); }
.svg-icon.cat-starred-icon { color: var(--cat-starred); }
.svg-icon.cat-trash-icon { color: var(--danger); }
.svg-icon.cat-gallery-icon { color: #ec4899; }
.svg-icon.cat-other-icon { color: var(--cat-other); }

/* ========================================== */
/* ========================================== */
#dashboard-screen {
    display: none;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    flex-direction: column;
    background: var(--bg-base);
    box-sizing: border-box;
}
#dashboard-screen.active {
    display: flex;
}

/* Top Navigation Bar */
.app-header {
    height: var(--header-height);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
    max-width: 1300px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.3px;
    line-height: 1.15;
}

.brand-sub {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

.search-container {
    position: relative;
    flex: 1;
    display: block;
    margin: 0;
}

.search-container .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    pointer-events: none;
}

.search-container input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 9px 36px 9px 36px;
    font-size: 13px;
    color: var(--text-main);
    transition: var(--transition-fast);
    outline: none;
}

.search-container input:focus {
    border-color: var(--primary-light);
    background: var(--bg-surface-elevated);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-fast);
}
.search-clear-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.08);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* View Mode Switcher */
.view-toggle-group {
    display: flex;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 3px;
}

.icon-toggle-btn {
    background: transparent;
    border: none;
    padding: 6px 8px;
    color: var(--text-muted);
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
}

.icon-toggle-btn.active, .icon-toggle-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}
.icon-toggle-btn.active {
    color: var(--primary);
}

.theme-toggle-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-fast);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    color: var(--primary-light);
    border-color: var(--border-hover);
    background: var(--bg-surface-elevated);
    box-shadow: 0 0 12px var(--primary-glow);
}

.theme-toggle-btn .theme-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.auth-theme-switch-wrap {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 100;
}

/* Common Buttons */
.primary-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
    box-shadow: 0 2px 8px var(--primary-glow);
}
.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}
.primary-btn.sm {
    padding: 6px 14px;
    font-size: 12px;
}
.primary-btn.wide-btn {
    width: 100%;
    justify-content: center;
    padding: 12px;
}

.secondary-btn {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    border: 1px solid var(--border-subtle);
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
}
.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.ghost-btn {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
}
.ghost-btn:hover {
    color: var(--text-main);
    border-color: var(--border-strong);
}

/* User Profile Badge */
/* User Profile Badge */
.user-profile-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 4px 10px 4px 4px;
    border-radius: 30px;
}

.user-avatar-wrap {
    width: 32px;
    height: 32px;
    position: relative;
    cursor: pointer;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.user-avatar-wrap:hover {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--primary);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.user-avatar-initial {
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    cursor: pointer;
    line-height: 1.2;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    transition: var(--transition-fast);
}

.user-info-text:hover .user-name {
    color: var(--primary-light);
}

.user-displayname {
    font-size: 11px;
    font-weight: 400;
    color: var(--text-muted);
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
    outline: none;
}

.settings-btn:hover {
    color: var(--primary-light);
    border-color: var(--primary);
    background: rgba(6, 182, 212, 0.12);
}

.settings-btn:hover svg {
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}

.signout-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition-fast);
    outline: none;
}

.signout-btn:hover {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.12);
}

.security-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    user-select: none;
}

.security-badge .security-dot {
    width: 7px;
    height: 7px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px #10b981;
    animation: pulseSecurityDot 2s infinite ease-in-out;
}

@keyframes pulseSecurityDot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.dashboard-body {
    display: flex;
    flex-direction: row;
    flex: 1;
    width: 100%;
    overflow: hidden;
    height: calc(100vh - var(--header-height));
    max-height: calc(100vh - var(--header-height));
    min-height: 0;
    box-sizing: border-box;
}

.sidebar {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
    height: 100%;
    max-height: 100%;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 16px;
    flex-shrink: 0;
    overflow-y: auto;
    box-sizing: border-box;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-faint);
    padding: 8px 12px 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    border: 1px solid transparent;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: var(--transition-fast);
    width: 100%;
    box-sizing: border-box;
}

.nav-item:hover {
    background: var(--bg-hover-subtle);
    color: var(--text-main);
    border-color: var(--border-subtle);
}

.nav-item.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    font-weight: 600;
    border-color: var(--nav-active-border);
}

.nav-item.active .nav-icon {
    color: var(--primary-light);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}
.nav-item:hover .nav-icon {
    color: var(--text-main);
}

.storage-meter-card {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: auto;
    flex-shrink: 0;
}

.meter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.meter-title {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.meter-val {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.meter-bar-track {
    height: 6px;
    background: var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.meter-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.4s ease, background 0.3s ease;
}

.meter-bar-fill.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.meter-bar-fill.danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.meter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: var(--text-faint);
}

.meter-refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 11px;
    transition: var(--transition-fast);
}
.meter-refresh-btn:hover {
    color: var(--text-main);
    transform: rotate(90deg);
}

.explorer-pane {
    flex: 1 1 0;
    width: calc(100% - 250px);
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    background: var(--bg-base);
    padding: 24px 32px;
    box-sizing: border-box;
}

.drag-overlay {
    display: none !important;
    position: absolute;
    inset: 16px;
    background: rgba(16, 22, 38, 0.95);
    border: 2px dashed var(--primary);
    border-radius: var(--radius-lg);
    z-index: 90;
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    pointer-events: none;
    box-sizing: border-box;
}

.drag-overlay.active {
    display: flex !important;
    animation: pulseBorder 1.5s infinite;
}

@keyframes pulseBorder {
    0%, 100% { border-color: var(--primary-light); box-shadow: 0 0 20px rgba(56, 189, 248, 0.3); }
    50% { border-color: #818cf8; box-shadow: 0 0 35px rgba(129, 140, 248, 0.45); }
}

.drag-overlay-content {
    text-align: center;
}

.drag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    border-radius: 20px;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--primary-light);
    box-shadow: 0 0 28px rgba(56, 189, 248, 0.25);
}

.drag-icon .svg-icon {
    width: 38px;
    height: 38px;
}

.drag-overlay-content h3 {
    font-family: var(--font-heading);
    font-size: 22px;
    margin-bottom: 6px;
}

.drag-overlay-content p {
    font-size: 14px;
    color: var(--text-muted);
}

/* Explorer Toolbar */
.explorer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.breadcrumb-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.crumb-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-fast);
}

.crumb-btn:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-main);
}

.crumb-btn.active {
    color: var(--text-main);
    font-weight: 700;
}

.crumb-sep {
    color: var(--text-faint);
    font-size: 12px;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.item-count-badge {
    font-size: 12px;
    color: var(--text-faint);
    font-weight: 500;
}

.sort-selector-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}

.sort-selector-wrapper select {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    font-size: 12px;
    color: var(--text-main);
    outline: none;
    cursor: pointer;
}

.action-icon-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 6px 8px;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition-fast);
}
.action-icon-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.search-banner {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    font-size: 13px;
    color: #c7d2fe;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.search-banner-close {
    background: none;
    border: none;
    color: #c7d2fe;
    text-decoration: underline;
    cursor: pointer;
    font-size: 12px;
}

/* ========================================== */
/* Grid View                                  */
/* ========================================== */
.items-container.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
    align-content: start;
}

.item-card.cat-folder { --card-accent: var(--cat-folder); --card-accent-rgb: var(--cat-folder-rgb); }
.item-card.cat-image { --card-accent: var(--cat-image); --card-accent-rgb: var(--cat-image-rgb); }
.item-card.cat-video { --card-accent: var(--cat-video); --card-accent-rgb: var(--cat-video-rgb); }
.item-card.cat-audio { --card-accent: var(--cat-audio); --card-accent-rgb: var(--cat-audio-rgb); }
.item-card.cat-document { --card-accent: var(--cat-doc); --card-accent-rgb: var(--cat-doc-rgb); }
.item-card.cat-code { --card-accent: var(--cat-code); --card-accent-rgb: var(--cat-code-rgb); }
.item-card.cat-archive { --card-accent: var(--cat-archive); --card-accent-rgb: var(--cat-archive-rgb); }
.item-card.cat-starred { --card-accent: var(--cat-starred); --card-accent-rgb: var(--cat-starred-rgb); }
.item-card.cat-other { --card-accent: var(--cat-other); --card-accent-rgb: var(--cat-other-rgb); }

/* Prism Gallery Card Subtle Enhancements */
.item-card.is-gallery-card {
    --card-accent: #a855f7;
    --card-accent-rgb: 168, 85, 247;
    border-top: 3px solid transparent;
    border-image: linear-gradient(90deg, #ec4899, #a855f7, #06b6d4) 1;
    background: linear-gradient(165deg, rgba(236, 72, 153, 0.08) 0%, rgba(168, 85, 247, 0.05) 45%, rgba(6, 182, 212, 0.03) 100%, var(--bg-card));
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(236, 72, 153, 0.25);
}

.item-card.is-gallery-card:hover {
    background: linear-gradient(165deg, rgba(236, 72, 153, 0.14) 0%, rgba(168, 85, 247, 0.09) 45%, rgba(6, 182, 212, 0.05) 100%, var(--bg-card-hover));
    border-color: rgba(168, 85, 247, 0.6);
    box-shadow: 0 12px 30px -6px rgba(0, 0, 0, 0.55), 0 0 24px -2px rgba(168, 85, 247, 0.38), 0 0 12px -2px rgba(236, 72, 153, 0.25);
}

.item-card.is-gallery-card .item-preview-backdrop {
    background: radial-gradient(circle at 50% 35%, rgba(236, 72, 153, 0.14) 0%, rgba(168, 85, 247, 0.10) 45%, rgba(6, 182, 212, 0.05) 85%, rgba(13, 18, 31, 0.65) 100%);
}

.item-card.is-gallery-card .item-backdrop-icon {
    color: #ec4899;
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.45));
}

.item-card.is-gallery-card .item-card-watermark {
    color: #a855f7;
    opacity: 0.09;
}

.item-card.is-gallery-card:hover .item-card-watermark {
    opacity: 0.2;
    transform: scale(1.15) rotate(12deg);
}

/* Subtle Prism Badge */
.gallery-subtle-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 1px 6px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(168, 85, 247, 0.22));
    border: 1px solid rgba(236, 72, 153, 0.4);
    color: #f472b6;
    margin-left: 6px;
    vertical-align: middle;
    box-shadow: 0 0 8px rgba(236, 72, 153, 0.2);
    transition: all 0.2s ease;
}

.gallery-subtle-badge:hover {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(168, 85, 247, 0.35));
    border-color: rgba(236, 72, 153, 0.6);
    color: #fbcfe8;
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

/* Quick launch button */
.item-gallery-launch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 5px;
    background: rgba(168, 85, 247, 0.14);
    border: 1px solid rgba(168, 85, 247, 0.35);
    color: #d8b4fe;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.item-gallery-launch-btn:hover {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.6);
    transform: scale(1.12);
}

.gallery-meta-hint {
    display: inline-flex;
    align-items: center;
    color: #c084fc;
    font-weight: 500;
}

.list-row.is-gallery-row {
    border-left: 3px solid #a855f7;
}

.context-menu-item.context-menu-gallery-item:hover {
    background: linear-gradient(90deg, rgba(236, 72, 153, 0.15), rgba(168, 85, 247, 0.15));
    color: #f472b6;
}

/* Light mode adjustments */
[data-theme="light"] .item-card.is-gallery-card {
    background: linear-gradient(165deg, rgba(236, 72, 153, 0.05) 0%, rgba(168, 85, 247, 0.04) 45%, rgba(6, 182, 212, 0.02) 100%, #ffffff);
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.08), inset 0 1px 0 rgba(236, 72, 153, 0.2);
}

[data-theme="light"] .item-card.is-gallery-card:hover {
    background: linear-gradient(165deg, rgba(236, 72, 153, 0.09) 0%, rgba(168, 85, 247, 0.07) 45%, rgba(6, 182, 212, 0.04) 100%, #ffffff);
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.12), 0 0 20px -2px rgba(168, 85, 247, 0.25);
}

[data-theme="light"] .item-card.is-gallery-card .item-preview-backdrop {
    background: radial-gradient(circle at 50% 35%, rgba(236, 72, 153, 0.08) 0%, rgba(168, 85, 247, 0.06) 45%, rgba(6, 182, 212, 0.03) 85%, #f8fafc 100%);
}

[data-theme="light"] .gallery-subtle-badge {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(168, 85, 247, 0.15));
    border-color: rgba(236, 72, 153, 0.35);
    color: #db2777;
}

[data-theme="light"] .gallery-meta-hint {
    color: #9333ea;
}

.item-card {
    background: linear-gradient(165deg, rgba(var(--card-accent-rgb, 56, 189, 248), 0.12) 0%, rgba(var(--card-accent-rgb, 56, 189, 248), 0.03) 40%, var(--bg-card) 100%);
    border: 1px solid rgba(var(--card-accent-rgb, 56, 189, 248), 0.25);
    border-top: 3px solid var(--card-accent, var(--primary-light));
    border-radius: var(--radius-md);
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all var(--transition-smooth);
    cursor: pointer;
    position: relative;
    user-select: none;
    min-height: 205px;
    backdrop-filter: blur(10px);
    overflow: hidden;
    box-shadow: 0 4px 16px -4px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(var(--card-accent-rgb, 56, 189, 248), 0.2);
}

.item-card:hover {
    background: linear-gradient(165deg, rgba(var(--card-accent-rgb, 56, 189, 248), 0.16) 0%, rgba(var(--card-accent-rgb, 56, 189, 248), 0.05) 50%, var(--bg-card-hover) 100%);
    border-color: var(--card-accent, var(--primary-light));
    transform: translateY(-3px);
    box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.5), 0 0 22px -2px rgba(var(--card-accent-rgb, 56, 189, 248), 0.35);
}

.item-card-watermark {
    position: absolute;
    right: -12px;
    bottom: -12px;
    opacity: 0.07;
    pointer-events: none;
    z-index: 1;
    color: var(--card-accent, var(--primary-light));
    filter: blur(0.5px);
    transition: all 0.3s ease;
}

.item-card:hover .item-card-watermark {
    opacity: 0.14;
    transform: scale(1.1) rotate(-5deg);
}

.item-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    z-index: 2;
    min-height: 24px;
    position: relative;
}

.item-select-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

.item-preview-backdrop {
    position: relative;
    width: 100%;
    height: 110px;
    border-radius: 8px;
    background: radial-gradient(circle at center, rgba(var(--card-accent-rgb, 56, 189, 248), 0.20) 0%, rgba(var(--card-accent-rgb, 56, 189, 248), 0.05) 100%);
    border: 1px solid rgba(var(--card-accent-rgb, 56, 189, 248), 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 10px;
    z-index: 2;
    transition: all var(--transition-fast);
}

.item-card:hover .item-preview-backdrop {
    border-color: rgba(var(--card-accent-rgb, 56, 189, 248), 0.45);
    background: radial-gradient(circle at center, rgba(var(--card-accent-rgb, 56, 189, 248), 0.28) 0%, rgba(var(--card-accent-rgb, 56, 189, 248), 0.08) 100%);
}

.item-backdrop-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--card-accent, var(--primary-light));
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-backdrop-icon .svg-icon {
    width: 44px;
    height: 44px;
    filter: drop-shadow(0 2px 8px rgba(var(--card-accent-rgb, 56, 189, 248), 0.35));
}

.item-card:hover .item-backdrop-icon {
    transform: scale(1.08);
}

/* File preview sitting ON TOP OF the backdrop icon */
.item-preview-backdrop .item-thumbnail-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 7px;
    z-index: 2;
    margin: 0;
    background: rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease;
}

.item-card:hover .item-preview-backdrop .item-thumbnail-preview {
    transform: scale(1.03);
}

/* Legacy fallback for icon box if referenced */
.item-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}
.item-icon-box .svg-icon {
    width: 22px;
    height: 22px;
}
.item-icon-box.folder { background: rgba(56, 189, 248, 0.12); border-color: rgba(56, 189, 248, 0.25); color: var(--cat-folder); }
.item-icon-box.image { background: rgba(192, 132, 252, 0.12); border-color: rgba(192, 132, 252, 0.25); color: var(--cat-image); }
.item-icon-box.video { background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.25); color: var(--cat-video); }
.item-icon-box.audio { background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.25); color: var(--cat-audio); }
.item-icon-box.document { background: rgba(96, 165, 250, 0.12); border-color: rgba(96, 165, 250, 0.25); color: var(--cat-doc); }
.item-icon-box.code { background: rgba(45, 212, 191, 0.12); border-color: rgba(45, 212, 191, 0.25); color: var(--cat-code); }
.item-icon-box.archive { background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.25); color: var(--cat-archive); }
.item-icon-box.other { background: rgba(148, 163, 184, 0.12); border-color: rgba(148, 163, 184, 0.25); color: var(--cat-other); }

.item-menu-btn {
    background: transparent;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 14px;
    transition: var(--transition-fast);
}
.item-menu-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

.item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

/* ========================================== */
/* List View - Modern Glassmorphic Table      */
/* ========================================== */
.items-container.view-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 32px;
}

/* 7 Columns: Checkbox, Icon, Name, Category, Size, Modified, Actions */
.list-table-header {
    display: grid;
    grid-template-columns: 32px 36px minmax(130px, 1fr) 90px 80px 105px 155px;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-faint);
    background: var(--bg-surface);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    user-select: none;
}

.list-header-sortable {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition-fast);
    padding: 3px 6px;
    margin: -3px -6px;
    border-radius: 6px;
    width: fit-content;
}

.list-header-sortable:hover {
    color: var(--primary-light);
    background: var(--bg-hover-subtle);
}

.list-header-sortable.is-sorted {
    color: var(--primary-light);
    font-weight: 700;
}

.sort-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13px;
    height: 13px;
}

.sort-arrow {
    transition: transform var(--transition-fast);
}

.sort-arrow-idle {
    opacity: 0.35;
}

.list-header-sortable:hover .sort-arrow-idle {
    opacity: 0.75;
}

.sort-arrow-active {
    color: var(--primary-light);
    opacity: 1;
}

.list-header-actions-cell {
    text-align: right;
    justify-self: end;
}

/* Row card */
.list-row {
    display: grid;
    grid-template-columns: 32px 36px minmax(130px, 1fr) 90px 80px 105px 155px;
    align-items: center;
    gap: 10px;
    padding: 7px 14px;
    min-height: 50px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: all var(--transition-fast);
    cursor: pointer;
    font-size: 13px;
    position: relative;
}

.list-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22), 0 0 12px var(--primary-glow);
    transform: translateY(-1px);
}

.list-row:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 1px;
}

.list-row.is-selected {
    background: rgba(56, 189, 248, 0.10) !important;
    border-color: var(--primary-light) !important;
    border-left: 4px solid var(--primary-light) !important;
    box-shadow: 0 0 0 1px var(--primary-light) inset, 0 4px 16px rgba(56, 189, 248, 0.15) !important;
}

/* Checkbox cell & custom checkboxes */
.list-col-checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-row-checkbox,
.list-header-checkbox-input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all var(--transition-fast);
    outline: none;
    margin: 0;
    flex-shrink: 0;
}

.list-row-checkbox:hover,
.list-header-checkbox-input:hover {
    border-color: var(--primary-light);
    background: rgba(56, 189, 248, 0.12);
}

.list-row-checkbox:checked,
.list-header-checkbox-input:checked {
    background: var(--primary) !important;
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 8px var(--primary-glow);
}

.list-row-checkbox:checked::after,
.list-header-checkbox-input:checked::after {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-0.5px, -1px);
}

.list-header-checkbox-input:indeterminate {
    background: var(--primary) !important;
    border-color: var(--primary-light) !important;
    box-shadow: 0 0 8px var(--primary-glow);
}

.list-header-checkbox-input:indeterminate::after {
    content: '';
    display: block;
    width: 8px;
    height: 2px;
    background: #ffffff;
    border-radius: 1px;
}

[data-theme="light"] .list-row-checkbox,
[data-theme="light"] .list-header-checkbox-input {
    background: #f8fafc;
    border-color: rgba(15, 23, 42, 0.25);
}

/* Icon / thumbnail badge */
.list-col-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 36px;
    margin: 0 auto;
}

.list-icon-badge {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    transition: transform var(--transition-fast);
    margin: 0 auto;
}

.list-icon-badge svg,
.list-icon-badge .svg-icon {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-fallback-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0 auto;
}

.list-row:hover .list-icon-badge {
    transform: scale(1.05);
}

/* Category-specific icon tinting */
.list-icon-badge.cat-folder {
    background: rgba(var(--cat-folder-rgb, 56, 189, 248), 0.14);
    color: var(--cat-folder);
    border-color: rgba(var(--cat-folder-rgb, 56, 189, 248), 0.25);
}
.list-icon-badge.cat-image {
    background: rgba(var(--cat-image-rgb, 192, 132, 252), 0.14);
    color: var(--cat-image);
    border-color: rgba(var(--cat-image-rgb, 192, 132, 252), 0.25);
}
.list-icon-badge.cat-video {
    background: rgba(var(--cat-video-rgb, 251, 113, 133), 0.14);
    color: var(--cat-video);
    border-color: rgba(var(--cat-video-rgb, 251, 113, 133), 0.25);
}
.list-icon-badge.cat-audio {
    background: rgba(var(--cat-audio-rgb, 52, 211, 153), 0.14);
    color: var(--cat-audio);
    border-color: rgba(var(--cat-audio-rgb, 52, 211, 153), 0.25);
}
.list-icon-badge.cat-document {
    background: rgba(var(--cat-doc-rgb, 96, 165, 250), 0.14);
    color: var(--cat-doc);
    border-color: rgba(var(--cat-doc-rgb, 96, 165, 250), 0.25);
}
.list-icon-badge.cat-code {
    background: rgba(var(--cat-code-rgb, 45, 212, 191), 0.14);
    color: var(--cat-code);
    border-color: rgba(var(--cat-code-rgb, 45, 212, 191), 0.25);
}
.list-icon-badge.cat-archive {
    background: rgba(var(--cat-archive-rgb, 251, 191, 36), 0.14);
    color: var(--cat-archive);
    border-color: rgba(var(--cat-archive-rgb, 251, 191, 36), 0.25);
}

.list-thumb-preview {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    object-position: center center;
    border-radius: 7px;
    margin: 0 !important;
    display: block;
    flex-shrink: 0;
}

/* Name cell */
.list-col-name {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.list-name-text {
    font-weight: 500;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.1px;
}

.list-row:hover .list-name-text {
    color: var(--primary-light);
}

.list-name-star-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #f59e0b;
    flex-shrink: 0;
}

/* Category pill badge */
.list-col-category {
    display: flex;
    align-items: center;
}

.list-category-pill {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 600;
    padding: 2.5px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
    white-space: nowrap;
    text-transform: capitalize;
    letter-spacing: 0.2px;
}

.list-category-pill.cat-folder {
    background: rgba(var(--cat-folder-rgb, 56, 189, 248), 0.10);
    color: var(--cat-folder);
    border-color: rgba(var(--cat-folder-rgb, 56, 189, 248), 0.22);
}
.list-category-pill.cat-image {
    background: rgba(var(--cat-image-rgb, 192, 132, 252), 0.10);
    color: var(--cat-image);
    border-color: rgba(var(--cat-image-rgb, 192, 132, 252), 0.22);
}
.list-category-pill.cat-video {
    background: rgba(var(--cat-video-rgb, 251, 113, 133), 0.10);
    color: var(--cat-video);
    border-color: rgba(var(--cat-video-rgb, 251, 113, 133), 0.22);
}
.list-category-pill.cat-audio {
    background: rgba(var(--cat-audio-rgb, 52, 211, 153), 0.10);
    color: var(--cat-audio);
    border-color: rgba(var(--cat-audio-rgb, 52, 211, 153), 0.22);
}
.list-category-pill.cat-document {
    background: rgba(var(--cat-doc-rgb, 96, 165, 250), 0.10);
    color: var(--cat-doc);
    border-color: rgba(var(--cat-doc-rgb, 96, 165, 250), 0.22);
}
.list-category-pill.cat-code {
    background: rgba(var(--cat-code-rgb, 45, 212, 191), 0.10);
    color: var(--cat-code);
    border-color: rgba(var(--cat-code-rgb, 45, 212, 191), 0.22);
}
.list-category-pill.cat-archive {
    background: rgba(var(--cat-archive-rgb, 251, 191, 36), 0.10);
    color: var(--cat-archive);
    border-color: rgba(var(--cat-archive-rgb, 251, 191, 36), 0.22);
}

/* Size and Date */
.list-col-size {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.list-col-date {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Actions toolbar */
.list-col-actions {
    display: flex;
    align-items: center;
    gap: 3px;
    justify-content: flex-end;
}

.list-action-btn {
    background: transparent;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
    flex-shrink: 0;
}

.list-action-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover-subtle);
    transform: scale(1.08);
}

.list-actions .list-action-btn {
    opacity: 0.65;
}

.list-row:hover .list-actions .list-action-btn,
.list-row.is-selected .list-actions .list-action-btn {
    opacity: 1;
}

.list-actions .list-action-btn.item-star-btn.starred {
    opacity: 1 !important;
    color: #f59e0b;
}

.list-action-btn.delete:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.15);
}

/* Light Theme refinements */
[data-theme="light"] .list-table-header {
    background: rgba(241, 245, 249, 0.95);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

[data-theme="light"] .list-row {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.06);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .list-row:hover {
    background: #ffffff;
    border-color: rgba(2, 132, 199, 0.3);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.07);
}

[data-theme="light"] .list-row.is-selected {
    background: rgba(2, 132, 199, 0.06) !important;
    border-left: 4px solid var(--primary) !important;
}

[data-theme="light"] .list-icon-badge {
    background: rgba(15, 23, 42, 0.03);
    border-color: rgba(15, 23, 42, 0.08);
}

/* Responsive Table Layout */
@media (max-width: 960px) {
    .list-table-header,
    .list-row {
        grid-template-columns: 32px 36px minmax(120px, 1fr) 80px 105px 145px;
        gap: 8px;
    }
    .list-col-category {
        display: none !important;
    }
}

@media (max-width: 680px) {
    .list-table-header,
    .list-row {
        grid-template-columns: 28px 32px minmax(100px, 1fr) 100px;
        gap: 6px;
        padding: 6px 10px;
    }
    .list-col-category,
    .list-col-size,
    .list-col-date {
        display: none !important;
    }
    .list-action-btn:not(.item-star-btn):not(.item-menu-btn):not(.delete) {
        display: none !important;
    }
}

/* Empty State */
.empty-folder-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: var(--text-muted);
}

.empty-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    background: rgba(56, 189, 248, 0.08);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--primary-light);
    margin: 0 auto 16px;
    box-shadow: 0 0 24px rgba(56, 189, 248, 0.12);
}

.empty-icon .svg-icon {
    width: 32px;
    height: 32px;
}

.empty-folder-state h4 {
    font-family: var(--font-heading);
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 6px;
}

.empty-folder-state p {
    font-size: 13px;
    margin-bottom: 20px;
}

/* Loading state */
.loading-spinner-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

/* Context / Dropdown Menu */
.context-menu-dropdown {
    position: fixed;
    z-index: 10000;
    background: var(--bg-surface-elevated, #181b2a);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-strong, rgba(255, 255, 255, 0.15));
    border-radius: 10px;
    box-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 1px 1px rgba(255, 255, 255, 0.08);
    padding: 6px;
    min-width: 175px;
    display: flex;
    flex-direction: column;
    animation: ctxMenuFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.context-menu-item {
    background: transparent;
    border: none;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main, #f1f5f9);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.context-menu-item:hover {
    background: var(--nav-active-bg, rgba(255, 255, 255, 0.08));
    color: var(--nav-active-text, #ffffff);
}
.context-menu-item.starred {
    color: var(--cat-starred, #eab308);
}
.context-menu-item.starred svg {
    fill: var(--cat-starred, #eab308);
    stroke: var(--cat-starred, #eab308);
}
.context-menu-item.danger {
    color: var(--danger, #ef4444);
}
.context-menu-item.danger:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.context-menu-separator {
    height: 1px;
    background: var(--border-subtle, rgba(255, 255, 255, 0.08));
    margin: 4px 6px;
}

.item-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================== */
/* Modals & Overlays                          */
/* ========================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-dialog {
    background: var(--bg-surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: scaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes scaleUp {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.modal-title-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    overflow: hidden;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-subtitle {
    font-size: 12px;
    color: var(--text-muted);
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition-fast);
}
.modal-btn:hover {
    background: var(--bg-hover-subtle);
    border-color: var(--border-strong);
}

.modal-close-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 6px;
    transition: var(--transition-fast);
}
.modal-close-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover-subtle);
}

.modal-body {
    padding: 20px;
}

.modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.modal-body input {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 14px;
    color: var(--text-main);
    outline: none;
    transition: var(--transition-fast);
}
.modal-body input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

/* Size Variants */
.sm-dialog {
    width: 100%;
    max-width: 420px;
}

/* Media Dialog */
.media-dialog {
    width: 90vw;
    max-width: 900px;
    max-height: 85vh;
}

.modal-content-area {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    background: #060910;
    min-height: 350px;
    max-height: calc(85vh - 70px);
}

.preview-image {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}

.preview-video {
    max-width: 100%;
    max-height: calc(85vh - 120px);
    border-radius: var(--radius-sm);
    outline: none;
}

.preview-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 40px 20px;
    width: 100%;
    max-width: 500px;
}

.preview-audio-cover-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 160px;
    height: 160px;
}

.preview-audio-cover {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 0 0 1px rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: fadeInCover 0.35s ease-out;
}

.preview-audio-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-main);
    text-align: center;
    max-width: 90%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

@keyframes fadeInCover {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

.preview-audio-icon {
    font-size: 64px;
    animation: bounce 2s infinite ease-in-out;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.preview-audio-player {
    width: 100%;
    border-radius: 30px;
    outline: none;
}

.preview-pdf-iframe {
    width: 100%;
    height: 70vh;
    border: none;
    border-radius: var(--radius-sm);
}

.preview-ndml-wrapper {
    width: 100%;
    height: 80vh;
    display: flex;
    justify-content: center;
    align-items: stretch;
    background: #090d16;
    padding: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.preview-ndml-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #0f172a;
}

/* Editor Dialog */
.editor-dialog {
    width: 90vw;
    max-width: 950px;
    height: 80vh;
}

.editor-filename-input {
    background: transparent;
    border: 1px solid transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-main);
    padding: 4px 8px;
    border-radius: 4px;
    outline: none;
}
.editor-filename-input:focus {
    background: var(--bg-surface);
    border-color: var(--border-strong);
}

.status-pill {
    font-size: 11px;
    font-weight: 600;
    color: var(--success);
    background: rgba(16, 185, 129, 0.15);
    padding: 2px 8px;
    border-radius: 12px;
}
.status-pill.unsaved {
    color: var(--accent-amber);
    background: rgba(245, 158, 11, 0.15);
}

.editor-body {
    flex: 1;
    overflow: hidden;
    display: flex;
}

.editor-body textarea {
    width: 100%;
    height: 100%;
    background: var(--bg-surface-elevated);
    color: var(--text-main);
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    padding: 18px 20px;
    border: none;
    outline: none;
    resize: none;
}

.editor-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 20px;
    background: var(--bg-surface-elevated);
    border-top: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-faint);
}

/* Upload Progress Drawer */
.upload-drawer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 340px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-soft), var(--shadow-glow);
    z-index: 150;
    overflow: hidden;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.upload-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.upload-drawer-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
}

.drawer-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    animation: drawerSpinnerRotate 1s linear infinite;
}
@keyframes drawerSpinnerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.drawer-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    transition: var(--transition-fast);
}
.drawer-close-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover-subtle);
}

.upload-drawer-body {
    padding: 14px 16px;
}

.upload-progress-bar-track {
    height: 6px;
    background: var(--border-subtle);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress-bar-fill {
    height: 100%;
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: width 0.2s ease;
}

.upload-progress-details {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
}

#upload-current-file {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
}

/* ========================================== */

/* ========================================== */

.sidebar-shares-section {
    padding: 12px 14px;
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
}

.shares-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 4px;
}

.shares-header-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
}

.shares-count-pill {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.85; transform: scale(1.05); }
}

.pending-shares-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.no-pending-shares {
    font-size: 11px;
    color: var(--text-faint);
    font-style: italic;
    padding: 4px;
}

.pending-share-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all var(--transition-fast);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pending-share-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-surface-elevated);
}

.share-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.share-card-icon {
    font-size: 16px;
    line-height: 1;
}

.share-card-info {
    overflow: hidden;
    flex: 1;
}

.share-card-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-card-meta {
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    margin-top: 1px;
}

.share-card-sender {
    color: var(--primary);
    font-weight: 600;
}

.share-card-actions {
    display: flex;
    gap: 6px;
    margin-top: 2px;
}

.share-btn-accept {
    flex: 1;
    background: var(--success);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.share-btn-accept:hover {
    background: #047857;
}

.share-btn-decline {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.share-btn-decline:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

/* Modal share preview */
.share-file-card-preview {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}

.share-file-preview-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.1);
    color: var(--primary-light);
    flex-shrink: 0;
}

.share-file-preview-icon .svg-icon {
    width: 22px;
    height: 22px;
}

.share-file-preview-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    word-break: break-all;
}

.share-file-preview-meta {
    font-size: 11px;
    color: var(--text-muted);
}

.recipient-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.recipient-input-prefix {
    position: absolute;
    left: 12px;
    color: var(--primary);
    font-weight: 700;
    font-family: var(--font-mono);
    pointer-events: none;
    font-size: 14px;
}

#share-recipient-input {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 10px 32px 10px 28px;
    font-size: 13px;
    font-family: var(--font-body);
    outline: none;
    transition: all var(--transition-fast);
}

#share-recipient-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

#share-recipient-input.has-selection {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.05);
}

.recipient-clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 12px;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast);
}

.recipient-clear-btn:hover {
    color: var(--text-main);
}

.recipient-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-hover);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6);
    max-height: 180px;
    overflow-y: auto;
    z-index: 1050;
    padding: 4px 0;
    scrollbar-width: thin;
}

.recipient-suggestion-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.recipient-suggestion-item:hover,
.recipient-suggestion-item.active {
    background: rgba(99, 102, 241, 0.18);
}

.recipient-suggestion-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.recipient-suggestion-name {
    font-size: 13px;
    color: var(--text-main);
    font-weight: 500;
}

.recipient-match-highlight {
    color: #38bdf8;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.field-hint.recipient-selected-hint {
    color: #34d399 !important;
    font-weight: 500;
}

/* ========================================================================== */
/* viewports (<768px and <480px) into a native-feel mobile layout with an     */
/* off-canvas drawer, compact touch header, 2-column grid, FAB, & bottom bar. */
/* ========================================================================== */

/* Desktop defaults for mobile-only controls */
#mobile-sidebar-toggle-btn {
    display: none;
}
.sidebar-mobile-header {
    display: none;
}
.sidebar-backdrop {
    display: none;
}
.mobile-fab-wrap {
    display: none;
}
.mobile-bottom-nav {
    display: none;
}
#mobile-search-toggle-btn {
    display: none;
}
.mobile-search-back-btn {
    display: none;
}
.mobile-view-toggle {
    display: none;
}

/* Responsive Header Action Buttons: Collapse text to icon-only buttons earlier */
@media (max-width: 2000px) {
    #upload-action-btn span,
    #new-folder-btn span,
    #new-note-btn span {
        display: none !important;
    }
    .header-left {
        max-width: 1000px;
    }

    #upload-action-btn,
    #new-folder-btn,
    #new-note-btn {
        width: 36px !important;
        height: 36px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        gap: 0 !important;
    }

    #upload-action-btn .svg-icon,
    #new-folder-btn .svg-icon,
    #new-note-btn .svg-icon {
        margin: 0 !important;
    }
}

/* Responsive Universal Navigation Tabs: Collapse text to icon-only sooner */
@media (max-width: 1600px) {
    .universal-nav-tabs .nav-tab span {
        display: none !important;
    }

    .universal-nav-tabs .nav-tab {
        padding: 6px 10px !important;
        gap: 0 !important;
        justify-content: center !important;
    }

    .universal-nav-tabs .nav-tab-icon {
        width: 15px !important;
        height: 15px !important;
    }
}

/* Secondary header compression for compact viewports */
@media (max-width: 1220px) {
    #settings-btn span,
    #signout-btn span {
        display: none !important;
    }

    #settings-btn,
    #signout-btn {
        padding: 6px 8px !important;
        gap: 0 !important;
    }
}

/* Tablet & Mobile Screens (<= 900px) */
@media (max-width: 1095px) {
    #mobile-sidebar-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        background: transparent;
        border: none;
        color: var(--text-main);
        cursor: pointer;
        margin-right: 2px;
        padding: 0;
        flex-shrink: 0;
        transition: background var(--transition-fast), color var(--transition-fast);
    }
    #mobile-sidebar-toggle-btn:hover,
    #mobile-sidebar-toggle-btn:active {
        background: var(--bg-hover-subtle);
        color: var(--primary-light);
    }

    /* Header Clean Non-Colliding Layout */
    .app-header {
        padding: 0 12px;
        height: 56px;
        gap: 10px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: sticky;
        top: 0;
        z-index: 100;
    }
    .header-left {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
        max-width: none;
        overflow: hidden;
    }
    .brand-logo {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-shrink: 0;
        min-width: 0;
        user-select: none;
    }
    .brand-logo .brand-app-icon.sm {
        width: 28px;
        height: 28px;
        border-radius: 8px;
        flex-shrink: 0;
    }
    .brand-logo .brand-name {
        font-size: 17px;
        font-weight: 700;
        white-space: nowrap;
        flex-shrink: 0;
        letter-spacing: -0.3px;
        display: inline-block;
    }

    #mobile-search-toggle-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: var(--radius-sm);
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        flex-shrink: 0;
        transition: background var(--transition-fast), color var(--transition-fast);
    }
    #mobile-search-toggle-btn:hover,
    #mobile-search-toggle-btn:active {
        background: var(--bg-hover-subtle);
        color: var(--primary-light);
    }

    /* Hide desktop inline search container on mobile by default */
    .search-container {
        display: none;
    }

    /* Full-width search overlay when activated on mobile */
    .search-container.mobile-active {
        display: flex !important;
        position: absolute;
        inset: 0;
        z-index: 120;
        background: var(--bg-surface);
        padding: 0 12px;
        align-items: center;
        gap: 8px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
    .mobile-search-back-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 34px;
        height: 34px;
        border-radius: 6px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        flex-shrink: 0;
    }
    .mobile-search-back-btn:hover,
    .mobile-search-back-btn:active {
        color: var(--text-main);
        background: var(--bg-hover-subtle);
    }
    .search-container.mobile-active input {
        flex: 1;
        width: 100%;
        height: 38px;
        background: var(--bg-surface-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: 20px;
        padding: 8px 36px 8px 36px;
        font-size: 13px;
        color: var(--text-main);
        outline: none;
    }
    .search-container.mobile-active .search-icon {
        left: 54px;
    }
    .search-container.mobile-active .search-clear-btn {
        right: 20px;
    }

    /* Header Right: Clean 3-Item Group (Search, Theme, Avatar) */
    .header-right {
        display: flex;
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .view-toggle-group,
    #upload-action-btn,
    #new-folder-btn,
    #new-note-btn,
    #header-chat-btn,
    #header-ai-btn,
    #security-badge {
        display: none !important;
    }

    /* Compact Theme Toggle */
    #theme-toggle-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }

    .user-profile-badge {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        cursor: pointer;
    }
    .user-avatar-wrap {
        width: 34px;
        height: 34px;
        border-radius: 50%;
        box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.45);
        cursor: pointer;
        transition: transform var(--transition-fast);
    }
    .user-avatar-wrap:active {
        transform: scale(0.92);
    }
    .user-info-text,
    #settings-btn,
    #signout-btn {
        display: none !important;
    }

    /* Mobile view mode toggle in explorer toolbar */
    .mobile-view-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .sidebar {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 285px;
        max-width: 84vw;
        height: 100vh;
        max-height: 100vh;
        background: var(--bg-surface);
        border-right: 1px solid var(--border-subtle);
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: none;
        padding: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    .sidebar.mobile-open {
        transform: translateX(0);
        box-shadow: 6px 0 32px rgba(0, 0, 0, 0.65);
    }
    .sidebar-mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 1px solid var(--border-subtle);
        background: var(--bg-surface-elevated);
        flex-shrink: 0;
    }
    .sidebar-mobile-brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .sidebar-close-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 6px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        cursor: pointer;
        transition: background var(--transition-fast), color var(--transition-fast);
    }
    .sidebar-close-btn:hover,
    .sidebar-close-btn:active {
        color: var(--text-main);
        background: var(--bg-hover-subtle);
    }
    .sidebar-nav {
        padding: 12px 14px;
        flex-shrink: 0;
    }
    .sidebar-shares-section {
        padding: 0 14px 14px;
    }
    .storage-meter-card {
        margin: auto 14px 16px;
    }

    .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.25s ease;
    }
    .sidebar-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }

    /* Main Workspace Adjustment */
    .dashboard-body {
        position: relative;
        overflow: hidden;
        height: calc(100vh - 56px);
    }
    .explorer-pane {
        padding: 12px;
        height: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 84px; /* Room for bottom navigation bar and FAB */
    }
    .breadcrumb-nav {
        overflow-x: auto;
        white-space: nowrap;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .breadcrumb-nav::-webkit-scrollbar {
        display: none;
    }

    /* Responsive Grid and List Items */
    .items-container.view-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 10px;
    }
    .list-table-header, .list-row {
        grid-template-columns: 32px 34px minmax(110px, 1fr) 110px;
        gap: 8px;
        padding: 8px 10px;
    }
    .list-col-category,
    .list-col-size,
    .list-col-date,
    .list-category,
    .list-date {
        display: none !important;
    }
    .list-action-btn:not(.item-star-btn):not(.item-menu-btn):not(.delete) {
        display: none !important;
    }

    .mobile-fab-wrap {
        display: block;
        position: fixed;
        right: 16px;
        bottom: 72px;
        z-index: 90;
    }
    .mobile-fab-btn {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: var(--primary-gradient);
        color: #ffffff;
        border: none;
        box-shadow: 0 4px 18px var(--primary-glow);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
        outline: none;
    }
    .mobile-fab-btn.active {
        transform: rotate(45deg);
        background: #f43f5e;
        box-shadow: 0 4px 16px rgba(244, 63, 94, 0.4);
    }
    .mobile-create-menu {
        position: absolute;
        right: 0;
        bottom: 60px;
        background: var(--bg-surface-elevated);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
        padding: 6px;
        min-width: 170px;
        display: flex;
        flex-direction: column;
        gap: 4px;
        transform: scale(0.85) translateY(12px);
        opacity: 0;
        pointer-events: none;
        transform-origin: bottom right;
        transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    }
    .mobile-create-menu.active {
        transform: scale(1) translateY(0);
        opacity: 1;
        pointer-events: auto;
    }
    .mobile-menu-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        background: transparent;
        border: none;
        border-radius: 8px;
        color: var(--text-main);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        transition: background var(--transition-fast);
        text-align: left;
        width: 100%;
    }
    .mobile-menu-item:hover,
    .mobile-menu-item:active {
        background: var(--bg-hover-subtle);
        color: var(--primary-light);
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 60px;
        background: var(--bg-glass);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        border-top: 1px solid var(--border-subtle);
        z-index: 85;
        justify-content: space-around;
        align-items: center;
        padding: 0 6px;
    }
    .mobile-nav-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: transparent;
        border: none;
        color: var(--text-muted);
        padding: 6px 12px;
        border-radius: 8px;
        font-size: 10.5px;
        font-weight: 500;
        cursor: pointer;
        transition: color var(--transition-fast), transform var(--transition-fast);
        outline: none;
    }
    .mobile-nav-tab .svg-icon {
        width: 18px;
        height: 18px;
    }
    .mobile-nav-tab.active {
        color: var(--primary-light);
        font-weight: 600;
    }
    .mobile-nav-tab:active {
        transform: scale(0.92);
    }
}

/* Extra-Small Mobile Screens (<= 480px) */
@media (max-width: 480px) {
    .app-header {
        padding: 0 8px;
    }
    .header-left {
        gap: 5px;
    }
    .brand-logo {
        gap: 6px;
    }
    .brand-logo .brand-name {
        font-size: 14px;
    }
    .universal-nav-tabs {
        display: flex !important;
        margin-left: 2px !important;
        padding: 2px 2px !important;
        gap: 2px !important;
    }
    .universal-nav-tabs .nav-tab {
        padding: 4px 6px !important;
    }
    .universal-nav-tabs .nav-tab-icon {
        width: 13px !important;
        height: 13px !important;
    }
    .header-right {
        gap: 4px;
    }
    #theme-toggle-btn,
    #mobile-search-toggle-btn {
        width: 32px;
        height: 32px;
    }
    .user-avatar-wrap {
        width: 30px;
        height: 30px;
    }
}

/* Ultra-Small Mobile Screens (<= 380px) */
@media (max-width: 380px) {
    .brand-logo .brand-name {
        display: none !important; /* Hide text brand name, keep icon so tabs fit with ample space */
    }
}

    .auth-card {
        padding: 26px 18px;
        margin: 12px;
    }
    .brand-app-icon.lg {
        width: 54px;
        height: 54px;
    }
    .brand h1 {
        font-size: 24px;
    }
    .features-pill-row {
        gap: 6px;
    }
    .pill-item {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Touch-friendly modals */
    .modal-dialog {
        width: calc(100% - 20px) !important;
        margin: 10px auto !important;
        padding: 16px 14px !important;
        max-height: 92vh !important;
    }
    .media-dialog {
        max-width: 100% !important;
    }
}

/* ========================================================================== */
/* cancel buttons, desktop context menu, animated toasts, and markdown preview */
/* ========================================================================== */

/* 1. Sidebar Transfer Tabs */
.shares-tab-row {
    display: flex;
    gap: 4px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    padding: 3px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.shares-tab-btn {
    flex: 1;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    outline: none;
}

.shares-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-hover-subtle);
}

.shares-tab-btn.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 8px var(--primary-glow);
}

.shares-tab-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    line-height: 1.4;
}

.shares-tab-btn:not(.active) .shares-tab-badge {
    background: var(--primary);
    color: #ffffff;
}

/* 2. Transfer Notes & Outgoing Cards */
.share-note-textarea {
    width: 100%;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-main) !important;
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
    min-height: 60px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.share-note-textarea::placeholder {
    color: var(--text-faint);
    opacity: 0.85;
}

.share-note-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.share-card-note {
    margin-top: 8px;
    padding: 7px 11px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-left: 3px solid var(--primary);
    border-radius: 0 6px 6px 0;
    font-size: 12px;
    color: var(--text-main);
    word-break: break-word;
    line-height: 1.45;
    cursor: pointer;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.share-card-note:hover {
    background: var(--bg-hover-subtle);
    border-left-color: var(--primary-light);
}

.share-note-tag {
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 2px;
}

.share-note-text {
    font-style: italic;
    color: var(--text-main);
    white-space: pre-wrap;
}

.share-card-no-note {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-faint);
    font-style: italic;
}

.request-modal-note-callout {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-main);
    line-height: 1.6;
    max-height: 180px;
    overflow-y: auto;
}

.share-btn-cancel {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.share-btn-cancel:hover {
    background: var(--danger);
    color: #ffffff;
    border-color: var(--danger);
}

/* 3. Custom Right-Click Context Menu */
.custom-context-menu {
    position: fixed;
    z-index: 9999;
    min-width: 190px;
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 6px;
    box-shadow: var(--shadow-soft), 0 4px 20px rgba(0, 0, 0, 0.12);
    opacity: 1;
    animation: ctxMenuFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes ctxMenuFadeIn {
    from { opacity: 0; transform: scale(0.96) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.ctx-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    border-radius: 6px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.ctx-item:hover {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
}

.ctx-item.starred .ctx-icon {
    color: var(--cat-starred);
}
.ctx-item.starred .ctx-icon svg {
    fill: var(--cat-starred);
    stroke: var(--cat-starred);
}

.ctx-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.ctx-icon .svg-icon {
    width: 16px;
    height: 16px;
}

.ctx-item:hover .ctx-icon {
    color: var(--nav-active-text);
}

.ctx-separator {
    height: 1px;
    background: var(--border-subtle);
    margin: 4px 0;
}

.ctx-item.ctx-danger {
    color: var(--danger);
}

.ctx-item.ctx-danger .ctx-icon {
    color: var(--danger);
}

.ctx-item.ctx-danger:hover {
    background: rgba(239, 68, 68, 0.12);
    color: var(--danger-hover);
}

.ctx-item.ctx-danger:hover .ctx-icon {
    color: var(--danger-hover);
}

/* 4. Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 290px;
    max-width: 440px;
    padding: 12px 18px;
    border-radius: 10px;
    background: var(--bg-surface-elevated);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-soft);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-item.toast-show {
    transform: translateX(0);
    opacity: 1;
}

.toast-item.toast-hide {
    transform: translateX(40px);
    opacity: 0;
}

.toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
.toast-icon .svg-icon {
    width: 18px;
    height: 18px;
}

.toast-msg {
    flex: 1;
    line-height: 1.4;
    word-break: break-word;
}

.toast-item.toast-success {
    border-left: 4px solid #10b981;
}

.toast-item.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-item.toast-info {
    border-left: 4px solid var(--primary);
}

.editor-body.preview-active {
    display: flex;
}

.editor-markdown-preview {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    background: var(--bg-surface-elevated);
    border: none;
    border-radius: var(--radius-sm);
    padding: 18px 24px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}

.editor-markdown-preview h1,
.editor-markdown-preview h2,
.editor-markdown-preview h3,
.editor-markdown-preview h4 {
    color: var(--text-main);
    margin-top: 1.2em;
    margin-bottom: 0.5em;
    font-weight: 700;
    line-height: 1.25;
}

.editor-markdown-preview h1 { font-size: 1.5rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.3em; }
.editor-markdown-preview h2 { font-size: 1.25rem; }
.editor-markdown-preview h3 { font-size: 1.1rem; }

.editor-markdown-preview p {
    margin-bottom: 0.9em;
}

.editor-markdown-preview code {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.88em;
}

.editor-markdown-preview pre {
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    padding: 12px 14px;
    overflow-x: auto;
    margin: 1em 0;
}

.editor-markdown-preview pre code {
    background: transparent;
    color: var(--text-main);
    padding: 0;
}

.editor-markdown-preview blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 12px;
    margin: 1em 0;
    color: var(--text-muted);
    font-style: italic;
}

.editor-markdown-preview ul,
.editor-markdown-preview ol {
    margin: 0.6em 0 1em 1.5em;
}

.editor-markdown-preview li {
    margin-bottom: 0.3em;
}

.editor-markdown-preview hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.5em 0;
}

.settings-dialog {
    max-width: 680px;
    width: 92%;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}

.settings-dialog .modal-header {
    padding: 20px 24px 14px 24px;
    border-bottom: none;
}

.settings-tabs {
    display: flex;
    gap: 6px;
    padding: 0 24px 14px 24px;
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
}

.settings-tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.settings-tab-btn:hover {
    color: var(--text-main);
    background: var(--bg-surface-elevated);
}

.settings-tab-btn.active {
    color: var(--primary-light);
    background: rgba(6, 182, 212, 0.12);
    border-color: rgba(6, 182, 212, 0.3);
}

.settings-tab-btn.danger-tab:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

.settings-tab-btn.danger-tab.active {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.4);
}

.settings-content-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.settings-section {
    margin-bottom: 24px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-subheading {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 12px;
}

.settings-helptext {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

/* Avatar Setting Section */
.avatar-preview-container {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.avatar-preview-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border-strong);
    background: var(--bg-surface-elevated);
}

.avatar-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-preview-initial {
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    color: #fff;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.avatar-camera-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.avatar-preview-wrap:hover .avatar-camera-overlay {
    opacity: 1;
}

.avatar-actions-col {
    flex: 1;
}

.avatar-actions-col .settings-subheading {
    margin-bottom: 4px;
}

.avatar-btns-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Forms & Inputs */
.settings-form-row {
    margin-bottom: 14px;
}

.settings-form-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.settings-form-row input,
.settings-form-row textarea {
    width: 100%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    outline: none;
    transition: var(--transition-fast);
}

.settings-form-row input:focus,
.settings-form-row textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

.settings-form-row textarea {
    resize: vertical;
    font-family: inherit;
}

/* Metadata Grid */
.settings-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    color: var(--text-faint);
}

.meta-val {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.code-font {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
    font-size: 12px;
    color: var(--primary-light);
}

.settings-footer-actions {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
}

/* Drive & Storage Tab */
.settings-storage-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.settings-storage-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.storage-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 14px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
}

.storage-chip-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Card Actions */
.settings-card-action {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
    transition: var(--transition-fast);
}

.settings-card-action:hover {
    border-color: var(--border-strong);
}

.settings-card-action.warning-border {
    border-color: rgba(245, 158, 11, 0.3);
}

.settings-card-action.warning-border:hover {
    border-color: rgba(245, 158, 11, 0.6);
}

.card-action-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-action-icon.bg-cyan {
    background: rgba(6, 182, 212, 0.15);
    color: var(--primary);
}

.card-action-icon.bg-amber {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.card-action-info {
    flex: 1;
}

.card-action-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}

.card-action-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Danger Button Styling */
.danger-outline-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: var(--danger);
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.danger-outline-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    border-color: var(--danger);
}

.danger-btn {
    background: var(--danger);
    border: 1px solid transparent;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition-fast);
}

.danger-btn:hover:not(:disabled) {
    background: #dc2626;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.danger-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Danger Zone Card */
.danger-zone-card {
    border: 1px solid rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.05);
    border-radius: var(--radius-md);
    padding: 20px;
}

.danger-zone-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--danger);
    margin-bottom: 10px;
}

.danger-zone-header h3 {
    font-size: 15px;
    font-weight: 700;
}

.danger-zone-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 18px;
}

.danger-zone-desc strong {
    color: var(--danger);
}

.danger-zone-actions {
    display: flex;
    justify-content: flex-start;
}

/* Security Tab Overview */
.security-overview-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 16px;
}

.sec-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.sec-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 4px;
    flex-shrink: 0;
}

.sec-dot.active {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.sec-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 2px;
}

.sec-desc {
    font-size: 12px;
    color: var(--text-muted);
}

.settings-error-msg {
    font-size: 12px;
    font-weight: 600;
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.settings-success-msg {
    font-size: 12px;
    font-weight: 600;
    color: var(--success);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-top: 8px;
}

.ai-mcp-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(59, 130, 246, 0.08));
    border: 1px solid rgba(6, 182, 212, 0.25);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
}

.ai-banner-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
}

.ai-banner-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 3px;
}

.ai-banner-desc {
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.45;
}

.copy-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.copy-input-field {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 12.5px;
    color: var(--text-main);
    user-select: all;
}

.copy-input-field:focus {
    border-color: var(--primary);
    outline: none;
}

.mcp-guides-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}

@media (max-width: 640px) {
    .mcp-guides-grid {
        grid-template-columns: 1fr;
    }
}

.mcp-guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
}

.mcp-guide-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--primary-light);
    margin-bottom: 6px;
}

.mcp-guide-text {
    font-size: 11.5px;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 8px;
}

.mcp-code-snippet {
    background: var(--bg-main);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-main);
    overflow-x: auto;
    white-space: pre;
    line-height: 1.4;
    max-height: 140px;
}

/* ========================================== */
/* ========================================== */
.recents-bar {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 14px;
    margin-bottom: 12px;
    backdrop-filter: blur(8px);
    transition: all var(--transition-fast);
}

.recents-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.recents-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.recents-action-btn {
    background: transparent;
    border: none;
    font-size: 11px;
    color: var(--text-faint);
    cursor: pointer;
    transition: color var(--transition-fast);
}
.recents-action-btn:hover {
    color: var(--danger);
}

.recents-chips-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}
.recents-chips-scroll::-webkit-scrollbar {
    display: none;
}

.recents-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 5px 12px 5px 9px;
    font-size: 12px;
    color: var(--text-main);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.recent-chip:hover {
    background: rgba(56, 189, 248, 0.12);
    border-color: var(--primary-light);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--primary-glow);
}

.recent-chip-name {
    font-weight: 500;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-chip-time {
    font-size: 10px;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

/* ========================================== */
/* ========================================== */
.item-star-btn {
    background: transparent;
    border: none;
    color: var(--text-faint);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-fast);
}

.item-card:hover .item-star-btn,
.list-row:hover .item-star-btn,
.item-star-btn.starred {
    opacity: 1;
}

.item-star-btn:hover {
    color: var(--cat-starred);
    transform: scale(1.15);
}

.item-star-btn.starred {
    color: var(--cat-starred);
}

.item-star-btn.starred svg {
    fill: var(--cat-starred);
    stroke: var(--cat-starred);
}

/* ========================================== */
/* ========================================== */
.item-card {
    position: relative;
    user-select: none;
}

.item-select-checkbox {
    position: static;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.45;
    z-index: 5;
    margin: 0;
    transition: all var(--transition-fast);
}

.item-card:hover .item-select-checkbox,
.item-card.selected .item-select-checkbox,
.batch-mode .item-select-checkbox,
.list-row:hover .list-select-checkbox,
.list-row.selected .list-select-checkbox {
    opacity: 1;
}

.item-select-checkbox.checked,
.list-select-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary-light);
    box-shadow: 0 0 8px var(--primary-glow);
}

.item-select-checkbox.checked::after,
.list-select-checkbox.checked::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translate(-1px, -1px);
}

.item-card.selected {
    border-color: var(--primary-light) !important;
    background: rgba(56, 189, 248, 0.08) !important;
    box-shadow: 0 0 0 1px var(--primary-light), 0 8px 24px var(--primary-glow) !important;
}

.list-row {
    position: relative;
    user-select: none;
}

.list-select-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-surface);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-right: 10px;
    flex-shrink: 0;
    transition: all var(--transition-fast);
}

.list-row.selected {
    background: rgba(56, 189, 248, 0.08) !important;
    border-left: 3px solid var(--primary-light);
}

/* ========================================== */
/* ========================================== */
.item-card.drag-target-hover,
.list-row.drag-target-hover {
    border: 2px dashed var(--primary-light) !important;
    background: rgba(56, 189, 248, 0.16) !important;
    box-shadow: 0 0 20px var(--primary-glow) !important;
    transform: scale(1.02);
    transition: all 0.15s ease;
}

.item-card.dragging,
.list-row.dragging {
    opacity: 0.45;
    transform: scale(0.98);
}

/* ========================================== */
/* ========================================== */
.batch-action-bar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-focus);
    border-radius: 40px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55), 0 0 24px var(--primary-glow);
    animation: batchSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes batchSlideUp {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.batch-bar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    border-right: 1px solid var(--border-subtle);
    padding-right: 14px;
}

.batch-select-badge {
    background: rgba(56, 189, 248, 0.16);
    color: var(--primary-light);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.batch-link-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition-fast);
}
.batch-link-btn:hover {
    color: var(--text-main);
}

.batch-bar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.batch-action-btn {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 7px 14px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all var(--transition-fast);
}

.batch-action-btn:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    color: #fff;
    box-shadow: 0 2px 10px var(--primary-glow);
}

.batch-action-btn.batch-danger:hover {
    background: var(--danger);
    border-color: var(--danger-hover);
    color: #fff;
    box-shadow: 0 2px 10px rgba(244, 63, 94, 0.4);
}

.batch-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.batch-close-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

/* ========================================== */
/* ========================================== */
.item-card .video-thumb-container {
    position: relative;
    width: 100%;
    height: 110px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 8px 0;
    background: #000;
}

.item-card .video-thumb-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-thumb-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 4px;
}


/* ========================================== */
/* ========================================== */
.shortcuts-dialog {
    max-width: 500px;
}

.shortcuts-modal-body {
    padding: 18px 24px;
    max-height: 65vh;
    overflow-y: auto;
}

.shortcuts-group {
    margin-bottom: 20px;
}
.shortcuts-group:last-child {
    margin-bottom: 0;
}

.shortcuts-group-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--primary-light);
    margin-bottom: 10px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle);
}

.shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 0;
    font-size: 13px;
}

.shortcut-desc {
    color: var(--text-main);
}

.shortcut-keys {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.shortcut-keys kbd {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-main);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ========================================== */
/* ========================================== */
.editor-history-panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 310px;
    background: var(--bg-surface);
    border-left: 1px solid var(--border-subtle);
    z-index: 20;
    display: flex;
    flex-direction: column;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.4);
    animation: historySlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes historySlideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-surface-elevated);
}

.history-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
}

.history-close-btn {
    background: transparent;
    border: none;
    font-size: 18px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
}
.history-close-btn:hover {
    color: var(--text-main);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.history-item {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    padding: 12px;
    margin-bottom: 10px;
    transition: all var(--transition-fast);
}
.history-item:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.history-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.history-item-time {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.history-item-size {
    font-size: 11px;
    color: var(--text-faint);
    font-family: var(--font-mono);
}

.history-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.history-btn {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-fast);
}
.history-btn:hover {
    background: var(--primary);
    border-color: var(--primary-light);
    color: #fff;
}

/* ========================================== */
/* ========================================== */
.batch-move-folders-list {
    max-height: 220px;
    overflow-y: auto;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-surface-elevated);
}

.batch-folder-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
}
.batch-folder-option:last-child {
    border-bottom: none;
}
.batch-folder-option:hover,
.batch-folder-option.selected {
    background: rgba(56, 189, 248, 0.12);
    color: var(--primary-light);
}

/* ========================================== */
/* ========================================== */
.meter-bar-track {
    position: relative;
    overflow: hidden;
}

.meter-bar-fill {
    transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

/* Category-specific Empty State */
.empty-folder-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 50px 20px;
    max-width: 480px;
    margin: 40px auto;
}

.empty-state-svg-wrap {
    margin-bottom: 20px;
}

.empty-folder-state h4 {
    font-family: var(--font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.empty-folder-state p {
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 22px;
}

.empty-actions-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.universal-nav-tabs {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    padding: 3px 4px;
    border-radius: 9px;
    border: 1px solid var(--border-subtle);
    margin-left: 12px;
    flex-shrink: 0;
}

.universal-nav-tabs .nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 7px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    transition: var(--transition-fast);
    border: 1px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}

.universal-nav-tabs .nav-tab span {
    white-space: nowrap;
}

.universal-nav-tabs .nav-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.06);
}

.universal-nav-tabs .nav-tab.active {
    color: var(--primary-light);
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.28);
    font-weight: 600;
}

/* App-Specific Palette Accents on Active Tab matching Logo Colors */
.universal-nav-tabs .nav-tab.active[data-app="skydrive"],
.universal-nav-tabs .nav-tab.active[href="/"] {
    color: #38bdf8 !important;
    background: rgba(56, 189, 248, 0.15) !important;
    border-color: rgba(56, 189, 248, 0.35) !important;
    box-shadow: 0 0 12px -2px rgba(56, 189, 248, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="chat"],
.universal-nav-tabs .nav-tab.active[href="/chat"],
.universal-nav-tabs .nav-tab.active[href="/chat/"] {
    color: #34d399 !important;
    background: rgba(16, 185, 129, 0.15) !important;
    border-color: rgba(52, 211, 153, 0.35) !important;
    box-shadow: 0 0 12px -2px rgba(16, 185, 129, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="ai"],
.universal-nav-tabs .nav-tab.active[href="/ai"],
.universal-nav-tabs .nav-tab.active[href="/ai/"] {
    color: #c084fc !important;
    background: rgba(139, 92, 246, 0.16) !important;
    border-color: rgba(192, 132, 252, 0.38) !important;
    box-shadow: 0 0 12px -2px rgba(139, 92, 246, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="docs"],
.universal-nav-tabs .nav-tab.active[href="/docs"],
.universal-nav-tabs .nav-tab.active[href="/docs/"] {
    color: #60a5fa !important;
    background: rgba(37, 99, 235, 0.18) !important;
    border-color: rgba(96, 165, 250, 0.38) !important;
    box-shadow: 0 0 12px -2px rgba(37, 99, 235, 0.28);
}
.universal-nav-tabs .nav-tab.active[data-app="calendar"],
.universal-nav-tabs .nav-tab.active[href="/calendar"],
.universal-nav-tabs .nav-tab.active[href="/calendar/"] {
    color: #22d3ee !important;
    background: rgba(6, 182, 212, 0.16) !important;
    border-color: rgba(34, 211, 238, 0.38) !important;
    box-shadow: 0 0 12px -2px rgba(6, 182, 212, 0.25);
}
.universal-nav-tabs .nav-tab.active[data-app="gallery"],
.universal-nav-tabs .nav-tab.active[href="/gallery"],
.universal-nav-tabs .nav-tab.active[href="/gallery/"] {
    color: #f472b6 !important;
    background: rgba(236, 72, 153, 0.16) !important;
    border-color: rgba(244, 114, 182, 0.38) !important;
    box-shadow: 0 0 12px -2px rgba(236, 72, 153, 0.25);
}

.universal-nav-tabs .nav-tab-icon {
    flex-shrink: 0;
}

.trash-container {
    padding: 24px;
    width: 100%;
    box-sizing: border-box;
}

.trash-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 18px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 12px;
}

.trash-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.trash-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.trash-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trash-items-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trash-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    transition: var(--transition-fast);
}

.trash-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.trash-item-left {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.trash-item-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(244, 63, 94, 0.12);
    color: var(--danger);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.trash-item-info {
    min-width: 0;
}

.trash-item-name {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trash-item-meta {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.trash-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.trash-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.trash-empty-icon {
    margin-bottom: 14px;
    color: var(--text-faint);
}

.item-card.is-selected {
    border-color: var(--card-accent, var(--primary-light)) !important;
    background: linear-gradient(165deg, rgba(var(--card-accent-rgb, 56, 189, 248), 0.20) 0%, rgba(var(--card-accent-rgb, 56, 189, 248), 0.08) 50%, var(--bg-card) 100%) !important;
    box-shadow: 0 0 0 1.5px var(--card-accent, var(--primary-light)), 0 8px 25px rgba(var(--card-accent-rgb, 56, 189, 248), 0.32) !important;
}

.file-list-row.is-selected {
    border-color: var(--primary-light) !important;
    background: rgba(56, 189, 248, 0.12) !important;
    box-shadow: 0 0 0 1px var(--primary-light) inset;
}

.item-select-checkbox {
    position: static;
    accent-color: var(--card-accent, var(--primary-light));
    cursor: pointer;
    z-index: 4;
}

.item-card:hover .item-select-checkbox,
.item-card.is-selected .item-select-checkbox {
    opacity: 1;
}

.file-list-checkbox-cell {
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}

.file-list-checkbox-cell input {
    cursor: pointer;
    accent-color: var(--primary-light);
}

/* Keep universal tabs visible at the top in slim mobile layout */
@media (max-width: 640px) {
    .universal-nav-tabs {
        display: flex !important;
        margin-left: 4px;
        padding: 2px 3px;
        gap: 2px;
    }
    .universal-nav-tabs .nav-tab {
        padding: 5px 7px !important;
    }
    .universal-nav-tabs .nav-tab-icon {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Note / Code Editor Modal Mobile Layout */
@media (max-width: 640px) {
    .editor-dialog {
        width: 96vw !important;
        max-width: 96vw !important;
        height: 92vh !important;
        margin: 8px auto !important;
    }
    .editor-dialog .modal-header {
        flex-wrap: wrap !important;
        gap: 8px !important;
        padding: 10px 12px !important;
    }
    .editor-dialog .modal-title-group {
        width: 100% !important;
        flex: 1 1 100% !important;
        min-width: 0 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    .editor-dialog .editor-filename-input {
        flex: 1 !important;
        min-width: 0 !important;
        font-size: 13px !important;
        padding: 4px 6px !important;
    }
    .editor-dialog .modal-header-actions {
        width: 100% !important;
        justify-content: flex-end !important;
        gap: 6px !important;
        overflow-x: auto !important;
    }
    .editor-dialog .modal-header-actions button.sm span {
        display: none !important;
    }
    .editor-dialog .modal-header-actions button.sm {
        padding: 6px 10px !important;
    }
    #modal-save-btn {
        padding: 6px 14px !important;
    }
}

/* User Settings Modal Mobile Polish */
@media (max-width: 640px) {
    .settings-dialog {
        width: 96vw !important;
        max-width: 96vw !important;
    }
    .settings-dialog .modal-header {
        padding: 14px 16px 10px 16px !important;
    }
    .settings-dialog .modal-title {
        font-size: 14px !important;
    }
    .settings-tabs {
        padding: 0 16px 10px 16px !important;
        scrollbar-width: none !important;
    }
    .settings-tabs::-webkit-scrollbar {
        display: none !important;
    }
    .settings-content-body {
        padding: 16px !important;
    }
    .avatar-preview-container {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 12px !important;
    }
    .settings-card-action {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
    }
    .settings-card-action .card-action-icon {
        align-self: flex-start !important;
    }
    .settings-card-action .primary-btn,
    .settings-card-action .secondary-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    .meta-val.code-font {
        word-break: break-all !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Desktop Shell Integration (Electron)                                       */
/* ═══════════════════════════════════════════════════════════════════════════ */
html.is-desktop-app #user-profile-badge,
body.is-desktop-app #user-profile-badge {
    display: none !important;
}

html.is-desktop-app .brand-logo,
body.is-desktop-app .brand-logo,
html.is-desktop-app .universal-nav-tabs,
body.is-desktop-app .universal-nav-tabs {
    display: none !important;
}

html.is-desktop-app .header-left,
body.is-desktop-app .header-left {
    max-width: 900px;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* Shared Folders & Live Collaboration (Google Drive-like Folder Sync)         */
/* ═══════════════════════════════════════════════════════════════════════════ */

/* Explorer Header Banner when inside a Shared Folder */
.shared-folder-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    margin: 8px 16px 14px 16px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.14) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 1px solid rgba(56, 189, 248, 0.28);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 18px -4px rgba(0, 0, 0, 0.35);
    animation: fadeIn 0.2s ease-out;
}

.shared-folder-banner-left,
.shared-banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.shared-folder-banner-icon,
.shared-banner-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(56, 189, 248, 0.18);
    color: var(--primary-light);
    flex-shrink: 0;
}

.shared-folder-banner-info,
.shared-banner-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.shared-banner-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shared-folder-banner-title,
.shared-banner-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-main);
}

.shared-folder-banner-desc,
.shared-banner-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.shared-folder-banner-right,
.shared-banner-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.shared-banner-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(56, 189, 248, 0.14);
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: var(--radius-sm);
    color: var(--primary-light);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.shared-banner-action-btn:hover {
    background: rgba(56, 189, 248, 0.25);
    border-color: var(--primary-light);
}

/* Pulsating Live Sync indicator */
.folder-live-sync-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 12px;
    background: rgba(16, 185, 129, 0.14);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.32);
    letter-spacing: 0.02em;
}

.live-sync-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 8px #10b981;
    animation: liveSyncPulse 2s infinite cubic-bezier(0.4, 0, 0.6, 1);
}

@keyframes liveSyncPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* Role Badges */
.shared-role-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 7px;
    border-radius: 4px;
}

.shared-role-pill.role-owner {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

.shared-role-pill.role-editor {
    background: rgba(56, 189, 248, 0.16);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.35);
}

.shared-role-pill.role-viewer {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Shared Folder Badges on Cards */
.shared-folder-corner-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(56, 189, 248, 0.2);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.38);
    pointer-events: none;
    z-index: 2;
}

.shared-folder-row-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.3);
    margin-left: 6px;
    vertical-align: middle;
}

/* Modal Dialog for Folder Sharing */
.folder-share-dialog {
    max-width: 540px;
    width: 92%;
}

.folder-share-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
}

.folder-share-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(14, 165, 233, 0.1));
    color: var(--primary-light);
    flex-shrink: 0;
}

.folder-share-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.folder-share-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.folder-share-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.folder-share-owner-badge {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.folder-share-section-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.folder-share-add-section {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.folder-share-add-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.folder-share-role-select {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    outline: none;
    transition: border-color var(--transition-fast);
}

.folder-share-role-select:focus {
    border-color: var(--border-focus);
}

.folder-share-members-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.member-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

.folder-share-members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 230px;
    overflow-y: auto;
    padding-right: 4px;
}

.member-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.member-item-row:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.member-user-col {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.member-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #8b5cf6);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.member-user-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.member-user-name {
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.member-user-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.member-actions-col {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.member-role-select {
    font-size: 0.8rem;
    padding: 4px 8px;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    border-radius: var(--radius-sm);
    outline: none;
    cursor: pointer;
}

.member-role-select:focus {
    border-color: var(--border-focus);
}

.member-remove-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.member-remove-btn:hover {
    color: var(--danger);
    background: rgba(244, 63, 94, 0.12);
}

.danger-ghost-btn {
    background: transparent;
    border: 1px solid rgba(244, 63, 94, 0.35);
    color: var(--danger);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.danger-ghost-btn:hover {
    background: rgba(244, 63, 94, 0.12);
    border-color: var(--danger);
}

