/* assets/css/style.css - Brutalist "Indestructible Vault" styling for KucLab Drive */

@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/JetBrainsMono.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-style: normal; font-weight: 500 700; font-display: swap; src: url('../fonts/Outfit.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 600 700; font-display: swap; src: url('../fonts/SpaceGrotesk.woff2') format('woff2'); }

:root {
    /* Zero Transparency - Heavy Opaque Elements (Vault feel) */
    --bg-dark: #07090c;          /* Deep bedrock */
    --bg-panel: #121620;         /* Solid iron panel */
    --bg-input: #030406;         /* Deep recessed slot */
    --bg-header: #1c212f;        /* Heavy steel plate */
    
    /* Structural Borders (Thick, double, blocky) */
    --border-steel: #2c3547;     /* Dark steel */
    --border-steel-light: #44516c; /* Polished steel */
    --border-thick: 4px solid var(--border-steel);
    --border-double: 6px double var(--border-steel);
    
    /* Lock Gold & Accents */
    --accent-bronze: #d97706;    /* Warm brass/gold lock */
    --accent-bronze-dark: #b45309;
    --accent-blue: #3b82f6;      
    
    /* Status LEDs */
    --led-green: #10b981;
    --led-amber: #f59e0b;
    --led-red: #ef4444;
    
    /* Text */
    --text-primary: #f8fafc;     
    --text-secondary: #94a3b8;   
    
    /* Absolute Square corners (removes any organic curved feeling, feels indestructible) */
    --border-radius-heavy: 0px;  
    --transition-snappy: 0.08s;  /* Fast, mechanical reaction times */
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    /* Heavy industrial grid representing welded construction plates */
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 2px, transparent 2px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 2px, transparent 2px);
    background-size: 60px 60px;
    background-position: center;
}

/* Scrollbar styling - blocky industrial */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
    border-left: 4px solid var(--border-steel);
}
::-webkit-scrollbar-thumb {
    background: var(--border-steel);
    border: 3px solid var(--bg-dark);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-bronze);
}

header {
    background: var(--bg-panel);
    border-bottom: 4px solid var(--border-steel);
    padding: 12px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.logo i {
    color: var(--accent-bronze);
    filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.5));
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-nav .btn {
    padding: 10px 18px;
    font-size: 0.82rem;
}

.user-info {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.user-info strong {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    background: var(--bg-dark);
    padding: 6px 12px;
    border: 2px solid var(--border-steel);
}

/* Concrete Safe Panel */
.glass-card {
    background: var(--bg-panel);
    border: 4px solid var(--border-steel);
    border-radius: var(--border-radius-heavy);
    padding: 40px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
}

main {
    flex: 1;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.screen {
    display: none;
    width: 100%;
}

.screen.active {
    display: block;
}

#screen-auth.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
}

/* Auth container settings */
.auth-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.auth-container .glass-card {
    padding: 60px;
}

.auth-container .auth-tab {
    padding: 22px;
    font-size: 1.4rem;
}

.auth-container .form-group label {
    font-size: 1.1rem;
}

.auth-container .form-group input {
    padding: 22px 26px;
    font-size: 1.3rem;
}

.auth-container .form-group .form-help-text {
    font-size: 1.05rem !important;
}

.auth-container .btn {
    padding: 22px 44px;
    font-size: 1.3rem;
}

.auth-container .auth-toggle-link {
    font-size: 1.15rem;
}

.auth-container .warning-box {
    font-size: 1.15rem;
    padding: 20px;
}

.auth-tabs {
    display: flex;
    background: var(--bg-dark);
    border: 3px solid var(--border-steel);
    border-radius: var(--border-radius-heavy);
    padding: 4px;
    margin-bottom: 32px;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 14px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
    border-radius: var(--border-radius-heavy);
    transition: all var(--transition-snappy);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-tab.active {
    color: var(--text-primary);
    background: var(--bg-panel);
    border: 2px solid var(--border-steel-light);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
}

.form-group {
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.form-group input {
    background: var(--bg-input);
    border: 3px solid var(--border-steel);
    border-radius: var(--border-radius-heavy);
    padding: 16px 20px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    outline: none;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.95);
    transition: all var(--transition-snappy);
}

.form-group input:focus {
    border-color: var(--accent-bronze);
    box-shadow: 
        inset 0 4px 8px rgba(0, 0, 0, 0.95),
        0 0 0 3px rgba(217, 119, 6, 0.25);
}

/* Mechanical Push Button (satisfying heavy spring click) */
.btn {
    background: linear-gradient(180deg, #2a3447, #171d28);
    color: var(--text-primary);
    border: 2px solid var(--border-steel-light);
    border-bottom: 6px solid #0b0d13; /* thick bottom plate */
    border-radius: var(--border-radius-heavy);
    padding: 16px 32px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform var(--transition-snappy), border-bottom-width var(--transition-snappy);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.6);
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
}

.btn:hover {
    background: linear-gradient(180deg, #323d54, #1b222f);
    border-color: #556687;
}

/* Physical mechanical switch press */
.btn:active {
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.95);
    background: linear-gradient(180deg, #1b222f, #121620);
}

.btn-primary-action:active, button[type="submit"].btn:active {
    background: linear-gradient(180deg, #7d3f00, #542900);
}

.btn-danger:active {
    background: linear-gradient(180deg, #7f1d1d, #4c1111);
}

.btn-secondary:active {
    background: linear-gradient(180deg, #0f131b, #090b10);
}

/* Lock Amber button */
.btn-primary-action, button[type="submit"].btn {
    background: linear-gradient(180deg, #ad5a02, #6e3700);
    border-color: #e58717;
    border-bottom: 6px solid #3d1a00;
}

.btn-primary-action:hover, button[type="submit"].btn:hover {
    background: linear-gradient(180deg, #c26703, #7d3f00);
    border-color: #fbbf24;
}

.btn-danger {
    background: linear-gradient(180deg, #b91c1c, #7f1d1d);
    border-color: #ef4444;
    border-bottom: 6px solid #450a0a;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #dc2626, #991b1b);
    border-color: #ff8787;
}

.btn-secondary {
    background: linear-gradient(180deg, #1c2230, #0f131b);
    border-color: var(--border-steel);
    border-bottom: 6px solid #050608;
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: linear-gradient(180deg, #22293a, #131923);
    color: var(--text-primary);
}

.auth-toggle-recovery {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
}

.auth-toggle-link {
    color: var(--accent-bronze);
    cursor: pointer;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: none;
    border: none;
    padding: 0;
    font-family: inherit;
    font-size: inherit;
}

.auth-toggle-link:hover {
    color: #fbbf24;
    text-decoration: underline;
}

/* Explorer Dashboard Layout */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: stretch;
    width: 100%;
    min-height: calc(100vh - 132px);
}

/* Sidebar Navigation */
.explorer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 24px;
}

.explorer-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.explorer-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: 2px solid transparent;
    border-radius: var(--border-radius-heavy);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-snappy);
}

.explorer-nav-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--border-steel);
}

.explorer-nav-item.active {
    color: var(--text-primary);
    background: var(--bg-dark);
    border-color: var(--accent-bronze);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}

.explorer-nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.explorer-nav-item.active i {
    color: var(--accent-bronze);
}

/* Compact Sidebar Dropzone */
.dropzone-compact {
    border: 2px dashed var(--border-steel);
    border-radius: var(--border-radius-heavy);
    background: var(--bg-input);
    padding: 24px 16px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all var(--transition-snappy);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.95);
}

.dropzone-compact:hover {
    border-color: var(--accent-bronze);
    background: rgba(217, 119, 6, 0.02);
}

.dropzone-compact i {
    font-size: 2rem;
    color: var(--border-steel-light);
}

.dropzone-compact:hover i {
    color: var(--accent-bronze);
}

.dropzone-compact .dropzone-text {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.dropzone-compact:hover .dropzone-text {
    color: var(--text-primary);
}

/* Storage usage panel */
.storage-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.storage-panel {
    border-top: 2px solid var(--border-steel);
    padding-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-container {
    background: var(--bg-input);
    border: 2px solid var(--border-steel);
    border-radius: var(--border-radius-heavy);
    height: 14px;
    width: 100%;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.95);
}

.progress-bar {
    background: linear-gradient(90deg, var(--accent-bronze), #fbbf24);
    height: 100%;
    width: 0%;
}

.storage-info-text {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 4px;
}

.storage-info-text i {
    color: var(--accent-bronze);
    margin-right: 4px;
}

/* Explorer Main Area, Header & Breadcrumbs */
.explorer-main {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: 680px;
}

#file-list-container {
    flex: 1;
    min-height: 280px;
    position: relative;
    cursor: default;
}

.explorer-header {
    border-bottom: 2px solid var(--border-steel);
    padding-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

/* Dropdown Menu styling */
.new-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-panel);
    border: 3px solid var(--border-steel);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9);
    z-index: 150;
    min-width: 180px;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    width: 100%;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-snappy);
}

.dropdown-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.dropdown-item i {
    color: var(--accent-bronze);
    width: 20px;
    text-align: center;
}

/* Drag Selection Area marquee box */
.drag-select-box {
    position: absolute;
    border: 2px dashed var(--accent-bronze);
    background-color: rgba(217, 119, 6, 0.15);
    z-index: 99;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(217, 119, 6, 0.18), inset 0 0 18px rgba(217, 119, 6, 0.1);
}

.explorer-main,
#file-list-container,
#file-list-container *,
.view-list,
.view-grid,
.explorer-table,
.explorer-row,
.file-grid-card {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Selection and Drag/Drop visual feedback */
.explorer-row.selected {
    background-color: rgba(217, 119, 6, 0.08) !important;
    border-left: 4px solid var(--accent-bronze);
}

.file-grid-card.selected {
    border-color: var(--accent-bronze) !important;
    background-color: rgba(217, 119, 6, 0.08) !important;
    box-shadow: 0 0 12px rgba(217, 119, 6, 0.3);
}

.file-grid-card.dragging, .explorer-row.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-bronze) !important;
}

.file-grid-card.drag-over {
    border-color: #fbbf24 !important;
    background-color: rgba(251, 191, 36, 0.1) !important;
}

.explorer-row.drag-over {
    background-color: rgba(251, 191, 36, 0.1) !important;
    border-bottom: 2px solid #fbbf24;
}

.explorer-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.explorer-breadcrumbs i {
    font-size: 0.75rem;
    color: var(--border-steel-light);
}

.explorer-breadcrumbs .bc-root, .explorer-breadcrumbs .bc-item {
    font-weight: 600;
}

.explorer-breadcrumbs .bc-item.active {
    color: var(--accent-bronze);
    font-weight: 700;
}

/* Explorer Toolbar */
.explorer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-dark);
    padding: 10px;
    border: 2px solid var(--border-steel);
}

.toolbar-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.toolbar-middle {
    flex: 1;
    max-width: 380px;
    min-width: 180px;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.search-box input {
    width: 100%;
    background: var(--bg-input);
    border: 2px solid var(--border-steel);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.85rem;
    padding: 8px 12px 8px 32px;
    outline: none;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.95);
}

.search-box input:focus {
    border-color: var(--accent-bronze);
}

.toolbar-right {
    display: flex;
    align-items: center;
}

.view-toggle-group {
    display: flex;
    border: 2px solid var(--border-steel);
    background: var(--bg-panel);
    padding: 2px;
}

.view-toggle-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-snappy);
}

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

.view-toggle-btn.active {
    background: var(--border-steel);
    color: var(--text-primary);
}

/* File list - List View (Explorer Table) */
.view-list {
    overflow-x: auto;
    width: 100%;
}

.explorer-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    min-width: 600px;
}

.explorer-table th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    padding: 10px 12px;
    border-bottom: 2px solid var(--border-steel);
    font-weight: 700;
}

.explorer-row {
    border-bottom: 1px solid var(--border-steel);
}

.explorer-row:hover {
    outline: 2px solid var(--accent-bronze);
    outline-offset: -2px;
}

.explorer-row td {
    padding: 12px;
    vertical-align: middle;
    font-size: 0.9rem;
}

.explorer-row .col-name {
    font-weight: 600;
    max-width: 320px;
}

.file-title {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    min-height: 28px;
}

.explorer-row .file-icon {
    font-size: 1.2rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    line-height: 1;
}

.explorer-row .file-name {
    display: block;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.25;
}

.explorer-row .col-size,
.explorer-row .col-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.explorer-row .col-type {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.explorer-row .col-actions {
    text-align: right;
}

.explorer-row .file-actions {
    display: inline-flex;
    gap: 4px;
}

/* File List - Grid View (Explorer Cards) */
.view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 150px);
    grid-auto-flow: row;
    grid-auto-rows: 150px;
    justify-content: start;
    align-content: start;
    gap: 20px;
    width: 100%;
}

.file-grid-card {
    background: var(--bg-input);
    border: 2px solid var(--border-steel);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
    aspect-ratio: 1;
    justify-content: center;
}

.file-grid-card:hover {
    border-color: var(--accent-bronze);
}

.file-card-preview {
    font-size: 3.6rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}



.file-card-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.file-card-info {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.file-card-hover-actions {
    display: none;
}

/* Action Buttons inside lists/grids */
.action-btn {
    background: var(--bg-input);
    border: 2px solid var(--border-steel);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 6px 10px;
    border-radius: var(--border-radius-heavy);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-snappy);
}

.action-btn:hover {
    color: var(--text-primary);
    border-color: var(--border-steel-light);
}

.action-btn.delete-btn:hover {
    color: #f87171;
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Modals */
dialog {
    position: fixed;
    inset: 0;
    margin: auto;
    border: 2px solid var(--border-steel-light);
    background: linear-gradient(180deg, #171d2a 0%, #10141d 100%);
    border-radius: 8px;
    padding: 0;
    color: var(--text-primary);
    max-width: 560px;
    width: 90%;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.04);
    overflow-y: auto;
    max-height: 90vh;
}

/* Context Menu */
.context-menu {
    display: none;
    position: absolute;
    background: var(--bg-panel);
    border: 3px solid var(--border-steel);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95);
    z-index: 1000;
    min-width: 220px;
    user-select: none;
}

.context-item {
    padding: 12px 16px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all var(--transition-snappy);
}

.context-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.context-item i {
    color: var(--accent-bronze);
    width: 20px;
    text-align: center;
}

.context-item.danger {
    color: #f87171;
}

.context-item.danger i {
    color: var(--led-red);
}

.context-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ff8787;
}

.context-divider {
    height: 2px;
    background: var(--border-steel);
    margin: 4px 0;
}

dialog::backdrop {
    background-color: rgba(3, 4, 6, 0.82);
    backdrop-filter: blur(3px);
}

/* Encrypted Server View styling */
.encrypted-view-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    text-align: left;
    color: var(--text-secondary);
}

.encrypted-view-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
}

@media (max-width: 600px) {
    .encrypted-view-top {
        grid-template-columns: 1fr;
    }
}

.encrypted-visual-panel {
    background: var(--bg-input);
    border: 3px solid var(--border-steel);
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
}

.encrypted-visual-panel p {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-bronze);
}

.noise-canvas {
    width: 100%;
    max-width: 300px;
    height: 180px;
    border: 2px solid var(--border-steel-light);
    image-rendering: pixelated;
    background: #000;
}

.encrypted-meta-panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.encrypted-meta-box {
    background: var(--bg-input);
    border: 2px solid var(--border-steel);
    padding: 12px;
}

.encrypted-meta-box label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 4px;
}

.encrypted-meta-box code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--text-primary);
    word-break: break-all;
    display: block;
}

.encrypted-payload-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.encrypted-payload-panel h4 {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.encrypted-payload-box {
    background: #090b10;
    border: 3px solid var(--border-steel);
    padding: 16px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    color: var(--led-green);
    max-height: 180px;
    overflow-y: auto;
    word-break: break-all;
    white-space: pre-wrap;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.98);
}

.modal-header {
    background: linear-gradient(180deg, #202737 0%, #171c28 100%);
    padding: 22px 30px;
    border-bottom: 1px solid var(--border-steel-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.16rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 30px;
    background: #111722;
    color: var(--text-primary);
}

.modal-footer {
    padding: 20px 30px 26px;
    border-top: 1px solid var(--border-steel);
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    background: #171c28;
}

.modal-footer .btn {
    min-width: 124px;
    padding: 14px 24px;
}

.prompt-dialog {
    max-width: 480px;
}

.prompt-dialog .modal-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.prompt-label {
    display: block;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.78rem;
    letter-spacing: 0.6px;
    color: var(--text-secondary);
}

.modal-text-input,
dialog input[type="text"],
dialog input[type="email"],
dialog input[type="password"] {
    width: 100%;
    min-height: 48px;
    background: #070a10;
    border: 2px solid var(--border-steel);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    line-height: 1.4;
    outline: none;
    padding: 12px 14px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 255, 255, 0.04);
    transition: border-color var(--transition-snappy), box-shadow var(--transition-snappy), background var(--transition-snappy);
}

.modal-text-input::placeholder,
dialog input[type="text"]::placeholder,
dialog input[type="email"]::placeholder,
dialog input[type="password"]::placeholder {
    color: #64748b;
}

.modal-text-input:focus,
dialog input[type="text"]:focus,
dialog input[type="email"]:focus,
dialog input[type="password"]:focus {
    background: #090d15;
    border-color: var(--accent-bronze);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.75), 0 0 0 3px rgba(217, 119, 6, 0.22);
}

/* Master Key display block */
.master-key-container {
    background: var(--bg-input);
    border: 3px solid var(--border-steel);
    border-radius: var(--border-radius-heavy);
    padding: 24px;
    margin: 24px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.1rem;
    word-break: break-all;
    text-align: center;
    user-select: all;
    color: var(--accent-bronze);
    letter-spacing: 2px;
    box-shadow: inset 0 4px 8px rgba(0, 0, 0, 0.98);
}

/* Solid concrete warning banners */
.warning-box {
    background: #23170e;
    border-left: 6px solid var(--accent-bronze);
    border-radius: 0;
    padding: 20px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.5;
    border-top: 2px solid #3d230f;
    border-bottom: 2px solid #3d230f;
    border-right: 2px solid #3d230f;
}

.warning-box strong {
    color: var(--accent-bronze);
}

/* Toast alert banner */
.alert-banner {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: var(--bg-panel);
    border: 4px solid var(--border-steel);
    border-radius: var(--border-radius-heavy);
    padding: 22px 32px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 1000;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: slideIn 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.alert-banner.success {
    border-left: 6px solid var(--led-green);
}
.alert-banner.success i {
    color: var(--led-green);
}

.alert-banner.error {
    border-left: 6px solid var(--led-red);
}
.alert-banner.error i {
    color: var(--led-red);
}

.alert-banner.info {
    border-left: 6px solid var(--accent-blue);
}
.alert-banner.info i {
    color: var(--accent-blue);
}

/* Card loader spinner */
.card-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 9, 12, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.spinner {
    width: 36px;
    height: 36px;
    border: 4px solid rgba(255, 255, 255, 0.05);
    border-top-color: var(--accent-bronze);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Decrypted previews */
.preview-container {
    max-height: 70vh;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-input);
    border: 3px solid var(--border-steel);
    border-radius: var(--border-radius-heavy);
    padding: 16px;
    box-shadow: inset 0 6px 12px rgba(0, 0, 0, 0.98);
}

.preview-container img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border: 3px solid var(--border-steel);
}

.preview-container pre {
    width: 100%;
    max-height: 60vh;
    overflow: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
    background: #090b10;
    padding: 24px;
    border-radius: 0px;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    border: 3px solid var(--border-steel);
    box-shadow: inset 0 4px 8px rgba(0,0,0,0.98);
}

.preview-container video {
    max-width: 100%;
    max-height: 60vh;
    border: 3px solid var(--border-steel);
}

/* Mobile Responsiveness Rules */
@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .user-nav {
        flex-direction: column;
        width: 100%;
        gap: 10px;
    }
    
    .user-nav button, .user-nav .user-info {
        width: 100%;
        text-align: center;
    }

    .user-info strong {
        display: block;
        margin-top: 4px;
    }
    
    main {
        padding: 20px 12px;
    }
    
    .glass-card {
        padding: 24px 16px;
    }
}

@media (max-width: 600px) {
    .explorer-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .new-dropdown-wrapper {
        width: 100%;
    }
    
    .new-dropdown-wrapper button {
        width: 100%;
        justify-content: center;
    }
    
    .dropdown-menu {
        width: 100%;
        left: 0;
        right: 0;
    }

    .explorer-sidebar {
        padding: 12px;
        gap: 16px;
    }
    
    .explorer-nav {
        flex-direction: row;
        overflow-x: auto;
        width: 100%;
        padding-bottom: 6px;
        gap: 6px;
        scrollbar-width: none;
    }
    
    .explorer-nav::-webkit-scrollbar {
        display: none;
    }
    
    .explorer-nav-item {
        padding: 10px 14px;
        white-space: nowrap;
        width: auto;
        font-size: 0.85rem;
    }
    
    .explorer-nav-item span {
        display: inline;
    }
    
    .explorer-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
    }
    
    .toolbar-left, .toolbar-middle, .toolbar-right {
        width: 100%;
        max-width: 100%;
    }
    
    .toolbar-left {
        display: grid;
        grid-template-columns: 1fr auto;
    }
    
    .view-toggle-group {
        width: 100%;
        justify-content: center;
    }
    
    .view-toggle-btn {
        flex: 1;
        text-align: center;
    }
    
    .explorer-main {
        padding: 16px 12px;
        min-height: auto;
    }
    
    .alert-banner {
        left: 16px;
        right: 16px;
        bottom: 16px;
        padding: 16px 20px;
        font-size: 0.85rem;
    }
}

/* Disable user-select globally during active marquee drag */
.marquee-active, .marquee-active * {
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

.marquee-active {
    cursor: crosshair;
}

/* Upload progress */
.upload-progress-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: min(360px, calc(100vw - 48px));
    background: #111722;
    border: 2px solid var(--border-steel-light);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.85);
    padding: 16px;
    z-index: 1200;
}

.upload-progress-panel[hidden] {
    display: none;
}

.upload-progress-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.upload-progress-head span {
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.upload-progress-head strong,
.upload-progress-detail {
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.upload-progress-track {
    height: 12px;
    background: var(--bg-input);
    border: 2px solid var(--border-steel);
    overflow: hidden;
    margin-bottom: 10px;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent-bronze), #fbbf24);
    transition: width 0.16s ease-out;
}

.upload-progress-detail {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Public share page */
.share-page main {
    justify-content: flex-start;
}

.share-card {
    max-width: 980px;
    width: 100%;
    margin: 0 auto;
}

.share-list {
    display: flex;
    flex-direction: column;
    border: 2px solid var(--border-steel);
    background: var(--bg-dark);
    margin-top: 20px;
}

.share-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-steel);
}

.share-row:last-child {
    border-bottom: none;
}

.share-row code {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.share-row-title {
    min-width: 0;
}

.share-row-title strong {
    display: block;
    margin-bottom: 4px;
}

.share-note {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 12px;
}

@media (max-width: 700px) {
    .share-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

/* Vault specific styles */
.vault-icon {
    color: var(--accent-bronze);
    position: relative;
}

.vault-icon::after {
    content: "\f023";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    bottom: -2px;
    right: -2px;
    font-size: 0.6em;
    color: var(--led-green);
}

.vault-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    background: rgba(217, 119, 6, 0.2);
    border: 1px solid var(--accent-bronze);
    font-size: 0.7rem;
    color: var(--accent-bronze);
    margin-left: 8px;
}

.vault-badge i {
    font-size: 0.8em;
}

.vault-unlocked {
    border-color: var(--led-green) !important;
    background: rgba(16, 185, 129, 0.1) !important;
}

.vault-unlocked .vault-badge {
    background: rgba(16, 185, 129, 0.2);
    border-color: var(--led-green);
    color: var(--led-green);
}

/* Vault modal styles */
.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--led-amber);
    padding: 12px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: var(--led-amber);
}

.warning-box strong {
    color: var(--text-primary);
}

/* Vault key file input */
input[type="file"] {
    background: var(--bg-input);
    border: 1px solid var(--border-steel);
    padding: 8px;
    color: var(--text-primary);
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--bg-panel);
    border: 1px solid var(--border-steel);
    color: var(--text-primary);
    padding: 6px 12px;
    cursor: pointer;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: var(--border-steel);
}

/* Empty state centering rules */
#file-list-container.is-empty {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
}

.explorer-empty-state, #file-list-container .empty-state {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    color: var(--text-secondary) !important;
    width: 100% !important;
    min-height: 300px !important;
    padding: 40px 20px !important;
    margin: auto !important;
}

.explorer-empty-state i, #file-list-container .empty-state i {
    display: block !important;
    margin: 0 auto 16px auto !important;
    text-align: center !important;
}

/* Spinner styling */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--border-steel);
    border-top: 5px solid var(--accent-bronze);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Text editor overrides */
#modal-text-editor {
    width: 96vw !important;
    height: 92vh !important;
    max-width: 96vw !important;
    max-height: 92vh !important;
    margin: auto !important;
    border: 4px solid var(--border-steel-light) !important;
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    background: var(--bg-panel);
    color: var(--text-primary);
}

#modal-text-editor[open] {
    display: flex !important;
    flex-direction: column !important;
}

#modal-text-editor .modal-body {
    flex: 1 !important;
    height: auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Ribbon group styling for modern office layout */
.ribbon-group {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 12px;
    border-right: 2px solid var(--border-steel);
    position: relative;
    height: 100%;
}

.ribbon-group:last-child {
    border-right: none;
}

#modal-text-editor textarea {
    background: var(--bg-input) !important;
    border: 2px solid var(--border-steel) !important;
    color: var(--text-primary) !important;
}

/* Mobile compact adjustments */
body.mobile-mode main {
    padding: 10px;
}

body.mobile-mode .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
}

body.mobile-mode header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
}

body.mobile-mode .user-nav {
    flex-direction: column;
    width: 100%;
    gap: 8px;
}

body.mobile-mode .user-nav button, 
body.mobile-mode .user-nav .user-info {
    width: 100%;
    text-align: center;
}

body.mobile-mode .explorer-sidebar {
    padding: 16px 12px;
    gap: 16px;
}

body.mobile-mode .explorer-nav {
    flex-direction: row;
    overflow-x: auto;
    width: 100%;
    padding-bottom: 6px;
    gap: 6px;
    scrollbar-width: none;
}

body.mobile-mode .explorer-nav::-webkit-scrollbar {
    display: none;
}

body.mobile-mode .explorer-nav-item {
    padding: 8px 12px;
    white-space: nowrap;
    width: auto;
    font-size: 0.85rem;
}

body.mobile-mode .explorer-main {
    padding: 16px 12px;
    min-height: auto;
}

body.mobile-mode .explorer-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

body.mobile-mode .toolbar-left, 
body.mobile-mode .toolbar-middle, 
body.mobile-mode .toolbar-right {
    width: 100%;
    max-width: 100%;
}

body.mobile-mode .explorer-table th.col-type, 
body.mobile-mode .explorer-table td.col-type,
body.mobile-mode .explorer-table th.col-date, 
body.mobile-mode .explorer-table td.col-date,
body.mobile-mode .explorer-table th.col-size, 
body.mobile-mode .explorer-table td.col-size {
    display: none; /* Hide redundant columns on mobile table view */
}

body.mobile-mode dialog {
    width: 95% !important;
    max-width: 95% !important;
    padding: 16px 12px !important;
}

body.mobile-mode #text-editor-textarea {
    height: 300px;
}

body.mobile-mode .file-grid-card {
    padding: 16px 12px;
}


/* Vault folders: lock icon in the file list, no badge or green unlocked state. */
.vault-badge {
    display: none !important;
}

.explorer-row.vault-unlocked {
    background: transparent !important;
    border-color: var(--border-steel) !important;
}

.file-grid-card.vault-unlocked {
    background: var(--bg-input) !important;
    border-color: var(--border-steel) !important;
}

/* Compact phone UI */
@media (max-width: 760px) {
    body,
    body.mobile-mode {
        background-size: 40px 40px;
    }

    body.mobile-mode main {
        max-width: 100%;
        padding: 8px;
    }

    body.mobile-mode header {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
    }

    body.mobile-mode .logo {
        gap: 8px;
        font-size: 1rem;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    body.mobile-mode .user-nav {
        flex-direction: row;
        justify-content: flex-end;
        width: auto;
        margin-left: auto;
        gap: 6px;
    }

    body.mobile-mode .user-nav .user-info {
        display: none;
    }

    body.mobile-mode .user-nav .btn {
        width: 34px;
        height: 34px;
        min-width: 34px;
        min-height: 34px;
        padding: 0 !important;
        padding-top: 2px !important; /* Offset bottom border of 6px */
        font-size: 0 !important;
        gap: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.mobile-mode .user-nav .btn i,
    body.mobile-mode .user-nav .btn svg,
    body.mobile-mode #btn-refresh-files i,
    body.mobile-mode #btn-refresh-files svg {
        display: block !important;
        margin: 0 !important;
        line-height: 1 !important;
        font-size: 0.9rem !important;
        transform: translateX(4.5px) !important;
    }

    body.mobile-mode .glass-card {
        border-width: 2px;
        padding: 12px;
        box-shadow: none;
    }

    body.mobile-mode .dashboard-grid {
        display: flex;
        flex-direction: column;
        min-height: 0;
        gap: 8px;
    }

    body.mobile-mode .explorer-sidebar {
        padding: 8px;
        gap: 8px;
    }

    body.mobile-mode .explorer-nav {
        gap: 6px;
        padding-bottom: 0;
    }

    body.mobile-mode .explorer-nav-item {
        flex: 0 0 auto;
        padding: 7px 10px;
        font-size: 0.78rem;
    }

    body.mobile-mode .explorer-nav-item i {
        width: 16px;
        font-size: 0.95rem;
    }

    body.mobile-mode .dropzone-compact {
        display: none;
    }

    body.mobile-mode .storage-panel {
        border-top: 1px solid var(--border-steel);
        padding-top: 8px;
        gap: 6px;
    }

    body.mobile-mode .storage-meta {
        font-size: 0.72rem;
    }

    body.mobile-mode .progress-container {
        height: 8px;
        margin-bottom: 0 !important;
    }

    body.mobile-mode .storage-info-text {
        display: none !important;
    }

    body.mobile-mode .storage-stats-container {
        display: flex !important;
        font-size: 0.72rem;
        margin-top: 8px;
    }

    body.mobile-mode .explorer-main {
        min-height: 60vh;
        padding: 10px;
        gap: 10px;
    }

    body.mobile-mode .explorer-header {
        align-items: stretch;
        gap: 8px;
        padding-bottom: 8px;
    }

    body.mobile-mode .explorer-breadcrumbs {
        flex: 1;
        flex-wrap: nowrap;
        overflow-x: auto;
        white-space: nowrap;
        font-size: 0.8rem;
        scrollbar-width: none;
    }

    body.mobile-mode .explorer-breadcrumbs::-webkit-scrollbar {
        display: none;
    }

    body.mobile-mode .new-dropdown-wrapper {
        flex: 0 0 auto;
    }

    body.mobile-mode #btn-new-dropdown {
        padding: 7px 10px !important;
        font-size: 0.8rem;
    }

    body.mobile-mode .dropdown-menu {
        right: 0;
        left: auto;
        min-width: 220px;
    }

    body.mobile-mode .explorer-toolbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 8px;
        padding: 8px;
        align-items: center;
    }

    body.mobile-mode .toolbar-left,
    body.mobile-mode .toolbar-middle,
    body.mobile-mode .toolbar-right {
        width: auto;
        min-width: 0;
        max-width: none;
    }

    body.mobile-mode #btn-refresh-files {
        width: 36px;
        height: 34px;
        padding: 0 !important;
        padding-top: 2px !important; /* Offset bottom border of 6px */
        font-size: 0 !important;
        gap: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.mobile-mode #btn-refresh-files i {
        font-size: 0.9rem;
    }

    body.mobile-mode .search-box input {
        height: 34px;
        font-size: 0.8rem;
    }

    body.mobile-mode .view-toggle-btn {
        min-width: 32px;
        height: 30px;
        padding: 0;
    }

    body.mobile-mode .view-list {
        overflow-x: visible;
    }

    body.mobile-mode .explorer-table {
        display: block;
        min-width: 0;
    }

    body.mobile-mode .explorer-table thead {
        display: none;
    }

    body.mobile-mode .explorer-table tbody {
        display: flex;
        flex-direction: column;
        gap: 6px;
    }

    body.mobile-mode .explorer-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        background: var(--bg-input);
        border: 1px solid var(--border-steel);
    }

    body.mobile-mode .explorer-row:hover {
        outline-width: 1px;
    }

    body.mobile-mode .explorer-row td {
        display: block;
        padding: 8px;
    }

    body.mobile-mode .explorer-row .col-name {
        max-width: none;
        min-width: 0;
    }

    body.mobile-mode .explorer-row .col-actions {
        padding-left: 0;
        text-align: right;
    }

    body.mobile-mode .explorer-row .file-actions {
        display: flex;
        gap: 4px;
    }

    body.mobile-mode .file-title {
        grid-template-columns: 22px minmax(0, 1fr);
        gap: 8px;
    }

    body.mobile-mode .explorer-row .file-name {
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    body.mobile-mode .action-btn {
        width: 32px;
        min-width: 32px;
        height: 32px;
        padding: 0;
    }

    body.mobile-mode .view-grid {
        grid-auto-flow: row;
        grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
        grid-auto-rows: 132px;
        justify-content: stretch;
        gap: 8px;
    }

    body.mobile-mode .file-grid-card {
        min-height: 132px;
        aspect-ratio: auto;
        padding: 10px;
    }

    body.mobile-mode .file-card-preview {
        height: 60px;
        font-size: 2.6rem;
    }

    body.mobile-mode.share-page .share-card {
        padding: 12px;
    }

    body.mobile-mode.share-page .explorer-toolbar {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body.mobile-mode.share-page .toolbar-left {
        grid-column: 1 / -1;
    }

    body.mobile-mode.share-page .share-card h1 {
        font-size: 1.15rem !important;
    }
}


/* Extra dense phone pass */
@media (max-width: 760px) {
    body.mobile-mode main {
        padding: 6px;
    }

    body.mobile-mode header {
        padding: 7px 8px;
        border-bottom-width: 2px;
    }

    body.mobile-mode .logo {
        font-size: 0.92rem;
    }

    body.mobile-mode .logo i {
        font-size: 0.95rem;
    }

    body.mobile-mode .user-nav .btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        min-height: 30px;
        padding: 0 !important;
        padding-top: 1px !important; /* Offset bottom border of 3px */
        border-width: 1px;
        border-bottom-width: 3px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    body.mobile-mode .glass-card {
        padding: 8px;
    }

    body.mobile-mode .dashboard-grid {
        gap: 6px;
    }

    body.mobile-mode .explorer-sidebar {
        padding: 7px;
        gap: 6px;
    }

    body.mobile-mode .explorer-nav {
        gap: 5px;
    }

    body.mobile-mode .explorer-nav-item {
        justify-content: center;
        width: 36px;
        min-width: 36px;
        height: 32px;
        padding: 0;
        gap: 0;
        font-size: 0.74rem;
    }

    body.mobile-mode .explorer-nav-item span {
        display: none;
    }

    body.mobile-mode .explorer-nav-item.active {
        width: auto;
        min-width: max-content;
        padding: 0 10px;
        gap: 7px;
    }

    body.mobile-mode .explorer-nav-item.active span {
        display: inline;
        max-width: 132px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body.mobile-mode .explorer-nav-item i {
        width: auto;
        font-size: 0.92rem;
    }

    body.mobile-mode .storage-panel {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding-top: 6px;
    }

    body.mobile-mode .storage-stats-container {
        font-size: 0.7rem;
        gap: 5px;
        padding-top: 6px;
    }

    body.mobile-mode .storage-meta {
        display: contents;
    }

    body.mobile-mode .storage-meta span {
        font-size: 0.68rem;
    }

    body.mobile-mode .explorer-main {
        padding: 8px;
        gap: 8px;
        min-height: calc(100vh - 270px);
    }

    body.mobile-mode .explorer-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px;
        padding-bottom: 7px;
    }

    body.mobile-mode .new-dropdown-wrapper {
        width: auto;
    }

    body.mobile-mode .new-dropdown-wrapper button,
    body.mobile-mode #btn-new-dropdown {
        width: auto !important;
        min-width: 76px;
        height: 30px;
        padding: 0 10px !important;
        font-size: 0.74rem;
        border-bottom-width: 3px;
    }

    body.mobile-mode .dropdown-menu {
        left: auto;
        right: 0;
        width: min(260px, calc(100vw - 24px));
        min-width: 0;
    }

    body.mobile-mode .dropdown-item {
        padding: 10px 12px;
        font-size: 0.78rem;
    }

    body.mobile-mode .explorer-toolbar {
        grid-template-columns: 32px minmax(0, 1fr) 68px;
        gap: 6px;
        padding: 6px;
        border-width: 1px;
    }

    body.mobile-mode #btn-refresh-files {
        width: 32px;
        height: 32px;
        border-width: 1px;
        border-bottom-width: 3px;
        gap: 0 !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 !important;
        padding-top: 1px !important; /* Offset bottom border of 3px */
    }

    body.mobile-mode .search-box input {
        height: 32px;
        padding-left: 28px;
        font-size: 0.74rem;
        border-width: 1px;
    }

    body.mobile-mode .search-box i {
        left: 9px;
        font-size: 0.78rem;
    }

    body.mobile-mode .view-toggle-group {
        width: 68px;
        height: 32px;
        justify-content: flex-start;
        border-width: 1px;
        padding: 1px;
    }

    body.mobile-mode .view-toggle-btn {
        flex: 0 0 32px;
        min-width: 32px;
        height: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    body.mobile-mode .explorer-table tbody {
        gap: 5px;
    }

    body.mobile-mode .explorer-row {
        min-height: 54px;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    body.mobile-mode .explorer-row td {
        padding: 6px;
        font-size: 0.78rem;
    }

    body.mobile-mode .file-title {
        grid-template-columns: 20px minmax(0, 1fr);
        gap: 6px;
        min-height: 24px;
    }

    body.mobile-mode .explorer-row .file-icon {
        width: 20px;
        height: 20px;
        font-size: 1rem;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.mobile-mode .explorer-row .file-name {
        font-size: 0.82rem;
        line-height: 1.18;
        -webkit-line-clamp: 2;
    }

    body.mobile-mode .explorer-row .file-actions {
        gap: 3px;
    }

    body.mobile-mode .action-btn {
        width: 28px;
        min-width: 28px;
        height: 28px;
        border-width: 1px;
        font-size: 0.72rem;
    }

    body.mobile-mode .view-grid {
        grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
        grid-auto-rows: 108px;
        gap: 6px;
    }

    body.mobile-mode .file-grid-card {
        min-height: 108px;
        padding: 8px;
    }

    body.mobile-mode .file-card-preview {
        height: 50px;
        font-size: 2rem;
        margin-bottom: 5px;
    }

    body.mobile-mode .file-card-name {
        font-size: 0.76rem;
    }

    body.mobile-mode .file-card-info {
        font-size: 0.68rem;
    }
}

/* Profile Dropdown styling */
.profile-dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.profile-dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--bg-panel);
    border: 3px solid var(--border-steel);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95);
    z-index: 1000;
    min-width: 220px;
    display: none;
    flex-direction: column;
    padding: 6px 0;
    overflow: hidden;
    animation: dropdownFadeIn 0.15s cubic-bezier(0, 0, 0.2, 1) forwards;
}

.profile-dropdown-menu.show {
    display: flex;
}

.profile-dropdown-item {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
    transition: all var(--transition-snappy);
    box-sizing: border-box;
}

.profile-dropdown-item i {
    color: var(--accent-bronze);
    width: 20px;
    text-align: center;
    font-size: 0.95rem;
}

.profile-dropdown-item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.profile-dropdown-item.danger {
    color: #f87171;
}

.profile-dropdown-item.danger i {
    color: var(--led-red);
}

.profile-dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.08);
    color: #ff8787;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Adjust dropdown alignment and responsiveness in mobile-mode */
body.mobile-mode .profile-dropdown-wrapper {
    width: 100%;
}

body.mobile-mode #btn-profile-toggle {
    width: 100%;
    justify-content: center;
}

body.mobile-mode .profile-dropdown-menu {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border-radius: 0;
    border: 4px solid var(--border-steel);
    border-bottom: none;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.95);
    animation: dropdownSlideUp 0.2s cubic-bezier(0, 0, 0.2, 1) forwards;
}

@keyframes dropdownSlideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}
/* Mobile header profile button alignment fix */
body.mobile-mode header .profile-dropdown-wrapper {
    width: auto;
    flex: 0 0 auto;
    display: inline-flex;
}

body.mobile-mode header #btn-profile-toggle {
    width: 44px;
    min-width: 44px;
    height: 30px;
    min-height: 30px;
    padding: 0 !important;
    gap: 2px;
    align-items: center;
    justify-content: center;
}

body.mobile-mode header #btn-profile-toggle .profile-btn-text {
    display: none;
}

body.mobile-mode header #btn-profile-toggle i,
body.mobile-mode header #btn-profile-toggle svg {
    transform: none !important;
}

body.mobile-mode header #btn-profile-toggle .fa-chevron-down {
    margin-left: 0 !important;
    font-size: 0.62rem !important;
}

/* Toast notifications */
#toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 380px;
    width: 100%;
}

.toast {
    pointer-events: auto;
    background: var(--bg-panel);
    border: 2px solid var(--border-steel);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: toast-in 0.25s ease-out;
    word-break: break-word;
}

.toast.toast-out {
    animation: toast-out 0.25s ease-in forwards;
}

.toast i {
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.toast-success { border-left: 4px solid var(--led-green); }
.toast.toast-error { border-left: 4px solid var(--led-red); }
.toast.toast-info { border-left: 4px solid var(--accent-blue); }

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ==========================================================================
   SECURE OFFICE WORKSPACE (Docs, Sheets, Slides)
   ========================================================================== */
#workspace-office {
    font-family: 'Space Grotesk', sans-serif;
}

#workspace-office select,
#workspace-office input,
#workspace-office textarea {
    border-radius: var(--border-radius-heavy);
    font-family: inherit;
}

/* Sidebar elements */
.ws-sidebar-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--bg-panel);
    border: 2px solid var(--border-steel);
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition-snappy);
    margin-bottom: 4px;
}

.ws-sidebar-item:hover {
    background: var(--bg-header);
}

.ws-sidebar-item.active {
    border-color: var(--accent-bronze);
    background: var(--bg-input);
    outline: 2px solid var(--accent-bronze);
    outline-offset: -2px;
}

.ws-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 2px 4px;
    font-size: 0.8rem;
    transition: color var(--transition-snappy);
}

.ws-action-btn:hover {
    color: var(--accent-bronze);
}

/* Spreadsheet Grid table */
#ws-sheet-table th, 
#ws-sheet-table td {
    outline: none;
}

#ws-sheet-table td:focus {
    outline: 3px solid var(--accent-bronze);
    outline-offset: -3px;
}

/* Presentation Slides styles */
.ws-slide-thumb {
    transition: border-color var(--transition-snappy);
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.ws-slide-thumb:hover {
    border-color: var(--border-steel-light) !important;
}

.ws-slide-thumb.active {
    border-color: var(--accent-bronze) !important;
    outline: 2px solid var(--accent-bronze);
}

.ws-slide-element {
    transition: none; /* Instant feedback when dragging/resizing */
}

.ws-slide-element.selected {
    box-shadow: 0 0 15px rgba(217, 119, 6, 0.4);
}

.ws-resize-handle {
    border: 1px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}

/* Fullscreen Presentation animations */
@keyframes fadeInSlide {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

#pres-fullscreen-content.fade {
    animation: fadeInSlide 0.3s ease-out forwards;
}

#pres-fullscreen-content.slide {
    animation: slideInRight 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

#pres-fullscreen-content.none {
    animation: none;
}

/* Scrollbar adjustment for dark panel content */
#workspace-office-sidebar::-webkit-scrollbar,
#workspace-office-file-list::-webkit-scrollbar,
#ws-slide-thumbnails::-webkit-scrollbar,
#prop-text-content::-webkit-scrollbar {
    width: 6px;
}

#workspace-office-sidebar::-webkit-scrollbar-thumb,
#workspace-office-file-list::-webkit-scrollbar-thumb,
#ws-slide-thumbnails::-webkit-scrollbar-thumb,
#prop-text-content::-webkit-scrollbar-thumb {
    background: var(--border-steel);
}

/* Zero-Knowledge Office Upgrades */
.ws-type-card {
    border-radius: 0px !important;
}
.ws-type-card:hover {
    border-color: var(--accent-bronze) !important;
    background: var(--bg-header) !important;
}
.ws-type-card.active {
    border-color: var(--accent-bronze) !important;
    background: rgba(217, 119, 6, 0.1) !important;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.2);
}

.btn.active, .btn-secondary.active {
    background-color: var(--accent-bronze) !important;
    border-color: var(--accent-bronze-dark) !important;
    color: #ffffff !important;
}

#pres-fullscreen-laser {
    animation: laser-pulse 0.8s infinite alternate;
}
@keyframes laser-pulse {
    from { transform: translate(-50%, -50%) scale(1); opacity: 0.9; }
    to { transform: translate(-50%, -50%) scale(1.4); opacity: 0.6; }
}
