/*
 * Quick FTP Explorer - the File-Explorer layout in the colours of Dessaud
 * Alarme Service: an ink navy that carries the frame, and a signal red kept
 * for the logo and for what needs attention (see PRODUCT.md). Selection and
 * filters use navy and words, never red alone.
 */

:root {
  /* Brand, from the Dessaud Alarme Service logo. */
  --brand-red: oklch(0.509 0.206 26.2);       /* #C00319 */
  --brand-ink: oklch(0.175 0.036 242.5);      /* #02121F */

  /* Ink: the top bar, sign-in header, primary actions. */
  --ink: oklch(0.205 0.035 245);
  --ink-raised: oklch(0.275 0.04 245);
  --ink-line: oklch(0.38 0.035 245);
  --on-ink: oklch(0.965 0.006 245);
  --on-ink-muted: oklch(0.78 0.02 245);
  --on-ink-link: oklch(0.84 0.075 252);
  --on-ink-dim: oklch(0.5 0.025 245);

  /* Neutrals, tinted toward the navy. */
  --text: oklch(0.235 0.028 245);
  --text-soft: oklch(0.4 0.025 245);
  --muted: oklch(0.505 0.022 245);
  --bg: oklch(0.972 0.004 245);
  --surface: oklch(0.993 0.002 245);
  --surface-alt: oklch(0.958 0.006 245);
  --border: oklch(0.885 0.01 245);
  --border-soft: oklch(0.93 0.007 245);
  --border-input: oklch(0.6 0.02 245);

  /* States. */
  --hover: oklch(0.952 0.014 245);
  --selected: oklch(0.905 0.035 245);
  --selected-hover: oklch(0.88 0.042 245);
  --primary: oklch(0.3 0.065 245);
  --primary-hover: oklch(0.37 0.075 245);
  --primary-active: oklch(0.25 0.055 245);
  --link: oklch(0.45 0.12 252);
  --focus: oklch(0.55 0.16 252);
  --focus-halo: oklch(0.55 0.16 252 / 0.24);
  --danger: oklch(0.507 0.199 26);
  --danger-soft: oklch(0.962 0.018 26);
  --danger-line: oklch(0.82 0.08 26);
  --disabled-bg: oklch(0.9 0.006 245);
  --disabled-text: oklch(0.6 0.012 245);
  --folder: oklch(0.88 0.045 245);
  --mark: oklch(0.91 0.09 90);

  /* The viewer stays dark: footage reads best on it. */
  --viewer: oklch(0.15 0.015 245);
  --viewer-bar: oklch(0.2 0.022 245);
  --viewer-raised: oklch(0.27 0.025 245);
  --viewer-line: oklch(0.32 0.02 245);
  --viewer-media: oklch(0.1 0.008 245);
  --on-viewer: oklch(0.94 0.006 245);
  --on-viewer-muted: oklch(0.75 0.015 245);
  --viewer-link: oklch(0.8 0.09 252);

  /* Type in rem, so the browser's text-size setting applies; 13 px at the
     least, for older eyes. */
  --fs-xs: 0.8125rem;
  --fs-sm: 0.875rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1rem;
  --fs-xl: 1.25rem;

  --radius: 4px;
  --radius-lg: 8px;
  --shadow-pop: 0 8px 24px oklch(0.2 0.03 245 / 0.18);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --head-h: 34px;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", sans-serif;
  font-size: var(--fs-md);
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

a { color: var(--link); }

/* Pages wait for their translation (i18n.js), so nobody sees them switch
   language; after a second they show anyway, whatever happened. */
.i18n-pending body {
  visibility: hidden;
  animation: i18n-reveal 0s 1s forwards;
}
@keyframes i18n-reveal { to { visibility: visible; } }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-folder { fill: var(--folder); }

/* The skip control: first Tab stop, visible only once focused. */
.skip-link {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 200;
  transform: translateY(-200%);
}
.skip-link:focus-visible { transform: none; }

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

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 12px;
  background: var(--ink);
  color: var(--on-ink);
  flex-shrink: 0;
}
.topbar .muted { color: var(--on-ink-muted); }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.topbar .brand { min-width: 210px; }
.brand-mark {
  display: block;
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}
.brand-name {
  font-size: var(--fs-lg);
  font-weight: 600;
  white-space: nowrap;
}

.nav-buttons { display: flex; gap: 4px; flex-shrink: 0; }

/* The address bar: Tous les sites › site › folders. The last segment never
   shrinks; earlier ones give way first. */
.breadcrumb {
  flex: 1 1 auto;
  min-width: 0;
  padding: 4px 10px;
  background: var(--ink-raised);
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
}
.bc-list {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
}
.bc-item {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
}
.bc-item:last-child { flex: 0 0 auto; max-width: 100%; }
.bc-item + .bc-item::before {
  content: "›";
  margin: 0 6px;
  color: var(--on-ink-muted);
}
.bc-link, .bc-current {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 1px 2px;
  border-radius: 2px;
}
.bc-link { color: var(--on-ink-link); text-decoration: none; }
.bc-link:hover { text-decoration: underline; }
.bc-current { color: var(--on-ink); font-weight: 600; }

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search input {
  width: 260px;
  box-sizing: border-box;
  padding: 5px 30px;
  border: 1px solid var(--ink-line);
  border-radius: var(--radius);
  background: var(--ink-raised);
  color: var(--on-ink);
  font: inherit;
}
.search input::-webkit-search-cancel-button { display: none; }
.search input::placeholder { color: var(--on-ink-muted); }
.search input:focus {
  outline: none;
  border-color: var(--on-ink-link);
  box-shadow: 0 0 0 3px oklch(0.84 0.075 252 / 0.28);
}
.search-glass {
  position: absolute;
  left: 9px;
  color: var(--on-ink-muted);
  pointer-events: none;
}
.search-clear {
  position: absolute;
  right: 3px;
  min-height: 0;
  width: 26px;
  height: 26px;
  padding: 0;
  color: var(--on-ink-muted);
  background: transparent;
}
.search-clear:hover { color: var(--on-ink); background: var(--ink-line); }
.topbar .search-open, .topbar .search-close { display: none; }

/* ---- panels ---- */

.panels {
  display: flex;
  flex: 1 1 auto;
  overflow: hidden;
  min-height: 0;
}

.pane-left {
  width: 280px;
  flex: 0 0 auto;
  overflow: auto;
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
}

/* The right pane: command bar, notices, then the list, which alone scrolls. */
.pane-right {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.splitter {
  position: relative;
  width: 8px;
  margin: 0 -4px;
  z-index: 2;
  cursor: col-resize;
  flex: 0 0 auto;
  touch-action: none;
}
.splitter::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 3px;
  width: 2px;
  background: transparent;
}
.splitter:hover::after,
.splitter:focus-visible::after,
.splitter.dragging::after { background: var(--primary-hover); }
.splitter:focus-visible { outline: none; }

.pane-header {
  display: flex;
  align-items: center;
  padding: 8px 8px 8px 14px;
  min-height: 24px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1;
}
.pane-title {
  flex: 1 1 auto;
  font-size: var(--fs-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/* "Trouver un site", under the pane's title. */
.site-find {
  position: relative;
  display: flex;
  align-items: center;
  padding: 8px 8px 2px;
}
.site-find > .icon {
  position: absolute;
  left: 17px;
  color: var(--muted);
  pointer-events: none;
}
.site-find input {
  width: 100%;
  box-sizing: border-box;
  min-height: 30px;
  padding: 4px 30px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
}
.site-find input::-webkit-search-cancel-button { display: none; }
.site-find input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.site-find .search-clear { right: 11px; color: var(--muted); }
.site-find .search-clear:hover { color: var(--text); background: var(--border-soft); }
.tree-label mark { padding: 0; }

/* ---- the sites tree (left pane) ---- */

.shortcut-list {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.tree-node, .tree-children {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tree-children { padding-left: 16px; }
.tree-node:focus { outline: none; }
.tree-node:focus-visible > .tree-row {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.tree-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 1px 6px;
  padding: 2px 6px 2px 2px;
  min-height: 28px;
  box-sizing: border-box;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
}
.tree-row:hover { background: var(--hover); }
.tree-row.active {
  background: var(--selected);
  font-weight: 600;
}
.tree-home { margin-bottom: 4px; }

.tree-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  color: var(--muted);
  border-radius: var(--radius);
}
.tree-toggle:hover { color: var(--primary); background: var(--border-soft); }
.tree-toggle .icon { width: 12px; height: 12px; flex-basis: 12px; transition: transform 150ms var(--ease-out); }
.tree-toggle.open .icon { transform: rotate(90deg); }
.tree-toggle.loading::after {
  content: "";
  width: 10px;
  height: 10px;
  box-sizing: border-box;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.tree-icon {
  display: inline-flex;
  color: var(--text-soft);
}
.tree-node > .tree-row .icon-site,
.tree-node > .tree-row .icon-home { color: var(--primary); }

.tree-label {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tree-more {
  min-height: 0;
  width: 24px;
  height: 24px;
  color: var(--text-soft);
  background: transparent;
  border: 0;
}
.tree-more:hover { background: var(--border); color: var(--text); }

.tree-message {
  padding: 4px 14px;
  font-size: var(--fs-sm);
  font-style: italic;
  color: var(--muted);
}
.tree-error {
  color: var(--danger);
  font-style: normal;
  white-space: pre-wrap;
}

.empty-hint { padding: 14px; }
.drawer-foot { display: none; }
.scrim { display: none; }

/* ---- command bar ---- */

.commandbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  min-height: 44px;
  box-sizing: border-box;
  padding: 6px 12px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.cmd-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.cmd-actions { gap: 4px; padding-right: 14px; border-right: 1px solid var(--border); }
.cmd-sort label,
.field-inline label {
  font-size: var(--fs-sm);
  color: var(--text-soft);
}
.cmd-sort, .field-inline {
  display: flex;
  align-items: center;
  gap: 6px;
}
.commandbar select,
.commandbar input[type="datetime-local"] {
  min-height: 30px;
  box-sizing: border-box;
  padding: 3px 6px;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
}
.commandbar select:focus-visible,
.commandbar input:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.commandbar .filter-active {
  border: 2px solid var(--primary);
  font-weight: 600;
}
.commandbar .btn-secondary { min-height: 30px; padding: 3px 10px; }
.commandbar .filter-open, .commandbar .select-mode { display: none; }
.selection-bar { display: none; }

/* Phones only: on desktop the selects already say what is on. */
.filter-summary {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 2px 10px;
  font-weight: 600;
  font-size: var(--fs-sm);
  color: var(--primary);
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: 16px;
}
.chip:hover { background: var(--hover); }
.chip .icon { width: 12px; height: 12px; flex-basis: 12px; }
.filter-count { margin-left: auto; font-size: var(--fs-sm); color: var(--text-soft); }

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border-bottom: 1px solid var(--danger-line);
}

/* New files: a quiet line, never red; the rows get a navy "Nouveau". */
.new-files {
  padding: 6px 12px;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--selected);
  border-bottom: 1px solid var(--border);
}
.new-files .link-button { font-weight: 600; }
.tag-new {
  display: inline-block;
  margin-left: 8px;
  padding: 0 6px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  color: var(--primary);
  border: 1px solid var(--primary);
  border-radius: 9px;
  vertical-align: 1px;
}

/* ---- the list (right pane) ---- */

.file-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  scroll-padding-top: var(--head-h);
}
.placeholder { margin: 0; padding: 28px 24px; max-width: 70ch; }
.placeholder-error { color: var(--danger); white-space: pre-wrap; }
.placeholder-error button { margin-left: 8px; }
.filtered-out p { margin: 0 0 12px; }

/* The list: an ARIA grid of divs, each row a CSS grid sharing one column
   template, so rows off screen skip layout (content-visibility): a site can
   hold thousands of clips. The template follows the columns shown. */
.file-table { --cols: minmax(0, 1fr) 165px 90px; min-width: 100%; }
.file-table.c-camera { --cols: minmax(0, 1fr) 150px 165px 90px; }
.file-table.with-checks { --cols: 34px minmax(0, 1fr) 165px 90px; }
.file-table.with-checks.c-camera { --cols: 34px minmax(0, 1fr) 150px 165px 90px; }
.file-table.c-home { --cols: minmax(0, 1fr); }

.grid-row {
  display: grid;
  grid-template-columns: var(--cols);
  align-items: center;
  border-bottom: 1px solid var(--border-soft);
}
.grid-cell {
  min-width: 0;
  padding: 6px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.grid-head { position: sticky; top: 0; z-index: 2; }
.head-row {
  min-height: var(--head-h);
  box-sizing: border-box;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-soft);
}
.head-row .grid-cell { padding-top: 0; padding-bottom: 0; }
.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 30px;
  padding: 0;
  font-weight: 600;
  color: inherit;
  background: none;
  border: 0;
  justify-content: flex-start;
}
.sort-button:hover { background: none; color: var(--text); text-decoration: underline; }
.sort-button:active { background: none; }
[aria-sort] .sort-button { color: var(--text); }
.col-size .sort-button { justify-content: flex-end; }

.grid-cell.col-check { padding: 0 0 0 10px; text-align: center; text-overflow: clip; }
.grid-cell.col-size { text-align: right; }
.grid-cell.col-size,
.grid-cell.col-date { font-variant-numeric: tabular-nums; }
.entry-row .col-camera,
.entry-row .col-date,
.entry-row .col-size { color: var(--text-soft); }
.entry-row .col-date.muted { color: var(--muted); font-style: italic; }
.head-row .col-check input { width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--primary); }

.entry-row {
  content-visibility: auto;
  contain-intrinsic-size: auto 36px;
  cursor: default;
  user-select: none;
}
.entry-row:hover { background: var(--hover); }
.entry-row.selected { background: var(--selected); box-shadow: inset 3px 0 0 var(--primary); }
.entry-row.selected:hover { background: var(--selected-hover); }
.entry-row:focus { outline: none; }
.entry-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Windows 11's item check boxes: on hover, on the focused row, on selected
   rows, and on every row once anything is selected. The tick is a
   background, so selecting a row never changes the layout. */
.check {
  display: inline-block;
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  vertical-align: -2px;
  border: 1.5px solid var(--border-input);
  border-radius: 3px;
  background: var(--surface) center / 10px no-repeat;
  visibility: hidden;
}
.entry-row:hover .check,
.entry-row:focus-visible .check,
.entry-row.selected .check,
.file-table.has-selection .check { visibility: visible; }
.entry-row.selected .check {
  border-color: var(--primary);
  background-color: var(--primary);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3.5 8.25 3 3 6-6.5' fill='none' stroke='%23f4f6f9' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Day headings, under the column header while their day scrolls by. */
.group-row {
  display: block;
  position: sticky;
  top: var(--head-h);
  z-index: 1;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.group-cell {
  padding: 5px 12px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text);
}
.file-list.grouped { scroll-padding-top: calc(var(--head-h) + 30px); }

.file-icon {
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 10px;
  color: var(--muted);
}
/* Files' icons are masks painted in the text colour: no SVG per row. */
.file-icon[class*=" i-"] {
  width: 16px;
  height: 16px;
  background-color: currentColor;
  -webkit-mask: center / 16px no-repeat;
  mask: center / 16px no-repeat;
}
.file-icon.i-video { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%271.75%27%20y%3D%273.25%27%20width%3D%2712.5%27%20height%3D%279.5%27%20rx%3D%271.25%27%2F%3E%3Cpath%20d%3D%27M6.75%205.9v4.2L10.3%208z%27%20fill%3D%27black%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%271.75%27%20y%3D%273.25%27%20width%3D%2712.5%27%20height%3D%279.5%27%20rx%3D%271.25%27%2F%3E%3Cpath%20d%3D%27M6.75%205.9v4.2L10.3%208z%27%20fill%3D%27black%27%2F%3E%3C%2Fsvg%3E"); }
.file-icon.i-image { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%271.75%27%20y%3D%272.75%27%20width%3D%2712.5%27%20height%3D%2710.5%27%20rx%3D%271.25%27%2F%3E%3Ccircle%20cx%3D%275.5%27%20cy%3D%276.25%27%20r%3D%271.25%27%2F%3E%3Cpath%20d%3D%27M2%2011.75l3.5-3.25%202.5%202.25%202.25-2%203.75%203.5%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Crect%20x%3D%271.75%27%20y%3D%272.75%27%20width%3D%2712.5%27%20height%3D%2710.5%27%20rx%3D%271.25%27%2F%3E%3Ccircle%20cx%3D%275.5%27%20cy%3D%276.25%27%20r%3D%271.25%27%2F%3E%3Cpath%20d%3D%27M2%2011.75l3.5-3.25%202.5%202.25%202.25-2%203.75%203.5%27%2F%3E%3C%2Fsvg%3E"); }
.file-icon.i-audio { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M6%2011.5V3.75l6.25-1.25v7.25%27%2F%3E%3Ccircle%20cx%3D%274.5%27%20cy%3D%2711.5%27%20r%3D%271.5%27%2F%3E%3Ccircle%20cx%3D%2710.75%27%20cy%3D%279.75%27%20r%3D%271.5%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M6%2011.5V3.75l6.25-1.25v7.25%27%2F%3E%3Ccircle%20cx%3D%274.5%27%20cy%3D%2711.5%27%20r%3D%271.5%27%2F%3E%3Ccircle%20cx%3D%2710.75%27%20cy%3D%279.75%27%20r%3D%271.5%27%2F%3E%3C%2Fsvg%3E"); }
.file-icon.i-doc { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%201.75h5l3%203v9.5H4z%27%2F%3E%3Cpath%20d%3D%27M9%201.75v3h3M6%208.25h4M6%2010.75h4%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%201.75h5l3%203v9.5H4z%27%2F%3E%3Cpath%20d%3D%27M9%201.75v3h3M6%208.25h4M6%2010.75h4%27%2F%3E%3C%2Fsvg%3E"); }
.file-icon.i-file { -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%201.75h5l3%203v9.5H4z%27%2F%3E%3Cpath%20d%3D%27M9%201.75v3h3%27%2F%3E%3C%2Fsvg%3E"); mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2016%2016%27%20fill%3D%27none%27%20stroke%3D%27black%27%20stroke-width%3D%271.4%27%20stroke-linecap%3D%27round%27%20stroke-linejoin%3D%27round%27%3E%3Cpath%20d%3D%27M4%201.75h5l3%203v9.5H4z%27%2F%3E%3Cpath%20d%3D%27M9%201.75v3h3%27%2F%3E%3C%2Fsvg%3E"); }
.entry-row.folder .file-icon,
.entry-row.site .file-icon,
.entry-row.video .file-icon { color: var(--primary); }
.entry-row.folder .file-name,
.entry-row.site .file-name { font-weight: 600; }
.row-meta { display: none; }

/* ---- search results ---- */

.search-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  padding: 8px 14px;
  background: var(--surface-alt);
  border-bottom: 1px solid var(--border);
}
.search-status { margin: 0; flex: 1 1 auto; color: var(--text-soft); }
.search-notes { order: 1; flex: 1 0 100%; }
.search-note { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

.result-location {
  display: block;
  margin: 1px 0 0 26px;   /* under the name, past the icon */
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--muted);
}

mark {
  padding: 0 1px;
  border-radius: 2px;
  color: inherit;
  background: var(--mark);
}

/* ---- buttons ---- */

button, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-sizing: border-box;
  min-height: 32px;
  padding: 5px 14px;
  font: inherit;
  font-weight: 600;
  color: var(--on-ink);
  background: var(--primary);
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background-color 150ms var(--ease-out), border-color 150ms var(--ease-out);
}
button:hover { background: var(--primary-hover); }
button:active { background: var(--primary-active); }
button:disabled { background: var(--disabled-bg); color: var(--disabled-text); cursor: default; }

.btn-secondary {
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border-color: var(--border-input);
}
.btn-secondary:hover { background: var(--hover); }
.btn-secondary:active { background: var(--selected); }
.btn-secondary:disabled { background: var(--surface); color: var(--disabled-text); border-color: var(--border); }

.btn-sm { min-height: 28px; padding: 3px 10px; font-size: var(--fs-sm); }
.btn-block { width: 100%; min-height: 40px; }
.btn-icon { width: 32px; padding: 0; }

/* On the ink top bar: outlined, light. */
.topbar .btn-secondary {
  color: var(--on-ink);
  background: transparent;
  border-color: var(--ink-line);
}
.topbar .btn-secondary:hover { background: var(--ink-raised); }
.topbar .btn-secondary:active { background: var(--ink-line); }
.topbar .btn-secondary:disabled { background: transparent; color: var(--on-ink-dim); border-color: var(--ink-raised); }

.link-button {
  display: inline;
  min-height: 0;
  padding: 0;
  font-weight: 400;
  color: var(--link);
  background: none;
  border: 0;
}
.link-button:hover,
.link-button:active { background: none; text-decoration: underline; }

/* ---- spinner and toast ---- */

.spinner {
  position: fixed;
  right: 16px;
  bottom: 40px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  z-index: 50;
}
.spinner-ring {
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-text { font-size: var(--fs-sm); }
@keyframes spin { to { transform: rotate(360deg); } }

.toast-info {
  color: var(--on-ink) !important;
  background: var(--ink) !important;
  border-color: var(--ink) !important;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  max-width: min(560px, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 10px 14px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  z-index: 140;
}

/* ---- status bar ---- */

.statusbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 28px;
  padding: 0 14px;
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  font-size: var(--fs-xs);
  flex-shrink: 0;
  white-space: nowrap;
  overflow: hidden;
}
.statusbar #status-selection:not(:empty)::before,
.statusbar #status-updated:not(:empty)::before {
  content: "";
  display: inline-block;
  width: 1px;
  height: 12px;
  margin-right: 14px;
  vertical-align: -2px;
  background: var(--border);
}
.status-hint { color: var(--text-soft); overflow: hidden; text-overflow: ellipsis; }
.status-spacer { flex: 1 1 auto; }
.account { display: flex; align-items: center; gap: 14px; }
.account form { margin: 0; }

/* ---- context menu ---- */

.ctx-menu {
  position: fixed;
  z-index: 160;
  min-width: 210px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
}
.ctx-item {
  display: flex;
  width: 100%;
  min-height: 30px;
  justify-content: space-between;
  gap: 24px;
  padding: 5px 12px;
  font-weight: 400;
  color: var(--text);
  text-align: left;
  background: none;
  border: 0;
  border-radius: var(--radius);
  white-space: nowrap;
}
.ctx-item:hover, .ctx-item:focus { background: var(--hover); outline: none; }
.ctx-item:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.ctx-default .ctx-label { font-weight: 700; }
.ctx-shortcut { color: var(--muted); font-size: var(--fs-sm); }
.ctx-item[aria-disabled="true"] { color: var(--disabled-text); cursor: default; }
.ctx-item[aria-disabled="true"]:hover { background: none; }
.ctx-danger { color: var(--danger); }
.ctx-danger:hover, .ctx-danger:focus { background: var(--danger-soft); }
.ctx-separator { height: 1px; margin: 4px 6px; background: var(--border); }

/* ---- form fields ---- */

.field { margin-bottom: 12px; }
.field label {
  display: block;
  margin-bottom: 4px;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-soft);
}
.field label .muted { font-weight: 400; }
.field input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.field input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px var(--focus-halo);
}
.field-hint { margin: 4px 0 0; font-size: var(--fs-xs); }
.field-hint:empty { display: none; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1 1 auto; }
.field-row .field-port { flex: 0 0 100px; }

.form-error {
  margin: 0 0 14px;
  padding: 8px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius);
}

.preview { min-height: 18px; }
.preview span { font-weight: 600; color: var(--text); }

/* ---- dialogs ---- */

dialog::backdrop { background: oklch(0.2 0.03 245 / 0.45); }

.modal {
  box-sizing: border-box;
  width: 440px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px 22px 18px;
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 40px oklch(0.2 0.03 245 / 0.3);
}
.modal h3, .sheet h3 { margin: 0 0 14px; font-size: var(--fs-lg); }

.help { width: 560px; }
.help h4 { margin: 16px 0 6px; font-size: var(--fs-md); }
.help-tips { margin: 0; padding-left: 20px; line-height: 1.6; }
.help-keys { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.help-keys th, .help-keys td { padding: 5px 8px; text-align: left; border-bottom: 1px solid var(--border-soft); vertical-align: top; }
.help-keys th { color: var(--text-soft); }
.help-key { font-weight: 600; white-space: nowrap; }
.help-open { display: inline-flex; gap: 4px; align-items: center; }
.help-open .icon { width: 14px; height: 14px; flex-basis: 14px; }

/* The admins' accounts dialog. */
.accounts { width: 640px; }
.acc-intro { margin: -6px 0 12px; }
.acc-notice {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: var(--selected);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.acc-notice p { margin: 0 0 4px; }
.acc-notice p:last-child { margin-bottom: 0; }
.acc-password-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.acc-password { padding: 2px 6px; font-size: var(--fs-md); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); user-select: all; }
.acc-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.acc-caption { caption-side: top; text-align: left; padding: 0 0 6px; color: var(--muted); }
.acc-table th, .acc-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--border-soft); }
.acc-table th { color: var(--text-soft); }
.acc-name { font-weight: 600; overflow-wrap: anywhere; }
.acc-name .muted { font-weight: 400; }
.acc-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.acc-role, .acc-form select {
  min-height: 30px;
  padding: 3px 6px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
}
.acc-delete:not(:disabled) { color: var(--danger); }
.acc-form { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--border); }
.acc-form h4 { margin: 12px 0 10px; font-size: var(--fs-md); }
.acc-form .field-row .field:last-child { flex: 0 0 170px; }
.acc-form select { width: 100%; min-height: 36px; }
.acc-form .field > .btn-secondary { margin-top: 6px; }

.link-field {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  font: inherit;
  font-size: var(--fs-sm);
  color: var(--text);
  background: var(--surface-alt);
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  resize: none;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

/* The phone's filter sheet, at the bottom of the screen. */
.sheet {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: auto 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  color: var(--text);
  background: var(--surface);
  border: 0;
  border-radius: 12px 12px 0 0;
}
.sheet .cmd-filters { flex-direction: column; align-items: stretch; gap: 12px; }
.sheet .field-inline { flex-wrap: wrap; }
.sheet .field-inline label { flex: 0 0 100%; font-weight: 600; }
.sheet select, .sheet input[type="datetime-local"] {
  width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.sheet .filter-active { border: 2px solid var(--primary); font-weight: 600; }
.sheet #f-around, .sheet #f-range { display: grid; grid-template-columns: 1fr; }
.sheet #f-around[hidden], .sheet #f-range[hidden] { display: none; }
.sheet #f-clear { display: none; }
.sheet-actions { display: flex; gap: 8px; margin-top: 16px; }
.sheet-actions button { flex: 1 1 0; min-height: 44px; }

/* ---- viewer (image / video / audio) ---- */

.viewer {
  box-sizing: border-box;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--on-viewer);
  background: var(--viewer);
}
.viewer[open] {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto auto;
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "nav caption link download close"
    "stage stage stage stage stage";
}
.viewer::backdrop { background: var(--viewer); }
.viewer-nav, .viewer-caption, .viewer-link, .viewer-download, .viewer-close {
  align-self: center;
}
.viewer-link { grid-area: link; margin: 6px 4px; }
.viewer-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
}
.viewer-caption {
  grid-area: caption;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 6px 12px;
}
.viewer-download { grid-area: download; margin: 6px 4px; }
.viewer-close { grid-area: close; margin: 6px 12px 6px 4px; }
.viewer > :not(.viewer-body) { background: var(--viewer-bar); }
.viewer-nav, .viewer-caption, .viewer-link, .viewer-download, .viewer-close { border-bottom: 1px solid var(--viewer-line); }
.viewer-link, .viewer-download, .viewer-close { box-shadow: 0 0 0 6px var(--viewer-bar); }
.viewer-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.viewer-subtitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--fs-sm);
  color: var(--on-viewer-muted);
}
.viewer-autoplay {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
  font-size: var(--fs-sm);
  color: var(--on-viewer-muted);
  cursor: pointer;
  white-space: nowrap;
}
.viewer-autoplay input { width: 16px; height: 16px; margin: 0; accent-color: var(--on-viewer-muted); }
.viewer-position { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; color: var(--on-viewer-muted); }
.viewer .btn-secondary {
  color: var(--on-viewer);
  background: transparent;
  border-color: var(--viewer-line);
}
.viewer .btn-secondary:hover { background: var(--viewer-raised); }
.viewer .btn-secondary:disabled { color: var(--viewer-line); border-color: var(--viewer-raised); background: transparent; }

.viewer-body {
  grid-area: stage;
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  outline: none;
}

.viewer-media {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  background: var(--viewer-media);
}
audio.viewer-media {
  flex: 0 0 auto;
  margin: auto;
  width: min(640px, calc(100% - 32px));
  background: transparent;
}

.viewer-status {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  pointer-events: none;
}

.viewer-message {
  margin: auto;
  max-width: 460px;
  padding: 20px;
  text-align: center;
  line-height: 1.5;
}
.viewer-message a { color: var(--viewer-link); }

.image-controls {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  background: var(--viewer-bar);
  border-bottom: 1px solid var(--viewer-line);
  flex-shrink: 0;
}

.image-canvas {
  flex: 1 1 auto;
  overflow: auto;
  background: var(--viewer-media);
  text-align: center;
  cursor: grab;
  touch-action: none;
}
.image-canvas.dragging { cursor: grabbing; }
.image-canvas img {
  display: block;
  margin: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---- sign-in and error pages ---- */

.card-page {
  display: flex;
  align-items: center;
  justify-content: center;
}
.card {
  box-sizing: border-box;
  width: 100%;
  max-width: 360px;
  margin: 16px;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 32px oklch(0.2 0.03 245 / 0.12);
}
.card .brand {
  gap: 12px;
  padding: 18px 24px;
  background: var(--ink);
  color: var(--on-ink);
}
.card .brand-mark { width: 36px; height: 36px; }
.card-body { padding: 22px 24px 24px; }
.card-body > p:last-child { margin-bottom: 0; }
.card-footer { margin: 16px 0 0; text-align: center; font-size: var(--fs-sm); }

/* ---- narrow screens (phones) ---- */

.menu-toggle { display: none; }

@media (max-width: 700px) {
  .menu-toggle { display: inline-flex; }
  .topbar { gap: 6px; min-height: 56px; padding: 0 6px; }
  .topbar .brand, .nav-buttons { display: none; }
  .topbar .btn-icon { width: 44px; min-height: 44px; flex-shrink: 0; }

  /* Only the current place shows, as the page's title. */
  .breadcrumb { padding: 0 4px; background: none; border: 0; }
  .bc-item:not(:last-child) { display: none; }
  .bc-item + .bc-item::before { display: none; }
  .bc-current { font-size: var(--fs-lg); }

  /* ⌕ lays the search field across the bar. */
  .topbar .search-open { display: inline-flex; }
  .search { display: none; }
  .topbar.searching > :not(.search) { display: none; }
  .topbar.searching .search { display: flex; flex: 1 1 auto; gap: 6px; }
  .topbar.searching .search-close { display: inline-flex; }
  .filter-summary { display: flex; }
  .search input { width: 100%; min-height: 44px; padding-left: 32px; }
  .search-glass { left: 58px; }
  .search-clear { width: 40px; height: 40px; }

  .panels { position: relative; }
  .splitter { display: none; }
  .pane-left {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    display: flex;
    flex-direction: column;
    width: min(320px, 85vw) !important;   /* beats the width the splitter saved */
    box-shadow: 4px 0 16px oklch(0.2 0.03 245 / 0.2);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 200ms var(--ease-out), visibility 200ms;
  }
  .shortcut-list { flex: 1 1 auto; }
  #app.drawer-open .pane-left {
    transform: none;
    visibility: visible;
    transition: transform 200ms var(--ease-out), visibility 0s;   /* focusable at once */
  }
  .scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 15;
    background: oklch(0.2 0.03 245 / 0.4);
  }
  .scrim[hidden] { display: none; }
  .drawer-foot {
    display: block;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
  }
  .drawer-foot .account { flex-direction: column; align-items: flex-start; gap: 4px; }
  .drawer-foot .link-button { padding: 10px 0; }

  /* Touch targets of at least 44 px. */
  .tree-row { min-height: 44px; }
  .site-find input { min-height: 44px; }
  .tree-toggle { width: 44px; height: 44px; flex-basis: 44px; }
  .btn-sm { min-height: 40px; }

  /* Command row: Trier and Filtres; the actions are hidden. */
  .commandbar { flex-wrap: nowrap; gap: 8px; min-height: 48px; padding: 6px 8px; }
  .cmd-actions, .commandbar > .cmd-filters { display: none; }
  .cmd-sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .cmd-sort { flex: 1 1 auto; }
  .cmd-sort select { width: 100%; min-height: 40px; }
  .commandbar .filter-open { display: inline-flex; min-height: 40px; }
  .commandbar .select-mode { display: inline-flex; width: 44px; min-height: 40px; flex-shrink: 0; }
  #app.selecting .select-mode { background: var(--selected); border-color: var(--primary); }

  /* Selection mode: a box on every file, and the bar at the bottom. */
  .file-table.selecting .check { visibility: visible; width: 22px; height: 22px; background-size: 15px; }
  .selection-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: var(--surface-alt);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
  }
  .selection-bar[hidden] { display: none; }
  .selection-bar button { min-height: 44px; }
  .selection-bar .btn-icon { width: 44px; }
  .sel-count { flex: 1 1 auto; font-weight: 600; }
  .commandbar .btn-secondary { min-height: 40px; }

  /* Rows: the name, never cut, then one muted line. */
  .grid-head { display: none; }
  #file-list .file-table { --cols: minmax(0, 1fr); }
  #file-list .file-table.selecting { --cols: 44px minmax(0, 1fr); }
  .entry-row .grid-cell:not(.col-name) { display: none; }
  .file-table.selecting .entry-row .col-check { display: block; }
  .entry-row { contain-intrinsic-size: auto 60px; }
  .entry-row .grid-cell.col-name {
    min-height: 56px;
    padding: 9px 12px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .file-table .file-name { line-height: 1.3; }
  .row-meta {
    display: block;
    margin: 2px 0 0 26px;
    font-size: var(--fs-sm);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
  }
  .result-location { white-space: normal; }
  .file-list, .file-list.grouped { scroll-padding-top: 30px; }
  .group-row { top: 0; }
  .group-cell { padding: 8px 12px; }

  .statusbar { display: none; }
  .toast { bottom: 16px; }
  .spinner { bottom: 16px; }

  /* The viewer: Fermer and the caption on top, the steps at the bottom. */
  .viewer[open] {
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "close caption caption caption"
      "stage stage stage stage"
      "nav nav link download";
  }
  .viewer-close { margin: 6px 0 6px 6px; }
  .viewer-nav { border-bottom: 0; border-top: 1px solid var(--viewer-line); justify-content: space-between; }
  .viewer-download, .viewer-link { margin: 0; align-self: stretch; border-radius: 0; border: 0; border-top: 1px solid var(--viewer-line); }
  .viewer-link .btn-label, .viewer-download .btn-label { display: none; }
  .viewer-link, .viewer-download { min-width: 56px; }
  .viewer .btn-secondary { min-height: 48px; }
  .viewer-nav .btn-label { display: none; }
  .viewer-nav .btn-secondary { min-width: 64px; }
  .viewer-close .btn-label { display: none; }
  .viewer-close { min-width: 48px; }
  .viewer-autoplay { display: none; }   /* a desk tool: reviewing clips one after another */
  .help-key { white-space: normal; }
  /* Accounts: one block per account, the buttons under the name and role. */
  .acc-table thead { display: none; }
  .acc-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 10px; padding: 10px 0; border-bottom: 1px solid var(--border-soft); }
  .acc-table td { padding: 0; border: 0; }
  .acc-table .acc-actions-cell { grid-column: 1 / -1; }
  .acc-actions { justify-content: flex-start; }
  .acc-actions button, .acc-role { min-height: 40px; }
  .acc-form .field-row { flex-direction: column; gap: 0; }
  .acc-form .field-row .field:last-child { flex: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .spinner-ring, .tree-toggle.loading::after { animation-duration: 2.4s; }
}

/* Windows contrast themes: the system's colours, and shapes that still show. */
@media (forced-colors: active) {
  .entry-row.selected { background: Highlight; color: HighlightText; forced-color-adjust: none; }
  .entry-row.selected .grid-cell { color: HighlightText; }
  .tree-row.active { outline: 2px solid Highlight; outline-offset: -2px; }
  .tree-node:focus-visible > .tree-row,
  .entry-row:focus-visible,
  :focus-visible { outline: 2px solid Highlight; }
  mark { background: Mark; color: MarkText; forced-color-adjust: none; }
  .check { border-color: CanvasText; }
  .entry-row.selected .check { background-color: Highlight; border-color: HighlightText; }
  .commandbar .filter-active, .sheet .filter-active, .chip { border: 2px solid CanvasText; }
  .splitter::after { background: CanvasText; }
}

/* ---- utilities ---- */

.muted { color: var(--muted); }
[hidden] { display: none !important; }
