/* Neutral greys so images are judged on their own colour, like any photo tool. */
:root {
  --bg: #2a2b2d;
  --panel: #222325;
  --raised: #333538;
  --line: #3d3f43;
  --text: #e4e2de;
  --muted: #9b9c9f;
  --focus: #8fb8e8;
  --select: #4f7fb8;
  --well: #1c1d1f;

  --red: #d9534a; --yellow: #e2b93b; --green: #5aa860; --blue: #4d8fd6; --purple: #9467c7; --other: #8a8a8a;

  --radius-s: 3px; --radius-m: 6px;
  --font: ui-sans-serif, -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text); font: 13px/1.4 var(--font);
  display: grid; grid-template-rows: auto 1fr auto; overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
h2 { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 0 8px; }

/* top bar */
.home-brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
/* The globe is white-only; it always sits on dark so it never needs recolouring. */
.home-brand img { height: 26px; width: auto; padding: 3px 4px; background: #1d1e20; border-radius: var(--radius-s); box-sizing: content-box; }
.page-nav { display: flex; gap: 4px; }
.page-nav a { color: var(--muted); text-decoration: none; padding: 5px 10px; border-radius: var(--radius-s); }
.page-nav a:hover { color: var(--text); background: var(--raised); }
.page-nav a[aria-current="page"] { color: var(--text); background: var(--raised); }
.home-brand span { font-weight: 650; }
.topbar {
  display: flex; align-items: center; gap: 16px; padding: 8px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; letter-spacing: -0.01em; font-size: 14px; white-space: nowrap; }
.search {
  flex: 1; max-width: 560px; display: flex; align-items: center; gap: 8px;
  background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 0 10px;
}
.search svg, .zoom svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 1.6; flex: none; }
.search input { flex: 1; border: 0; background: none; padding: 7px 0; outline: none; }
.tools { display: flex; align-items: center; gap: 8px; }
select, .sidebar input[type=search], .kw-add input, .dl select {
  background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 5px 7px;
}
.zoom { display: flex; align-items: center; gap: 6px; }
.zoom svg:first-child { width: 11px; height: 11px; }
.zoom input { width: 120px; accent-color: var(--muted); }
.index-status { margin-left: auto; display: flex; gap: 10px; align-items: center; color: var(--muted); white-space: nowrap; }
.icon-btn, .text-btn {
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-s);
  padding: 4px 9px; cursor: pointer; line-height: 1.2;
}
.icon-btn:hover, .text-btn:hover { border-color: var(--muted); }
.primary { background: var(--select); border-color: var(--select); color: #fff; }

/* three-column layout */
.layout { display: grid; min-height: 0; --side-def: 240px; --insp-def: 310px;
          grid-template-columns: var(--side-w, var(--side-def)) 6px minmax(0, 1fr) 6px var(--insp-w, var(--insp-def)); }
.sidebar, .inspector { background: var(--panel); overflow-y: auto; min-height: 0; }
.sidebar { padding: 14px 12px; }

.sidebar section { margin-bottom: 22px; }
.check { display: flex; gap: 6px; align-items: center; color: var(--muted); margin-bottom: 6px; }

.tree { font-size: 13px; }
.tree ul { list-style: none; margin: 0; padding-left: 12px; }
.tree > ul { padding-left: 0; }
.node { display: flex; align-items: center; gap: 4px; min-height: 26px; border-radius: var(--radius-s); cursor: pointer; padding: 2px 4px; }
.node:hover { background: var(--raised); }
.node.active { background: var(--select); color: #fff; }
.node.active .n, .node.active .chev, .node.active .ficon { color: inherit; }
.node .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.node .n { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.node.root .nm { font-weight: 600; }

.rating-filter { display: flex; gap: 4px; }
.rating-filter button { flex: 1; padding: 4px 0; font-size: 12px; }
.rating-filter button[aria-pressed=true] { background: var(--select); border-color: var(--select); color: #fff; }

.kw-section input { width: 100%; margin-bottom: 8px; }
.kw-list { list-style: none; margin: 0; padding: 0; }
.kw-list li { display: flex; justify-content: space-between; padding: 3px 6px; border-radius: var(--radius-s); cursor: pointer; }
.kw-list li:hover { background: var(--raised); }
.kw-list li.active { background: var(--select); color: #fff; }
.kw-list .n { color: var(--muted); font-size: 11px; }
.kw-list li.active .n { color: inherit; }

/* grid */
.content { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.content > * { flex-shrink: 0; }      /* the bar above the grid grows when it wraps (phones) instead of hiding behind it */
.crumbs-bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px 0; min-height: 34px; }
.crumbs { color: var(--muted); font-size: 12px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.access-chip {
  display: inline-flex; gap: 6px; align-items: center; font-size: 12px; padding: 3px 10px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--line); border-radius: 99px; white-space: nowrap; max-width: 50%;
  overflow: hidden; text-overflow: ellipsis;
}
.access-chip:hover { border-color: var(--muted); }
.access-chip .edit { color: var(--focus); }
.access-dialog {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--text);
  padding: 22px 24px; width: min(420px, 92vw);
}
.access-dialog::backdrop { background: rgba(0,0,0,.5); }
.access-dialog { overflow: visible; }
.access-dialog h2 { font-size: 15px; color: var(--text); margin: 0 0 4px; }
.access-dialog form { display: grid; gap: 10px; }
.access-dialog #ad-body { display: grid; gap: 10px; }
.ad-path { color: var(--muted); margin: 0 0 6px; word-break: break-word; }
.ad-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.grid {
  --size: 180px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--size), 1fr));
  gap: 10px; padding: 12px 16px 16px; outline: none; align-content: start;
}
.card {
  border-radius: var(--radius-m); background: var(--panel); overflow: hidden; cursor: default;
  border: 1px solid transparent; user-select: none; display: flex; flex-direction: column;
}
.card.selected { border-color: var(--select); box-shadow: 0 0 0 1px var(--select); }
.card.cursor { outline: 2px solid var(--focus); outline-offset: 1px; }
.thumb { aspect-ratio: 1; display: grid; place-items: center; background: var(--well); position: relative; overflow: hidden; }
.thumb img { position: absolute; inset: 4%; width: 92%; height: 92%; object-fit: contain; }
.thumb .play {
  position: absolute; z-index: 1; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55);
  color: #fff; display: grid; place-items: center; font-size: 13px; padding-left: 3px; pointer-events: none;
}
.thumb .ext { z-index: 1;
  position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 600; padding: 1px 5px;
  border-radius: var(--radius-s); background: rgba(0,0,0,.55); color: #ddd;
}
.thumb .noimg { color: var(--muted); font-size: 12px; text-align: center; padding: 10px; }
/* The caption band takes the label colour, as in Bridge. */
.cap { padding: 5px 8px 6px; background: var(--panel); border-top: 3px solid transparent; }
.cap .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.cap .stars { font-size: 11px; color: var(--muted); letter-spacing: 1px; min-height: 15px; }
.cap .stars.reject { color: var(--red); }

.empty { padding: 60px 20px; text-align: center; color: var(--muted); max-width: 46ch; margin: 0 auto; }
.empty strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }

/* inspector */
.inspector .pv { background: var(--well); aspect-ratio: 4/3; position: relative; cursor: zoom-in; }
.inspector .pv img { position: absolute; inset: 3%; width: 94%; height: 94%; object-fit: contain; }
.inspector .body { padding: 14px; display: grid; gap: 18px; }
.inspector .fname { font-weight: 600; font-size: 14px; word-break: break-all; }
.inspector .path { color: var(--muted); font-size: 12px; word-break: break-all; margin-top: 2px; }
.inspector .copy { margin-top: 6px; font-size: 12px; }
.star-picker { display: flex; gap: 2px; align-items: center; }
.star-picker button { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--line); padding: 0 1px; line-height: 1; }
.star-picker button.on { color: var(--text); }
.star-picker .reject { font-size: 12px; margin-left: 10px; color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 2px 6px; }
.star-picker .reject.on { color: var(--red); border-color: var(--red); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 4px; background: var(--raised); border: 1px solid var(--line);
  border-radius: 99px; padding: 2px 4px 2px 9px; font-size: 12px;
}
.chip.partial { border-style: dashed; color: var(--muted); }
.chip button { background: none; border: 0; cursor: pointer; color: var(--muted); padding: 0 4px; font-size: 13px; }
.chip button:hover { color: var(--text); }
.kw-add { display: flex; gap: 6px; }
.kw-add input { flex: 1; min-width: 0; }
.hint-s { color: var(--muted); font-size: 11px; margin-top: 5px; }
dl.details { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 0; font-size: 12px; }
dl.details dt { color: var(--muted); }
dl.details dd { margin: 0; word-break: break-word; }
.dl { display: grid; gap: 8px; }
.dl .row { display: flex; gap: 8px; align-items: center; }
.dl .row label { color: var(--muted); width: 54px; font-size: 12px; }
.dl .row select, .dl .row input[type=range] { flex: 1; }
.dl .row output { width: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.dl .actions { display: flex; gap: 8px; }
.dl .actions button { flex: 1; padding: 7px; }
.inspector .placeholder { padding: 40px 18px; color: var(--muted); text-align: center; }

.statusbar {
  display: flex; justify-content: space-between; padding: 4px 14px; font-size: 12px; color: var(--muted);
  background: var(--panel); border-top: 1px solid var(--line);
}

/* loupe */
.loupe { position: fixed; inset: 0; background: #151516; z-index: 20; display: grid; grid-template-rows: auto 1fr; color: #e4e2de; }
.loupe-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 14px; background: #1f2022; }
.loupe-tools, .loupe-right { display: flex; gap: 6px; align-items: center; }
.loupe-right { gap: 14px; }
.loupe-stage video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
.loupe-stage.video-mode { cursor: default; }
.loupe-msg {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px;
  color: #c9c7c3; max-width: 44ch; margin: auto; line-height: 1.5;
}
.loupe-msg .bar { height: 4px; width: 260px; background: #2c2d30; border-radius: 2px; overflow: hidden; margin: 0 auto; }
.loupe-msg .bar span { display: block; height: 100%; background: #8fb8e8; width: 0; }
.loupe-msg .sub { color: #8c8d90; font-size: 12px; }
.loupe .icon-btn, .loupe .text-btn { background: #2c2d30; border-color: #3d3f43; color: #e4e2de; }
#loupe-pct { width: 48px; text-align: center; font-variant-numeric: tabular-nums; color: #9b9c9f; }
.loupe-stage { position: relative; overflow: hidden; cursor: grab; }
.loupe-stage.dragging { cursor: grabbing; }
.loupe-stage img { position: absolute; left: 0; top: 0; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.loupe-nav {
  position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,.4); color: #fff;
  border: 0; font-size: 34px; width: 44px; height: 70px; cursor: pointer; border-radius: var(--radius-m);
}
.loupe-nav.prev { left: 10px; } .loupe-nav.next { right: 10px; }

.toast {
  position: fixed; bottom: 36px; left: 50%; transform: translateX(-50%); background: var(--raised);
  border: 1px solid var(--line); padding: 8px 14px; border-radius: var(--radius-m); z-index: 30;
  box-shadow: 0 4px 16px rgba(0,0,0,.35); max-width: 80vw;
}
.toast.error { border-color: var(--red); }

@media (max-width: 1100px) { .layout { --side-def: 200px; --insp-def: 270px; } .zoom input { width: 80px; } }
@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar, .inspector, .pane-handle { display: none; }
  .topbar-upload { padding: 5px 8px; }
  .brand, .index-status span { display: none; }
}
@media (prefers-reduced-motion: no-preference) {
  .loupe-stage img.animate { transition: transform .15s ease-out; }
}

/* ---------------------------------------------------------------- user menu */
.user-menu { position: relative; display: flex; align-items: center; gap: 10px; }
.user-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; z-index: 15; padding: 6px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: 0 6px 20px rgba(0,0,0,.3); display: grid;
}
.user-pop .who { padding: 6px 10px 8px; color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.user-pop a, .user-pop button {
  display: block; text-align: left; padding: 7px 10px; border-radius: var(--radius-s); color: var(--text);
  text-decoration: none; background: none; border: 0; cursor: pointer;
}
.user-pop a:hover, .user-pop button:hover { background: var(--panel); }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 12px; margin: 8px 0 0; }
.danger { color: var(--red); }

/* ---------------------------------------------------------------- forms (shared) */
label { display: grid; gap: 4px; font-size: 13px; }
.auth-card input, .settings input:not([type=checkbox]):not([type=radio]), .settings select {
  background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; min-width: 0;
}
.wide { width: 100%; padding: 9px; }
.form-error { color: var(--red); margin: 0 0 4px; }
.text-btn:disabled { opacity: .6; cursor: default; }
.qr { width: 190px; height: 190px; background: #fff; padding: 6px; border-radius: var(--radius-m); display: block; margin: 4px 0; }
code.secret {
  font: 13px/1.5 ui-monospace, "SF Mono", Menlo, monospace; background: var(--well); padding: 6px 9px;
  border-radius: var(--radius-s); word-break: break-all; display: inline-block;
}
details summary { cursor: pointer; color: var(--muted); }

/* ---------------------------------------------------------------- sign-in page */
/* The sign-in page is always dark: the DLX logo is white and must not be recoloured. */
body.auth-page {
  display: grid; grid-template-rows: 1fr; place-items: center; min-height: 100vh; overflow: auto; padding: 32px 24px;
}
.auth-logo { display: block; width: 168px; height: auto; margin: 0 auto 14px; }
.auth-title { text-align: center; }
.auth-quote { text-align: center; font-style: italic; font-size: 15px; color: var(--muted); margin: -8px 0 18px !important; letter-spacing: .01em; }
.auth-switch { margin-top: 16px !important; text-align: center; color: var(--muted); font-size: 13px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--focus); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.auth-card textarea { background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; font: inherit; color: inherit; resize: vertical; }
.auth-card .cb { width: 100%; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.sent p { margin: 0 0 8px; line-height: 1.5; }
.auth-card {
  position: relative; width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 28px 28px 22px;
}
.auth-card h1 { font-size: 19px; font-weight: 650; letter-spacing: -0.01em; margin: 0 0 14px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card p { margin: 0; line-height: 1.5; }

/* ---------------------------------------------------------------- settings page */
body.settings-page { display: block; overflow: auto; }
.settings-page .topbar { position: sticky; top: 0; z-index: 5; }
.settings-page .back { color: var(--text); text-decoration: none; white-space: nowrap; }
.settings-page .user-menu { margin-left: auto; }
.settings { display: grid; grid-template-columns: 200px 1fr; gap: 24px; max-width: 1280px; margin: 0 auto; padding: 24px; }
.tabs { display: grid; gap: 2px; align-content: start; position: sticky; top: 76px; }
.tabs button { text-align: left; background: none; border: 0; padding: 8px 12px; border-radius: var(--radius-s); cursor: pointer; }
.tabs button:hover { background: var(--panel); }
.tabs button[aria-current] { background: var(--raised); font-weight: 600; }
.panel { display: grid; gap: 18px; min-width: 0; align-content: start; }
.sbox { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; min-width: 0; }
.sbox h2 { font-size: 15px; color: var(--text); margin: 0 0 10px; }
.sbox > p { line-height: 1.5; margin: 0 0 8px; max-width: 75ch; }
.stack { display: grid; gap: 12px; max-width: 380px; }
.stack button { justify-self: start; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form input { flex: 1 1 160px; }
.callout { margin-top: 14px; padding: 14px; border: 1px solid var(--select); border-radius: var(--radius-m); background: var(--raised); }
.secret-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.grid-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.grid-table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.grid-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.grid-table td.who-cell { white-space: nowrap; }
.grid-table td.actions { white-space: nowrap; text-align: right; }
.grid-table td.actions .text-btn { margin-left: 4px; }
.grid-table td.detail { max-width: 46ch; word-break: break-word; color: var(--muted); }
.grid-table tr.flag td { background: color-mix(in srgb, var(--red) 10%, transparent); }
.roles-table td, .roles-table th { text-align: center; }
.roles-table td:first-child, .roles-table th:first-child { text-align: left; }
.roles-table th { white-space: normal; min-width: 90px; }
.pill { font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line); white-space: nowrap; }
.pill.ok { border-color: var(--green); }
.pill.warn { border-color: var(--yellow); }
.pill.off { color: var(--muted); }

.fa { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(280px, 380px); gap: 18px; margin-top: 12px; }
.fa-tree { border: 1px solid var(--line); border-radius: var(--radius-m); max-height: 62vh; overflow: auto; padding: 4px; }
.fa-row { display: flex; align-items: center; gap: 4px; padding: 5px 8px; border-radius: var(--radius-s); cursor: pointer; }
.fa-row:hover { background: var(--raised); }
.fa-row.active { background: var(--select); color: #fff; }
.fa-row .twisty { width: 14px; flex: none; color: inherit; opacity: .7; font-size: 10px; text-align: center; }
.fa-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-row .nm.root { font-weight: 600; }
.fa-row .own { color: var(--focus); font-size: 9px; }
.fa-row.active .own { color: #fff; }
.fa-row .who { font-size: 11px; color: var(--muted); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-row.active .who { color: #e6eefa; }
.fa-editor h3 { margin: 0 0 4px; font-size: 14px; word-break: break-word; }
.radio, .check { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.role-checks { border: 0; padding: 0 0 0 24px; margin: 0; display: grid; gap: 6px; }
.role-checks:disabled { opacity: .5; }

@media (max-width: 860px) {
  .settings { grid-template-columns: 1fr; padding: 14px; }
  .tabs { position: static; display: flex; overflow-x: auto; }
  .fa { grid-template-columns: 1fr; }
}

.people-head { display: flex; align-items: baseline; gap: 10px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.filter-bar input { flex: 1 1 220px; }

/* ---------------------------------------------------------------- favorites */
.fav-section { margin-bottom: 16px !important; }
.fav-nav {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-s);
  background: none; border: 1px solid transparent; cursor: pointer; text-align: left; font-weight: 600;
}
.fav-nav:hover { background: var(--raised); }
.fav-nav[aria-pressed=true] { background: var(--select); color: #fff; }
.fav-nav .heart { color: var(--red); font-size: 14px; }
.fav-nav[aria-pressed=true] .heart { color: #fff; }
.fav-nav .nm { flex: 1; }
.fav-nav .n { color: var(--muted); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.fav-nav[aria-pressed=true] .n { color: inherit; }
.fav-btn {
  position: absolute; z-index: 2; top: 5px; right: 5px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 15px; line-height: 28px; padding: 0;
  cursor: pointer; opacity: 0;
}
.card:hover .fav-btn, .card.cursor .fav-btn, .fav-btn:focus-visible, .fav-btn.on { opacity: 1; }
.fav-btn.on { color: #ff5a6e; }
.fav-btn:hover { background: rgba(0,0,0,.72); }
@media (hover: none) { .fav-btn { opacity: 1; } }
.fav-toggle { margin-top: 8px; font-size: 12px; }
.fav-toggle.on { color: #ff5a6e; border-color: color-mix(in srgb, #ff5a6e 50%, var(--line)); }
.loupe-fav.on { color: #ff5a6e; }

/* ---------------------------------------------------------------- collections */
.sec-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sec-head h2 { margin: 0; }
.icon-btn.small, .text-btn.small { padding: 2px 8px; font-size: 12px; }
.coll-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.coll { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: var(--radius-s); cursor: pointer; border: 1px solid transparent; }
.coll:hover { background: var(--raised); }
.coll.active { background: var(--select); color: #fff; }
.coll .ic { width: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.coll .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll .n { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.coll.active .ic, .coll.active .n { color: inherit; }
.shared-head { margin-top: 14px; }
.coll .from { display: block; font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.coll.active .from { color: #dfe8f5; }
.coll-list .empty { padding: 2px 6px; }
.drop-hover { border-color: var(--focus) !important; background: color-mix(in srgb, var(--focus) 18%, transparent) !important; }
.drag-ghost { position: fixed; top: -100px; left: -100px; padding: 5px 10px; background: var(--select); color: #fff; border-radius: 99px; font-size: 12px; }
.coll-actions { display: flex; gap: 6px; align-items: center; white-space: nowrap; font-size: 12px; }
.sel-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sel-actions .text-btn { font-size: 12px; }
.sel-actions .fav-toggle { margin-top: 0; }
.coll-dialog { width: min(620px, 94vw); }
.cd-form { display: grid; gap: 12px; }
.cd-form h2 { font-size: 15px; color: var(--text); margin: 0; }
.cd-form input, .cd-form textarea, .cd-form select {
  background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 9px; font: inherit; color: inherit;
}
.cd-form textarea { resize: vertical; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; display: grid; gap: 2px; }
.pick { width: 100%; display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; background: none; border: 1px solid transparent; border-radius: var(--radius-s); cursor: pointer; text-align: left; }
.pick:hover { background: var(--raised); border-color: var(--line); }
.share-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 40vh; overflow: auto; }
.share-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.share-list .warns { grid-column: 2 / -1; }
.share-list li:last-child { border-bottom: 0; }
.share-list .kind { width: 16px; text-align: center; color: var(--muted); font-size: 11px; }
.share-list .only-you { display: block; border: 0; padding: 4px 0; }
.share-list .who { flex: 1; display: grid; gap: 1px; min-width: 0; }
.share-list .who .muted { font-size: 12px; }
.share-list .warn { color: var(--yellow); font-size: 12px; line-height: 1.4; }
.share-add { display: flex; gap: 6px; flex-wrap: wrap; }
.share-add #sh-target { flex: 1 1 200px; }

/* ---------------------------------------------------------------- type-ahead */
.cb { position: relative; flex: 1 1 auto; min-width: 0; }
.cb > input { width: 100%; }
.cb-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 30; list-style: none; margin: 0; padding: 4px;
  background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgba(0,0,0,.35); max-height: 280px; overflow: auto;
}
.cb-group { font-size: 11px; color: var(--muted); padding: 6px 8px 2px; }
.cb-opt { padding: 6px 8px; border-radius: var(--radius-s); cursor: pointer; display: grid; gap: 1px; }
.cb-opt.active, .cb-opt:hover { background: var(--select); color: #fff; }
.cb-opt .sub { font-size: 12px; color: var(--muted); }
.cb-opt.active .sub, .cb-opt:hover .sub { color: #dfe8f5; }
.cb-empty { padding: 8px; color: var(--muted); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-s); overflow: hidden; flex: none; }
.seg button { background: none; border: 0; padding: 4px 9px; font-size: 12px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed=true] { background: var(--raised); color: var(--text); font-weight: 600; }

.add-person { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)) auto; gap: 10px; align-items: end; }
.add-person .cb { width: 100%; }
@media (max-width: 1000px) { .add-person { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------- folder access editor */
.access-custom { display: grid; gap: 8px; padding-left: 24px; }
.access-custom.off { opacity: .5; }
.access-custom .role-checks { padding-left: 0; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.fine-head { font-size: 12px; font-weight: 600; color: var(--text); margin-top: 4px; }
.fine-head .muted { font-weight: 400; }
.org-pick { display: grid; gap: 6px; }
.org-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.fine-inline { font-size: 12px; }
.org-pick input { background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 9px; }
.access-custom.off .chip button { display: none; }
.will-see { margin: 4px 0 0; padding: 8px 10px; background: var(--raised); border-radius: var(--radius-s); font-size: 13px; line-height: 1.45; }

/* ---------------------------------------------------------------- access requests, folder search */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 99px; background: var(--red); color: #fff; font-size: 11px; font-weight: 600; text-align: center; margin-left: 4px; }
.req-list { display: grid; gap: 10px; margin-top: 8px; }
.req { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; }
.req-main { display: grid; gap: 3px; min-width: 0; }
.req-msg { margin: 4px 0 0; white-space: pre-wrap; max-width: 70ch; line-height: 1.45; }
.req-actions { display: flex; gap: 6px; align-items: flex-start; }
.req-form { grid-column: 1 / -1; }
.fa-left { display: grid; gap: 8px; align-content: start; min-width: 0; }
.fa-hits { font-size: 11px; color: var(--muted); padding: 4px 8px; }
.fa-row.search .nm { white-space: normal; }
.fa-row.search .path { color: var(--muted); }
.fa-row.active .path { color: #dfe8f5; }
.fa-row mark { background: color-mix(in srgb, var(--yellow) 45%, transparent); color: inherit; border-radius: 2px; }
.fa-none { padding: 10px; }
.user-pop .req-link { color: var(--text); }

/* ---------------------------------------------------------------- active filters, folder search */
.active-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 16px;
  position: sticky; top: 0; z-index: 4; background: var(--bg); border-bottom: 1px solid var(--line);
}
.af-label { font-size: 12px; color: var(--muted); margin-right: 2px; }
.af-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 6px 3px 10px; border-radius: 99px; font-size: 12px;
  background: color-mix(in srgb, var(--select) 22%, var(--panel)); border: 1px solid color-mix(in srgb, var(--select) 55%, var(--line));
  cursor: pointer; color: var(--text);
}
.af-chip:hover { border-color: var(--text); }
.af-chip .x { font-size: 14px; line-height: 1; color: var(--muted); padding: 0 2px; }
.af-chip:hover .x { color: var(--text); }
.af-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.af-mode button { font-size: 11px; }
.af-clear { margin-left: 4px; }
.kw-list li .tick { display: inline-block; width: 14px; }
.kw-hint { margin: -2px 0 6px; }
.side-search { width: 100%; margin-bottom: 8px; background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 5px 7px; }
.folder-hits { list-style: none; margin: 0; padding: 0; }
.node.hit { align-items: flex-start; padding: 4px 6px; }
.node.hit .nm { display: grid; white-space: normal; }
.node.hit .nm-path { font-size: 11px; color: var(--muted); }
.node.hit.active .nm-path { color: #dfe8f5; }

.version-banner { position: fixed; top: 0; left: 0; right: 0; z-index: 50; background: var(--yellow); color: #1d1e20; padding: 10px 16px; font-weight: 600; line-height: 1.4; }

/* ---------------------------------------------------------------- transcripts */
.search-mode { flex: none; }
.search-mode button { padding: 6px 10px; font-size: 12px; }
.grid.tx-mode { display: block; padding: 12px 16px 24px; }
.tx-loading, .tx-more { color: var(--muted); margin: 6px 0 12px; }
.txr { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 14px; padding: 12px; margin-bottom: 10px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); }
.txr.selected { border-color: var(--select); box-shadow: 0 0 0 1px var(--select); }
.txr-thumb { position: relative; padding: 0; border: 0; background: var(--well); border-radius: var(--radius-s);
  aspect-ratio: 16 / 10; overflow: hidden; cursor: pointer; display: grid; place-items: center; }
.txr-thumb img { width: 100%; height: 100%; object-fit: contain; }
.txr-thumb .play { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff;
  display: grid; place-items: center; font-size: 13px; padding-left: 3px; }
.txr-body { min-width: 0; display: grid; gap: 6px; align-content: start; }
.txr-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.txr-head .muted { font-size: 12px; }
.txr-hits { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.txr-hits button { width: 100%; display: flex; gap: 10px; align-items: baseline; text-align: left; background: none;
  border: 0; padding: 5px 6px; border-radius: var(--radius-s); cursor: pointer; line-height: 1.45; }
.txr-hits button:hover { background: var(--raised); }
.ts { font-variant-numeric: tabular-nums; color: var(--focus); font-size: 12px; min-width: 40px; flex: none; }
.who { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 0 7px; flex: none; white-space: nowrap; }
.snip mark, .tx-text mark { background: color-mix(in srgb, var(--yellow) 45%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }

.loupe-main { display: flex; min-height: 0; }
.loupe-main .loupe-stage { flex: 1; min-width: 0; }
.loupe-tx { width: 380px; flex: none; background: #1d1e20; border-left: 1px solid #333538; display: flex; flex-direction: column; min-height: 0; color: #e4e2de; }
.loupe-tx[hidden] { display: none; }          /* closed: the video gets the full width */
.loupe-tx .pad { padding: 14px; }
.loupe-tx h3 { margin: 0; font-size: 14px; }
.loupe-tx .muted { color: #9b9c9f; }
.tx-head { padding: 12px 14px 10px; border-bottom: 1px solid #333538; display: grid; gap: 8px; }
.tx-title { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tx-title .muted { font-size: 12px; }
.tx-find { background: #151516; border: 1px solid #3d3f43; border-radius: var(--radius-s); padding: 6px 8px; color: inherit; font: inherit; }
.tx-chans { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.tx-chan { font-size: 11px; padding: 2px 9px; border-radius: 99px; border: 1px solid #3d3f43; background: none; color: #9b9c9f; cursor: pointer; }
.tx-chan.on { background: #2c3e55; border-color: #4f7fb8; color: #fff; }
.tx-rename { font-size: 12px; }
.tx-dl { font-size: 12px; color: #9b9c9f; }
.tx-dl a { color: #8fb8e8; }
.tx-lines { list-style: none; margin: 0; padding: 6px 6px 20px; overflow-y: auto; flex: 1; }
.tx-lines li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: start; padding: 6px 8px; border-radius: var(--radius-s); }
.tx-lines li:hover { background: #26272a; }
.tx-lines li[data-line] { cursor: pointer; }
.tx-lines li[data-line] .tx-editbox { cursor: text; }
.tx-lines li.cur { background: #2a3442; }
.tx-lines .ts { background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.tx-line { display: grid; gap: 3px; line-height: 1.45; font-size: 13px; }
.tx-line .who { justify-self: start; color: #9b9c9f; border-color: #3d3f43; }
.tx-line .edited { color: #9b9c9f; font-size: 11px; }
.tx-edit { opacity: 0; background: none; border: 1px solid #3d3f43; color: #c9c7c3; border-radius: var(--radius-s); font-size: 11px; padding: 1px 6px; cursor: pointer; }
.tx-lines li:hover .tx-edit, .tx-edit:focus-visible { opacity: 1; }
.tx-editbox { width: 100%; background: #151516; color: inherit; border: 1px solid #4f7fb8; border-radius: var(--radius-s); padding: 5px 7px; font: inherit; resize: vertical; }
.loupe .link-btn { color: #8fb8e8; }
#loupe-txbtn[aria-pressed=true] { background: #2c3e55; border-color: #4f7fb8; }
.insp-tx-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.insp-tx-actions a.text-btn { text-decoration: none; color: var(--text); }
@media (max-width: 900px) { .loupe-tx { width: 300px; } .txr { grid-template-columns: 110px minmax(0, 1fr); } }

.tx-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.tx-stats div { display: grid; min-width: 96px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--raised); }
.tx-stats strong { font-size: 20px; font-variant-numeric: tabular-nums; }
.tx-stats span { font-size: 12px; color: var(--muted); }
.check.big { font-size: 14px; color: var(--text); margin-top: 6px; }
.tx-vocab { width: 100%; max-width: 480px; background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 8px 10px; font: inherit; color: inherit; }
.sbox h3.sub { font-size: 13px; margin: 18px 0 4px; }
.tx-steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; line-height: 1.5; }
.tx-steps code.secret { display: block; margin-top: 4px; }
.loupe:has(.loupe-tx:not([hidden])) .loupe-nav.next { right: 390px; }
@media (max-width: 900px) { .loupe:has(.loupe-tx:not([hidden])) .loupe-nav.next { right: 310px; } }

/* ---------------------------------------------------------------- portal: member dialogs, logos */
.member-dialog { max-width: 460px; }
.member-dialog p { margin: 0; line-height: 1.5; }
.member-dialog .field { display: grid; gap: 5px; margin-top: 4px; }
.member-dialog .field input { background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 7px 9px; }
.danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.danger-solid:disabled { opacity: .45; cursor: not-allowed; }
.warn-note { border-left: 3px solid var(--yellow); padding: 6px 10px; background: var(--well); border-radius: var(--radius-s); }
.pill.off { color: var(--text); border-color: var(--red); }
.logo-cell { white-space: nowrap; }
.logo-cell > * { vertical-align: middle; margin-right: 4px; }
.logo-thumb { display: inline-flex; align-items: center; justify-content: center; height: 34px; min-width: 50px; max-width: 120px;
              padding: 4px 8px; border-radius: var(--radius-s); background: #121314; border: 1px solid var(--line); }
.logo-thumb[data-bg="light"] { background: #f4f4f2; }
.logo-thumb img { max-height: 100%; max-width: 100%; object-fit: contain; }
.page-nav a:focus-visible, .home-brand:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* ---------------------------------------------------------------- uploads */
.upload-panel { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 60; min-width: 320px; max-width: 90vw;
                background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px 14px; display: grid; gap: 8px; }
.upload-panel progress { width: 100%; accent-color: var(--select); }
.drop-hint { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(20, 30, 45, .55);
             border: 3px dashed var(--select); }
.drop-hint > div { pointer-events: none; background: var(--panel); padding: 16px 22px; border-radius: var(--radius-m); font-size: 15px; }
.replace-form p { margin: 0; line-height: 1.5; max-width: 52ch; }

/* ---------------------------------------------------------------- resizable panes */
.pane-handle { position: relative; cursor: col-resize; touch-action: none; background: var(--panel); outline: none; }
.pane-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; transform: translateX(-50%); background: var(--line); }
.pane-handle:hover::before, .pane-handle.dragging::before, .pane-handle:focus-visible::before { width: 3px; background: var(--select); }
body.resizing, body.resizing * { cursor: col-resize !important; user-select: none !important; }

/* ---------------------------------------------------------------- folder tree */
.side-head { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.side-head h2 { margin: 0; flex: 1; }
.tree-tools { display: flex; gap: 2px; }
.tree-tools .text-btn { padding: 2px 6px; font-size: 11px; color: var(--muted); background: none; border-color: transparent; }
.tree-tools .text-btn:hover { color: var(--text); background: var(--raised); }
.tree ul { padding-left: 14px; }
.chev, .chev-space { flex: none; width: 18px; height: 18px; }
.chev { display: grid; place-items: center; padding: 0; border: 0; border-radius: var(--radius-s); background: none; color: var(--muted); cursor: pointer; }
.chev:hover { background: var(--line); color: var(--text); }
.chev:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.chev svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .12s ease; }
.chev.open svg { transform: rotate(90deg); }
.ficon { flex: none; width: 16px; height: 16px; fill: color-mix(in srgb, currentColor 14%, transparent); stroke: var(--muted); stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.node:hover .ficon { stroke: var(--text); }
.node.active .ficon { stroke: #fff; fill: rgba(255,255,255,.18); }
.node.hit .ficon { margin-top: 1px; }
@media (prefers-reduced-motion: reduce) { .chev svg { transition: none; } }

/* ---------------------------------------------------------------- upload button + dialog */
.topbar-upload { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; flex: none; }
.topbar-upload svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.upload-form { min-width: min(460px, 80vw); }
.upload-form .field { display: grid; gap: 5px; }
.upload-form select { padding: 6px 8px; }
.drop-zone { border: 2px dashed var(--line); border-radius: var(--radius-m); padding: 26px 16px; text-align: center; color: var(--muted); }
.drop-zone.over, .drop-zone:focus-visible { border-color: var(--select); color: var(--text); outline: none; }
.pick-list { list-style: none; margin: 0; padding: 0; max-height: 180px; overflow-y: auto; display: grid; gap: 2px; }
.pick-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; font-size: 13px; padding: 2px 4px; }
.pick-list li span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-list:empty { display: none; }
#user-btn { white-space: nowrap; }

/* ---------------------------------------------------------------- favorite folders */
.fstar { flex: none; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; border-radius: var(--radius-s);
         background: none; color: var(--muted); cursor: pointer; opacity: 0; }
.fstar svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.node:hover .fstar, .ffav:hover .fstar, .fstar:focus-visible, .fstar.on { opacity: 1; }
.fstar:hover { background: var(--line); color: var(--text); }
.fstar.on { color: var(--yellow); }
.fstar.on svg { fill: currentColor; }
.node.active .fstar { color: #fff; }
.node.active .fstar.on svg { fill: #fff; }
.fstar:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
.ffav-section { margin-top: 10px; }
.ffav-list { display: grid; gap: 1px; }
.ffav { display: flex; align-items: center; gap: 6px; padding: 4px 6px; border-radius: var(--radius-s); cursor: pointer; min-height: 28px; }
.ffav:hover { background: var(--raised); }
.ffav.active { background: var(--select); color: #fff; }
.ffav.active .n, .ffav.active .nm-ctx, .ffav.active .fstar { color: inherit; }
.ffav.active .ficon { stroke: #fff; }
.ffav .nm { flex: 1; min-width: 0; display: grid; }
.ffav .nm-name, .ffav .nm-ctx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ffav .nm-ctx { font-size: 11px; color: var(--muted); }
.ffav .n { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.ffav:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.ffav-toggle { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; flex: none; padding: 3px 9px; font-size: 12px;
               border: 1px solid var(--line); border-radius: 99px; background: none; color: var(--muted); cursor: pointer; }
.ffav-toggle svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.ffav-toggle:hover { color: var(--text); background: var(--raised); }
.ffav-toggle[aria-pressed=true] { color: var(--text); border-color: var(--yellow); }
.ffav-toggle[aria-pressed=true] svg { fill: var(--yellow); stroke: var(--yellow); }
/* unstarred folders don't reserve room for the star until hovered, so names have space */
.node .fstar:not(.on) { width: 0; margin: 0; overflow: hidden; }
.node:hover .fstar:not(.on), .node .fstar:not(.on):focus-visible { width: 20px; }

/* ---------------------------------------------------------------- two-factor method choice */
.choose-2fa { display: grid; gap: 10px; }
.choose-2fa p { margin: 0 0 4px; line-height: 1.5; }
.method { display: grid; gap: 4px; text-align: left; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-m);
          background: var(--raised); color: var(--text); cursor: pointer; }
.method:hover, .method:focus-visible { border-color: var(--focus); }
.method span { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.method-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.email-cell a { color: inherit; }
.email-cell .none { color: var(--muted); }

/* ---------------------------------------------------------------- CSV import */
.file-pick { display: inline-flex; cursor: pointer; margin: 6px 10px 6px 0; }
.imp-summary { margin: 14px 0 8px; }
.imp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; margin-bottom: 14px; }
.imp-grid h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 8px 0 6px; }
.imp-grid .field { display: grid; gap: 4px; margin-bottom: 8px; }
.imp-grid .check { display: flex; gap: 6px; align-items: center; margin: 4px 0; flex-wrap: wrap; }
.grid-table.compact th, .grid-table.compact td { padding: 4px 8px; font-size: 12.5px; }
.grid-table.compact select { max-width: 220px; }
.imp-table { max-height: 360px; overflow: auto; margin-bottom: 10px; }
.imp-table tr.skip td { color: var(--muted); }
.imp-done p { line-height: 1.5; }
.welcome-note { background: var(--raised); border-left: 3px solid var(--select); padding: 8px 10px; border-radius: var(--radius-s); margin: 0 0 12px; }
.imp-grid > div { min-width: 0; }
.imp-grid table { width: 100%; }
.imp-grid select { width: 100%; max-width: 100%; }

/* ================================================================= phones (under 800px) */
.m-only, .m-backdrop { display: none; }
@media (max-width: 800px) {
  .m-only { display: inline-flex; }
  .brand { display: flex; }                                   /* keep the globe on phones */
  /* top bar: logo, pages, upload, account on one row; search (and sort) on the next */
  .topbar { flex-wrap: wrap; row-gap: 8px; padding: 8px 10px; gap: 10px; }
  .topbar .search { order: 10; flex: 1 1 60%; max-width: none; }
  .topbar .tools { order: 11; flex: none; }
  .topbar .zoom, .index-status, #search-mode { display: none !important; }
  .topbar #sort { max-width: 120px; }
  .page-nav a { padding: 5px 8px; }
  .topbar-upload { padding: 5px 9px; }
  .topbar-upload { font-size: 0; gap: 0; }
  .topbar-upload svg { width: 17px; height: 17px; }
  #user-btn { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }
  .user-menu { margin-left: auto; }
  /* two columns of cards that always fit */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 8px 10px 80px; }
  .crumbs-bar { flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; }
  #m-folders { order: -1; }
  .crumbs { flex-basis: 100%; order: 2; font-size: 13px; }
  .access-chip { order: 3; }
  .statusbar .hints { display: none; }
  /* folder drawer */
  .sidebar { display: block !important; position: fixed; z-index: 45; inset: 0 auto 0 0; width: min(88vw, 360px);
             transform: translateX(-102%); transition: transform .2s ease; overflow-y: auto; padding-top: 52px;
             box-shadow: 4px 0 24px rgba(0,0,0,.5); }
  body.m-side-open .sidebar { transform: none; }
  .m-close { position: absolute; top: 10px; right: 10px; }
  /* file details sheet */
  .inspector { display: block !important; position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; top: 12vh;
               border-radius: 10px 10px 0 0; transform: translateY(105%); transition: transform .22s ease; overflow-y: auto;
               box-shadow: 0 -4px 24px rgba(0,0,0,.5); padding-top: 44px; }
  body.m-insp-open .inspector { transform: none; }
  .m-sheet-close { position: fixed; z-index: 46; right: 12px; top: calc(12vh + 8px); padding: 6px 12px; border-radius: 99px;
                   border: 1px solid var(--line); background: var(--raised); color: var(--text); visibility: hidden; }
  body.m-insp-open .m-sheet-close { visibility: visible; }
  .m-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(0,0,0,.55); }
  .m-backdrop[hidden] { display: none; }
  /* touch: hearts and stars are always visible, targets a bit bigger */
  .fstar { opacity: 1; }
  .node .fstar:not(.on) { width: 20px; }
  .node, .ffav, .coll { min-height: 36px; }
  .chev { width: 28px; height: 28px; }
  /* settings: tabs scroll sideways, member rows become cards */
  .settings-layout, .settings { grid-template-columns: 1fr !important; }
  .tabs { display: flex !important; overflow-x: auto; position: static !important; gap: 4px; padding-bottom: 4px; }
  .tabs button { white-space: nowrap; flex: none; }
  .add-person { grid-template-columns: 1fr !important; }
  #people-body tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
  #people-body td { border: 0 !important; padding: 0 !important; }
  #people-body td.who-cell, #people-body td.email-cell, #people-body td.actions { grid-column: 1 / -1; }
  #people-body td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  #people-body td.actions { display: flex; flex-wrap: wrap; gap: 6px; }
  .grid-table:has(#people-body) thead { display: none; }
  .loupe-tx { width: 100%; }
}
@media (max-width: 800px) and (prefers-reduced-motion: reduce) { .sidebar, .inspector { transition: none; } }

/* ---------------------------------------------------------------- Bridge colour labels (NAS edition) */
.label-filter { display: flex; flex-wrap: wrap; gap: 6px; }
.lchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 6px; border-radius: 99px;
         border: 1px solid var(--line); background: none; cursor: pointer; font-size: 12px; }
.lchip .dot, .active-filters .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); display: inline-block; }
.lchip[aria-pressed=true] { background: var(--raised); border-color: var(--text); }
.cap[data-label] { background: color-mix(in srgb, var(--c) 30%, var(--panel)); border-top: 2px solid var(--c); }
.label-picker { display: flex; gap: 6px; }
.label-picker button { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; }
.label-picker button[aria-pressed=true] { border-color: var(--text); box-shadow: 0 0 0 2px var(--panel) inset; }
.label-picker button.none { background: none; border: 1px dashed var(--muted); color: var(--muted); font-size: 12px; }
.label-name { color: var(--muted); font-size: 12px; margin-top: 6px; }
.ro-label { display: flex; align-items: center; gap: 8px; }
.ro-label .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }

/* Bridge label colours stay true to Bridge, independent of the theme's accent colours */
:root { --lab-red: #d9534a; --lab-yellow: #e2b93b; --lab-green: #5aa860; --lab-blue: #4d8fd6; --lab-purple: #9467c7; }
.approved-note { background: var(--raised); border-left: 3px solid var(--green); padding: 10px 12px; border-radius: var(--radius-s); line-height: 1.5; }

/* upload dialog: never wider than the screen, whatever the folder names */
.upload-form, .replace-form { width: min(520px, 86vw); min-width: 0; }
.upload-form select { width: 100%; max-width: 100%; text-overflow: ellipsis; }
.dest-path { margin: -4px 0 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-list li span:first-child, .replace-form strong { overflow-wrap: anywhere; }
.upload-panel { max-width: min(520px, 92vw); }
.upload-panel strong { overflow-wrap: anywhere; }

.secret { user-select: all; -webkit-user-select: all; }

/* bulk tagging */
.tag-panel .tag-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.recent-kw { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.chip.quick { cursor: pointer; border-style: dashed; background: none; color: var(--text); }
.chip.quick:hover { border-style: solid; border-color: var(--focus); }

/* ---------------------------------------------------------------- file management */
.folder-tool { display: inline-flex; align-items: center; gap: 5px; margin-left: 8px; flex: none; white-space: nowrap; }
.folder-tool svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; stroke-linecap: round; }
.ctx-menu { position: fixed; z-index: 90; min-width: 200px; padding: 4px; display: grid;
            background: var(--raised); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.ctx-menu button { all: unset; box-sizing: border-box; padding: 7px 10px; border-radius: var(--radius-s); cursor: pointer; font-size: 13px; color: var(--text); }
.ctx-menu button:hover, .ctx-menu button:focus-visible { background: var(--select); color: #fff; }
.ctx-menu button.danger { color: var(--red); }
.ctx-menu button.danger:hover, .ctx-menu button.danger:focus-visible { background: var(--red); color: #fff; }
.ctx-menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; }
.pick-folder { display: grid; gap: 8px; }
.pick-folder .side-search { width: 100%; }
.pf-list { max-height: min(46vh, 380px); overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--well); padding: 4px; }
.pf-item { all: unset; box-sizing: border-box; display: flex; align-items: center; gap: 6px; width: 100%; padding: 5px 8px 5px calc(8px + var(--d, 0) * 16px);
           border-radius: var(--radius-s); cursor: pointer; white-space: nowrap; overflow: hidden; }
.pf-item span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.pf-item .ficon { width: 14px; height: 14px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.3; }
.pf-item:hover { background: var(--raised); }
.pf-item.on { background: var(--select); color: #fff; }
.pf-item.on .ficon { stroke: #fff; }
.pf-here { margin-left: auto; font-size: 11px; opacity: .7; }
.pf-new { display: flex; gap: 6px; }
.pf-new input { flex: 1; min-width: 0; }
.pick-folder .ad-actions, .trash-dialog .ad-actions { align-items: center; }
.ad-actions .grow { flex: 1; }
.pick-folder .dest-path { margin: 0; min-height: 1.4em; }
.access-dialog:has(.pick-folder), .access-dialog:has(.trash-dialog) { width: min(520px, 94vw); }
.organize .sel-actions { margin-top: 0; }
.text-btn.danger { color: var(--red); }
.dl-wm { margin: 8px 0 0; color: var(--text); }
.trash-nav { font-weight: 400; color: var(--muted); margin-top: 2px; }
.trash-nav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linejoin: round; stroke-linecap: round; }
.trash-nav .nm { flex: 1; }
.trash-list { list-style: none; margin: 0; padding: 0; max-height: 50vh; overflow: auto; display: grid; gap: 6px; }
.trash-list li { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-s); background: var(--well); display: grid; gap: 2px; }
.trash-list .tr-name { display: flex; gap: 6px; align-items: center; min-width: 0; }
.trash-list .tr-name strong { overflow-wrap: anywhere; }
.trash-list .tr-name .ficon { width: 14px; height: 14px; fill: none; stroke: var(--muted); stroke-width: 1.3; flex: none; }
.trash-list .tr-actions { display: flex; gap: 6px; margin-top: 4px; }
.tree .node.drop-hover { outline: 2px dashed var(--focus); outline-offset: -2px; background: var(--raised); }
@media (max-width: 800px) {
  .folder-tool { margin-left: 4px; }
  #newfolder-btn { font-size: 0; gap: 0; }            /* icon only on phones */
  #newfolder-btn svg { width: 16px; height: 16px; }
  #folder-menu .lbl { display: none; }
}
.finder-form { display: grid; gap: 10px; max-width: 560px; margin-top: 8px; }
.finder-form label { display: grid; gap: 4px; font-size: 13px; }
.finder-form input { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.ai-stage { display: flex; align-items: center; gap: 8px; font-weight: 600; margin: 4px 0 8px; }
.ai-stage .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
.ai-stage .dot.on { background: #3fb950; box-shadow: 0 0 0 3px rgba(63,185,80,.2); }
.ai-progress { width: min(420px, 100%); vertical-align: middle; }
.callout.warn { border-color: var(--red); }
.ai-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0; }
.ai-tags button { all: unset; cursor: pointer; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--raised); border: 1px solid var(--line); }
.ai-tags button:hover { border-color: var(--focus); }
.ai-desc { margin: 4px 0; line-height: 1.45; }
.dup-list { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 2px; font-size: 12.5px; }
.dup-list button { all: unset; cursor: pointer; color: var(--text); overflow-wrap: anywhere; }
.dup-list button:hover { text-decoration: underline; }
.ai-prod { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 10px; margin-top: 10px; display: grid; gap: 8px; background: var(--well); }
.ai-prod-head { display: flex; gap: 6px; align-items: center; }
.ai-prod-name { flex: 1; min-width: 0; font-weight: 600; }
.ai-prod-notes { width: 100%; }
.ai-refs { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-refs figure { position: relative; margin: 0; width: 96px; height: 72px; border-radius: var(--radius-s); overflow: hidden; background: var(--raised); }
.ai-refs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ai-ref-x { all: unset; position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
            background: rgba(0,0,0,.65); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; }
.ai-ref-x:hover { background: var(--red); }
.ai-ref-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ai-ref-row select { flex: 1; min-width: 120px; }

/* ================================================================ Simple view (sales, dealers, customers, STIG) */
/* Folder cards and a breadcrumb instead of the tree; tabs; one Download button. Full-view tools are hidden, not removed. */
.simple-bar[hidden] { display: none; }
body.simple .sidebar, body.simple .pane-handle[data-pane="side"], body.simple #m-folders, body.simple #crumbs,
body.simple #ffav-toggle, body.simple .folder-tool, body.simple .access-chip, body.simple #sort, body.simple #order,
body.simple #search-mode, body.simple .statusbar .hint, body.simple #active-filters, body.simple .index-status { display: none !important; }
body.simple .layout { grid-template-columns: minmax(0, 1fr) 6px var(--insp-w, 340px); }
body.simple .crumbs-bar:not(:has(#coll-actions:not([hidden]))) { display: none; }
.simple-bar { padding: 18px 20px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.simple-bar > * { min-width: 0; }
.s-crumbs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.s-crumbs .trail { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0;
  font-family: var(--display, sans-serif); text-transform: uppercase; letter-spacing: .04em; font-size: 15px; }
.s-crumbs .trail button { background: none; border: 0; padding: 4px 0; color: var(--muted); font: inherit; letter-spacing: inherit; text-transform: inherit; cursor: pointer; }
.s-crumbs .trail button:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.s-crumbs .trail [aria-current] { color: var(--text); font-size: 20px; font-weight: 600; }
.s-crumbs .sep { color: var(--muted); }
.s-folder-actions { margin-left: auto; display: flex; gap: 8px; }
.s-save-folder { background: var(--raised); border: 1px solid var(--line); color: var(--text); border-radius: 999px; padding: 6px 14px; cursor: pointer; font: inherit; }
.s-save-folder.on { border-color: var(--select); }
.s-save-folder:hover { border-color: var(--muted); }
.s-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.s-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.s-tabs button { flex: none; height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--raised); color: var(--text); font: inherit; cursor: pointer; }
.s-tabs button .n { color: var(--muted); margin-left: 4px; font-size: 12px; }
.s-tabs button[aria-pressed="true"] { background: var(--text); color: #121212; border-color: var(--text); font-weight: 600; }
.s-tabs button[aria-pressed="true"] .n { color: #555; }
.s-approved { display: flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.s-approved input { accent-color: var(--rapid-red, #8A191B); width: 16px; height: 16px; }
.s-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; color: var(--muted); white-space: nowrap; }
.s-sort select { background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 5px 8px; color: var(--text); font: inherit; }
.s-h { margin: 4px 0 -4px; font-family: var(--display, sans-serif); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; }
.s-h[hidden] { display: none; }
.s-folders { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.s-folders:empty { display: none; }
.s-folder { display: flex; align-items: center; gap: 12px; text-align: left; padding: 12px 14px; min-height: 58px; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius-m); color: var(--text); font: inherit; cursor: pointer; }
.s-folder:hover { border-color: var(--muted); }
.s-folder svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.s-folder .s-ico { width: 22px; flex: none; text-align: center; color: var(--muted); font-size: 17px; }
.s-folder .s-ico.heart { color: var(--red-text, #E0605B); }
.s-folder .t { display: grid; min-width: 0; }
.s-folder .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-folder .c { color: var(--muted); font-size: 12px; }
body.simple .grid { gap: 14px; padding: 14px 20px 24px; }
body.simple .topbar .tools { margin-left: auto; }
.s-card { border: 1px solid var(--line); border-radius: 10px; }
.s-card .thumb { aspect-ratio: 4 / 3; }
.s-card .thumb img { inset: 0; width: 100%; height: 100%; object-fit: cover; }
.s-card .cap { border-top: 0; padding: 9px 11px 11px; }
.s-card .cap .nm { font-size: 13px; font-weight: 500; }
.s-pill { position: absolute; z-index: 1; left: 8px; bottom: 8px; display: flex; align-items: center; gap: 5px; background: rgba(0,0,0,.72); color: #fff;
  border-radius: 999px; padding: 3px 9px 3px 7px; font-size: 12px; font-weight: 600; }
.s-pill svg { width: 10px; height: 10px; fill: #fff; }
.s-tag { position: absolute; z-index: 1; left: 8px; bottom: 8px; background: #ececec; color: #121212; border-radius: 4px; padding: 2px 6px; font-size: 11px; font-weight: 700; }
/* detail panel */
.s-body { gap: 16px !important; }
.s-title { margin: 0; font-family: var(--display, sans-serif); font-weight: 600; font-size: 21px; letter-spacing: .02em; line-height: 1.2; word-break: break-word; }
.s-where { margin: 4px 0 0; color: var(--muted); font-size: 13px; word-break: break-word; }
.s-go { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 2px 0; text-align: left; cursor: pointer; font: inherit; font-size: 13px; color: var(--text); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.s-go:hover { text-decoration-color: var(--text); }
.s-go svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; }
.inspector .pv .s-playbig { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 52px; height: 52px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; font-size: 18px; padding-left: 4px; pointer-events: none; }
.s-dl { position: relative; display: grid; gap: 8px; }
.s-split { display: flex; }
.s-dl-main { flex: 1; height: 48px; background: var(--rapid-red, #8A191B); color: #fff; border: 0; border-radius: 8px 0 0 8px; cursor: pointer;
  font-family: var(--display, sans-serif); font-weight: 600; font-size: 17px; letter-spacing: .08em; text-transform: uppercase; }
.s-dl-main.solo { border-radius: 8px; }
.s-dl-main:hover, .s-dl-size:hover { filter: brightness(1.15); }
.s-dl-size { height: 48px; padding: 0 14px; background: var(--rapid-red, #8A191B); color: #fff; border: 0; border-left: 1px solid rgba(255,255,255,.25);
  border-radius: 0 8px 8px 0; cursor: pointer; font: inherit; font-weight: 600; white-space: nowrap; }
.s-menu { position: absolute; z-index: 20; top: 54px; left: 0; right: 0; display: grid; padding: 6px; background: var(--raised);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.s-menu[hidden] { display: none; }
.s-menu button { display: flex; justify-content: space-between; gap: 12px; padding: 9px 10px; background: none; border: 0; border-radius: 6px; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.s-menu button:hover { background: var(--panel); }
.s-menu button[aria-checked="true"] { font-weight: 600; }
.s-menu .h { color: var(--muted); font-weight: 400; }
.s-seg { display: none; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 3px; order: -1; }
.s-seg button { height: 40px; background: none; border: 0; border-radius: 8px; color: #cfcfcf; font: inherit; cursor: pointer; }
.s-seg button[aria-checked="true"] { background: #4a4a4a; color: #fff; font-weight: 600; }
.s-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.s-btn { flex: 1 1 auto; min-height: 40px; padding: 0 14px; background: var(--raised); color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: inherit; font-weight: 500; cursor: pointer; }
.s-btn:hover { border-color: var(--muted); }
.s-btn.on { border-color: var(--select); }
.s-tags-box h2 { font-family: var(--display, sans-serif); text-transform: uppercase; letter-spacing: .06em; font-size: 13px; margin-bottom: 8px; }
.s-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.s-chip { display: inline-flex; align-items: center; background: var(--raised); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.s-chip:hover { border-color: var(--muted); }
.s-chip.ai { border-style: dashed; }
.s-chip button { background: none; border: 0; padding: 5px 12px; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.s-chip .x { padding: 5px 10px 5px 2px; color: var(--muted); }
.s-chip .x:hover { color: var(--text); }
.s-kw-add { display: flex; gap: 8px; margin-top: 10px; }
.s-kw-add input { flex: 1; min-width: 0; height: 38px; background: var(--well); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; color: var(--text); font: inherit; }
.s-kw-add .s-btn { flex: none; min-height: 38px; }
.s-meta { margin: 0; color: var(--muted); font-size: 12px; }
.empty .text-btn { margin-top: 10px; }
@media (max-width: 800px) {
  body.simple .layout { grid-template-columns: 1fr; }
  .simple-bar { padding: 12px 12px 0; gap: 12px; }
  .s-crumbs .trail { font-size: 13px; }
  .s-crumbs .trail [aria-current] { font-size: 19px; flex-basis: 100%; }
  .s-folder-actions { position: absolute; right: 0; bottom: -6px; gap: 4px; }
  .s-save-folder:not(.s-share-folder) { padding: 0; width: 44px; height: 44px; font-size: 0; }
  .s-save-folder:not(.s-share-folder)::before { content: "♥"; font-size: 18px; }
  .s-share-folder { height: 44px; padding: 0 12px; }
  .s-crumbs { position: relative; padding-right: 130px; }
  .s-controls { gap: 10px; }
  .s-tabs { flex: 1 1 100%; }
  .s-sort { margin-left: auto; }
  .s-folders { display: flex; overflow-x: auto; gap: 8px; scrollbar-width: none; }
  .s-folder { flex: none; min-height: 44px; padding: 0 12px; }
  .s-folder .c { display: none; }
  .s-h { display: none !important; }
  body.simple .grid { gap: 12px; padding: 12px 12px 80px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .s-split .s-dl-size, .s-menu { display: none !important; }
  .s-dl-main { border-radius: 10px; height: 52px; font-size: 18px; }
  .s-seg { display: grid; }
  .s-btn { min-height: 46px; }
}

#fshare-btn { margin-left: 6px; }
#fshare-btn[hidden] { display: none; }

/* ---------------------------------------------------------------- notifications bell */
.bell-wrap { position: relative; }
.bell { position: relative; width: 38px; height: 38px; display: grid; place-items: center; background: none; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer; }
.bell:hover, .bell[aria-expanded="true"] { color: var(--text); background: var(--raised); }
.bell svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bell .badge { position: absolute; top: 3px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--rapid-red, #8A191B);
  color: #fff; font-size: 11px; font-weight: 700; line-height: 17px; text-align: center; }
.bell .badge[hidden] { display: none; }
.bell-pop { position: absolute; right: 0; top: 44px; z-index: 60; width: min(360px, calc(100vw - 24px)); max-height: min(70vh, 520px); overflow: auto;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.5); }
.bell-pop[hidden] { display: none; }
.bell-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel); }
.bell-pop ul { list-style: none; margin: 0; padding: 4px; }
.bell-pop a { display: grid; gap: 2px; padding: 10px 12px 10px 22px; border-radius: 8px; color: var(--text); text-decoration: none; position: relative; }
.bell-pop a:hover { background: var(--raised); }
.bell-pop a.unread::before { content: ""; position: absolute; left: 8px; top: 15px; width: 7px; height: 7px; border-radius: 50%; background: var(--rapid-red, #8A191B); }
.bell-pop a:not(.unread) .t { font-weight: 400; color: var(--muted); }
.bell-pop .t { font-weight: 600; font-size: 13px; }
.bell-pop .b { font-size: 13px; }
.bell-pop .w { font-size: 12px; color: var(--muted); }
.bell-empty { margin: 0; padding: 16px 14px; color: var(--muted); font-size: 13px; }
@media (max-width: 800px) { .bell-pop { position: fixed; right: 12px; top: 56px; } }
.s-approved.off { display: none !important; }
.s-sort[hidden] { display: none; }
.s-tabs .s-tab-shared { margin-left: 6px; }

/* ---------------------------------------------------------------- usage in the side panel */
.insp-usage h2 { margin-bottom: 8px; }
.usage-nums { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.usage-nums strong { color: var(--text); font-size: 16px; font-weight: 600; margin-right: 3px; }
.usage-recent { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; font-size: 12.5px; }
.usage-recent li { display: flex; justify-content: space-between; gap: 10px; }
.usage-recent li > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.usage-recent li > span:last-child { flex: none; }

/* ---------------------------------------------------------------- analytics (Settings) */
/* Three categorical slots from the validated reference palette, dark steps (this page is dark). */
.settings-page { --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70; }
.an-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.an-bar h2 { margin: 0 auto 0 0; }
.an-bar label { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.an-bar select { background: var(--well); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; color: var(--text); font: inherit; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.kpi { display: grid; gap: 2px; background: var(--well); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.kpi-l { color: var(--muted); font-size: 12.5px; }
.kpi-n { font-size: 26px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi-d { font-size: 12px; color: var(--text); }
.an-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.an-legend i, .an-tip i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.an-plot { position: relative; margin-top: 10px; }
.an-chart { width: 100%; height: auto; display: block; }
.an-chart .grid { stroke: var(--line); stroke-width: 1; }
.an-chart .tick { fill: var(--muted); font-size: 11px; }
.an-chart .end { fill: var(--text); font-size: 12px; }
.an-chart .xhair { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
.an-tip { position: absolute; z-index: 5; min-width: 170px; pointer-events: none; background: var(--raised); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12.5px; box-shadow: 0 6px 18px rgba(0,0,0,.4); display: grid; gap: 3px; }
.an-tip[hidden] { display: none; }
.an-tip div { display: flex; align-items: center; }
.an-tip b { margin-left: auto; padding-left: 14px; font-variant-numeric: tabular-nums; }
.an-daytable { max-height: 360px; overflow: auto; }
.an-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 18px; }
.an-files { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.an-files li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.an-thumb { width: 48px; height: 36px; border-radius: 4px; background: var(--well); overflow: hidden; }
.an-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.an-f { display: grid; min-width: 0; font-size: 13px; }
.an-f a, .an-f span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-f a { color: var(--text); }
.an-f .muted { font-size: 12px; }
.an-n { display: grid; text-align: right; font-size: 12px; }
.an-n strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.ranked { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
.ranked li, .an-files li { min-width: 0; }
.an-files { grid-template-columns: minmax(0, 1fr); }
.rk-row { min-width: 0; }
.rk-l { flex: 1 1 auto; }
.an-grid > .sbox { overflow: hidden; }
.detail .muted { word-break: break-word; }
.rk-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.rk-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rk-l a { color: var(--text); }
.rk-v { font-weight: 600; font-variant-numeric: tabular-nums; }
.rk-bar { height: 4px; margin-top: 4px; background: var(--well); border-radius: 2px; overflow: hidden; }
.rk-bar span { display: block; height: 100%; background: var(--series-1); border-radius: 2px; }
.rk-sub { font-size: 12px; margin-top: 3px; }
@media (max-width: 800px) { .an-grid { grid-template-columns: 1fr; } .kpi-n { font-size: 22px; } }
.an-head { display: grid; gap: 12px; }
.an-views { display: flex; gap: 4px; background: var(--well); border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.an-views button, .an-kinds button { background: none; border: 0; border-radius: 6px; padding: 5px 12px; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.an-views button[aria-current="page"], .an-kinds button[aria-pressed="true"] { background: var(--raised); color: var(--text); font-weight: 600; }
.an-views button:hover, .an-kinds button:hover { color: var(--text); }
.an-kinds { display: inline-flex; gap: 2px; background: var(--well); border: 1px solid var(--line); border-radius: 8px; padding: 3px; flex-wrap: wrap; }
.an-filters { gap: 12px 16px; }
.an-dates { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.an-dates input { background: var(--well); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; color: var(--text); font: inherit; color-scheme: dark; }
.an-range { margin: 0; }
.an-more { margin-left: auto; }
.an-bar h2 + .an-more { margin-left: auto; }
.an-click tbody tr { cursor: pointer; }
.an-click tbody tr:hover td { background: var(--raised); }
.an-ftable td { vertical-align: middle; }
.an-ftable .an-thumb { display: block; }
.an-name { max-width: 340px; }
.an-name a { color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-name .muted { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-who td { background: var(--well); font-size: 13px; }
.an-who .usage-recent { max-width: 560px; }
.an-chip { margin: 0 0 6px; font-size: 13px; }
.an-person h2 { margin: 8px 0 2px; font-size: 20px; }
.an-person > .muted { margin: 0 0 4px; }
.sbox .detail a { color: var(--text); }

/* Folder access: filters and changing several folders at once */
.fa-filters { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--muted); }
.fa-filters label { display: flex; align-items: center; gap: 6px; }
.fa-filters select { max-width: 230px; }
.fa-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; min-height: 26px; }
.fa-bar .grow { flex: 1; }
.fa-row .fa-pick { flex: none; margin: 0 4px 0 0; cursor: pointer; }
.fa-row.picked:not(.active) { background: color-mix(in srgb, var(--select) 14%, transparent); }
.fa-row .fa-sh { margin-left: 8px; font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 9px; padding: 0 6px; white-space: nowrap; }
.fa-row.active .fa-sh { color: #e6eefa; border-color: rgba(255,255,255,.4); }
.fa-picked { list-style: none; margin: 6px 0 12px; padding: 0; display: grid; gap: 4px; font-size: 12px; }
.fa-picked li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.fa-picked li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-picked li > .muted { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fa-party { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; min-width: 0; position: relative; }
.fa-party input { width: 100%; }
.fa-party .chip { display: inline-flex; align-items: center; gap: 2px; }
.fa-all { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.fa-row .fa-why { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.fa-row.active .fa-why { color: #e6eefa; }

/* Simple: sort direction, include subfolders, ratings */
.s-order { background: var(--well); border: 1px solid var(--line); border-radius: var(--radius-s); padding: 5px 9px; color: var(--text); font: inherit; cursor: pointer; white-space: nowrap; }
.s-order:hover { border-color: var(--muted); }
.s-sort label { cursor: default; }
.s-card .cap .s-stars { color: var(--yellow, #e3b341); font-size: 11px; letter-spacing: 1px; margin-top: 2px; }
.s-rate h2 { margin: 0 0 6px; }
.s-rate-stars { display: flex; align-items: center; gap: 2px; }
.s-rate-stars button { background: none; border: 0; padding: 2px 3px; font-size: 22px; line-height: 1; color: var(--line); cursor: pointer; }
.s-rate-stars button.on { color: var(--yellow, #e3b341); }
.s-rate-stars:hover button { color: var(--yellow, #e3b341); }
.s-rate-stars button:hover ~ button { color: var(--line); }
.s-rate-stars .hint-s { margin-left: 8px; }

/* Search tips (the ? in the search box) */
.search { position: relative; }
.q-help { flex: none; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: none; color: var(--muted);
  font: 600 11px/1 inherit; cursor: pointer; padding: 0; margin-left: 4px; }
.q-help:hover, .q-help[aria-expanded="true"] { color: var(--text); border-color: var(--muted); }
.q-help.ai-off { border-color: var(--select); color: var(--select); }
.q-tips { position: absolute; top: calc(100% + 6px); left: 0; right: auto; z-index: 60; width: min(440px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: 0 8px 24px rgba(0,0,0,.25);
  padding: 12px 14px; font-size: 12.5px; color: var(--text); }
.q-tips table { border-collapse: collapse; width: 100%; }
.q-tips td { padding: 4px 8px 4px 0; vertical-align: top; }
.q-tips td:first-child { white-space: nowrap; }
.q-tips code { font-size: 12px; background: var(--well); border-radius: 4px; padding: 1px 5px; }
.q-tips .q-ai { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.q-tips .q-ai { justify-content: flex-start; text-align: left; width: auto; }
.q-tips .q-ai input { flex: none; margin: 0 2px 0 0; width: auto; }
.q-tips .q-ai .muted { flex-basis: 100%; padding-left: 22px; font-size: 11.5px; }

/* Simple: date filter (shown when sorted by Date) */
.s-when { display: flex; gap: 6px; align-items: center; }
.s-when select { max-width: 170px; }

/* Team rating */
.team-rate h2 { margin: 0 0 4px; }
.team-avg { margin: 0 0 6px; font-size: 13px; }
.team-dist { display: grid; gap: 2px; margin: 0 0 8px; font-size: 11px; color: var(--muted); max-width: 240px; }
.team-dist div { display: grid; grid-template-columns: 24px 1fr 28px; gap: 6px; align-items: center; }
.team-dist i { display: block; height: 6px; border-radius: 3px; background: var(--line); position: relative; overflow: hidden; }
.team-dist i::after { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w); background: #e3b341; }
.team-dist span:last-child { text-align: right; }
.team-mine { display: flex; flex-direction: column; gap: 2px; }
.s-stars-row { display: flex; gap: 8px; align-items: baseline; margin-top: 2px; }
.s-stars-row .s-stars { margin-top: 0; }
.s-team { font-size: 11px; color: #e3b341; white-space: nowrap; }
.s-team .n { color: var(--muted); }
.s-card .cap .s-from { font-size: 11px; color: var(--muted); margin-top: 1px; }
.s-leave { margin-top: 6px; }

/* Roles: rights down the side, roles across the top */
.rm-wrap { overflow: auto; max-height: calc(100vh - 220px); border: 1px solid var(--line); border-radius: var(--radius-m); background: var(--panel); }
.rm { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.rm th, .rm td { padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--panel); }
.rm td { text-align: center; min-width: 96px; }
.rm td select { width: 100%; min-width: 0; max-width: 150px; font-size: 12px; }
.rm thead th { position: sticky; top: 0; z-index: 3; border-bottom: 2px solid var(--line); }
.rm .rm-corner { left: 0; z-index: 4; text-align: left; font-weight: 500; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.rm .rm-role { text-align: center; vertical-align: bottom; }
.rm .rm-role .nm { display: block; font-weight: 700; color: var(--text); font-size: 13px; }
.rm .rm-role .sub { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.rm .rm-right { position: sticky; left: 0; z-index: 2; text-align: left; font-weight: 400; min-width: 260px; max-width: 340px; border-right: 1px solid var(--line); }
.rm .rm-right .nm { display: block; color: var(--text); font-weight: 600; }
.rm .rm-right .desc { display: block; color: var(--muted); font-size: 11.5px; line-height: 1.35; margin-top: 2px; }
.rm .rm-corner { border-right: 1px solid var(--line); }
.rm .rm-group th { position: sticky; left: 0; text-align: left; padding: 14px 10px 6px; background: var(--well); border-bottom: 1px solid var(--line); }
.rm .rm-group th span { position: sticky; left: 10px; font-family: Oswald, sans-serif; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); }
.rm input[type="checkbox"] { width: 17px; height: 17px; cursor: pointer; accent-color: var(--select); }
.rm input:disabled { cursor: default; }
/* where you are: the row and the role you're pointing at */
.rm tr.hr > th, .rm tr.hr > td { background: color-mix(in srgb, var(--select) 10%, var(--panel)); }
.rm .hc { background: color-mix(in srgb, var(--select) 10%, var(--panel)); }
.rm tr.hr > .hc { background: color-mix(in srgb, var(--select) 22%, var(--panel)); }
.rm thead .hc { box-shadow: inset 0 -3px 0 var(--select); }
.rm .rm-foot td, .rm .rm-foot th { border-bottom: 0; }

/* Roles on a phone: pick a role, see its rights as switches */
.rm-pick { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.rm-pick button { flex: none; border: 1px solid var(--line); background: var(--well); color: var(--text); border-radius: 999px; padding: 7px 14px; font: inherit; cursor: pointer; }
.rm-pick button[aria-selected="true"] { background: var(--select); border-color: var(--select); color: #fff; }
.rm-card { border: 1px solid var(--line); border-radius: var(--radius-m); padding: 12px 14px; background: var(--panel); }
.rm-card-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rm-card-head h3 { margin: 0; font-size: 18px; }
.rm-card-head [data-del], .rm-card-head .fine { margin-left: auto; }
.rm-card h4 { margin: 16px 0 4px; font-family: Oswald, sans-serif; text-transform: uppercase; letter-spacing: .06em; font-size: 12px; color: var(--muted); font-weight: 500; }
.rm-list { list-style: none; margin: 0; padding: 0; }
.rm-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rm-list li:last-child { border-bottom: 0; }
.rm-list label { flex: 1; min-width: 0; }
.rm-list .nm { display: block; font-weight: 600; }
.rm-list .desc { display: block; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: 2px; }
.rm-list .ctl { flex: none; }
.rm-list select { max-width: 160px; }
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
input.switch:checked { background: var(--select); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:disabled { opacity: .55; cursor: default; }
input.switch:focus-visible { outline: 2px solid var(--select); outline-offset: 2px; }

/* PDF reader in the viewer */
.loupe-pdf { position: absolute; inset: 0; background: #3a3b3e; cursor: default; }
.pdf-scroll { position: absolute; inset: 0; overflow: auto; outline: none; }
.pdf-scroll .pdfViewer { padding: 12px 0 40px; }
.pdf-scroll .pdfViewer .page { box-shadow: 0 2px 10px rgba(0,0,0,.45); border: 0; margin: 10px auto; }
.pdf-tools { gap: 4px; flex-wrap: wrap; }
.pdf-tools .pdf-sep { width: 1px; height: 18px; background: var(--line); margin: 0 6px; }
.pdf-page { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); }
.pdf-page input { width: 42px; text-align: center; padding: 3px 4px; font-size: 12px; }
.pdf-zoom { min-width: 42px; text-align: center; font-size: 12px; color: var(--muted); }
.pdf-find { position: relative; display: inline-flex; align-items: center; }
.pdf-find input { width: 170px; padding: 4px 8px; font-size: 12px; }
.pdf-hits { font-size: 11px; color: var(--muted); margin-left: 6px; min-width: 44px; }
@media (max-width: 760px) {
  .pdf-tools .pdf-sep, .pdf-zoom { display: none; }
  .pdf-find input { width: 120px; }
  .loupe-bar:has(#loupe-pdfbar:not([hidden])) { flex-wrap: wrap; row-gap: 6px; }
  .loupe-bar:has(#loupe-pdfbar:not([hidden])) #loupe-name { flex-basis: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.pdf-tools input { color: #1a1a1a; background: #f4f3f1; border: 1px solid #c9c7c3; border-radius: 4px; }
.pdf-tools input::placeholder { color: #8a8884; }
.loupe-pdf, .loupe-pdf * { -webkit-user-select: text; user-select: text; }
.loupe-pdf .textLayer { cursor: text; }

/* ---------------------------------------------------------------- settings: appearance */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 560px; margin: 4px 0 10px; }
.theme-opt { display: grid; gap: 4px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius-m); cursor: pointer; background: var(--panel); }
.theme-opt:hover { border-color: var(--muted); }
.theme-opt:has(input:checked) { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); }
.theme-opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.theme-opt input { position: absolute; opacity: 0; pointer-events: none; }
.theme-opt .fine { margin: 0; }
.theme-swatch { display: grid; grid-template-columns: 1fr 2fr; grid-template-rows: 10px 1fr; height: 54px; border-radius: var(--radius-s);
                overflow: hidden; border: 1px solid var(--line); margin-bottom: 4px; }
.theme-swatch i:first-child { grid-column: 1 / -1; background: #161616; }
.theme-swatch.light i:nth-child(2) { background: #fff; } .theme-swatch.light i:nth-child(3) { background: #f3f3f2; }
.theme-swatch.dark i:nth-child(2) { background: #1c1c1c; } .theme-swatch.dark i:nth-child(3) { background: #222; }
.theme-swatch.system i:nth-child(2) { background: #fff; } .theme-swatch.system i:nth-child(3) { background: linear-gradient(90deg, #f3f3f2 50%, #222 50%); }
@media (max-width: 560px) { .theme-pick { grid-template-columns: 1fr; } .theme-swatch { height: 36px; } }
/* the Move/Copy picker folds like the tree */
.pf-tw { flex: none; width: 14px; height: 14px; display: grid; place-items: center; color: var(--muted); border-radius: var(--radius-s); }
.pf-tw[data-tw] { cursor: pointer; }
.pf-tw[data-tw]:hover { background: var(--line); color: var(--text); }
.pf-tw svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .12s ease; }
.pf-tw.open svg { transform: rotate(90deg); }
.pf-item.on .pf-tw { color: #fff; }
.pf-item .pf-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-item:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
@media (max-width: 800px) { .pf-tw { width: 26px; height: 26px; } }
/* several folders selected in the tree */
.node.multi:not(.active) { background: color-mix(in srgb, var(--select) 28%, transparent); }
.node.multi:not(.active):hover { background: color-mix(in srgb, var(--select) 38%, transparent); }
.fsel-bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; margin: 6px 0; padding: 5px 6px 5px 10px; border: 1px solid var(--focus);
            border-radius: var(--radius-s); background: color-mix(in srgb, var(--select) 12%, var(--panel)); }
.fsel-n { flex: 1; font-weight: 600; font-size: 12.5px; }
.sent-note h2 { margin: 0 0 6px; font-size: 18px; } .sent-note p { margin: 0 0 14px; color: var(--muted); }

/* ---------------------------------------------------------------- pages of a long list */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 12px; font-size: 13px; }
.pg-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.pg-nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pg-nums { display: flex; align-items: center; gap: 2px; }
.pager button { min-width: 32px; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: var(--radius-s);
                background: var(--panel); color: var(--text); cursor: pointer; font: inherit; font-variant-numeric: tabular-nums; }
.pager button:hover:not(:disabled) { border-color: var(--muted); }
.pager button[aria-current="page"] { background: var(--select); border-color: var(--select); color: #fff; font-weight: 600; }
.pager button:disabled { opacity: .4; cursor: default; }
.pager button:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.pg-gap { color: var(--muted); padding: 0 4px; }
.pg-size { display: flex; align-items: center; gap: 6px; color: var(--muted); }
.pg-size select { width: auto; }
@media (max-width: 640px) {
  .pager { justify-content: center; }
  .pg-count { width: 100%; text-align: center; }
  .pg-nav { margin: 0; }
  .pg-nums button:not([aria-current]) { display: none; }       /* phones: ‹ Previous  [7]  Next › */
  .pg-gap { display: none; }
  .pager button { height: 40px; }
}
