:root {
  color-scheme: dark;
  --bg: #08090d;
  --bg-soft: #0d0f15;
  --panel: rgba(18, 20, 28, .78);
  --panel-solid: #12141c;
  --line: rgba(255, 255, 255, .09);
  --line-bright: rgba(255, 255, 255, .16);
  --text: #f7f8fb;
  --muted: #9095a3;
  --acid: #b7ff5a;
  --cyan: #70e4ff;
  --violet: #9b7cff;
  --danger: #ff6785;
  --radius: 22px;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body { margin: 0; min-height: 100vh; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { position: relative; display: grid; place-items: center; width: 42px; aspect-ratio: 1; border: 1px solid var(--line-bright); border-radius: 14px; background: linear-gradient(145deg, rgba(183,255,90,.14), rgba(112,228,255,.04) 44%, rgba(155,124,255,.16)); box-shadow: inset 0 1px rgba(255,255,255,.14), 0 10px 30px rgba(0,0,0,.24); }
.brand-mark::before { content: ''; position: absolute; top: 7px; left: 50%; width: 19px; height: 6px; transform: translateX(-50%); border: 1.5px solid var(--acid); border-radius: 50%; opacity: .9; }
.brand-mark span { padding-top: 5px; font: 800 24px/1 var(--font-display); background: linear-gradient(130deg, var(--acid), var(--cyan) 55%, var(--violet)); -webkit-background-clip: text; color: transparent; }
.brand-word { font: 700 21px/1 var(--font-display); letter-spacing: -.04em; }
.brand-word > span { color: var(--acid); }
.brand-word small { font-size: 12px; color: var(--muted); letter-spacing: 0; }

.primary-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 20px; border: 0; border-radius: 15px; color: #090b0e; background: linear-gradient(135deg, var(--acid), #8fffd7 55%, var(--cyan)); font-weight: 700; cursor: pointer; box-shadow: 0 10px 28px rgba(157, 255, 143, .14), inset 0 1px rgba(255,255,255,.6); transition: transform .18s ease, box-shadow .18s ease; }
.primary-button:hover { transform: translateY(-1px); box-shadow: 0 13px 34px rgba(157,255,143,.2), inset 0 1px rgba(255,255,255,.7); }
.primary-button:active { transform: translateY(1px) scale(.99); }
.primary-button svg { width: 20px; stroke-width: 2.2; }
.eyebrow { display: block; margin-bottom: 7px; color: var(--acid); font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }

/* Login */
.login-page { display: grid; place-items: center; overflow-x: hidden; background: radial-gradient(circle at 10% 10%, rgba(112,228,255,.08), transparent 28%), radial-gradient(circle at 85% 80%, rgba(155,124,255,.12), transparent 34%), var(--bg); }
.login-shell { display: grid; grid-template-columns: minmax(360px, 480px) minmax(400px, 1fr); width: min(1120px, calc(100% - 48px)); min-height: 690px; margin: 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 30px; background: rgba(10,11,16,.84); box-shadow: 0 45px 120px rgba(0,0,0,.52); backdrop-filter: blur(28px); }
.login-panel { display: flex; flex-direction: column; padding: 48px 54px 38px; border-right: 1px solid var(--line); }
.brand-login { align-self: flex-start; }
.login-copy { margin: auto 0 42px; }
.login-copy h1 { margin: 0 0 17px; font: 700 clamp(2.6rem, 5vw, 4.6rem)/.98 var(--font-display); letter-spacing: -.065em; }
.login-copy h1 em { font-style: normal; background: linear-gradient(100deg, var(--acid), var(--cyan) 54%, var(--violet)); -webkit-background-clip: text; color: transparent; }
.login-copy p { max-width: 350px; margin: 0; color: var(--muted); font-size: 1.06rem; line-height: 1.6; }
.login-form label { display: block; margin-bottom: 9px; color: #d9dce5; font-size: .9rem; font-weight: 600; }
.password-field { position: relative; }
.password-field input { width: 100%; height: 56px; padding: 0 54px 0 17px; border: 1px solid var(--line-bright); border-radius: 15px; outline: none; color: var(--text); background: rgba(255,255,255,.045); transition: border-color .2s, box-shadow .2s; }
.password-field input:focus { border-color: rgba(183,255,90,.55); box-shadow: 0 0 0 4px rgba(183,255,90,.08); }
.password-field input::placeholder { color: #656a77; }
.reveal-password { position: absolute; inset: 7px 8px 7px auto; display: grid; place-items: center; width: 42px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; }
.reveal-password:hover { color: var(--text); background: rgba(255,255,255,.06); }
.login-button { width: 100%; margin-top: 15px; }
.login-button span { margin-left: auto; font-size: 1.25rem; }
.login-error { margin: 10px 0 0; color: #ff99ad; font-size: .88rem; }
.privacy-note { margin: 22px 0 0; color: #6e7380; font-size: .78rem; text-align: center; }
.privacy-note span { color: var(--acid); font-size: .55rem; }
.login-art { position: relative; min-height: 100%; overflow: hidden; background: radial-gradient(circle at 65% 23%, rgba(183,255,90,.15), transparent 24%), radial-gradient(circle at 38% 70%, rgba(112,228,255,.13), transparent 32%), linear-gradient(145deg, #0c0e14, #11131d); }
.login-art::before { content: ''; position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 46px 46px; mask-image: linear-gradient(to bottom right, black, transparent 80%); }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { top: 10%; right: 10%; width: 260px; height: 260px; border: 1px solid rgba(183,255,90,.2); box-shadow: inset 25px -30px 70px rgba(183,255,90,.06), 0 0 100px rgba(183,255,90,.05); }
.orb-two { bottom: 8%; left: 8%; width: 190px; height: 190px; border: 1px solid rgba(112,228,255,.18); box-shadow: inset -20px 25px 60px rgba(155,124,255,.08); }
.glass-stack { position: absolute; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; width: 250px; height: 315px; padding: 22px; overflow: hidden; border: 1px solid rgba(255,255,255,.16); border-radius: 28px; box-shadow: 0 35px 80px rgba(0,0,0,.38), inset 0 1px rgba(255,255,255,.13); backdrop-filter: blur(16px); }
.glass-stack::before { content: ''; position: absolute; inset: 0; background: linear-gradient(145deg, rgba(255,255,255,.11), transparent 48%); }
.glass-stack span { position: relative; height: 9px; border-radius: 8px; background: rgba(255,255,255,.65); }
.glass-stack span:last-child { width: 58%; height: 6px; background: rgba(255,255,255,.24); }
.card-a { top: 120px; left: 14%; transform: rotate(-9deg); background: radial-gradient(circle at 30% 28%, rgba(112,228,255,.8), transparent 23%), radial-gradient(circle at 65% 42%, rgba(155,124,255,.65), transparent 33%), #151724; }
.card-b { top: 205px; right: 7%; transform: rotate(8deg); background: radial-gradient(circle at 55% 26%, rgba(183,255,90,.68), transparent 24%), radial-gradient(circle at 35% 58%, rgba(112,228,255,.42), transparent 36%), #12151d; }
.art-caption { position: absolute; left: 50px; bottom: 42px; color: rgba(255,255,255,.42); font: 500 1rem/1.35 var(--font-display); letter-spacing: .03em; text-transform: uppercase; }
.art-caption strong { color: var(--text); font-size: 1.55rem; letter-spacing: -.04em; text-transform: none; }

/* Application */
.app-page { overflow-x: hidden; background: radial-gradient(circle at 80% -10%, rgba(155,124,255,.08), transparent 30%), var(--bg); }
.app-shell { display: grid; grid-template-columns: 252px minmax(0,1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 27px 20px 22px; border-right: 1px solid var(--line); background: rgba(8,9,13,.9); backdrop-filter: blur(20px); }
.sidebar > .brand { margin: 0 9px 42px; }
.nav-list { display: grid; gap: 6px; }
.nav-item { display: flex; align-items: center; gap: 13px; width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid transparent; border-radius: 14px; color: var(--muted); background: transparent; font-weight: 600; text-align: left; cursor: pointer; transition: .18s ease; }
.nav-item:hover { color: var(--text); background: rgba(255,255,255,.04); }
.nav-item.active { color: var(--text); border-color: rgba(183,255,90,.14); background: linear-gradient(100deg, rgba(183,255,90,.12), rgba(112,228,255,.035)); }
.nav-item.active svg { color: var(--acid); }
.storage-card { margin-top: auto; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(145deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); }
.storage-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: .77rem; color: var(--muted); }
.storage-heading strong { color: var(--text); font-size: .8rem; }
.storage-track { height: 5px; margin: 13px 0 12px; overflow: hidden; border-radius: 10px; background: rgba(255,255,255,.07); }
.storage-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--acid), var(--cyan)); transition: width .4s ease; }
.storage-card p { margin: 0; color: #747986; font-size: .74rem; }
.logout-form { margin-top: 10px; }
.logout-button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 12px 15px; border: 0; border-radius: 12px; color: #6f7481; background: transparent; font-size: .85rem; cursor: pointer; }
.logout-button:hover { color: var(--text); background: rgba(255,255,255,.04); }
.logout-button svg { width: 18px; }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 10; top: 0; display: grid; grid-template-columns: minmax(220px, 540px) auto; justify-content: space-between; gap: 20px; min-height: 86px; padding: 18px 34px; border-bottom: 1px solid var(--line); background: rgba(8,9,13,.78); backdrop-filter: blur(22px); }
.mobile-brand { display: none; }
.search-box { display: flex; align-items: center; gap: 11px; width: 100%; height: 50px; padding: 0 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.035); transition: border-color .2s, background .2s; }
.search-box:focus-within { border-color: rgba(112,228,255,.3); background: rgba(255,255,255,.05); }
.search-box svg { flex: 0 0 auto; width: 20px; color: #747987; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; color: var(--text); background: transparent; }
.search-box input::placeholder { color: #646976; }
.search-box kbd { padding: 4px 7px; border: 1px solid var(--line); border-radius: 7px; color: #656a77; background: rgba(255,255,255,.03); font: 500 .7rem var(--font-body); }
.top-actions { display: flex; gap: 10px; }
.icon-button { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid var(--line); border-radius: 15px; color: #b9bdc8; background: rgba(255,255,255,.035); cursor: pointer; }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.07); }
.add-button { height: 50px; }
.content { padding: 38px 34px 80px; }
.content-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.content-heading h1 { margin: 0; font: 750 clamp(2rem, 3.5vw, 3.35rem)/1 var(--font-display); letter-spacing: -.055em; }
.view-count { color: #6f7481; font-size: .86rem; }
.view-count strong { color: #dfe2e9; }
.upload-zone { display: flex; align-items: center; gap: 16px; min-height: 90px; margin-bottom: 37px; padding: 19px 22px; border: 1px dashed rgba(112,228,255,.22); border-radius: 20px; background: linear-gradient(100deg, rgba(112,228,255,.045), rgba(155,124,255,.03)); cursor: pointer; transition: .2s ease; }
.upload-zone:hover, .upload-zone.dragging { border-color: rgba(183,255,90,.5); background: linear-gradient(100deg, rgba(183,255,90,.08), rgba(112,228,255,.04)); transform: translateY(-1px); }
.upload-icon { display: grid; flex: 0 0 auto; place-items: center; width: 49px; height: 49px; border: 1px solid rgba(183,255,90,.19); border-radius: 15px; color: var(--acid); background: rgba(183,255,90,.07); }
.upload-zone strong { display: block; margin-bottom: 4px; font-size: .95rem; }
.upload-zone span { display: block; color: var(--muted); font-size: .8rem; }
.date-group + .date-group { margin-top: 42px; }
.date-heading { display: flex; align-items: baseline; gap: 11px; margin-bottom: 14px; }
.date-heading h2 { margin: 0; font: 650 1.05rem var(--font-display); text-transform: capitalize; }
.date-heading span { color: #646976; font-size: .76rem; }
.media-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.media-card { position: relative; min-width: 0; aspect-ratio: 1; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; color: var(--text); background: var(--panel-solid); text-align: left; cursor: pointer; isolation: isolate; transition: transform .2s ease, border-color .2s ease; }
.media-card:hover { z-index: 1; border-color: rgba(255,255,255,.22); transform: translateY(-3px); }
.photo-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
.photo-card:hover img { transform: scale(1.035); }
.card-shade { position: absolute; inset: 35% 0 0; background: linear-gradient(transparent, rgba(4,5,8,.76)); }
.card-label { position: absolute; z-index: 2; inset: auto 14px 13px; min-width: 0; }
.card-label strong, .card-label small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-label strong { font-size: .82rem; }
.card-label small { margin-top: 3px; color: rgba(255,255,255,.58); font-size: .69rem; }
.document-card { background: radial-gradient(circle at 75% 20%, rgba(155,124,255,.22), transparent 35%), linear-gradient(145deg, #171a25, #101219); }
.document-glow { position: absolute; top: -35%; right: -25%; width: 78%; aspect-ratio: 1; border: 1px solid rgba(112,228,255,.13); border-radius: 50%; box-shadow: inset 0 0 60px rgba(112,228,255,.04); }
.document-icon { position: absolute; left: 17px; top: 17px; display: grid; place-items: center; width: 49px; height: 49px; border: 1px solid rgba(255,255,255,.1); border-radius: 15px; color: var(--cyan); background: rgba(255,255,255,.045); }
.document-icon svg { width: 25px; }
.file-extension { position: absolute; top: 22px; right: 17px; color: rgba(255,255,255,.3); font: 700 .72rem var(--font-display); letter-spacing: .08em; }
.loading-state { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.loading-state span { aspect-ratio: 1; border-radius: 18px; background: linear-gradient(105deg, rgba(255,255,255,.035) 30%, rgba(255,255,255,.075) 45%, rgba(255,255,255,.035) 60%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position-x: -200%; } }
.empty-state { display: grid; place-items: center; padding: 90px 20px; text-align: center; }
.empty-orbit { position: relative; display: grid; place-items: center; width: 74px; height: 74px; margin-bottom: 23px; border: 1px solid rgba(112,228,255,.17); border-radius: 25px; background: linear-gradient(145deg, rgba(183,255,90,.08), rgba(155,124,255,.09)); }
.empty-orbit::before { content: ''; position: absolute; top: 10px; width: 30px; height: 8px; border: 2px solid var(--acid); border-radius: 50%; }
.empty-orbit span { padding-top: 8px; font: 800 37px var(--font-display); color: var(--cyan); }
.empty-state h2 { margin: 0 0 8px; font: 700 1.7rem var(--font-display); letter-spacing: -.04em; }
.empty-state p { margin: 0 0 24px; color: var(--muted); }
.mobile-nav { display: none; }

/* Viewer */
.viewer { width: min(1160px, calc(100% - 32px)); max-width: none; height: min(88vh, 820px); max-height: none; padding: 0; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 25px; color: var(--text); background: #0b0c11; box-shadow: 0 40px 140px rgba(0,0,0,.7); }
.viewer::backdrop { background: rgba(0,0,0,.74); backdrop-filter: blur(12px); }
.viewer-surface { display: grid; grid-template-rows: 72px minmax(0,1fr); height: 100%; }
.viewer header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 0 17px 0 23px; border-bottom: 1px solid var(--line); }
.viewer-title { min-width: 0; }
.viewer-title strong, .viewer-title span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-title strong { font-size: .93rem; }
.viewer-title span { margin-top: 4px; color: var(--muted); font-size: .73rem; }
.viewer-actions { display: flex; align-items: center; gap: 9px; }
.viewer-download { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; color: var(--text); background: rgba(255,255,255,.045); font-size: .83rem; font-weight: 600; text-decoration: none; }
.viewer-download:hover { border-color: rgba(183,255,90,.25); background: rgba(183,255,90,.06); }
.viewer-download svg { width: 18px; color: var(--acid); }
.viewer-content { display: grid; place-items: center; min-height: 0; overflow: auto; padding: 24px; background: radial-gradient(circle at center, rgba(255,255,255,.035), transparent 50%); }
.viewer-content > img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 18px 60px rgba(0,0,0,.35); }
.viewer-content iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; background: white; }
.document-preview { display: grid; justify-items: center; text-align: center; }
.document-preview .document-icon { position: static; width: 76px; height: 76px; margin-bottom: 22px; }
.document-preview .document-icon svg { width: 36px; }
.document-preview strong { max-width: 500px; font: 650 1.25rem var(--font-display); }
.document-preview p { margin: 8px 0 22px; color: var(--muted); }
.document-preview a { display: inline-flex; align-items: center; gap: 9px; min-height: 46px; padding: 0 17px; border-radius: 13px; color: #090b0e; background: var(--acid); font-weight: 700; text-decoration: none; }
.document-preview a svg { width: 19px; }

/* Upload feedback */
.upload-drawer { position: fixed; z-index: 40; right: 22px; bottom: 22px; width: min(390px, calc(100% - 44px)); max-height: 410px; overflow: auto; padding: 18px; border: 1px solid var(--line-bright); border-radius: 20px; background: rgba(17,19,27,.96); box-shadow: 0 25px 80px rgba(0,0,0,.5); backdrop-filter: blur(22px); }
.upload-drawer-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; font-size: .84rem; }
.upload-drawer-head span { color: var(--muted); font-size: .75rem; }
.upload-list { display: grid; gap: 8px; }
.upload-row { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 10px; border-radius: 13px; background: rgba(255,255,255,.035); }
.upload-file-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: var(--cyan); background: rgba(112,228,255,.08); }
.upload-row strong, .upload-row span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-row strong { font-size: .76rem; }
.upload-row span, .upload-row em { color: var(--muted); font-size: .67rem; font-style: normal; }
.upload-row i { display: block; height: 3px; margin-top: 7px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.08); }
.upload-row i b { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--cyan); transition: width .3s; }
.upload-row.done i b { background: var(--acid); }
.upload-row.done em { color: var(--acid); }
.upload-row.failed i b { background: var(--danger); }
.upload-row.failed em { max-width: 92px; color: #ff8ca3; text-align: right; }
.toast-region { position: fixed; z-index: 70; top: 18px; left: 50%; display: grid; gap: 9px; width: min(440px, calc(100% - 32px)); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 13px 16px; border: 1px solid var(--line-bright); border-radius: 14px; color: var(--text); background: rgba(19,21,29,.96); box-shadow: 0 15px 45px rgba(0,0,0,.35); font-size: .85rem; text-align: center; animation: toast-in .25s ease; }
.toast.success { border-color: rgba(183,255,90,.25); }
.toast.error { border-color: rgba(255,103,133,.32); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1080px) {
  .media-grid, .loading-state { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .login-shell { grid-template-columns: minmax(350px, 450px) 1fr; }
  .glass-stack { width: 210px; height: 280px; }
}

@media (max-width: 800px) {
  .login-page { display: block; }
  .login-shell { display: block; width: auto; min-height: 100vh; margin: 0; border: 0; border-radius: 0; background: radial-gradient(circle at 90% 10%, rgba(155,124,255,.14), transparent 29%), radial-gradient(circle at 8% 85%, rgba(112,228,255,.1), transparent 30%), var(--bg); }
  .login-panel { min-height: 100vh; padding: max(30px, env(safe-area-inset-top)) 24px max(25px, env(safe-area-inset-bottom)); border: 0; }
  .login-copy { margin: auto 0 35px; }
  .login-copy h1 { font-size: clamp(2.75rem, 14vw, 4rem); }
  .login-art { display: none; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; min-height: 76px; padding: 13px 16px; }
  .mobile-brand { display: flex; align-items: center; }
  .mobile-brand .brand-word { display: none; }
  .brand-mark.mini { width: 42px; }
  .search-box { height: 46px; }
  .search-box kbd { display: none; }
  .top-actions { gap: 7px; }
  .top-actions .camera-button { width: 46px; height: 46px; }
  .add-button { width: 46px; height: 46px; min-height: 46px; padding: 0; }
  .add-button span { display: none; }
  .content { padding: 28px 16px 120px; }
  .content-heading { align-items: end; margin-bottom: 20px; }
  .content-heading h1 { font-size: 2.35rem; }
  .upload-zone { min-height: 78px; margin-bottom: 30px; padding: 15px; }
  .upload-icon { width: 44px; height: 44px; }
  .upload-zone span { font-size: .72rem; }
  .media-grid, .loading-state { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .media-card { border-radius: 15px; }
  .mobile-nav { position: fixed; z-index: 25; inset: auto 10px max(10px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr; align-items: center; height: 70px; padding: 7px 8px; border: 1px solid var(--line-bright); border-radius: 22px; background: rgba(16,18,25,.92); box-shadow: 0 22px 60px rgba(0,0,0,.5); backdrop-filter: blur(22px); }
  .mobile-nav button { display: grid; justify-items: center; gap: 3px; padding: 6px 3px; border: 0; color: #737986; background: transparent; font-size: .63rem; cursor: pointer; }
  .mobile-nav button svg { width: 21px; }
  .mobile-nav button.active { color: var(--acid); }
  .mobile-nav .mobile-add { justify-self: center; width: 54px; height: 54px; margin-top: -25px; border: 4px solid #101219; border-radius: 18px; color: #090b0e; background: linear-gradient(135deg, var(--acid), var(--cyan)); box-shadow: 0 12px 35px rgba(112,228,255,.18); }
  .mobile-nav .mobile-add svg { width: 25px; stroke-width: 2.5; }
  .viewer { width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; }
  .viewer-surface { grid-template-rows: 70px minmax(0,1fr); }
  .viewer header { padding: 0 12px 0 15px; }
  .viewer-download { width: 44px; padding: 0; justify-content: center; }
  .viewer-download { font-size: 0; }
  .viewer-content { padding: 12px; }
  .upload-drawer { right: 12px; bottom: 94px; width: calc(100% - 24px); }
}

@media (max-width: 420px) {
  .search-box { padding: 0 11px; }
  .search-box input { font-size: .9rem; }
  .camera-button { display: none; }
  .topbar { grid-template-columns: auto 1fr auto; }
  .content-heading h1 { font-size: 2.1rem; }
  .view-count { font-size: .74rem; }
  .upload-zone { gap: 12px; }
  .upload-zone strong { font-size: .86rem; }
  .card-label { inset: auto 10px 10px; }
  .card-label strong { font-size: .74rem; }
  .document-icon { left: 12px; top: 12px; width: 42px; height: 42px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
