:root {
    color-scheme: light;
    --bg: #f7f9fb;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: #ffffff;
    --text: #15171d;
    --muted: #68707f;
    --line: rgba(24, 30, 38, 0.1);
    --accent: #2563eb;
    --accent-2: #0ea5e9;
    --accent-3: #f5b84b;
    --danger: #b45309;
    --shadow: 0 18px 44px rgba(30, 41, 59, 0.12);
    --soft-shadow: 0 10px 24px rgba(30, 41, 59, 0.08);
    --radius: 8px;
    --sidebar-width: 292px;
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101114;
    --panel: rgba(30, 31, 35, 0.82);
    --panel-strong: #1d1e23;
    --text: #f3f5f7;
    --muted: #a8adb7;
    --line: rgba(255, 255, 255, 0.12);
    --accent: #60a5fa;
    --accent-2: #22d3ee;
    --accent-3: #f2c45d;
    --danger: #f59e0b;
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
    --soft-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.45;
    letter-spacing: 0;
    color: var(--text);
    background:
        linear-gradient(120deg, rgba(37, 99, 235, 0.12), transparent 34%),
        linear-gradient(240deg, rgba(14, 165, 233, 0.12), transparent 32%),
        var(--bg);
}

button,
input,
select {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

a {
    color: inherit;
    text-decoration: none;
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    border-right: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(20px);
    overflow-y: auto;
    transition: transform 180ms ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand strong,
.brand small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.brand small {
    color: var(--muted);
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: var(--radius);
    color: white;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: var(--soft-shadow);
}

.brand-mark.large {
    width: 64px;
    height: 64px;
    font-size: 28px;
}

.quick-actions {
    display: grid;
    gap: 10px;
    margin: 28px 0;
}

.primary-btn,
.ghost-btn,
.danger-btn,
.icon-btn {
    min-height: 42px;
    border-radius: var(--radius);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    font-weight: 700;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.primary-btn {
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

.ghost-btn,
.icon-btn {
    color: var(--text);
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid var(--line);
}

[data-theme="dark"] .ghost-btn,
[data-theme="dark"] .icon-btn {
    background: rgba(255, 255, 255, 0.06);
}

.danger-btn {
    color: white;
    background: var(--danger);
}

.primary-btn:hover,
.ghost-btn:hover,
.danger-btn:hover,
.icon-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--soft-shadow);
}

.compact {
    min-height: 36px;
    padding: 0 12px;
    font-size: 14px;
}

.wide {
    width: 100%;
}

.storage-meter {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.56);
}

[data-theme="dark"] .storage-meter {
    background: rgba(255, 255, 255, 0.05);
}

.meter-head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    color: var(--muted);
    font-size: 14px;
}

.meter-head strong {
    color: var(--text);
}

.meter-track {
    height: 9px;
    overflow: hidden;
    border-radius: var(--radius);
    background: rgba(104, 112, 127, 0.18);
}

.meter-track span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: var(--radius);
    background: linear-gradient(90deg, var(--accent), var(--accent-3), var(--accent-2));
    transition: width 240ms ease;
}

.storage-meter small {
    display: block;
    margin-top: 10px;
    color: var(--muted);
}

.filter-nav {
    display: grid;
    gap: 8px;
    margin: 24px 0;
}

.nav-pill {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 12px;
    border-radius: var(--radius);
    color: var(--muted);
    background: transparent;
    text-align: left;
}

.nav-pill:hover,
.nav-pill.active {
    color: var(--text);
    background: rgba(37, 99, 235, 0.12);
}

.stats-panel {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stats-panel div {
    min-width: 0;
    padding: 12px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.45);
}

[data-theme="dark"] .stats-panel div {
    background: rgba(255, 255, 255, 0.05);
}

.stats-panel span,
.stats-panel small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stats-panel span {
    font-weight: 800;
}

.stats-panel small {
    color: var(--muted);
    font-size: 12px;
}

.main-panel {
    min-width: 0;
    padding: 20px 24px 36px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px 0 16px;
    background: linear-gradient(180deg, var(--bg) 72%, transparent);
}

.nav-controls,
.top-actions,
.toolbar-left,
.toolbar-right,
.view-toggle,
.selection-bar,
.advanced-filters {
    display: flex;
    align-items: center;
    gap: 8px;
}

.icon-btn {
    width: 42px;
    padding: 0;
    font-size: 22px;
}

.logout-btn {
    font-size: 18px;
}

.breadcrumbs {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.breadcrumbs::-webkit-scrollbar {
    display: none;
}

.breadcrumbs button {
    flex: 0 0 auto;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
    background: transparent;
    border-radius: var(--radius);
    padding: 8px 10px;
}

.breadcrumbs button:hover {
    background: rgba(37, 99, 235, 0.1);
}

.breadcrumbs span {
    color: var(--muted);
}

.search-box {
    position: relative;
    display: block;
    width: 310px;
    max-width: 42vw;
}

.search-box span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

input,
select {
    width: 100%;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0 12px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.72);
    outline: none;
}

[data-theme="dark"] input,
[data-theme="dark"] select {
    background: rgba(255, 255, 255, 0.07);
}

input:focus,
select:focus {
    border-color: rgba(37, 99, 235, 0.8);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14);
}

.toolbar,
.advanced-filters,
.selection-bar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(18px);
}

.advanced-filters {
    justify-content: flex-start;
    flex-wrap: wrap;
}

.advanced-filters label,
.toolbar label {
    display: grid;
    gap: 4px;
    min-width: 116px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.advanced-filters input {
    min-height: 36px;
}

.view-toggle {
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .view-toggle {
    background: rgba(255, 255, 255, 0.05);
}

.view-toggle button {
    min-height: 32px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-size: 14px;
    font-weight: 700;
}

.view-toggle button.active {
    color: var(--text);
    background: var(--panel-strong);
    box-shadow: var(--soft-shadow);
}

.drop-zone {
    display: none;
    margin-bottom: 12px;
    padding: 20px;
    border: 2px dashed rgba(37, 99, 235, 0.38);
    border-radius: var(--radius);
    background: rgba(37, 99, 235, 0.08);
    text-align: center;
}

.drop-zone.active {
    display: block;
}

.drop-copy strong,
.drop-copy span {
    display: block;
}

.drop-copy span {
    color: var(--muted);
}

.selection-bar {
    align-items: center;
}

.selection-bar[hidden] {
    display: none;
}

.file-area {
    min-height: 420px;
}

.file-area.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 12px;
}

.file-card {
    position: relative;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: none;
    overflow: hidden;
    user-select: none;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
    content-visibility: auto;
    contain-intrinsic-size: 194px;
}

.file-card:hover,
.file-card.selected {
    transform: translateY(-2px);
    box-shadow: var(--soft-shadow);
    border-color: rgba(37, 99, 235, 0.45);
}

.file-area.soft-loading {
    opacity: 0.58;
    pointer-events: none;
    transition: opacity 120ms ease;
}

.thumb {
    height: 122px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.12)),
        rgba(255, 255, 255, 0.42);
    overflow: hidden;
}

[data-theme="dark"] .thumb {
    background:
        linear-gradient(135deg, rgba(96, 165, 250, 0.16), rgba(34, 211, 238, 0.14)),
        rgba(255, 255, 255, 0.05);
}

.thumb img,
.thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-symbol {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: white;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent-3));
    box-shadow: var(--soft-shadow);
}

.file-symbol.folder {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.file-symbol.pdf {
    background: linear-gradient(135deg, #315fbd, var(--accent-2));
}

.file-symbol.video {
    background: linear-gradient(135deg, #1d8fd7, #64c8f2);
}

.file-symbol.text {
    background: linear-gradient(135deg, #475569, #38bdf8);
}

.folder-icon {
    position: relative;
    width: 76px;
    height: 58px;
    display: block;
    border-radius: 6px;
    background: linear-gradient(135deg, #2f73ff, #44c7f5);
    box-shadow: var(--soft-shadow);
}

.folder-icon::before {
    content: "";
    position: absolute;
    left: 8px;
    top: -10px;
    width: 34px;
    height: 18px;
    border-radius: 6px 6px 0 0;
    background: #8ecbff;
}

.folder-icon span {
    position: absolute;
    inset: 14px 10px auto;
    height: 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.32);
}

.file-meta {
    min-width: 0;
    padding: 12px;
}

.file-name {
    min-height: 42px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-weight: 800;
}

.file-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.select-dot {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 22px;
    height: 22px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: var(--soft-shadow);
}

.file-card.selected .select-dot {
    background: var(--accent);
}

.list-view {
    display: block;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
}

.list-head,
.list-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 120px 120px 170px 122px;
    gap: 10px;
    align-items: center;
    min-height: 54px;
    padding: 0 14px;
}

.list-head {
    color: var(--muted);
    background: rgba(104, 112, 127, 0.08);
    font-size: 13px;
    font-weight: 800;
}

.list-row {
    border-top: 1px solid var(--line);
    user-select: none;
}

.list-row:hover,
.list-row.selected {
    background: rgba(37, 99, 235, 0.1);
}

.list-name {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.list-name span:last-child,
.list-row > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-symbol {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 6px;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    font-size: 12px;
    font-weight: 900;
}

.mini-symbol.folder-mini {
    background: transparent;
    border: 0;
}

.mini-folder-icon {
    position: relative;
    width: 28px;
    height: 22px;
    display: block;
    border-radius: 5px;
    background: linear-gradient(135deg, #2f73ff, #44c7f5);
}

.mini-folder-icon::before {
    content: "";
    position: absolute;
    left: 3px;
    top: -5px;
    width: 14px;
    height: 8px;
    border-radius: 4px 4px 0 0;
    background: #8ecbff;
}

.row-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.tiny-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid var(--line);
}

[data-theme="dark"] .tiny-btn {
    background: rgba(255, 255, 255, 0.07);
}

.empty-state,
.skeleton-grid {
    grid-column: 1 / -1;
}

.empty-state {
    min-height: 330px;
    display: grid;
    place-items: center;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
    padding: 28px;
    background: rgba(255, 255, 255, 0.42);
}

[data-theme="dark"] .empty-state {
    background: rgba(255, 255, 255, 0.04);
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 12px;
}

.skeleton-card {
    height: 192px;
    border-radius: var(--radius);
    background: linear-gradient(100deg, rgba(104, 112, 127, 0.12), rgba(104, 112, 127, 0.24), rgba(104, 112, 127, 0.12));
    background-size: 200% 100%;
    animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer {
    to {
        background-position: -200% 0;
    }
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 18px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 10, 12, 0.56);
    backdrop-filter: blur(10px);
}

.modal-panel {
    position: relative;
    z-index: 1;
    width: min(720px, 100%);
    max-height: 88vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border-radius: 6px;
    color: var(--text);
    background: rgba(104, 112, 127, 0.1);
    font-size: 22px;
}

.modal h2 {
    margin: 0 40px 14px 0;
}

.modal-body-field {
    display: grid;
    gap: 8px;
    margin: 16px 0;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.preview-frame {
    width: 100%;
    min-height: 420px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #0b0c0f;
}

.preview-frame img,
.preview-frame video,
.preview-frame iframe {
    display: block;
    width: 100%;
    height: 70vh;
    max-height: 680px;
    object-fit: contain;
    border: 0;
}

.preview-frame audio {
    width: 100%;
    margin: 120px 0;
}

.preview-text {
    min-height: 420px;
    max-height: 70vh;
    overflow: auto;
    margin: 0;
    padding: 18px;
    color: #f4f7fb;
    background: #111318;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.context-menu {
    position: fixed;
    z-index: 90;
    width: 188px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.context-menu button {
    width: 100%;
    min-height: 36px;
    padding: 0 10px;
    border-radius: 6px;
    color: var(--text);
    background: transparent;
    text-align: left;
}

.context-menu button:hover {
    background: rgba(37, 99, 235, 0.1);
}

.danger-text {
    color: var(--danger) !important;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100;
    display: grid;
    gap: 10px;
    width: min(360px, calc(100vw - 36px));
}

.toast {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    background: var(--panel-strong);
    box-shadow: var(--soft-shadow);
    animation: toast-in 180ms ease;
}

.toast.error {
    border-left-color: var(--danger);
}

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

.loader-screen {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: grid;
    place-items: center;
    background: var(--bg);
    transition: opacity 200ms ease, visibility 200ms ease;
}

.loader-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-card {
    width: 230px;
    padding: 24px;
    border-radius: var(--radius);
    text-align: center;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.loader-mark {
    width: 44px;
    height: 44px;
    display: inline-block;
    border: 4px solid rgba(37, 99, 235, 0.18);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 800ms linear infinite;
}

.loader-card strong,
.loader-card small {
    display: block;
    margin-top: 10px;
}

.loader-card small {
    color: var(--muted);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.progress-wrap {
    display: grid;
    gap: 10px;
}

.progress-line {
    height: 10px;
    overflow: hidden;
    border-radius: var(--radius);
    background: rgba(104, 112, 127, 0.16);
}

.progress-line span {
    display: block;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 120ms linear;
}

.login-page {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(980px, 100%);
    min-height: 620px;
    display: grid;
    grid-template-columns: 1fr 420px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.login-visual {
    display: grid;
    place-items: center;
    padding: 42px;
    color: white;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(24, 31, 38, 0.88)),
        linear-gradient(35deg, rgba(14, 165, 233, 0.68), transparent);
}

.visual-panel {
    max-width: 420px;
}

.visual-panel h1 {
    margin: 24px 0 8px;
    font-size: 42px;
    line-height: 1.08;
}

.visual-panel p {
    margin: 0;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.82);
}

.mini-files {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 34px;
}

.mini-files span {
    min-height: 68px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.14);
    font-weight: 900;
}

.login-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px;
    background: var(--panel-strong);
}

.mobile-brand {
    display: none;
    margin-bottom: 24px;
}

.login-card h2 {
    margin: 0 0 8px;
    font-size: 32px;
}

.login-card p {
    margin: 0 0 24px;
    color: var(--muted);
}

.login-card form {
    display: grid;
    gap: 16px;
}

.login-card label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 700;
}

.remember-row {
    grid-template-columns: auto 1fr;
    align-items: center;
    color: var(--text) !important;
    font-weight: 600 !important;
}

.remember-row input {
    width: 18px;
    min-height: 18px;
}

.form-alert {
    margin-bottom: 18px;
    padding: 12px;
    border: 1px solid rgba(180, 83, 9, 0.24);
    border-radius: var(--radius);
    color: var(--danger);
    background: rgba(180, 83, 9, 0.08);
}

body.sidebar-open .sidebar {
    transform: translateX(0);
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 70;
        width: min(var(--sidebar-width), 86vw);
        transform: translateX(-105%);
        box-shadow: var(--shadow);
    }

    .topbar {
        grid-template-columns: auto 1fr;
    }

    .top-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .search-box {
        width: 100%;
        max-width: none;
    }
}

@media (min-width: 1081px) {
    #mobileMenuBtn {
        display: none;
    }
}

@media (max-width: 820px) {
    .main-panel {
        padding: 12px;
    }

    .toolbar,
    .selection-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-left,
    .toolbar-right,
    .selection-bar {
        flex-wrap: wrap;
    }

    .file-area.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(142px, 1fr));
    }

    .thumb {
        height: 104px;
    }

    .list-head {
        display: none;
    }

    .list-row {
        grid-template-columns: 1fr auto;
        min-height: auto;
        gap: 8px;
        padding: 12px;
    }

    .list-row > span:not(.list-name),
    .list-row > .row-type,
    .list-row > .row-size,
    .list-row > .row-date {
        display: none;
    }

    .row-actions {
        align-self: start;
    }

    .login-shell {
        min-height: auto;
        grid-template-columns: 1fr;
    }

    .login-visual {
        display: none;
    }

    .mobile-brand {
        display: flex;
    }

    .login-card {
        padding: 28px;
    }
}

@media (max-width: 520px) {
    body {
        font-size: 15px;
    }

    .topbar {
        gap: 10px;
    }

    .nav-controls {
        order: 1;
    }

    .breadcrumbs {
        order: 2;
    }

    .top-actions {
        order: 3;
    }

    .advanced-filters label {
        width: calc(50% - 8px);
        min-width: 0;
    }

    .advanced-filters button {
        width: 100%;
    }

    .file-area.grid-view {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .file-name {
        min-height: 40px;
        font-size: 14px;
    }

    .file-detail {
        display: block;
    }

    .modal-panel {
        padding: 18px;
    }
}
