:root {
  color-scheme: light;
  --ink: #172333;
  --muted: #778396;
  --line: #e9edf3;
  --blue: #1478e8;
  --blue-dark: #095fc4;
  --blue-soft: #eef6ff;
  --canvas: #f5f8fc;
  --white: #fff;
  --shadow: 0 24px 70px rgba(31, 64, 105, .11);
  font-family: Manrope, Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--canvas); color: var(--ink); font-size: 14px; }
button, input { font: inherit; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 4; display: flex; flex-direction: column; width: 248px; padding: 25px 17px 17px; background: #fff; border-right: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 10px; width: fit-content; color: var(--ink); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-image { display: inline-flex; width: 48px; height: 42px; overflow: hidden; align-items: center; justify-content: center; border-radius: 12px; background: #fff; }
.brand-image img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 52%; }
.brand-name { font-size: 19px; font-weight: 800; letter-spacing: -.8px; }
.upload-button { margin-top: 36px; min-height: 48px !important; width: 100%; justify-content: center; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 42px; padding: 0 16px; border: 1px solid transparent; border-radius: 11px; font-size: 13px; font-weight: 700; transition: background .16s ease, border-color .16s ease, transform .16s ease; }
.button:active { transform: translateY(1px); }
.button svg, .nav-item svg, .search-box svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.button-primary { color: #fff; background: linear-gradient(110deg, #138eea, #1765df); box-shadow: 0 8px 17px rgba(20, 120, 232, .17); }
.button-primary:hover { background: linear-gradient(110deg, #077bda, #1059c9); }
.button-secondary { color: #435267; background: #fff; border-color: #dfe6ef; box-shadow: 0 1px 2px rgba(25, 47, 72, .025); }
.button-secondary:hover { border-color: #a9c9ed; background: #f8fbff; }
.button-danger { color: #fff; background: linear-gradient(110deg, #e4545a, #ca3541); box-shadow: 0 6px 14px rgba(202, 53, 65, .13); }
.button-danger:hover { background: linear-gradient(110deg, #d9474f, #b92d39); }
.button-quiet { color: #738095; background: transparent; border-color: transparent; }
.button-quiet:hover { color: var(--ink); background: #f1f4f8; }
.button-small { min-height: 32px; padding: 0 11px; border-radius: 8px; font-size: 11px; }
.button-wide { width: 100%; }
.side-nav { display: grid; gap: 5px; margin-top: 27px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; height: 44px; padding: 0 13px; border: 0; border-radius: 10px; color: #748195; background: transparent; text-align: left; font-size: 13px; font-weight: 600; }
.nav-item:hover { color: var(--ink); background: #f6f8fb; }
.nav-item.active { color: #126bd2; background: var(--blue-soft); }
.nav-item svg { width: 18px; height: 18px; }
.sidebar-spacer { flex: 1; }
.storage-card { padding: 14px 13px 13px; border: 1px solid #edf1f6; border-radius: 13px; background: #fbfcfe; }
.storage-heading { display: flex; align-items: center; justify-content: space-between; font-size: 11px; font-weight: 700; }
.storage-heading span:last-child { color: var(--blue); }
.progress-track { height: 5px; margin: 11px 0 8px; overflow: hidden; border-radius: 9px; background: #e7edf5; }
.progress-track progress { display: block; width: 100%; height: 100%; border: 0; appearance: none; background: transparent; }
.progress-track progress::-webkit-progress-bar { border-radius: inherit; background: #e7edf5; }
.progress-track progress::-webkit-progress-value { border-radius: inherit; background: linear-gradient(90deg, #13afe3, #1468dd); transition: width .25s ease; }
.progress-track progress::-moz-progress-bar { border-radius: inherit; background: linear-gradient(90deg, #13afe3, #1468dd); }
.storage-card p { margin: 0; }
.user-identity { margin-top: 18px !important; max-width: 100%; overflow: hidden; color: #344258; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.storage-card .button { margin-top: 9px; }

.main-area { display: flex; flex-direction: column; min-height: 100vh; width: calc(100% - 248px); margin-left: 248px; }
.topbar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; min-height: 72px; padding: 0 4.2vw; border-bottom: 1px solid rgba(231, 236, 243, .88); background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); }
.search-box { display: flex; align-items: center; width: min(430px, 52vw); height: 40px; gap: 10px; padding: 0 12px; border: 1px solid #edf0f5; border-radius: 10px; background: #f8fafd; color: #a2adbb; }
.search-box:focus-within { border-color: #bad5f3; background: white; box-shadow: 0 0 0 3px rgba(20, 120, 232, .07); }
.search-box svg { width: 17px; height: 17px; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #a3afbf; }
.search-shortcut { padding: 2px 6px; border: 1px solid #e7ecf2; border-radius: 5px; color: #9aa5b3; font-size: 10px; white-space: nowrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.top-user-name { max-width: 140px; overflow: hidden; color: #68768a; font-size: 12px; text-overflow: ellipsis; }
.avatar { display: grid; width: 35px; height: 35px; place-items: center; border: 1px solid #dce9f9; border-radius: 50%; color: #1476dc; background: #eef6ff; font-size: 12px; font-weight: 800; }
.mobile-brand { display: none; }
.content-wrap { width: min(1160px, 100%); flex: 1; margin: 0 auto; padding: 43px 4.2vw 54px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 26px; }
.eyebrow { margin: 0 0 7px; color: #8b98a9; font-size: 10px; font-weight: 800; letter-spacing: 1.3px; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(24px, 3vw, 32px); font-weight: 800; letter-spacing: -1.2px; }
.heading-actions { display: flex; gap: 9px; }
.breadcrumbs { display: flex; align-items: center; gap: 7px; margin-top: 9px; color: #8794a5; font-size: 11px; }
.breadcrumbs button { padding: 0; border: 0; color: #8794a5; background: none; font-size: inherit; }
.breadcrumbs button:hover, .breadcrumbs button.current { color: #2376d5; }
.breadcrumbs .crumb-sep { color: #bdc6d1; }
.view-toolbar { display: flex; align-items: center; justify-content: space-between; min-height: 42px; margin: -10px 0 11px; }
.view-count { color: #8a96a6; font-size: 11px; }
.view-switcher { display: inline-flex; gap: 3px; padding: 3px; border: 1px solid #e7edf4; border-radius: 10px; background: #fff; }
.view-button { display: inline-flex; min-height: 32px; align-items: center; justify-content: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 7px; color: #7d8999; background: transparent; font-size: 11px; font-weight: 700; }
.view-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.view-button.active { color: #126bd2; background: #eef6ff; }
.selection-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: -2px 0 12px; padding: 9px 12px; border: 1px solid #dceafa; border-radius: 11px; color: #31567e; background: #f2f8ff; }
.selection-count { font-size: 12px; font-weight: 700; }
.selection-actions { display: flex; align-items: center; gap: 6px; }
.selection-actions .button { gap: 6px; }
.selection-actions .button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.select-checkbox { width: 18px; height: 18px; margin: 0; accent-color: #1674dc; cursor: pointer; }
.row-select { flex: 0 0 auto; }
.tile-select { position: absolute; top: 10px; left: 10px; z-index: 1; width: 22px; height: 22px; padding: 2px; border: 1px solid rgba(28, 49, 72, .16); border-radius: 6px; background: rgba(255, 255, 255, .92); box-shadow: 0 2px 8px rgba(25, 47, 72, .16); }
.gallery-card.selected { border-color: #68a5e8; box-shadow: 0 0 0 2px rgba(22, 116, 220, .17); }
.item-row.selected { background: #f2f8ff; }
.drop-zone { position: relative; min-height: 315px; overflow: hidden; border: 1px solid #e9eef4; border-radius: 15px; background: #fff; box-shadow: 0 8px 26px rgba(31, 64, 105, .035); }
.drop-zone.gallery-mode { overflow: visible; padding: 13px; }
.drop-zone.gallery-mode .table-head { display: none; }
.table-head { display: grid; grid-template-columns: minmax(200px, 1fr) 150px 160px 72px; align-items: center; min-height: 47px; padding: 0 21px; border-bottom: 1px solid #eef1f5; color: #96a1af; font-size: 10px; font-weight: 700; letter-spacing: .25px; }
.table-actions-head { text-align: right; }
.item-list { display: grid; }
.item-list.gallery-view { display: block; columns: 205px 4; column-gap: 12px; }
.gallery-card { display: inline-block; width: 100%; margin: 0 0 12px; overflow: hidden; break-inside: avoid; border: 1px solid #edf0f4; border-radius: 12px; background: #fff; box-shadow: 0 4px 14px rgba(31, 64, 105, .035); transition: border-color .15s ease, box-shadow .15s ease; }
.gallery-card:hover { border-color: #d7e5f4; box-shadow: 0 8px 22px rgba(31, 64, 105, .08); }
.gallery-preview { position: relative; display: grid; min-height: 120px; max-height: 390px; place-items: center; overflow: hidden; background: #f2f6fa; }
.gallery-image { display: block; width: 100%; max-height: 390px; object-fit: cover; }
.gallery-file-icon { display: grid; width: 100%; min-height: 142px; place-items: center; color: #4288ce; background: linear-gradient(145deg, #f2f8ff, #f9fbfd); }
.gallery-file-icon.folder { color: #dfa12c; background: linear-gradient(145deg, #fff8ec, #fffdf9); }
.gallery-file-icon:is(button) { padding: 0; border: 0; font: inherit; cursor: pointer; }
.folder-card, .folder-row { cursor: pointer; }
.gallery-file-icon svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.gallery-details { display: flex; min-width: 0; align-items: center; gap: 7px; padding: 9px 10px; }
.gallery-name { min-width: 0; flex: 1; overflow: hidden; padding: 0; border: 0; color: #344256; background: none; font-size: 11px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.gallery-name:disabled { cursor: default; opacity: 1; }
.gallery-name.openable { cursor: pointer; }
.gallery-name.openable:hover { color: #126bd2; }
.gallery-meta { flex: 0 0 auto; color: #8a96a6; font-size: 10px; }
.gallery-actions { display: flex; flex: 0 0 auto; gap: 1px; }
.gallery-actions .icon-button { width: 27px; height: 27px; }
.item-row { display: grid; grid-template-columns: minmax(200px, 1fr) 150px 160px 72px; align-items: center; min-height: 62px; padding: 0 21px; border-bottom: 1px solid #f0f3f6; transition: background .13s ease; }
.item-row:last-child { border-bottom: 0; }
.item-row:hover { background: #fbfdff; }
.item-name-cell { display: flex; align-items: center; min-width: 0; gap: 12px; }
.file-icon { display: grid; width: 35px; height: 35px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #227bd7; background: #eef6ff; }
.file-icon.folder { color: #df9c22; background: #fff7e9; }
.file-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.item-name { overflow: hidden; padding: 0; border: 0; color: #27374a; background: none; font: inherit; font-size: 12px; font-weight: 700; text-align: left; text-overflow: ellipsis; white-space: nowrap; }
.item-name.openable { cursor: pointer; }
.item-name.openable:hover { color: #126bd2; }
.item-meta { color: #8a96a6; font-size: 11px; }
.row-actions { display: flex; justify-content: flex-end; gap: 4px; opacity: .72; }
.icon-button { display: grid; width: 30px; height: 30px; place-items: center; border: 0; border-radius: 8px; color: #8b98a8; background: transparent; }
.icon-button:hover { color: #1d6fcc; background: #eff6fd; }
.icon-button.danger:hover { color: #d64b50; background: #fff1f0; }
.icon-button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.empty-state { display: flex; align-items: center; flex-direction: column; padding: 46px 16px 42px; text-align: center; }
.empty-visual { display: grid; width: 92px; height: 76px; place-items: center; border-radius: 22px; background: linear-gradient(145deg, #f0f8ff, #f8fbff); }
.empty-visual svg { width: 70px; height: 55px; fill: none; stroke: #3989db; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.empty-state h2 { margin: 19px 0 5px; font-size: 17px; letter-spacing: -.4px; }
.empty-state p { margin: 0 0 19px; font-size: 12px; }
.drop-overlay { position: absolute; inset: 0; display: grid; place-items: center; border: 2px dashed #438fe0; border-radius: 15px; background: rgba(239, 247, 255, .94); }
.drop-message { padding: 13px 20px; border: 1px solid #d3e7fb; border-radius: 10px; color: #126bd2; background: #fff; font-weight: 800; }
.upload-status { min-height: 22px; padding-top: 10px; color: #76859a; font-size: 11px; }
.site-footer { padding: 18px 4.2vw 14px; border-top: 1px solid #e9edf2; background: rgba(255, 255, 255, .73); }
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.site-footer nav a { color: #758296; font-size: 10px; }
.footer-bottom { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 11px; }
.contact-link { color: #52637a; font-size: 10px; }
.copyright { color: #afb7c1; font-size: 9px; }

.admin-heading { align-items: flex-end; }
.admin-heading .muted { margin: 7px 0 0; font-size: 12px; }
.admin-users-list { display: grid; gap: 12px; }
.admin-user-card { overflow: hidden; padding: 17px 19px; border: 1px solid #e9eef4; border-radius: 14px; background: #fff; box-shadow: 0 8px 26px rgba(31, 64, 105, .035); }
.admin-user-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.admin-identity strong { display: block; color: #293a50; font-size: 13px; }
.admin-identity span { display: block; margin-top: 3px; color: #9ba6b4; font-size: 10px; }
.admin-user-usage { color: #65758a; font-size: 11px; text-align: right; }
.admin-user-usage strong { color: #35475e; }
.grant-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 15px; padding-top: 14px; border-top: 1px solid #eef2f6; }
.grant-form-label { color: #78869a; font-size: 10px; }
.grant-input { width: 72px; height: 34px; padding: 0 8px; border: 1px solid #e1e7ef; border-radius: 8px; color: #33445b; outline: 0; }
.grant-input:focus { border-color: #8bb9ed; box-shadow: 0 0 0 3px rgba(20, 120, 232, .07); }
.grant-days-input { width: 82px; }
.grant-unit { margin-left: -3px; color: #8490a0; font-size: 10px; }
.active-grants { display: grid; gap: 6px; margin-top: 12px; }
.grant-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 8px; color: #54657b; background: #f6f9fc; font-size: 10px; }
.grant-row strong { color: #286bb2; }
.admin-empty { padding: 25px; border: 1px solid #e9eef4; border-radius: 14px; color: var(--muted); background: #fff; }
.admin-table-head { grid-template-columns: minmax(160px, 1fr) 160px 130px 165px 94px; }
.admin-user-row { display: grid; grid-template-columns: minmax(160px, 1fr) 160px 130px 165px 94px; align-items: center; min-height: 65px; padding: 0 21px; border-bottom: 1px solid #f0f3f6; color: #58677b; font-size: 11px; }
.admin-user-row:last-child { border-bottom: 0; }
.admin-identity strong { display: block; color: #293a50; font-size: 12px; }
.admin-identity span { display: block; margin-top: 3px; color: #9ba6b4; font-size: 10px; }
.quota-form { display: flex; align-items: center; gap: 6px; }
.quota-input { width: 70px; height: 34px; padding: 0 8px; border: 1px solid #e1e7ef; border-radius: 8px; color: #33445b; outline: 0; }
.quota-input:focus { border-color: #8bb9ed; box-shadow: 0 0 0 3px rgba(20, 120, 232, .07); }
.quota-suffix { color: #8490a0; font-size: 10px; }
.admin-empty { padding: 30px; color: var(--muted); }

.auth-shell { display: grid; min-height: 100vh; place-items: center; padding: 25px; background: radial-gradient(ellipse at 50% 7%, #edf7ff 0, #f6f9fd 43%, #f4f7fb 100%); }
.auth-card { width: min(100%, 430px); padding: 38px 40px 29px; border: 1px solid rgba(223, 232, 242, .92); border-radius: 21px; background: #fff; box-shadow: var(--shadow); }
.brand-auth { margin-bottom: 35px; }
.auth-card .eyebrow { margin-bottom: 6px; }
.auth-card h1 { font-size: 26px; letter-spacing: -.9px; }
.auth-lead { margin: 8px 0 22px; font-size: 12px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 20px; padding: 4px; border-radius: 10px; background: #f3f6fa; }
.auth-tab { min-height: 36px; border: 0; border-radius: 8px; color: #7e8b9d; background: transparent; font-size: 12px; font-weight: 700; }
.auth-tab.active { color: #26374b; background: #fff; box-shadow: 0 1px 4px rgba(28, 53, 82, .11); }
.form-stack { display: grid; gap: 8px; }
.field-label { margin-top: 4px; color: #506074; font-size: 11px; font-weight: 700; }
.text-input { width: 100%; height: 43px; padding: 0 12px; border: 1px solid #e2e8f0; border-radius: 9px; color: #203147; background: #fff; outline: 0; font-size: 12px; }
.text-input:focus { border-color: #8dbbed; box-shadow: 0 0 0 3px rgba(20, 120, 232, .075); }
.form-stack .button { margin-top: 7px; }
.form-error { min-height: 14px; margin: 0; color: #ce454a; font-size: 11px; }
.consent { display: flex; align-items: flex-start; gap: 8px; margin-top: 8px; color: #718096; font-size: 10px; line-height: 1.55; }
.consent input { width: 14px; height: 14px; flex: 0 0 auto; margin: 1px 0 0; accent-color: var(--blue); }
.auth-footnote { margin: 20px 0 0; color: #a0aab7; font-size: 10px; line-height: 1.5; text-align: center; }
.verification-panel { margin-top: 17px; padding: 18px; border: 1px solid #e3ebf4; border-radius: 13px; background: #fbfdff; }
.verification-panel h2 { margin: 0 0 7px; font-size: 17px; letter-spacing: -.3px; }
.verification-panel > p { margin: 0 0 15px; font-size: 11px; line-height: 1.55; overflow-wrap: anywhere; }
.verification-panel > p strong { color: #35475e; }
.verification-code { font-size: 19px; font-weight: 700; letter-spacing: 6px; text-align: center; }
.verification-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 7px; margin-top: 10px; }
.form-success { color: #258052; }

.dialog-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 18px; background: rgba(20, 32, 47, .29); backdrop-filter: blur(5px); }
.dialog-card { position: relative; width: min(100%, 400px); padding: 27px; border: 1px solid #e7edf4; border-radius: 16px; background: white; box-shadow: 0 25px 70px rgba(18, 39, 64, .2); }
.dialog-card h2 { margin: 0 0 19px; font-size: 20px; letter-spacing: -.5px; }
.confirm-card { padding-top: 31px; }
.confirm-message { margin: -8px 0 3px; color: #6e7c8f; font-size: 13px; line-height: 1.55; }
.confirm-card .dialog-actions { margin-top: 22px; }
.dialog-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border: 0; border-radius: 8px; color: #8793a2; background: #f5f7fa; font-size: 22px; line-height: 1; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.cookie-notice { position: fixed; right: 20px; bottom: 18px; z-index: 8; display: flex; align-items: center; gap: 20px; width: min(600px, calc(100% - 40px)); padding: 14px 15px 14px 19px; border: 1px solid #e3eaf2; border-radius: 13px; background: #fff; box-shadow: 0 12px 36px rgba(30, 58, 91, .14); }
.cookie-notice p { flex: 1; margin: 0; color: #68778b; font-size: 10px; line-height: 1.5; }
.cookie-notice p a { white-space: nowrap; }
.toast { position: fixed; right: 22px; bottom: 21px; z-index: 20; max-width: min(400px, calc(100% - 44px)); padding: 12px 15px; transform: translateY(15px); border: 1px solid #dfebf8; border-radius: 10px; color: #30445d; background: #fff; box-shadow: 0 10px 30px rgba(28, 53, 82, .13); opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; font-size: 11px; }
.toast.visible { transform: translateY(0); opacity: 1; }

@media (max-width: 980px) {
  .sidebar { width: 215px; }
  .main-area { width: calc(100% - 215px); margin-left: 215px; }
  .content-wrap { padding-left: 3vw; padding-right: 3vw; }
  .topbar { padding-left: 3vw; padding-right: 3vw; }
  .table-head, .item-row { grid-template-columns: minmax(180px, 1fr) 105px 130px 65px; padding-left: 14px; padding-right: 14px; }
  .admin-table-head, .admin-user-row { grid-template-columns: minmax(130px, 1fr) 120px 95px 145px 72px; padding-left: 13px; padding-right: 13px; }
}
@media (max-width: 720px) {
  .auth-shell { padding: 16px; }
  .auth-card { padding: 29px 22px 23px; border-radius: 17px; }
  .brand-auth { margin-bottom: 25px; }
  .sidebar { position: relative; inset: auto; width: 100%; height: auto; flex-direction: row; align-items: center; gap: 10px; padding: 8px 15px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > .brand, .sidebar > .upload-button, .sidebar > .side-nav, .sidebar > .sidebar-spacer, .sidebar > .storage-card { display: none; }
  .app-shell { flex-direction: column; }
  .main-area { width: 100%; min-height: calc(100vh - 58px); margin: 0; }
  .topbar { position: static; min-height: 58px; gap: 9px; padding: 0 max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
  .mobile-brand { display: inline-flex; gap: 7px; flex: 0 0 auto; }
  .mobile-brand .brand-image { width: 37px; height: 33px; border-radius: 9px; }
  .mobile-brand .brand-name { font-size: 16px; }
  .search-box { width: auto; flex: 1; height: 36px; gap: 6px; padding: 0 9px; }
  .search-shortcut { display: none; }
  .topbar-right { gap: 6px; }
  .mobile-admin-button { display: inline-flex; }
  .top-user-name { display: none; }
  .avatar { width: 31px; height: 31px; }
  .content-wrap { padding: 24px 12px 32px; }
  .page-heading { align-items: flex-start; flex-direction: column; gap: 15px; margin-bottom: 19px; }
  .heading-actions { width: 100%; }
  .heading-actions .button { flex: 1; padding: 0 10px; }
  .view-toolbar { min-height: 38px; margin: -8px 0 9px; }
  .selection-toolbar { align-items: flex-start; flex-direction: column; gap: 9px; padding: 10px; }
  .selection-actions { width: 100%; flex-wrap: wrap; }
  .selection-actions .button { flex: 1 1 auto; }
  .tile-select { top: 8px; left: 8px; width: 24px; height: 24px; }
  .view-button { min-height: 34px; padding: 0 9px; }
  .drop-zone.gallery-mode { padding: 8px; border-radius: 12px; }
  .item-list.gallery-view { columns: 2; column-gap: 8px; }
  .gallery-card { margin-bottom: 8px; border-radius: 10px; }
  .gallery-preview { min-height: 95px; max-height: 300px; }
  .gallery-image { max-height: 300px; }
  .gallery-details { flex-wrap: wrap; gap: 4px 6px; padding: 7px; }
  .gallery-name { font-size: 10px; }
  .gallery-meta { font-size: 9px; }
  .gallery-actions { margin-left: auto; }
  .gallery-actions .icon-button { width: 29px; height: 29px; }
  .table-head, .item-row { grid-template-columns: minmax(0, 1fr) 70px 27px; gap: 7px; padding: 0 12px; }
  .table-head { grid-template-columns: minmax(0, 1fr) 70px 27px; font-size: 9px; }
  .table-head span:nth-child(3), .item-row .item-date { display: none; }
  .item-row { min-height: 59px; }
  .file-icon { width: 32px; height: 32px; }
  .item-name-cell { gap: 8px; }
  .item-meta { font-size: 10px; }
  .row-actions { opacity: 1; }
  .row-actions .icon-button { width: 27px; height: 27px; }
  .site-footer { padding: 15px 14px; }
  .site-footer nav { gap: 10px 17px; }
  .footer-bottom { flex-wrap: wrap; gap: 8px 13px; }
  .admin-user-card { padding: 14px; }
  .admin-user-head { flex-direction: column; }
  .admin-user-usage { text-align: left; }
  .grant-row { align-items: flex-start; }
  .cookie-notice { right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100% - 24px); gap: 10px; padding: 12px; }
}
@media (max-width: 420px) {
  .auth-card { padding: 29px 23px 22px; }
  .search-box input { font-size: 11px; }
  .mobile-brand { gap: 5px; }
  .brand-name { font-size: 16px; }
  .mobile-brand .brand-image { width: 31px; height: 30px; }
  .heading-actions .button { gap: 6px; min-height: 39px; font-size: 11px; }
  .heading-actions .button svg { width: 17px; height: 17px; }
  .heading-actions .button { min-width: 0; font-size: 10px; }
  .gallery-meta { display: none; }
  .view-button { gap: 4px; padding: 0 7px; font-size: 10px; }
}
