/* ============================================================
   FileRoom — адаптивная тема (телефон / планшет / десктоп)
   ============================================================ */

:root {
  --bg: #0f1216;
  --bg-2: #161b22;
  --bg-3: #1d242e;
  --line: #262d38;
  --line-2: #333c4a;
  --fg: #e6edf3;
  --fg-dim: #9aa7b4;
  --fg-mute: #6d7a89;
  --accent: #3b82f6;
  --accent-fg: #fff;
  --danger: #ef4444;
  --ok: #22c55e;
  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 56px;
  --toolbar-h: 52px;
  --shadow: 0 8px 30px rgba(0, 0, 0, .35);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f8fa;
    --bg-2: #fff;
    --bg-3: #eef1f5;
    --line: #e3e8ee;
    --line-2: #d3dae2;
    --fg: #16202b;
    --fg-dim: #56646f;
    --fg-mute: #8b98a5;
    --shadow: 0 8px 30px rgba(16, 32, 48, .12);
  }
}

* { box-sizing: border-box; }

/* Атрибут hidden должен побеждать: правила вида .lightbox{display:grid} имеют
   специфичность выше, чем [hidden]{display:none} из стилей браузера, и без этого
   оверлеи (лайтбокс, дропзона, панели) висят на экране постоянно. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}

button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }

/* ---------------------------------------------------------- кнопки */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  color: var(--fg);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { background: var(--line); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn-primary:hover { filter: brightness(1.1); background: var(--accent); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(239, 68, 68, .12); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-lg { padding: 13px 22px; font-size: 16px; width: 100%; justify-content: center; }
.btn .ico { font-size: 15px; line-height: 1; }

.select {
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  max-width: 46vw;
}

.spacer { flex: 1 1 auto; }

/* ============================================================
   Лендинг
   ============================================================ */

body.landing { display: grid; place-items: center; padding: 24px 16px calc(24px + var(--safe-b)); }

.hero { width: 100%; max-width: 620px; }

.hero-card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.hero-logo { font-size: 44px; line-height: 1; }
.hero h1 { margin: 10px 0 6px; font-size: clamp(26px, 6vw, 34px); letter-spacing: -.02em; }
.hero-sub { margin: 0 0 22px; color: var(--fg-dim); font-size: 15px; }

/* ---- форма создания комнаты ---- */

.create-form { display: grid; gap: 12px; text-align: left; }

.field { display: grid; gap: 5px; }
.field-label { font-size: 13px; color: var(--fg-dim); }
.field-label .req { color: var(--accent); font-weight: 600; font-style: normal; }
.field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.field input:focus { outline: none; border-color: var(--accent); }

.check { display: flex; align-items: center; gap: 9px; font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }

.field-hint { margin: 0; font-size: 13px; color: var(--fg-mute); }
.field-err {
  margin: 0;
  font-size: 13px;
  color: var(--danger);
  background: rgba(239, 68, 68, .1);
  border: 1px solid rgba(239, 68, 68, .35);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
}

/* ---- экран «введите пароль» в комнате ---- */

.gate {
  position: fixed;
  inset: 0;
  z-index: 97;
  display: grid;
  place-items: center;
  background: var(--bg);
  padding: 20px;
}
.gate-card {
  width: min(380px, 100%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 26px 22px;
  box-shadow: var(--shadow);
  text-align: center;
}
.gate-ico { font-size: 40px; line-height: 1; }
.gate-card h2 { margin: 10px 0 4px; font-size: 20px; }
.gate-card p { margin: 0 0 18px; color: var(--fg-dim); font-size: 14px; }
.gate-card form { display: grid; gap: 10px; }
.gate-card input {
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
  text-align: center;
}
.gate-card input:focus { outline: none; border-color: var(--accent); }
.gate-err { color: var(--danger); font-size: 13px; min-height: 18px; }
.gate-back { display: inline-block; margin-top: 14px; font-size: 13px; }

.hero-or {
  position: relative;
  margin: 20px 0 14px;
  color: var(--fg-mute);
  font-size: 13px;
}
.hero-or::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  border-top: 1px solid var(--line);
}
.hero-or span { position: relative; background: var(--bg-2); padding: 0 12px; }

.join-row { display: flex; gap: 8px; }
.join-row input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.recent { margin-top: 22px; text-align: left; }
.recent-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--fg-mute); margin-bottom: 8px; }
.recent ul, #recent { list-style: none; margin: 0; padding: 0; }
#recent li { border-top: 1px solid var(--line); display: flex; align-items: center; gap: 6px; }
#recent a {
  flex: 1 1 auto;
  min-width: 0;
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 2px; color: var(--fg);
}
#recent a > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#recent a:hover { color: var(--accent); }
#recent time { color: var(--fg-mute); font-size: 13px; white-space: nowrap; }

.recent-x {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--fg-mute);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 6px 4px;
  border-radius: 6px;
}
.recent-x:hover { background: var(--bg-3); color: var(--danger); }

.features { list-style: none; display: grid; gap: 12px; margin: 22px 0 0; padding: 0; }
.features li {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.features b { display: block; margin-bottom: 3px; }
.features span { color: var(--fg-dim); font-size: 14px; }

@media (min-width: 720px) { .features { grid-template-columns: repeat(3, 1fr); } }

/* ============================================================
   Комната: каркас
   ============================================================ */

body.room {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--topbar-h);
  padding: 0 12px;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
}
.topbar-main { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.brand { font-size: 22px; text-decoration: none; }

.room-title {
  min-width: 0;
  flex: 1 1 auto;
  max-width: 420px;
  padding: 6px 8px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-size: 16px;
  font-weight: 600;
}
.room-title:hover { border-color: var(--line); }
.room-title:focus { outline: none; border-color: var(--accent); background: var(--bg); }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fg-mute); flex: 0 0 auto; }
.dot.on { background: var(--ok); }
.dot.off { background: var(--danger); }

.users { display: flex; }
.users .av {
  width: 26px; height: 26px;
  margin-left: -7px;
  border-radius: 50%;
  border: 2px solid var(--bg-2);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #fff;
}
.users .av:first-child { margin-left: 0; }

.toolbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--toolbar-h);
  padding: 0 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.search-wrap { position: relative; flex: 0 1 340px; min-width: 0; }
.search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font-size: 13px; opacity: .6; }
.search-wrap input {
  width: 100%;
  padding: 8px 10px 8px 32px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--bg-2);
}

.viewtoggle { display: flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; }
.vt {
  padding: 7px 12px;
  border: 0;
  background: var(--bg-2);
  cursor: pointer;
  font-size: 15px;
  color: var(--fg-dim);
}
.vt.active { background: var(--accent); color: var(--accent-fg); }

.selbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-3);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.selbar .spacer { flex: 1; }

/* ---- хлебные крошки ---- */

.crumbs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
  font-size: 13px;
  overflow-x: auto;
  white-space: nowrap;
  scrollbar-width: thin;
}
.crumbs::-webkit-scrollbar { height: 0; }
.crumb {
  border: 0;
  background: transparent;
  color: var(--fg-dim);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.crumb:hover { background: var(--bg-3); color: var(--fg); }
.crumb.current { color: var(--fg); font-weight: 600; cursor: default; }
.crumb.current:hover { background: transparent; }
.crumb.drop-target { background: rgba(59, 130, 246, .2); color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent); }
.crumb-sep { color: var(--fg-mute); user-select: none; }

/* ---- модалка выбора папки ---- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 96;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .5);
  padding: 16px;
}
.modal-card {
  width: min(420px, 100%);
  max-height: min(70vh, 560px);
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.modal-card > header { padding: 12px 14px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal-card > footer { padding: 10px 14px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.dlg-body { padding: 14px; display: grid; gap: 10px; }
.dlg-body input {
  padding: 10px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.dlg-body input:focus { outline: none; border-color: var(--accent); }
.dlg-body footer { border: 0; padding: 0; display: flex; gap: 8px; justify-content: flex-end; }

.movetree { list-style: none; margin: 0; padding: 6px 0; overflow: auto; flex: 1 1 auto; }
.movetree li { padding: 0; }
.movetree button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--fg);
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.movetree button:hover { background: var(--bg-3); }
.movetree button.picked { background: rgba(59, 130, 246, .18); box-shadow: inset 2px 0 0 var(--accent); }
.movetree button:disabled { opacity: .38; cursor: not-allowed; }

/* ---- подсветка папки как цели перетаскивания ---- */

.filetable tbody tr.drop-target { background: rgba(59, 130, 246, .22); box-shadow: inset 0 0 0 1px var(--accent); }
.tile.drop-target { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.row-folder .fname, .tile.is-folder .tile-name { font-weight: 600; }
.dragging-item { opacity: .45; }

.content { flex: 1 1 auto; overflow: auto; -webkit-overflow-scrolling: touch; position: relative; }

.statusbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px calc(8px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--fg-dim);
  font-size: 13px;
}

.empty { display: grid; place-items: center; gap: 6px; padding: 12vh 16px; color: var(--fg-dim); text-align: center; }
.empty-ico { font-size: 44px; }
.empty p { margin: 0; font-size: 17px; color: var(--fg); }
.empty span { font-size: 14px; }

/* ============================================================
   Таблица
   ============================================================ */

.table-wrap { min-width: 0; }

.filetable { width: 100%; border-collapse: collapse; }

.filetable thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-mute);
  white-space: nowrap;
  user-select: none;
}
.filetable th.sortable { cursor: pointer; }
.filetable th.sortable:hover { color: var(--fg); }
.filetable th.sorted { color: var(--accent); }
.filetable th.sorted::after { content: " ▲"; font-size: 9px; }
.filetable th.sorted.desc::after { content: " ▼"; }

.filetable td { padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.filetable tbody tr:hover { background: var(--bg-2); }
.filetable tbody tr.sel { background: rgba(59, 130, 246, .14); }

.col-check { width: 38px; }
.col-size { width: 110px; }
.col-type { width: 110px; }
.col-date { width: 170px; }
.col-user { width: 150px; }
.col-act { width: 92px; }

.cell-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fname {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.fname:hover { color: var(--accent); }
.fmeta { display: none; }

.thumb-xs {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg-3);
}

.badge {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  border-radius: 6px;
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
  letter-spacing: .02em;
  overflow: hidden;
}
.cat-image { background: #7c3aed; }
.cat-video { background: #db2777; }
.cat-audio { background: #0891b2; }
.cat-doc { background: #2563eb; }
.cat-archive { background: #ca8a04; }
.cat-code { background: #059669; }
.cat-other { background: #64748b; }

.badge.folder-ico {
  background: transparent;
  font-size: 26px;
  color: inherit;
}
.tile-media .folder-ico { font-size: 54px; }

.rowacts { display: flex; gap: 4px; justify-content: flex-end; }
.iconbtn {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 5px 6px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1;
  opacity: .65;
}
.iconbtn:hover { background: var(--bg-3); opacity: 1; }
.iconbtn.del:hover { color: var(--danger); }

.muted { color: var(--fg-dim); }
.nowrap { white-space: nowrap; }

/* ============================================================
   Сетка иконок
   ============================================================ */

.grid-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 14px;
  align-content: start;
}

.tile {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}
.tile:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tile.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(59, 130, 246, .35); }

.tile-media {
  aspect-ratio: 1 / 1;
  background: var(--bg-3);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.tile-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-media .big { font-size: 34px; }
.tile-media .badge { width: 46px; height: 46px; font-size: 12px; border-radius: 10px; }

.tile-cap { padding: 7px 9px 9px; }
.tile-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tile-sub { font-size: 11px; color: var(--fg-mute); margin-top: 2px; }

.tile-check {
  position: absolute;
  top: 7px; left: 7px;
  z-index: 2;
  opacity: 0;
  transition: opacity .12s;
}
.tile:hover .tile-check, .tile.sel .tile-check, .touch .tile-check { opacity: 1; }

.tile-acts {
  position: absolute;
  top: 5px; right: 5px;
  display: flex;
  gap: 2px;
  background: rgba(0, 0, 0, .55);
  border-radius: 8px;
  padding: 2px;
  opacity: 0;
  transition: opacity .12s;
}
.tile:hover .tile-acts { opacity: 1; }
.tile-acts .iconbtn { color: #fff; opacity: .9; }

/* ============================================================
   Загрузка / drag&drop / lightbox / тост
   ============================================================ */

.dropzone {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  background: rgba(15, 18, 22, .82);
  backdrop-filter: blur(3px);
}
.dropzone > div {
  border: 2px dashed var(--accent);
  border-radius: 18px;
  padding: 44px 56px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}
.dropzone span { display: block; margin-top: 6px; font-size: 14px; font-weight: 400; opacity: .8; }

.uploads {
  position: fixed;
  right: 14px;
  bottom: calc(14px + var(--safe-b));
  z-index: 80;
  width: min(360px, calc(100vw - 28px));
  max-height: 46vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.uploads-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.uploads-head span { flex: 1; color: var(--fg-dim); font-size: 12px; }
.uploads ul { list-style: none; margin: 0; padding: 6px 0; overflow: auto; }
.uploads li { padding: 6px 12px; font-size: 13px; }
.up-row { display: flex; gap: 8px; align-items: center; }
.up-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-pct { color: var(--fg-mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.up-bar { height: 3px; margin-top: 5px; border-radius: 2px; background: var(--bg-3); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.up-err { color: var(--danger); font-size: 12px; }
.up-done .up-bar i { background: var(--ok); }

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(0, 0, 0, .92);
  display: grid;
  place-items: center;
}
.lightbox img { max-width: 94vw; max-height: 84vh; object-fit: contain; }
.lb-close, .lb-nav {
  position: absolute;
  background: rgba(255, 255, 255, .1);
  border: 0;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.lb-close { top: 14px; right: 14px; width: 40px; height: 40px; font-size: 17px; }
.lb-nav { top: 50%; transform: translateY(-50%); width: 46px; height: 46px; font-size: 30px; }
.lb-prev { left: 12px; }
.lb-next { right: 12px; }
.lb-cap {
  position: absolute;
  bottom: calc(16px + var(--safe-b));
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 13px;
  background: rgba(0, 0, 0, .5);
  padding: 6px 12px;
  border-radius: 999px;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 99;
  background: var(--fg);
  color: var(--bg);
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
}

.only-mobile { display: none; }

/* ============================================================
   ПЛАНШЕТ  (<= 1024px): прячем «Загрузил»
   ============================================================ */

@media (max-width: 1024px) {
  .col-user, .cell-user { display: none; }
  .grid-wrap { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
}

@media (max-width: 860px) {
  /* расширение и так видно в имени файла — жертвуем колонкой «Тип», дату оставляем */
  .col-type, .cell-type { display: none; }
  .col-date { width: 140px; }
  .btn .lbl { display: none; }
  .btn .ico { font-size: 17px; }
  .btn-lg .lbl, .btn-sm .lbl { display: inline; }
  .room-title { font-size: 15px; }
}

/* ============================================================
   ТЕЛЕФОН (<= 640px): таблица превращается в список-карточки
   ============================================================ */

@media (max-width: 640px) {
  :root { --topbar-h: 52px; }

  .only-mobile { display: block; }
  .toolbar { gap: 6px; padding: 0 10px; }
  .search-wrap { flex: 1 1 auto; }
  .toolbar .select { flex: 0 0 auto; font-size: 13px; padding: 7px 8px; }
  #typeFilter { display: none; }

  .filetable thead { display: none; }
  .filetable, .filetable tbody, .filetable tr, .filetable td { display: block; width: 100%; }

  .filetable tr {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0 10px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
  }
  .filetable td { border: 0; padding: 0; }
  .filetable td.col-check-cell { grid-column: 1; }
  .filetable td.cell-name-td { grid-column: 2; min-width: 0; }
  .filetable td.cell-acts { grid-column: 3; }
  .filetable td.cell-size, .filetable td.cell-type, .filetable td.cell-date, .filetable td.cell-user { display: none; }

  .fmeta { display: block; font-size: 12px; color: var(--fg-mute); margin-top: 2px; }
  .cell-name { align-items: flex-start; }
  .thumb-xs, .badge { width: 40px; height: 40px; }

  .grid-wrap { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 9px; padding: 10px; }
  .tile-cap { padding: 6px 7px 8px; }
  .tile-name { font-size: 12px; }
  .tile-acts { opacity: 1; }

  .uploads { left: 10px; right: 10px; width: auto; }
  .statusbar .hint { display: none; }
  .lb-nav { width: 40px; height: 40px; font-size: 26px; }
}

@media (max-width: 380px) {
  .users { display: none; }
  .grid-wrap { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
