/* The palette of MyFinance and Bird Audio Suite (warm paper, dark ink) with a blue accent of its
   own, so the installed apps tell apart; a dark variant. On a computer a grid of tiles with
   room around it; on the phone three columns, the tools within reach of a thumb. */
:root {
  --bg: #f4efe7;
  --surface: #fffaf4;
  --sunken: #ece5da;
  --ink: #1f2a24;
  --ink-soft: #59655d;
  --line: rgba(31, 42, 36, 0.12);
  --accent: #2f6f8f;
  --accent-deep: #1f4f68;
  --on-accent: #fff;
  --negative: #a23b2f;
  --folder: #c08a2e;
  --kind-image: #2f7a3e;
  --kind-video: #7a4fa0;
  --kind-audio: #b7651f;
  --kind-pdf: #a23b2f;
  --kind-other: #59655d;
  --shadow: 0 6px 24px rgba(31, 42, 36, 0.16);
  --radius: 10px;
  --control: 2.1rem; /* height of buttons and fields */
  --gap: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15191b;
    --surface: #1e2427;
    --sunken: #181d20;
    --ink: #e7ecea;
    --ink-soft: #a3b0ab;
    --line: rgba(231, 236, 234, 0.12);
    --accent: #7cb8d8;
    --accent-deep: #a8d2e8;
    --on-accent: #0e2230;
    --negative: #e58b7f;
    --folder: #e0b45b;
    --kind-image: #6cc07d;
    --kind-video: #b99be0;
    --kind-audio: #e6a160;
    --kind-pdf: #e58b7f;
    --kind-other: #a3b0ab;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}

body.viewing { overflow: hidden; }
body.busy { cursor: progress; }

button, input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
a { color: var(--accent-deep); }

.page-shell { width: min(100%, 1400px); margin: 0 auto; padding: 0 1rem 6rem; }

/* ---------------------------------------------------------------- controls */

button, .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: var(--control);
  padding: 0 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  color: inherit;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s;
}

button:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
button:disabled { opacity: 0.45; cursor: default; }
button svg, .button svg { width: 1.15rem; height: 1.15rem; fill: currentColor; flex: none; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
button.danger { background: var(--negative); border-color: var(--negative); color: var(--on-accent); }
button.ghost { border-color: transparent; background: transparent; color: var(--ink-soft); }
button.ghost:hover { background: var(--sunken); }
button.tool { min-height: 1.75rem; padding: 0 0.45rem; font-size: 0.8rem; border-radius: 6px; }
.link-button { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent-deep); font-weight: 600; text-decoration: underline; }

input, select {
  min-height: var(--control);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 0.6rem;
}

.icon-button {
  width: var(--control);
  padding: 0;
  border-radius: 999px;
}

.icon-button svg { fill: var(--accent); }
.pill { border-radius: 999px; }
.pill.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pill-button { padding: 0 0.8rem; border-radius: 999px; color: var(--accent-deep); font-weight: 600; }
.pill-button[aria-expanded="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

.dot { width: 0.55rem; height: 0.55rem; border-radius: 50%; background: var(--ink-soft); }
[data-state="on"] .dot { background: #3fa35a; }
[data-state="busy"] .dot { background: #d6a03a; }
[data-state="error"] .dot { background: var(--negative); }

.hint { margin: 0; color: var(--ink-soft); font-size: 0.82rem; }
.error { color: var(--negative); }

/* ---------------------------------------------------------------- top bar */

.top-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0 0.4rem;
}

.top-bar h1 { margin: 0; font-size: 1.25rem; color: var(--accent-deep); }
.top-tools { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }

/* ---------------------------------------------------------------- connection */

.connect-panel {
  margin-bottom: 0.8rem;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.connect-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.6rem 1rem; margin-bottom: 0.7rem; }
.connect-form label { display: grid; gap: 0.2rem; color: var(--ink-soft); font-size: 0.82rem; }
.connect-form label.check { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; }
.connect-form label.check input { min-height: 0; accent-color: var(--accent); }
.connect-actions { display: flex; gap: var(--gap); justify-content: flex-end; }
.connect-panel .error { margin: 0.6rem 0 0; font-weight: 600; }

/* ---------------------------------------------------------------- toolbar */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0 -1rem;
  padding: 0.5rem 1rem;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 18rem;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
  font-size: 1rem;
}

.breadcrumb a, .breadcrumb .crumb {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: var(--control);
  padding: 0 0.4rem;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover, .breadcrumb .crumb:hover { background: var(--sunken); color: var(--ink); }
.breadcrumb a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.breadcrumb svg { width: 1.15rem; height: 1.15rem; fill: var(--accent); }
.crumb-sep { color: var(--ink-soft); opacity: 0.6; }

.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--gap); }
.solo-telefono { display: none; }
#select-toggle svg { display: none; }
.tools input[type="search"] { width: 14rem; }
#view-toggle svg, #hidden-toggle svg { fill: var(--ink-soft); }
#hidden-toggle[aria-pressed="true"] { border-color: var(--accent); }
#hidden-toggle[aria-pressed="true"] svg { fill: var(--accent); }
/* "Mostra nascosti": what starts with a dot is there, but fainter */
.item.dotfile .open { opacity: 0.6; }

.summary { min-height: 1.2rem; margin: 0.6rem 0; color: var(--ink-soft); font-size: 0.85rem; }

.empty { padding: 3rem 1rem; text-align: center; color: var(--ink-soft); }

/* ---------------------------------------------------------------- items */

.items { list-style: none; margin: 0 0 0.8rem; padding: 0; }
.item { position: relative; -webkit-touch-callout: none; user-select: none; }
.item .open { width: 100%; min-height: 0; padding: 0; border-radius: var(--radius); white-space: normal; text-align: left; color: inherit; text-decoration: none; }
.thumb { position: relative; display: grid; place-items: center; overflow: hidden; background: var(--sunken); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb > svg { fill: var(--kind-other); }
.folder .thumb > svg { fill: var(--folder); }
.kind-image .thumb > svg, .kind-raw .thumb > svg { fill: var(--kind-image); }
.kind-video .thumb > svg { fill: var(--kind-video); }
.kind-audio .thumb > svg { fill: var(--kind-audio); }
.kind-pdf .thumb > svg { fill: var(--kind-pdf); }
.badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
}
.badge svg { width: 1rem; height: 1rem; fill: #fff; }
.name { font-weight: 600; overflow-wrap: anywhere; }
.meta { color: var(--ink-soft); font-size: 0.75rem; }
.item.selected .open { outline: 2px solid var(--accent); outline-offset: -1px; background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }

/* the round box of "Seleziona": always while selecting, on hover with a mouse */
.select-box {
  position: absolute;
  z-index: 2;
  display: none;
  place-items: center;
  width: 1.7rem;
  min-height: 1.7rem;
  height: 1.7rem;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.28);
  color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}
.select-box svg { width: 1.05rem; height: 1.05rem; }
.select-box[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
body.selecting .select-box { display: grid; }
@media (hover: hover) and (pointer: fine) {
  .item:hover .select-box { display: grid; }
}

.more {
  position: absolute;
  z-index: 2;
  width: 1.9rem;
  min-height: 1.9rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
}
.more:hover { background: var(--sunken); }
body.selecting .more { display: none; }

/* grid: square tiles for files, short ones for folders */
.items.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.items.grid .open { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.items.grid .files .open, .items.grid.files .open { height: 100%; }
.items.grid.files .thumb { aspect-ratio: 1; width: 100%; }
.items.grid.files .thumb > svg { width: 38%; height: 38%; }
.items.grid.files .name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 0.4rem 2.1rem 0 0.55rem;
  font-size: 0.85rem;
}
.items.grid.files .meta { padding: 0.15rem 0.55rem 0.5rem; }
.items.grid.files .more { right: 3px; bottom: 6px; }
.items.grid .select-box { top: 6px; left: 6px; }
.items.grid.folders .open { flex-direction: row; align-items: center; gap: 0.55rem; min-height: 3rem; padding: 0 2.2rem 0 0.7rem; }
.items.grid.folders .thumb { background: none; overflow: visible; }
.items.grid.folders .thumb > svg { width: 1.6rem; height: 1.6rem; }
.items.grid.folders .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items.grid.folders .more { right: 4px; top: 50%; transform: translateY(-50%); }
.items.grid.folders .select-box { top: 50%; left: auto; right: 2.3rem; transform: translateY(-50%); }

/* list: one row each, the details on the right (below the name on the phone) */
.items.list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.items.list .item + .item { border-top: 1px solid var(--line); }
.items.list .open {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  min-height: 3.2rem;
  padding: 0.35rem 2.8rem 0.35rem 0.6rem;
  border: 0;
  border-radius: 0;
  background: none;
}
.items.list .open:hover { background: var(--sunken); }
.items.list .thumb { width: 2.6rem; height: 2.6rem; border-radius: 6px; }
.items.list .thumb > svg { width: 1.5rem; height: 1.5rem; }
.items.list.folders .thumb { background: none; }
.items.list .badge { left: 2px; bottom: 2px; width: 1.1rem; height: 1.1rem; }
.items.list .badge svg { width: 0.75rem; height: 0.75rem; }
.items.list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.items.list .meta { font-size: 0.8rem; white-space: nowrap; }
.items.list .more { right: 0.4rem; top: 50%; transform: translateY(-50%); }
.items.list .select-box { left: 1rem; top: 50%; transform: translateY(-50%); }
body.selecting .items.list .thumb { visibility: hidden; }

/* ---------------------------------------------------------------- bulk bar */

body.with-bulk-bar .page-shell { padding-bottom: 8rem; }
.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: max(0.6rem, env(safe-area-inset-bottom));
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  width: min(40rem, calc(100% - 1rem));
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}
.bulk-bar .bulk-count { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bulk-bar .spacer { flex: 1; }
.bulk-bar .round { width: 2.5rem; height: 2.5rem; padding: 0; border-radius: 50%; }
.bulk-bar .round svg { width: 1.3rem; height: 1.3rem; }
.bulk-bar .round:not(.danger) svg { fill: var(--accent-deep); }

/* ---------------------------------------------------------------- uploads */

.transfers {
  position: fixed;
  right: 1rem;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 25;
  width: min(26rem, calc(100% - 1rem));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
body.with-bulk-bar .transfers { bottom: 5.2rem; }
.transfers-head { display: flex; align-items: center; gap: 0.4rem; padding: 0.3rem 0.4rem; }
.transfers-title { flex: 1; justify-content: flex-start; min-width: 0; color: var(--ink); font-weight: 600; }
.transfers-title span { overflow: hidden; text-overflow: ellipsis; }
.progress { height: 3px; background: var(--sunken); }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.transfers.finished .progress { display: none; }
.transfers-list { list-style: none; max-height: 14rem; margin: 0; padding: 0.2rem 0; overflow-y: auto; }
.transfers.collapsed .transfers-list { display: none; }
.transfer {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.2rem;
  padding: 0 0.7rem;
  font-size: 0.85rem;
}
.transfer-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer-state { color: var(--ink-soft); font-variant-numeric: tabular-nums; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.transfer.error .transfer-state { color: var(--negative); }
.transfer.done .transfer-state { color: #3fa35a; }
.transfer-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); }
.transfer .tool svg { width: 0.95rem; height: 0.95rem; }

/* ---------------------------------------------------------------- viewer */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: #0d0f10;
  color: #eef1f0;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: max(0.4rem, env(safe-area-inset-top)) 0.6rem 0.4rem;
  background: rgba(0, 0, 0, 0.5);
}
.viewer-bar .icon-button { border: 0; background: transparent; color: #eef1f0; }
.viewer-bar .icon-button svg { fill: #eef1f0; }
.viewer-bar .icon-button:hover { background: rgba(255, 255, 255, 0.12); }
.viewer-bar .hd {
  min-height: 1.8rem;
  padding: 0 0.55rem;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 6px;
  background: transparent;
  color: #eef1f0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.viewer-bar .hd:hover { background: rgba(255, 255, 255, 0.12); }
.viewer-bar .hd:disabled { opacity: 0.6; cursor: progress; }
.viewer-title { display: grid; min-width: 0; flex: 1; }
.viewer-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-title span { color: #a9b3b0; font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-actions { display: flex; gap: 0.2rem; }

/* One cell exactly as big as the stage: the photo or video fills it and object-fit fits the
   picture inside, whichever side is the tighter one. (With max-width/max-height in an "auto"
   row the height was never a limit: a photo on a phone held sideways came out cut.) */
.viewer-stage {
  position: relative;
  flex: 1;
  display: grid;
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
  place-items: center;
  min-height: 0;
  padding: 0.5rem;
  touch-action: pan-y pinch-zoom;
}
.viewer-stage img, .viewer-stage video { width: 100%; height: 100%; object-fit: contain; }
.viewer-stage iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 6px; }
.viewer-stage:has(iframe) { grid-template-rows: minmax(0, 1fr) auto; gap: 0.5rem; }
.viewer-text {
  align-self: start;
  width: min(100%, 60rem);
  max-height: 100%;
  margin: 0;
  padding: 1rem;
  overflow: auto;
  border-radius: 8px;
  background: #1b1f21;
  color: #e7ecea;
  font-size: 0.85rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}
.viewer-file { display: grid; justify-items: center; gap: 1rem; text-align: center; color: #c5ceca; }
.viewer-file > svg { width: 5rem; height: 5rem; fill: #7f8b87; }
.viewer-file audio { width: min(90vw, 26rem); }
.viewer-open { min-height: 2.6rem; padding: 0 1.2rem; }

.viewer-nav {
  position: absolute;
  top: 50%;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  transform: translateY(-50%);
}
.viewer-nav svg { width: 2rem; height: 2rem; fill: #fff; }
.viewer-nav:hover { background: rgba(0, 0, 0, 0.7); }
.viewer-nav:disabled { display: none; }
.viewer-nav.prev { left: 0.8rem; }
.viewer-nav.next { right: 0.8rem; }

/* ---------------------------------------------------------------- menu, dialog, drop, toast */

.menu {
  position: fixed;
  z-index: 50;
  display: grid;
  min-width: 13rem;
  max-width: calc(100vw - 1rem);
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.menu-title { margin: 0; padding: 0.35rem 0.6rem 0.45rem; color: var(--ink-soft); font-size: 0.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18rem; }
.menu button { justify-content: flex-start; gap: 0.7rem; min-height: 2.5rem; border: 0; background: none; }
.menu button:hover, .menu button:focus-visible { background: var(--sunken); outline: none; }
.menu button svg { fill: var(--ink-soft); }
.menu button.danger { color: var(--negative); }
.menu button.danger svg { fill: var(--negative); }

.dialog {
  width: min(28rem, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.dialog-form { display: grid; gap: 0.8rem; padding: 1rem; }
.dialog h2 { margin: 0; font-size: 1.05rem; overflow-wrap: anywhere; }
.dialog-message { margin: 0; overflow-wrap: anywhere; }
.dialog-message .hint { display: block; margin-top: 0.4rem; }
.dialog input { width: 100%; }
.dialog-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--gap); }
.dialog-actions .spacer { flex: 1; }
.chooser-path { flex: none; margin: 0 -0.4rem; font-size: 0.9rem; }
.chooser-new-form { display: flex; gap: var(--gap); }
.chooser-list { list-style: none; margin: 0; padding: 0; height: min(18rem, 45vh); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.chooser-list li + li { border-top: 1px solid var(--line); }
.chooser-list button { justify-content: flex-start; gap: 0.6rem; width: 100%; min-height: 2.6rem; border: 0; border-radius: 0; background: none; }
.chooser-list button:hover { background: var(--sunken); }
.chooser-list button svg { fill: var(--folder); }
.chooser-list .empty { padding: 1.2rem; }
.chooser-new svg { fill: var(--accent); }

.drop-zone {
  position: fixed;
  inset: 0.6rem;
  z-index: 60;
  display: grid;
  place-items: center;
  border: 3px dashed var(--accent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  backdrop-filter: blur(2px);
  pointer-events: none;
}
.drop-zone p { padding: 0.8rem 1.2rem; border-radius: 999px; background: var(--surface); font-size: 1.1rem; font-weight: 600; color: var(--accent-deep); box-shadow: var(--shadow); }

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 70;
  max-width: min(36rem, calc(100% - 2rem));
  margin: 0;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  text-align: center;
}
.toast.error { border-radius: var(--radius); background: var(--negative); color: #fff; }
body.with-bulk-bar .toast { bottom: 5.2rem; }

/* ---------------------------------------------------------------- phone */

@media (max-width: 720px) {
  :root { --control: 2.4rem; }
  .page-shell { padding: 0 0.75rem 6rem; }
  .toolbar { margin: 0 -0.75rem; padding: 0.4rem 0.75rem; gap: 0.4rem; }
  .breadcrumb { flex-basis: 100%; }
  .tools { width: 100%; flex-wrap: nowrap; gap: 0.3rem; }
  .tools input[type="search"] { flex: 1; width: auto; min-width: 0; }
  .tools select { max-width: 5.6rem; padding: 0 0.2rem; }
  .labelled { width: var(--control); padding: 0; }
  .labelled span { display: none; }
  .solo-pc { display: none; }
  .solo-telefono { display: inline-flex; }
  #select-toggle svg { display: block; }
  .tools #filter, #search-close { display: none; }
  .toolbar.searching .tools > * { display: none; }
  .toolbar.searching .tools #filter { display: block; }
  .toolbar.searching .tools #search-close { display: inline-flex; }
  .connect-form { grid-template-columns: minmax(0, 1fr); }

  .items.grid.files { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .items.grid.files .open { border-radius: 6px; }
  .items.grid.files .name { padding: 0.3rem 1.7rem 0 0.35rem; font-size: 0.75rem; -webkit-line-clamp: 1; }
  .items.grid.files .meta { padding: 0 0.35rem 0.35rem; font-size: 0.68rem; }
  .items.grid.files .more { right: 0; bottom: 2px; width: 1.6rem; min-height: 1.6rem; }
  .items.grid.folders { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }

  .items.list .open { grid-template-columns: 2.6rem minmax(0, 1fr); grid-template-rows: auto auto; row-gap: 0; }
  .items.list .thumb { grid-row: span 2; }
  .items.list .meta { grid-column: 2; }
  .items.list.folders .open { grid-template-rows: auto; }
  .items.list.folders .thumb { grid-row: auto; }

  .transfers { right: 0.5rem; }
  .bulk-bar .round { width: 2.3rem; height: 2.3rem; }
  .viewer-nav { display: none; }
}

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