/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-sidebar: #f0f4f9;
    --bg-hover: #e8eaed;
    --bg-selected: #c2e7ff;
    --bg-selected-hover: #a8d8f0;
    --bg-card: #ffffff;
    --bg-modal: #ffffff;
    --bg-overlay: rgba(0,0,0,0.4);
    --text-primary: #1f1f1f;
    --text-secondary: #444746;
    --text-tertiary: #70757a;
    --text-on-primary: #ffffff;
    --border-color: #e0e0e0;
    --border-light: #f0f0f0;
    --accent: #1a73e8;
    --accent-hover: #1557b0;
    --accent-light: #e8f0fe;
    --danger: #d93025;
    --danger-hover: #b3261e;
    --success: #188038;
    --warning: #f9ab00;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-xl: 0 8px 32px rgba(0,0,0,0.2);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    --sidebar-width: 256px;
    --header-height: 64px;
    --transition: 150ms ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"] {
    --bg-primary: #1e1e1e;
    --bg-secondary: #2d2d2d;
    --bg-sidebar: #282a2c;
    --bg-hover: #3c4043;
    --bg-selected: #004a77;
    --bg-selected-hover: #005a8f;
    --bg-card: #2d2d2d;
    --bg-modal: #2d2d2d;
    --bg-overlay: rgba(0,0,0,0.6);
    --text-primary: #e3e3e3;
    --text-secondary: #bdc1c6;
    --text-tertiary: #9aa0a6;
    --border-color: #3c4043;
    --border-light: #353535;
    --accent: #8ab4f8;
    --accent-hover: #aecbfa;
    --accent-light: #1a3a5c;
}

html { font-size: 14px; }
body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
}

/* ===== LAYOUT ===== */
.drive-layout {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-rows: var(--header-height) 1fr;
    height: 100vh;
}

/* ===== HEADER ===== */
.drive-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-primary);
    gap: 16px;
    z-index: 100;
}

.drive-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(var(--sidebar-width) - 32px);
    flex-shrink: 0;
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

.drive-logo svg { width: 36px; height: 36px; }

.search-bar {
    flex: 1;
    max-width: 720px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 10px 16px 10px 44px;
    border: none;
    border-radius: var(--radius-full);
    background: var(--bg-sidebar);
    font-size: 1rem;
    color: var(--text-primary);
    outline: none;
    transition: background var(--transition), box-shadow var(--transition);
}

.search-bar input:focus {
    background: var(--bg-primary);
    box-shadow: var(--shadow-md);
}

.search-bar .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-tertiary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

/* ===== BUTTONS ===== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    font-family: var(--font);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: var(--text-on-primary);
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-hover); }

.btn-danger {
    background: var(--danger);
    color: var(--text-on-primary);
}
.btn-danger:hover { background: var(--danger-hover); }

.btn-ghost {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition);
}
.btn-ghost:hover { background: var(--bg-hover); }

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: background var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); }

/* ===== SIDEBAR ===== */
.drive-sidebar {
    background: var(--bg-sidebar);
    padding: 12px;
    overflow-y: auto;
    border-right: 1px solid var(--border-light);
}

.sidebar-new-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    margin-bottom: 12px;
    background: var(--bg-primary);
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition);
    width: fit-content;
}
.sidebar-new-btn:hover { box-shadow: var(--shadow-md); }
.sidebar-new-btn svg { color: var(--text-primary); }

.sidebar-nav { list-style: none; }

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    margin: 1px 0;
    border-radius: var(--radius-full);
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition);
    user-select: none;
}
.sidebar-nav-item:hover { background: var(--bg-hover); }
.sidebar-nav-item.active {
    background: var(--bg-selected);
    color: var(--text-primary);
}
.sidebar-nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 12px;
}

.sidebar-label {
    padding: 12px 16px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
}

/* Folder tree */
.folder-tree { padding-left: 0; list-style: none; }
.folder-tree ul { list-style: none; padding-left: 20px; }

.tree-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    margin: 1px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.825rem;
    color: var(--text-secondary);
    transition: background var(--transition);
    user-select: none;
}
.tree-item:hover { background: var(--bg-hover); }
.tree-item.active { background: var(--bg-selected); color: var(--text-primary); }

.tree-toggle {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform var(--transition);
}
.tree-toggle.open { transform: rotate(90deg); }
.tree-toggle.empty { visibility: hidden; }

.tree-icon { width: 18px; height: 18px; flex-shrink: 0; color: var(--text-tertiary); }
.tree-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Property selector */
.property-selector {
    padding: 8px;
    margin-bottom: 4px;
}

.property-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-family: var(--font);
    cursor: pointer;
}

/* ===== MAIN CONTENT ===== */
.drive-main {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-primary);
}

/* Toolbar */
.drive-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    gap: 8px;
    border-bottom: 1px solid var(--border-light);
    min-height: 48px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    flex: 1;
    overflow: hidden;
}

.breadcrumb-item {
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: background var(--transition);
}
.breadcrumb-item:hover { background: var(--bg-hover); color: var(--text-primary); }
.breadcrumb-item.current { color: var(--text-primary); font-weight: 500; cursor: default; }
.breadcrumb-item.current:hover { background: transparent; }
.breadcrumb-sep { color: var(--text-tertiary); font-size: 0.75rem; }

.view-toggle { display: flex; gap: 2px; }

/* ===== FILE GRID ===== */
.drive-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
    padding: 0 4px;
}

.file-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.file-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), box-shadow var(--transition);
    overflow: hidden;
    user-select: none;
    position: relative;
}
.file-card:hover {
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}
.file-card.selected {
    border-color: var(--accent);
    background: var(--bg-selected);
}

.file-card-thumb {
    height: 148px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.file-card-thumb svg { width: 56px; height: 56px; }

.file-card-info {
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-card-icon { width: 24px; height: 24px; flex-shrink: 0; }
.file-card-name {
    font-size: 0.825rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.file-card-menu {
    opacity: 0;
    transition: opacity var(--transition);
}
.file-card:hover .file-card-menu { opacity: 1; }

/* Folder cards */
.folder-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    user-select: none;
}
.folder-card:hover {
    border-color: var(--border-color);
    background: var(--bg-secondary);
}
.folder-card.selected {
    border-color: var(--accent);
    background: var(--bg-selected);
}

.folder-card-icon { width: 24px; height: 24px; flex-shrink: 0; }
.folder-card-name {
    font-size: 0.875rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.folder-card-menu {
    opacity: 0;
    transition: opacity var(--transition);
}
.folder-card:hover .folder-card-menu { opacity: 1; }

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
}

/* ===== LIST VIEW ===== */
.file-list { width: 100%; }

.file-list-header {
    display: grid;
    grid-template-columns: 40px 1fr 160px 100px 100px 44px;
    padding: 8px 16px;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 1px solid var(--border-color);
}

.file-list-row {
    display: grid;
    grid-template-columns: 40px 1fr 160px 100px 100px 44px;
    padding: 8px 16px;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background var(--transition);
    font-size: 0.875rem;
}
.file-list-row:hover { background: var(--bg-secondary); }
.file-list-row.selected { background: var(--bg-selected); }

.file-list-row .file-icon { width: 24px; height: 24px; }
.file-list-row .file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list-row .file-meta { color: var(--text-tertiary); font-size: 0.8rem; }

/* ===== VISIBILITY BADGES ===== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-internal { background: #e8eaed; color: #5f6368; }
.badge-committee { background: #fef7e0; color: #b06000; }
.badge-owner { background: #e6f4ea; color: #137333; }
.badge-privilege { background: #fce8e6; color: #c5221f; }

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: var(--bg-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms, visibility 200ms;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal {
    background: var(--bg-modal);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    width: 90%;
    max-width: 540px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(20px);
    transition: transform 200ms;
}
.modal-overlay.active .modal { transform: translateY(0); }

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
}

.modal-body { padding: 20px 24px; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
}

/* Form elements */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 0.825rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--accent);
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    cursor: pointer;
}
.form-checkbox input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ===== CONTEXT MENU ===== */
.context-menu {
    position: fixed;
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    padding: 6px 0;
    z-index: 2000;
    display: none;
}
.context-menu.active { display: block; }

.context-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition);
}
.context-menu-item:hover { background: var(--bg-hover); }
.context-menu-item.danger { color: var(--danger); }
.context-menu-item svg { width: 18px; height: 18px; color: var(--text-tertiary); }
.context-menu-item.danger svg { color: var(--danger); }
.context-menu-divider { height: 1px; background: var(--border-light); margin: 4px 0; }

/* ===== DROP ZONE ===== */
.drop-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(26, 115, 232, 0.08);
    border: 3px dashed var(--accent);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
}
.drop-overlay.active { display: flex; }

.drop-message {
    background: var(--bg-primary);
    padding: 32px 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    text-align: center;
}
.drop-message svg { width: 48px; height: 48px; color: var(--accent); margin-bottom: 12px; }
.drop-message h3 { font-size: 1.1rem; margin-bottom: 4px; }
.drop-message p { color: var(--text-tertiary); font-size: 0.875rem; }

/* ===== UPLOAD PROGRESS ===== */
.upload-progress-panel {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 360px;
    background: var(--bg-modal);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    z-index: 800;
    display: none;
    overflow: hidden;
}
.upload-progress-panel.active { display: block; }

.upload-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    font-weight: 500;
    font-size: 0.9rem;
}

.upload-progress-list {
    max-height: 200px;
    overflow-y: auto;
}

.upload-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
}
.upload-item-name {
    flex: 1;
    font-size: 0.825rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.upload-item-status { font-size: 0.75rem; color: var(--text-tertiary); }
.upload-item-status.done { color: var(--success); }
.upload-item-status.error { color: var(--danger); }

.progress-bar {
    height: 3px;
    background: var(--bg-hover);
    border-radius: 2px;
    overflow: hidden;
    width: 80px;
}
.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 200ms;
}

/* ===== DETAIL PANEL ===== */
.detail-panel {
    width: 320px;
    border-left: 1px solid var(--border-light);
    background: var(--bg-primary);
    display: none;
    flex-direction: column;
    overflow-y: auto;
}
.detail-panel.active { display: flex; }

.detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-light);
}

.detail-title {
    font-size: 1rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-preview {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}
.detail-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.detail-meta {
    padding: 16px;
}
.detail-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
    font-size: 0.825rem;
}
.detail-meta-label { color: var(--text-tertiary); }
.detail-meta-value { color: var(--text-primary); font-weight: 500; text-align: right; }

.detail-actions {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 64px 32px;
    text-align: center;
}
.empty-state svg { width: 120px; height: 120px; color: var(--text-tertiary); opacity: 0.4; margin-bottom: 16px; }
.empty-state h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 8px; }
.empty-state p { color: var(--text-tertiary); font-size: 0.9rem; max-width: 360px; }

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.toast {
    background: #323232;
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    box-shadow: var(--shadow-lg);
    animation: toast-in 300ms ease, toast-out 300ms ease 2700ms forwards;
}

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

/* ===== AUTH PAGES ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
}

.auth-card {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 400px;
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    font-size: 0.9rem;
}

.auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--text-tertiary);
}
.auth-link a { color: var(--accent); text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }

.form-error {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* ===== SHARE PAGES ===== */
.share-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 24px;
}

.share-card {
    background: var(--bg-primary);
    padding: 40px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    width: 100%;
    max-width: 600px;
    text-align: center;
}

.share-card h2 { margin-bottom: 16px; }
.share-card p { color: var(--text-tertiary); margin-bottom: 24px; }

/* ===== NEW MENU (dropdown from + button) ===== */
.new-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-modal);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    padding: 6px 0;
    z-index: 600;
    display: none;
}
.new-menu.active { display: block; }

.new-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: background var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font);
}
.new-menu-item:hover { background: var(--bg-hover); }
.new-menu-item svg { width: 20px; height: 20px; color: var(--text-tertiary); }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .drive-layout { grid-template-columns: 1fr; }
    .drive-sidebar {
        position: fixed;
        left: -280px;
        top: var(--header-height);
        bottom: 0;
        width: 280px;
        z-index: 200;
        transition: left 200ms;
    }
    .drive-sidebar.open { left: 0; }
    .drive-logo { width: auto; }
    .file-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .folder-grid { grid-template-columns: 1fr; }
    .detail-panel { position: fixed; right: -320px; top: var(--header-height); bottom: 0; z-index: 200; transition: right 200ms; }
    .detail-panel.active { right: 0; }
}
