:root {
  color-scheme: light;
  --blue: #6e72d8;
  --blue-dark: #5d60c8;
  --blue-wash: #f0efff;
  --ink: #334065;
  --muted: #7d89a9;
  --line: #e9eaf6;
  --canvas: #f8f9ff;
  --surface: #ffffff;
  --green: #047857;
  --red: #dc2626;
  --rainbow: linear-gradient(96deg, #ef90a9 0%, #e9ba61 25%, #70c1a8 51%, #7c94e5 74%, #a27fce 100%);
  --rainbow-soft: linear-gradient(96deg, rgba(239, 144, 169, .16) 0%, rgba(233, 186, 97, .13) 25%, rgba(112, 193, 168, .13) 51%, rgba(124, 148, 229, .14) 74%, rgba(162, 127, 206, .15) 100%);
  --shadow: 0 12px 34px rgba(80, 88, 165, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--canvas); }
body { margin: 0; min-width: 320px; color: var(--ink); background: radial-gradient(circle at 95% 0%, rgba(181, 214, 255, .34) 0, transparent 27%), radial-gradient(circle at 47% 0%, rgba(255, 203, 218, .31) 0, transparent 28%), var(--canvas); font-size: 15px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, [tabindex="0"]:focus-visible { outline: 3px solid rgba(79, 124, 255, 0.32); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: flex; }
.sidebar { display: flex; flex: 0 0 258px; min-height: 100vh; flex-direction: column; padding: 24px 14px 18px; background: rgba(255, 255, 255, .92); border-right: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 24px; color: var(--ink); font-size: 20px; font-weight: 700; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 10px; color: #fff; background: var(--rainbow); box-shadow: 0 6px 16px rgba(124, 130, 211, .3); }

.primary-action, .outline-button, .text-button, .icon-text-button, .more-button, .nav-item, .bottom-nav-item, .upload-fab, .close-button, .preview-close { border: 0; background: transparent; }
.primary-action { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; gap: 7px; padding: 0 17px; border-radius: 10px; color: #fff; background: var(--rainbow); font-weight: 650; box-shadow: 0 8px 16px rgba(113, 126, 214, .24); transition: filter .18s ease, transform .18s ease; }
.primary-action:hover { filter: saturate(1.15) brightness(.98); transform: translateY(-1px); }
.primary-action:disabled { cursor: not-allowed; filter: grayscale(.18); opacity: .62; transform: none; }
.primary-action.compact { min-height: 38px; padding: 0 15px; font-size: 14px; }
.sidebar > .primary-action { width: 100%; margin-bottom: 16px; }
.outline-button { display: inline-flex; min-height: 38px; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid #dedff2; border-radius: 10px; color: #555d91; background: rgba(255, 255, 255, .82); font-weight: 600; transition: background .16s ease, border-color .16s ease; }
.outline-button:hover { border-color: #c3c5ec; background: #faf9ff; }
.text-button { padding: 5px 0; color: var(--blue); font-size: 14px; font-weight: 600; }
.text-button:hover { color: var(--blue-dark); }
.text-button.danger { color: var(--red); }

.main-nav { display: grid; gap: 3px; margin-bottom: 22px; }
.nav-item { display: flex; min-height: 42px; align-items: center; gap: 11px; padding: 0 12px; border-radius: 9px; color: #52617a; text-align: left; font-weight: 600; }
.nav-item:hover { background: #f8f8fd; color: #4b5580; }
.nav-item.is-active { color: #6769ce; background: var(--rainbow-soft); }
.nav-symbol { display: inline-flex; width: 19px; justify-content: center; color: currentColor; font-size: 18px; }
.folder-nav { min-height: 86px; overflow: hidden; }
.folder-nav-title { display: flex; align-items: center; justify-content: space-between; padding: 0 12px 8px; color: #94a0b4; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.tree-button { display: flex; width: 100%; min-height: 34px; align-items: center; gap: 8px; padding: 0 12px; border: 0; border-radius: 8px; color: #61708a; background: transparent; text-align: left; font-size: 14px; }
.tree-button:hover { background: #f6f8fc; }
.tree-button.is-current { color: #345fc9; font-weight: 650; }
.tree-folder { color: #e0a63d; font-size: 14px; }

.storage-card { margin: auto 6px 18px; padding: 14px 12px 10px; border-radius: 12px; background: linear-gradient(135deg, rgba(255, 244, 248, .9), rgba(244, 247, 255, .95)); }
.storage-row { display: flex; justify-content: space-between; gap: 8px; color: #7e88a4; font-size: 12px; }
.storage-row strong { color: #5d668c; font-weight: 650; }
.storage-meter { height: 6px; margin: 10px 0 4px; overflow: hidden; border-radius: 999px; background: #e4eaf5; }
.storage-meter span { display: block; width: 19%; height: 100%; border-radius: inherit; background: var(--rainbow); }
.account-chip { display: flex; align-items: center; gap: 10px; padding: 9px 8px 0; border-top: 1px solid var(--line); }
.avatar { display: grid; width: 32px; height: 32px; flex: 0 0 32px; place-items: center; border-radius: 50%; color: #fff; background: linear-gradient(135deg, #e99db0, #8a8bde); font-size: 13px; font-weight: 700; }
.account-chip span:not(.avatar) { display: grid; flex: 1; gap: 1px; min-width: 0; }
.account-chip strong { overflow: hidden; color: #33425b; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.account-chip small { color: #8995a9; font-size: 11px; }
.more-button { padding: 4px; color: #95a0b4; letter-spacing: 1px; }

.main-content { width: min(100%, 1520px); flex: 1; padding: 0 42px 48px; }
.topbar { display: flex; min-height: 78px; align-items: center; justify-content: flex-end; border-bottom: 1px solid rgba(228, 231, 244, .9); }
.topbar-actions { display: flex; gap: 10px; }
.mobile-title { display: none; }
.page-view { display: none; max-width: 1320px; margin: 0 auto; padding-top: 37px; }
.page-view.is-visible { display: block; }
.page-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 35px; }
.page-heading h1 { margin: 7px 0 7px; color: #17223a; font-size: clamp(25px, 2.2vw, 34px); line-height: 1.18; letter-spacing: -.035em; }
.page-heading p { margin: 0; color: var(--muted); }
.folder-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 12px; }
.folder-rename-current { margin-top: 5px; }
.breadcrumbs { display: flex; min-height: 17px; flex-wrap: wrap; align-items: center; gap: 6px; color: #8591a5; font-size: 13px; }
.breadcrumb-button { padding: 0; border: 0; color: inherit; background: transparent; }
.breadcrumb-button:hover { color: var(--blue); }
.breadcrumb-current { color: #4d5c73; font-weight: 600; }
.breadcrumb-separator { color: #b0bac8; }
.icon-text-button { display: inline-flex; min-height: 34px; align-items: center; gap: 6px; padding: 0 7px; color: #7e8ba1; font-size: 13px; }
.icon-text-button:hover { color: #3e5171; }
.folder-section { margin-bottom: 38px; }
.section-heading { display: flex; min-height: 30px; align-items: center; justify-content: space-between; margin-bottom: 15px; }
.section-heading h2 { margin: 0; color: #293750; font-size: 17px; letter-spacing: -.02em; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.folder-card-wrap { position: relative; min-width: 0; }
.folder-card { display: flex; min-height: 135px; flex-direction: column; justify-content: flex-end; padding: 14px; overflow: hidden; border: 1px solid rgba(229, 230, 244, .92); border-radius: 13px; color: inherit; background: rgba(255, 255, 255, .9); text-align: left; box-shadow: 0 4px 13px rgba(81, 85, 144, .035); transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.folder-card-wrap .folder-card { width: 100%; }
.folder-card:hover { border-color: #d4d5ef; box-shadow: 0 12px 24px rgba(81, 85, 144, .1); transform: translateY(-2px); }
.folder-rename-button { position: absolute; z-index: 2; top: 8px; right: 8px; display: grid; width: 31px; height: 31px; place-items: center; padding: 0; border: 1px solid rgba(255,255,255,.92); border-radius: 9px; color: #5d6599; background: rgba(255,255,255,.84); box-shadow: 0 3px 9px rgba(52,63,116,.12); font-size: 17px; line-height: 1; opacity: 0; transition: opacity .16s ease, transform .16s ease; }
.folder-card-wrap:hover .folder-rename-button, .folder-rename-button:focus-visible { opacity: 1; }
.folder-rename-button:hover { color: #454d85; transform: translateY(-1px); }
.folder-cover { position: relative; height: 62px; margin: -14px -14px 12px; overflow: hidden; }
.folder-cover::before, .folder-cover::after { position: absolute; display: block; content: ""; border-radius: 50%; opacity: .82; }
.folder-cover::before { width: 88px; height: 88px; right: 14px; top: -28px; background: rgba(255,255,255,.4); }
.folder-cover::after { width: 50px; height: 50px; left: 32px; bottom: -28px; background: rgba(255,255,255,.25); }
.cover-yellow { background: linear-gradient(135deg, #f0bb8c, #f4dc94); }
.cover-blue { background: linear-gradient(135deg, #9bc9e2, #8297d4); }
.cover-pink { background: linear-gradient(135deg, #e8a5b9, #c695cf); }
.cover-green { background: linear-gradient(135deg, #9fd4bd, #82bed0); }
.cover-purple { background: linear-gradient(135deg, #bba5dc, #8394d5); }
.folder-card strong { overflow: hidden; color: #25344d; font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.folder-card small { margin-top: 4px; color: #8490a5; font-size: 12px; }
.folder-card-add { justify-content: center; align-items: center; gap: 8px; color: #70809a; background: #fbfcfe; border-style: dashed; }
.folder-card-add span { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 50%; color: var(--blue); background: var(--blue-wash); font-size: 21px; }
.folder-card-add strong { color: #687793; font-size: 14px; }

.media-section { padding-bottom: 18px; }
.media-heading { align-items: flex-end; }
.media-heading > div:first-child { display: flex; align-items: baseline; gap: 8px; }
.media-heading > div:first-child span { color: #97a1b2; font-size: 13px; }
.selection-tools { display: flex; align-items: center; gap: 14px; color: #5b6b85; font-size: 13px; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.media-grid.is-compact { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 10px; }
.media-card { position: relative; min-width: 0; overflow: hidden; border: 0; border-radius: 12px; color: #fff; background: #dbe4f2; aspect-ratio: .91; box-shadow: 0 4px 10px rgba(26, 41, 70, .05); }
.media-card button { color: inherit; }
.media-visual { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
.media-visual img, .media-visual video { width: 100%; height: 100%; display: block; object-fit: cover; }
.media-visual::after { position: absolute; inset: 0; display: block; content: ""; background: linear-gradient(180deg, transparent 46%, rgba(8, 18, 37, .73)); pointer-events: none; }
.media-art { width: 100%; height: 100%; background: var(--art, linear-gradient(135deg, #d6b193, #967172)); }
.media-art::before, .media-art::after { position: absolute; content: ""; border-radius: 999px; opacity: .76; }
.media-art::before { width: 65%; height: 65%; left: -16%; top: -12%; background: rgba(255,255,255,.26); }
.media-art::after { width: 73%; height: 53%; right: -25%; bottom: -14%; background: rgba(14, 25, 44, .18); }
.media-card-info { position: absolute; right: 11px; bottom: 10px; left: 11px; z-index: 2; display: flex; align-items: flex-end; justify-content: space-between; gap: 7px; pointer-events: none; }
.media-card-info span { overflow: hidden; max-width: 100%; font-size: 12px; font-weight: 600; text-overflow: ellipsis; text-shadow: 0 1px 4px rgba(0,0,0,.32); white-space: nowrap; }
.media-card-kind { display: inline-flex; flex: 0 0 auto; align-items: center; gap: 3px; padding: 3px 5px; border-radius: 5px; background: rgba(9, 18, 36, .46); font-size: 10px !important; }
.media-thumb { color: transparent; background: var(--art, #dbe4f2); }
.load-more { display: flex; min-height: 48px; align-items: center; justify-content: center; margin-top: 20px; }
.load-more-button { min-width: 190px; }
.page-status { color: #8a96a9; font-size: 13px; }
.media-select { position: absolute; z-index: 4; top: 9px; left: 9px; display: grid; width: 23px; height: 23px; place-items: center; padding: 0; border: 1.5px solid rgba(255,255,255,.9); border-radius: 50%; color: transparent; background: rgba(12, 22, 42, .16); opacity: 0; transition: opacity .16s ease, background .16s ease; }
.media-card:hover .media-select, .media-card.is-selected .media-select { opacity: 1; }
.media-card.is-selected .media-select { color: #fff; border-color: var(--blue); background: var(--blue); }
.media-card.is-selected::after { position: absolute; inset: 0; z-index: 3; content: ""; border: 3px solid #7475dc; border-radius: 12px; pointer-events: none; }
.favorite-mark { position: absolute; z-index: 4; top: 9px; right: 9px; display: grid; width: 27px; height: 27px; place-items: center; padding: 0; border: 0; border-radius: 50%; color: #fff; background: rgba(12,22,42,.28); opacity: 0; transition: opacity .16s ease, background .16s ease; }
.media-card:hover .favorite-mark, .favorite-mark.is-favorite { opacity: 1; }
.favorite-mark.is-favorite { color: #e8749a; background: rgba(255,255,255,.92); }
.empty-state { display: grid; min-height: 290px; place-content: center; justify-items: center; padding: 24px; border: 1px dashed #d9e2f0; border-radius: 14px; color: var(--muted); background: #fbfcff; text-align: center; }
.empty-symbol { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 12px; border-radius: 16px; color: #6f70d6; background: var(--rainbow-soft); font-size: 24px; }
.empty-state h3 { margin: 0 0 7px; color: #45536c; font-size: 16px; }
.empty-state p { max-width: 270px; margin: 0 0 16px; font-size: 13px; line-height: 1.55; }

.simple-heading { margin-bottom: 27px; }
.timeline-group { display: grid; gap: 30px; }
.timeline-month h2 { margin: 0 0 13px; color: #34425c; font-size: 17px; }
.timeline-month h2 span { margin-left: 7px; color: #98a3b3; font-size: 13px; font-weight: 500; }
.recycle-list { display: grid; gap: 9px; }
.recycle-row { display: flex; min-height: 68px; align-items: center; gap: 13px; padding: 8px 12px 8px 9px; border: 1px solid #e8edf5; border-radius: 12px; background: #fff; }
.recycle-thumb { width: 52px; height: 50px; flex: 0 0 52px; overflow: hidden; border-radius: 8px; background: var(--art); }
.recycle-info { display: grid; flex: 1; min-width: 0; gap: 3px; }
.recycle-info strong { overflow: hidden; color: #40506a; text-overflow: ellipsis; white-space: nowrap; }
.recycle-info span { color: #909aad; font-size: 12px; }
.recycle-actions { display: flex; gap: 12px; }

.bottom-nav { display: none; }
.modal-backdrop { position: fixed; z-index: 20; inset: 0; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(17, 28, 51, .42); backdrop-filter: blur(5px); }
.modal-backdrop.is-open { display: flex; }
.modal { width: min(100%, 610px); max-height: min(800px, calc(100vh - 48px)); overflow-y: auto; padding: 28px; border-radius: 18px; background: #fff; box-shadow: 0 24px 60px rgba(11, 26, 56, .26); }
.small-modal { width: min(100%, 430px); }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.eyebrow { color: var(--blue); font-size: 12px; font-weight: 700; letter-spacing: .05em; }
.modal h2 { margin: 5px 0 0; color: #202e47; font-size: 24px; letter-spacing: -.025em; }
.close-button { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 50%; color: #74819a; font-size: 25px; line-height: 1; }
.close-button:hover { color: #40506a; background: #f5f7fc; }
.modal-intro { margin: 0 0 22px; color: #687791; font-size: 14px; line-height: 1.6; }
.upload-type-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-bottom: 20px; }
.upload-choice { display: grid; min-height: 120px; justify-items: start; align-content: center; gap: 4px; padding: 15px; border: 1px solid #dfe6f2; border-radius: 12px; color: #40506b; background: #fff; text-align: left; }
.upload-choice:hover { border-color: #aec3f0; }
.upload-choice.is-selected { border-color: #9294e2; background: linear-gradient(135deg, #fff8fb, #f5f7ff); box-shadow: inset 0 0 0 1px #9294e2; }
.upload-choice-symbol { display: grid; width: 31px; height: 31px; place-items: center; margin-bottom: 3px; border-radius: 8px; color: #6f70d6; background: var(--rainbow-soft); font-size: 18px; }
.upload-choice strong { font-size: 14px; }
.upload-choice small { color: #8793a7; font-size: 12px; line-height: 1.4; }
.field-label { display: block; margin: 0 0 8px; color: #53627b; font-size: 13px; font-weight: 650; }
.select-control, .text-control { width: 100%; height: 42px; margin-bottom: 16px; padding: 0 12px; border: 1px solid #dbe3ef; border-radius: 9px; color: #3d4c66; background: #fff; }
.text-control { font-size: 15px; }
.file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.drop-zone { display: grid; min-height: 148px; place-content: center; justify-items: center; gap: 7px; padding: 15px; border: 1.5px dashed #bbcbeb; border-radius: 12px; color: #60718d; background: #fafcff; text-align: center; }
.drop-zone.is-dragging { border-color: #8789dd; background: linear-gradient(135deg, #fff4f8, #eef5ff); }
.drop-zone strong { color: #465671; font-size: 14px; }
.drop-zone small { color: #8c98aa; font-size: 12px; }
.drop-symbol { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 50%; color: #6f70d6; background: var(--rainbow-soft); font-size: 21px; }
.pending-files { max-height: 140px; margin-top: 12px; overflow: auto; border-top: 1px solid #edf0f5; }
.pending-file { display: flex; min-height: 37px; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid #edf0f5; color: #53627a; font-size: 13px; }
.pending-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-file small { flex: 0 0 auto; color: #97a1b0; }
.upload-note { margin-top: 15px; color: #8a96a9; font-size: 12px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 23px; }
.inline-error { margin: -10px 0 0; color: var(--red); font-size: 12px; }
.auth-backdrop { background: rgba(26, 32, 64, .54); }
.auth-modal { position: relative; overflow: hidden; }
.auth-modal::before { position: absolute; width: 220px; height: 220px; top: -145px; right: -94px; border-radius: 50%; background: var(--rainbow-soft); content: ""; pointer-events: none; }
.auth-sparkle { position: relative; display: grid; width: 42px; height: 42px; margin-bottom: 18px; place-items: center; border-radius: 14px; color: #fff; background: var(--rainbow); box-shadow: 0 8px 18px rgba(112, 121, 212, .24); font-size: 22px; }
.auth-tabs { position: absolute; z-index: 1; top: 25px; right: 25px; display: flex; padding: 3px; border-radius: 9px; background: #f5f5fb; }
.auth-tab { min-height: 29px; padding: 0 9px; border: 0; border-radius: 7px; color: #8a94a8; background: transparent; font-size: 12px; font-weight: 650; }
.auth-tab.is-active { color: #5d60c8; background: #fff; box-shadow: 0 1px 4px rgba(65, 76, 133, .12); }
.auth-modal .modal-header, .auth-modal .modal-intro, .auth-modal .field-label, .auth-modal .text-control, .auth-modal .inline-error, .auth-modal .modal-actions { position: relative; }
.auth-modal .modal-actions { margin-top: 24px; }
.auth-modal #auth-submit { width: 100%; }

.preview-modal-panel { position: relative; display: flex; width: min(100%, 1040px); height: min(760px, calc(100vh - 42px)); max-height: calc(100vh - 42px); flex-direction: column; overflow: hidden; border-radius: 17px; background: #fff; box-shadow: 0 28px 65px rgba(11, 26, 56, .3); }
.preview-media { position: relative; min-height: 0; flex: 1 1 auto; overflow: hidden; background: #131c30; touch-action: none; }
.preview-track { display: flex; width: 300%; height: 100%; transform: translate3d(-33.333333%, 0, 0); will-change: transform; }
.preview-slide { display: grid; width: 33.333333%; flex: 0 0 33.333333%; height: 100%; place-items: center; overflow: hidden; background: #131c30; }
.preview-slide .preview-art { width: 100%; height: 100%; background: var(--art); }
.preview-slide img, .preview-slide video { display: block; width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
.preview-slide img { cursor: zoom-in; user-select: none; image-rendering: auto; }
.preview-slide img.is-zoomed { cursor: grab; }
.preview-info { flex: 0 0 auto; }
.preview-dots { position: absolute; z-index: 2; right: 18px; bottom: 14px; left: 18px; display: flex; min-height: 16px; align-items: center; justify-content: center; gap: 7px; pointer-events: none; }
.preview-dot { width: 6px; height: 6px; flex: 0 0 6px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.46); box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.preview-dot.is-current { width: 8px; height: 8px; flex-basis: 8px; background: #fff; }
.preview-dot.is-ellipsis { width: auto; flex-basis: auto; color: rgba(255,255,255,.72); background: transparent; font-size: 13px; line-height: 1; }
.preview-close { position: absolute; z-index: 2; top: 14px; right: 14px; display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; color: #fff; background: rgba(12, 20, 36, .45); font-size: 26px; line-height: 1; }
.preview-info { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 22px; }
.preview-info h2 { margin: 3px 0 3px; color: #2b3a53; font-size: 18px; }
.preview-info p { margin: 0; color: #8692a7; font-size: 13px; }
.preview-actions { display: flex; gap: 8px; }
.toast { position: fixed; z-index: 40; bottom: 28px; left: 50%; max-width: calc(100vw - 32px); padding: 11px 15px; border-radius: 9px; color: #fff; background: #293a57; box-shadow: 0 10px 24px rgba(18,35,66,.2); font-size: 14px; opacity: 0; pointer-events: none; transform: translate(-50%, 14px); transition: opacity .2s ease, transform .2s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 920px) {
  .sidebar { flex-basis: 218px; }
  .main-content { padding-right: 25px; padding-left: 25px; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(152px, 1fr)); }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(145px, 1fr)); }
}

@media (max-width: 700px) {
  body { padding-bottom: calc(66px + env(safe-area-inset-bottom)); }
  body.is-previewing { overflow: hidden; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { width: 100%; min-height: calc(100vh - 66px); padding: 0 16px 25px; }
  .topbar { min-height: 61px; justify-content: space-between; }
  .mobile-title { display: block; color: #26354e; font-size: 18px; font-weight: 750; letter-spacing: -.02em; }
  .topbar-actions .outline-button { display: none; }
  .topbar-actions .primary-action { min-height: 35px; padding: 0 13px; }
  .page-view { padding-top: 25px; }
  .page-heading { margin-bottom: 26px; }
  .page-heading h1 { margin-top: 4px; font-size: 26px; }
  .page-heading p { max-width: 270px; font-size: 14px; line-height: 1.5; }
  .icon-text-button { display: none; }
  .folder-section { margin-bottom: 30px; }
  .folder-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .folder-card { min-height: 124px; padding: 11px; border-radius: 12px; }
  .folder-rename-button { top: 7px; right: 7px; opacity: 1; }
  .folder-cover { height: 56px; margin: -11px -11px 10px; }
  .media-heading > div:first-child { display: block; }
  .media-heading > div:first-child span { display: block; margin-top: 3px; }
  .selection-tools { gap: 10px; font-size: 12px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .media-grid.is-compact { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
  .media-card { border-radius: 10px; }
  .media-card.is-selected::after { border-radius: 10px; }
  .media-select { width: 25px; height: 25px; opacity: 1; }
  .favorite-mark { opacity: 1; }
.bottom-nav { position: fixed; z-index: 12; right: 0; bottom: 0; left: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(66px + env(safe-area-inset-bottom)); align-items: start; padding: 6px 4px env(safe-area-inset-bottom); border-top: 1px solid var(--line); background: rgba(255,255,255,.98); box-shadow: 0 -6px 18px rgba(69,76,140,.05); }
  .bottom-nav-item { display: grid; min-height: 52px; align-content: center; justify-items: center; gap: 2px; color: #8190a7; }
  .bottom-nav-item span { font-size: 19px; line-height: 19px; }
  .bottom-nav-item small { font-size: 11px; }
  .bottom-nav-item.is-active { color: var(--blue); font-weight: 650; }
.upload-fab { position: relative; align-self: start; justify-self: center; width: 48px; height: 48px; margin-top: -23px; border: 4px solid var(--canvas); border-radius: 50%; color: #fff; background: var(--rainbow); box-shadow: 0 7px 17px rgba(113,126,214,.32); font-size: 28px; line-height: 1; }
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { width: 100%; max-height: calc(100vh - 20px); padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .modal h2 { font-size: 21px; }
  .auth-tabs { top: 21px; right: 18px; }
  .desktop-only { display: none; }
  .upload-type-grid { grid-template-columns: 1fr; }
  .upload-choice { min-height: 78px; grid-template-columns: auto 1fr; column-gap: 10px; }
  .upload-choice-symbol { grid-row: span 2; margin: 0; }
  .upload-choice small { grid-column: 2; }
  .drop-zone { min-height: 128px; }
  #preview-modal { z-index: 70; display: none; align-items: stretch; padding: 0; background: #000; backdrop-filter: none; }
  #preview-modal.is-open { display: block; }
  #preview-modal .preview-modal-panel { width: 100vw; max-width: none; height: 100dvh; max-height: none; border-radius: 0; background: #000; box-shadow: none; }
  #preview-modal .preview-media { height: 100dvh; min-height: 100vh; flex: 0 0 100dvh; background: #000; }
  #preview-modal .preview-slide { background: #000; }
  #preview-modal .preview-slide img, #preview-modal .preview-slide video { width: 100%; height: 100%; max-width: none; max-height: none; object-fit: contain; }
  #preview-modal .preview-info, #preview-modal .preview-close { display: none; }
  #preview-modal .preview-dots { bottom: max(25px, env(safe-area-inset-bottom)); gap: 12px; }
  #preview-modal .preview-dot { width: 8px; height: 8px; flex-basis: 8px; background: rgba(255,255,255,.5); }
  #preview-modal .preview-dot.is-current { width: 10px; height: 10px; flex-basis: 10px; background: #fff; }
  .recycle-row { align-items: flex-start; }
  .recycle-actions { align-self: center; flex-direction: column; gap: 0; }
}

@media (max-width: 385px) {
  .main-content { padding-right: 12px; padding-left: 12px; }
  .folder-card { min-height: 115px; }
  .selection-tools { gap: 8px; }
  .selection-tools #selection-count { display: none; }
}
