/* ============================================================
   FileGo — monochrome theme (auto + manual, black & white)
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f6f7;
  --bg-elev: #ffffff;
  --fg: #0a0a0a;
  --fg-muted: #6b6b70;
  --fg-faint: #9a9aa0;
  --border: #e7e7ea;
  --border-strong: #d3d3d8;
  --card: #ffffff;
  --accent: #0a0a0a;
  --accent-fg: #ffffff;
  --danger: #0a0a0a;
  --danger-fg: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --space: 16px;
  --maxw: 1180px;
  --sidebar-w: 232px;
  --topbar-h: 60px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --transition: .16s ease;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c0c0d;
    --bg-soft: #151517;
    --bg-elev: #161618;
    --fg: #f4f4f5;
    --fg-muted: #a1a1a8;
    --fg-faint: #6c6c74;
    --border: #26262a;
    --border-strong: #36363c;
    --card: #161618;
    --accent: #f4f4f5;
    --accent-fg: #0c0c0d;
    --danger: #f4f4f5;
    --danger-fg: #0c0c0d;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px rgba(0,0,0,.35);
  }
}

[data-theme="dark"] {
  --bg: #0c0c0d;
  --bg-soft: #151517;
  --bg-elev: #161618;
  --fg: #f4f4f5;
  --fg-muted: #a1a1a8;
  --fg-faint: #6c6c74;
  --border: #26262a;
  --border-strong: #36363c;
  --card: #161618;
  --accent: #f4f4f5;
  --accent-fg: #0c0c0d;
  --danger: #f4f4f5;
  --danger-fg: #0c0c0d;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 24px rgba(0,0,0,.35);
}

/* reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
svg { display: block; flex: none; }
h1,h2,h3,h4 { margin: 0 0 .4em; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1em; }
small { color: var(--fg-muted); }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* universal icon sizing — prevent SVG overflow */
svg { width: 1em; height: 1em; overflow: visible; }
.btn svg { width: 18px; height: 18px; }
.btn-sm svg { width: 16px; height: 16px; }
.btn-lg svg { width: 20px; height: 20px; }
.icon-btn svg { width: 18px; height: 18px; }
.nav a svg { width: 18px; height: 18px; }
.menu-panel a svg, .menu-panel button svg { width: 18px; height: 18px; }
.sidebar-foot .btn svg { width: 18px; height: 18px; }
.brand svg { width: 34px; height: 34px; }
.badge svg { width: 12px; height: 12px; }
h3 svg, h4 svg, h2 svg { width: 18px; height: 18px; }
.alert svg { width: 16px; height: 16px; }
.empty svg { width: 46px; height: 46px; }
.stat-icon svg { width: 36px; height: 36px; }
.search .search-icon svg { width: 18px; height: 18px; }
.tile-thumb-icon svg { width: 40px; height: 40px; }
.tile-share-btn svg { width: 16px; height: 16px; }
.breadcrumb .sep svg { width: 14px; height: 14px; }
.dl-file-icon svg { width: 36px; height: 36px; }
.dl-preview-icon svg { width: 44px; height: 44px; }
.dl-folder-icon svg { width: 24px; height: 24px; }
.dl-status-icon svg { width: 48px; height: 48px; }

/* layout shell */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: start; height: 100vh;
  background: var(--bg-soft); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: 14px;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 8px 6px 16px; color: var(--fg); }
.brand svg { width: 34px; height: 34px; }
.brand .wordmark { height: 22px; width: auto; color: var(--fg); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-faint); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--fg-muted); font-weight: 500; transition: var(--transition);
}
.nav a:hover { background: var(--bg-elev); color: var(--fg); }
.nav a.active { background: var(--accent); color: var(--accent-fg); }
.nav a svg { width: 18px; height: 18px; flex: none; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

.main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px; padding: 0 22px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar .search { flex: 1; max-width: 460px; }
.content { padding: 24px 22px 60px; max-width: var(--maxw); width: 100%; margin: 0 auto; }

/* mobile sidebar */
.menu-btn { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50; width: 260px; transform: translateX(-100%);
    transition: transform .2s ease; box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .menu-btn { display: inline-flex; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40; display: none; }
  .scrim.open { display: block; }
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--bg-elev); color: var(--fg); cursor: pointer; font-weight: 600;
  transition: var(--transition); white-space: nowrap; user-select: none;
}
.btn:hover { border-color: var(--fg); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.btn-primary:hover { opacity: .88; border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-soft); border-color: transparent; }
.btn-sm { padding: 6px 11px; font-size: 13px; }
.btn-icon { padding: 8px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--danger); color: var(--danger-fg); border-color: var(--danger); }
.btn-link { background: none; border: none; color: var(--fg); text-decoration: underline; padding: 0; cursor: pointer; }

/* forms */
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 14px; }
.field .hint { font-size: 12.5px; color: var(--fg-muted); margin-top: 5px; }
.input, .select, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); background: var(--bg-elev); color: var(--fg);
  transition: var(--transition);
}
.input:focus, .select:focus, textarea.input:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg) 14%, transparent); }
.input-group { display: flex; align-items: center; gap: 8px; }
.row { display: flex; gap: 14px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 160px; }
.checkbox { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--fg); }

/* cards */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { font-size: 15px; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* stats */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-size: 26px; font-weight: 800; letter-spacing: -1px; }
.stat .lbl { font-size: 12.5px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .06em; }

/* table */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-muted); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: var(--transition); }
.table tbody tr:hover { background: var(--bg-soft); }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; border: 1px solid var(--border-strong); background: var(--bg-soft); }
.badge.solid { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); }
.badge.muted { color: var(--fg-muted); }
.badge.danger { background: var(--danger); color: var(--danger-fg); border-color: var(--danger); }

/* file grid */
.filebar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0; flex-wrap: wrap; }
.breadcrumb a { color: var(--fg-muted); }
.breadcrumb a:hover { color: var(--fg); text-decoration: underline; }
.breadcrumb .sep { color: var(--fg-faint); }
.breadcrumb .cur { color: var(--fg); font-weight: 600; }
.filelist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.filetile {
  position: relative; display: flex; align-items: center; gap: 12px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); transition: var(--transition);
}
.filetile:hover { border-color: var(--fg); box-shadow: var(--shadow); }
.filetile .name { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filetile .meta { font-size: 11.5px; color: var(--fg-muted); }
.filetile .bulk-cb { position: absolute; top: 8px; right: 8px; width: 15px; height: 15px; accent-color: var(--fg); opacity: 0; transition: opacity .15s; z-index: 2; }
.filetile:hover .bulk-cb, .filetile .bulk-cb:checked { opacity: 1; }

/* compact tile thumbnail — small 44px, not huge */
.tile-thumb { position: relative; width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--bg-soft); overflow: hidden; display: grid; place-items: center; flex: none; }
.tile-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-thumb-icon { width: 28px; height: 28px; color: var(--fg-muted); }
.tile-info { flex: 1; min-width: 0; }
.tile-share-btn { width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elev); color: var(--fg-muted); cursor: pointer; display: grid; place-items: center; flex: none; transition: var(--transition); }
.tile-share-btn:hover { color: var(--fg); border-color: var(--fg); }
.tile-actions { display: flex; gap: 2px; margin-top: 6px; }
.tile-actions .btn { padding: 4px 7px; }

#bulkDeleteBtn:disabled { opacity: .4; }

/* dropzone */
.dropzone {
  border: 2px dashed var(--border-strong); border-radius: var(--radius);
  padding: 34px; text-align: center; color: var(--fg-muted); transition: var(--transition);
  cursor: pointer;
}
.dropzone:hover, .dropzone.drag { border-color: var(--fg); color: var(--fg); background: var(--bg-soft); }
.dropzone .big { font-size: 15px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }
.progress { height: 6px; background: var(--bg-soft); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }
.upload-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.upload-item:last-child { border-bottom: 0; }
.upload-item .pbar { flex: 1; }

/* toolbar / segmented */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented button { background: var(--bg-elev); border: 0; padding: 7px 12px; cursor: pointer; font-weight: 600; color: var(--fg-muted); }
.segmented button.active { background: var(--accent); color: var(--accent-fg); }

/* avatar / user chip */
.uchip { display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-elev); cursor: pointer; }
.uchip .av { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex: none; }
.menu { position: relative; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 200px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 6px; display: none; z-index: 30;
}
.menu.open .menu-panel { display: block; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 9px; padding: 9px 11px; border-radius: var(--radius-sm); background: none; border: 0; cursor: pointer; text-align: left; font-size: 14px; }
.menu-panel a:hover, .menu-panel button:hover { background: var(--bg-soft); }

/* table avatars */
.table .av { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); font-size: 11px; font-weight: 700; margin-right: 6px; vertical-align: middle; }

/* table mobile scroll */
.table-wrap { overflow-x: auto; }

/* input-group prefix */
.input-group span { display: flex; align-items: center; padding: 0 8px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--bg-soft); font-size: 13px; }
.input-group .input { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* tag-list with icons */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* heading icons — prevent overflow */
.card h3 { display: flex; align-items: center; gap: 6px; }
.dl-file-info h3 { display: block; }

/* search */
.search { position: relative; flex: 1; max-width: 460px; }
.search .search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--fg-faint); pointer-events: none; }
.search input { padding-left: 38px; }

/* stat icons */
.stat-icon { width: 36px; height: 36px; color: var(--fg-faint); margin-bottom: 6px; }

/* tile actions */
.tile-actions { gap: 2px !important; }
.tile-actions .btn { padding: 6px 8px; }

/* alert with icon */
.alert { display: flex; align-items: center; gap: 6px; }

/* loader animation */
.loader, .loader svg { animation: spin 1s linear infinite; }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* modal */
.modal-scrim { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: none; align-items: center; justify-content: center; z-index: 60; padding: 20px; }
.modal-scrim.open { display: flex; }
.modal { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-lg); width: 100%; max-width: 480px; max-height: 88vh; overflow: auto; box-shadow: var(--shadow); }
.modal.lg { max-width: 680px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 18px; border-top: 1px solid var(--border); }

/* toast */
.toasts { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 9px; z-index: 80; }
.toast { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); padding: 12px 15px; box-shadow: var(--shadow); max-width: 360px; animation: slidein .2s ease; }
.toast.error { border-left-color: var(--danger); }
@keyframes slidein { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* auth page */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { justify-content: center; padding: 0 0 6px; }
.auth-card .brand svg { width: 40px; height: 40px; }
.auth-card h2 { text-align: center; font-size: 20px; }
.auth-card .sub { text-align: center; color: var(--fg-muted); margin-bottom: 20px; font-size: 13.5px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--fg-faint); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* alert */
.alert { padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--bg-soft); font-size: 13.5px; margin-bottom: 16px; }
.alert.error { border-color: var(--danger); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

/* empty state */
.empty { text-align: center; padding: 54px 20px; color: var(--fg-muted); }
.empty svg { width: 46px; height: 46px; margin: 0 auto 14px; color: var(--fg-faint); }
.empty .t { font-size: 15px; font-weight: 600; color: var(--fg); margin-bottom: 4px; }

/* nav */
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-faint); padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 11px; border-radius: var(--radius-sm);
  color: var(--fg-muted); font-weight: 500; transition: var(--transition);
}
.nav a:hover { background: var(--bg-elev); color: var(--fg); }
.nav a.active { background: var(--accent); color: var(--accent-fg); }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }

/* mobile improvements */
@media (max-width: 860px) {
  .content { padding: 16px 14px 40px; }
  .page-head h1 { font-size: 20px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .topbar { padding: 0 14px; gap: 10px; }
  .search { max-width: none; }
  .filelist { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
  .stat .num { font-size: 22px; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .uchip span:not(.av) { display: none; }
  .tile-actions { flex-wrap: wrap; }
}
.muted { color: var(--fg-muted); }
.faint { color: var(--fg-faint); }
.center { text-align: center; }
.right { text-align: right; }
.mono { font-family: var(--mono); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spacer { flex: 1; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.page-head { margin-bottom: 22px; }
.page-head h1 { font-size: 24px; }
.page-head .desc { color: var(--fg-muted); font-size: 14px; }
.kbd { font-family: var(--mono); font-size: 12px; padding: 2px 6px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg-soft); }
.skel { background: var(--bg-soft); border-radius: var(--radius-sm); height: 14px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.href { color: var(--fg); text-decoration: underline; }
.href:hover { opacity: .7; }
.copybox { display: flex; gap: 8px; align-items: center; }
.copybox .input { font-family: var(--mono); font-size: 13px; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg-elev); cursor: pointer; color: var(--fg-muted); }
.icon-btn:hover { color: var(--fg); border-color: var(--fg); }
.icon-btn svg { width: 17px; height: 17px; }
.dl-page { max-width: 560px; margin: 0 auto; }
.preview { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; min-height: 220px; }
.preview img, .preview video, .preview audio { max-width: 100%; max-height: 420px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }

/* ===== public download page ===== */
.dl-page-wrap { max-width: 520px; margin: 0 auto; width: 100%; padding: 0 16px; box-sizing: border-box; }
.dl-page-card { padding: 0; overflow: hidden; }
.dl-status { text-align: center; padding: 40px 20px; }
.dl-status-icon { width: 48px; height: 48px; margin: 0 auto 14px; color: var(--fg-faint); }
.dl-status-icon svg { width: 48px; height: 48px; }
.dl-status-title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.dl-password-gate { text-align: center; padding: 32px 20px; }
.dl-password-gate h3 { margin: 10px 0 4px; }
.dl-password-input { text-align: center; max-width: 300px; margin: 0 auto; }
.dl-header { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.dl-file-icon { width: 36px; height: 36px; color: var(--fg-muted); flex: none; display: grid; place-items: center; }
.dl-file-icon svg { width: 36px; height: 36px; }
.dl-file-info { min-width: 0; flex: 1; }
.dl-file-info h3 { margin: 0 0 2px; font-size: 16px; display: block; }
.dl-file-meta { font-size: 12.5px; }
.dl-remaining { margin: 12px 20px 0; }
/* preview — compact, centered, not huge */
.dl-preview { margin: 12px 20px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); display: grid; place-items: center; min-height: 120px; max-height: 300px; }
.dl-preview-img { max-width: 100%; max-height: 280px; object-fit: contain; display: block; }
.dl-preview-video { max-width: 100%; max-height: 280px; display: block; }
.dl-preview-audio { padding: 20px; width: 100%; box-sizing: border-box; }
.dl-preview-iframe { width: 100%; height: 280px; border: 0; background: #fff; display: block; }
.dl-preview-pdf { width: 100%; height: 300px; border: 0; display: block; }
.dl-preview-icon { padding: 28px; text-align: center; }
.dl-preview-icon svg { width: 44px; height: 44px; color: var(--fg-faint); }
.dl-folder-list { padding: 0 20px 12px; }
.dl-folder-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.dl-folder-item:last-child { border-bottom: 0; }
.dl-folder-icon { width: 24px; height: 24px; color: var(--fg-muted); flex: none; display: grid; place-items: center; }
.dl-folder-icon svg { width: 24px; height: 24px; }
.dl-folder-info { flex: 1; min-width: 0; }
.dl-folder-name { font-weight: 600; font-size: 13.5px; }
.dl-folder-size { font-size: 11.5px; }
.dl-actions { padding: 16px 20px; border-top: 1px solid var(--border); text-align: center; }
.btn-lg { padding: 11px 24px; font-size: 15px; }
.btn-lg svg { width: 20px; height: 20px; }

@media (max-width: 600px) {
  .dl-page-wrap { padding: 0 10px; }
  .dl-header { padding: 14px 16px; gap: 10px; }
  .dl-file-icon { width: 32px; height: 32px; }
  .dl-file-icon svg { width: 32px; height: 32px; }
  .dl-preview { margin: 10px 14px; max-height: 240px; }
  .dl-preview-img { max-height: 220px; }
  .dl-preview-iframe { height: 220px; }
  .dl-preview-pdf { height: 260px; }
  .dl-remaining { margin: 10px 14px 0; }
  .dl-folder-list { padding: 0 14px 10px; }
  .dl-actions { padding: 14px 16px; }
  .dl-status { padding: 32px 16px; }
  .dl-password-gate { padding: 24px 16px; }
}
