/* JAG Files on top of the DocIntel console's shell (tokens.css, shell.css: copies, kept identical by
   src/test/files-browser-tokens.test.ts). Only what the console doesn't have lives here. */

:root { --top-h: 56px; --tree-w: 300px; --kind-folder: var(--fg-2); --kind-image: hsl(199 89% 60%); --kind-pdf: hsl(16 85% 60%);
  --kind-email: hsl(280 65% 70%); --kind-archive: hsl(38 92% 55%); --kind-text: hsl(160 60% 50%); --kind-office: hsl(220 75% 65%); --kind-other: var(--muted-fg); }
[data-theme="light"] { --kind-image: hsl(199 89% 40%); --kind-pdf: hsl(16 80% 45%); --kind-email: hsl(280 55% 48%); --kind-archive: hsl(32 90% 40%);
  --kind-text: hsl(160 70% 30%); --kind-office: hsl(220 70% 45%); }
body { background: var(--bg); }
.num { font-variant-numeric: tabular-nums; }
kbd { font: 11px var(--mono); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; color: var(--muted-fg); background: var(--muted); }

/* Header extras. */
.badge.ro { gap: 5px; }
.badge.ro [data-icon] { width: 12px; height: 12px; display: block; }
.badge.ro [data-icon] svg { display: block; }
.indexed { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-fg); font-size: 12.5px; padding: 0 6px; white-space: nowrap; }
.indexed [data-icon] { width: 14px; height: 14px; display: block; }
.indexed [data-icon] svg { display: block; }
#refresh.spinning [data-icon] svg { animation: spin .9s linear infinite; }
.signed-out #refresh, .signed-out .indexed, .signed-out .navtabs, .signed-out .env { display: none; }
.closed { display: flex; gap: 10px; align-items: center; padding: 10px 18px; background: var(--bad-soft); color: var(--bad-ink); border-bottom: 1px solid hsl(350 89% 60% / 35%); font-size: 13px; }
.closed[hidden] { display: none; }
.closed [data-icon] { width: 16px; height: 16px; flex: none; }

/* Sign-in card: the whole page until a working key is set. */
.signin { min-height: calc(100vh - var(--top-h)); display: grid; place-items: center; padding: 32px 16px; background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px); background-size: 18px 18px; }
.signin-card { width: min(480px, 100%); padding: 28px; text-align: left; }
.signin-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--muted); color: var(--fg-2); margin-bottom: 14px; }
.signin-ic [data-icon] { width: 22px; height: 22px; }
.signin-card.bad .signin-ic { background: var(--bad-soft); color: var(--bad-ink); }
.signin-card.warn .signin-ic { background: var(--warn-soft); color: var(--warn-ink); }
.signin-card h1 { font-size: 20px; margin: 0 0 6px; }
.signin-card p { color: var(--muted-fg); margin: 0 0 16px; line-height: 1.5; }
.signin-facts { list-style: none; margin: 20px 0 0; padding: 16px 0 0; border-top: 1px solid var(--border); display: grid; gap: 8px; font-size: 12.5px; color: var(--muted-fg); }
.signin-facts li { display: flex; gap: 8px; align-items: center; }
.signin-facts [data-icon] { width: 14px; height: 14px; flex: none; }

/* Explorer: tree | main (| inspector, FB-5). The tree sticks under the header and scrolls alone. */
.explorer { display: grid; grid-template-columns: var(--tree-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
@media (min-width: 2200px) { :root { --tree-w: 360px; } }
.tree-pane { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow: auto; border-right: 1px solid var(--border); background: var(--card); padding: 12px 10px 24px; scrollbar-width: thin; }
.pane-head { display: flex; justify-content: space-between; color: var(--muted-fg); font-size: 11.5px; padding: 2px 6px 8px; }
.tree-pane ul { list-style: none; margin: 0; padding: 0; }
.tnode { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 2px; padding: 3px 6px 3px calc(var(--depth) * 14px + 2px); border-radius: var(--radius-s); font-size: 13px; min-height: 30px; }
.tnode:hover { background: var(--muted); }
.tnode.on { background: var(--muted); box-shadow: inset 2px 0 0 var(--brand); }
.tnode a { display: flex; gap: 7px; align-items: center; min-width: 0; color: var(--fg); text-decoration: none; }
.tnode a [data-icon] { width: 15px; height: 15px; flex: none; color: var(--muted-fg); }
.tnode.on a { font-weight: 600; }
.tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tsize { color: var(--muted-fg); font-size: 11.5px; font-variant-numeric: tabular-nums; padding-left: 8px; white-space: nowrap; }
.tchev { width: 18px; height: 18px; display: grid; place-items: center; border: 0; background: none; padding: 0; color: var(--muted-fg); cursor: pointer; border-radius: 4px; }
.tchev [data-icon] { width: 13px; height: 13px; }
.tchev:hover { color: var(--fg); }

.main-pane { min-width: 0; padding: 14px 20px 40px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 2200px) { .main-pane { padding: 18px 32px 48px; } }
.crumbs-row { display: flex; align-items: center; gap: 6px; min-height: 36px; }
.tree-toggle { display: none; }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; flex-wrap: wrap; font-size: 14px; }
.crumbs a { color: var(--muted-fg); text-decoration: none; padding: 2px 4px; border-radius: 4px; }
.crumbs a:hover { color: var(--fg); background: var(--muted); }
.crumbs > [data-icon] { width: 14px; height: 14px; color: var(--faint); flex: none; }
.crumbs h1 { margin: 0 4px; font-size: 20px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small [data-icon] { width: 15px; height: 15px; }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search { flex: 1 1 320px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--input); border-radius: var(--radius); padding: 0 10px; height: 36px; background: var(--card); min-width: 0; }
.search:focus-within { outline: 2px solid var(--ring); outline-offset: 1px; }
.search [data-icon] { width: 16px; height: 16px; color: var(--muted-fg); flex: none; }
.search input { flex: 1; border: 0; padding: 0; height: 100%; background: none; min-width: 0; }
.search input:focus-visible { outline: none; }
.chips { display: flex; gap: 4px; }
.chip-link { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--fg-2); text-decoration: none; }
.chip-link:hover { background: var(--muted); }
.chip-link.on { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.toolbar select { height: 32px; border-radius: 999px; padding: 0 12px; font-size: 13px; color: var(--fg-2); border-color: var(--border); }
.toolbar select.set { border-color: var(--info); color: var(--fg); }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--muted); margin-left: auto; }
.seg-btn { width: 32px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--muted-fg); }
.seg-btn [data-icon] { width: 16px; height: 16px; }
.seg-btn.on { background: var(--bg); color: var(--fg); box-shadow: var(--shadow-sm); }

.summary { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 13px; color: var(--fg-2); min-height: 22px; }
.summary b { color: var(--fg); font-weight: 600; }
.summary .sorted { margin-left: auto; }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border: 1px solid hsl(199 89% 60% / 40%); background: var(--info-soft); border-radius: var(--radius-l); font-size: 13px; }
.bulk[hidden] { display: none; }
.bulk .spacer { flex: 1; }

/* The list: a real grid with keyboard focus. */
.grid-table { border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--card); overflow: hidden; --cols: 44px 44px minmax(220px, 1fr) 80px 96px minmax(140px, 220px) 170px 44px; }
@media (min-width: 2200px) { .grid-table { --cols: 48px 48px minmax(320px, 1fr) 100px 120px minmax(200px, 360px) 200px 52px; } }
.gt-head, .gt-row { display: grid; grid-template-columns: var(--cols); align-items: center; }
.gt-head { font-size: 12px; color: var(--muted-fg); border-bottom: 1px solid var(--border); height: 38px; padding-right: 12px; }
.gt-head a { color: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 3px; }
.gt-head a:hover, .gt-head a.on { color: var(--fg); }
.gt-head [data-icon] { width: 13px; height: 13px; }
.gt-head > span:first-child, .gt-row > span:first-child { display: grid; place-items: center; }
.gt-head .c-items, .gt-head .c-size, .gt-row .c-items, .gt-row .c-size { text-align: right; justify-self: end; }
.gt-head .c-share { padding-left: 16px; }
.gt-row { min-height: 52px; border-bottom: 1px solid var(--border-2); padding-right: 12px; font-size: 13px; outline: none; position: relative; }
.gt-row:last-child { border-bottom: 0; }
.gt-row:hover { background: var(--raise); }
.gt-row.picked { background: var(--info-soft); }
.gt-row.focus { box-shadow: inset 2px 0 0 var(--brand); background: var(--raise); }
.gt-row input[type=checkbox], .gt-head input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--info); cursor: pointer; }
.ricon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--muted); color: var(--kind-other); }
.ricon [data-icon] { width: 16px; height: 16px; }
.k-folder { color: var(--kind-folder); } .k-image { color: var(--kind-image); } .k-pdf { color: var(--kind-pdf); } .k-email { color: var(--kind-email); }
.k-archive { color: var(--kind-archive); } .k-text { color: var(--kind-text); } .k-office { color: var(--kind-office); }
.c-name { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding: 6px 12px 6px 4px; }
.rname { font: 500 13px var(--mono); color: var(--fg); text-decoration: none; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rname:hover { text-decoration: underline; }
.rsub { font-size: 12px; color: var(--muted-fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-size { font-weight: 600; }
.c-modified { color: var(--fg-2); padding-left: 16px; white-space: nowrap; }
.share { display: grid; grid-template-columns: 48px 1fr; align-items: center; gap: 8px; padding-left: 16px; }
.share .pct { font-size: 12px; color: var(--muted-fg); text-align: right; font-variant-numeric: tabular-nums; }
.share .bar { height: 6px; border-radius: 99px; background: var(--muted); overflow: hidden; }
.share .bar i { display: block; height: 100%; border-radius: inherit; background: var(--info); }

.skeleton .sk { display: block; height: 10px; border-radius: 99px; background: var(--muted); animation: pulse 1.4s ease-in-out infinite; }
.skeleton .sk.box { width: 15px; height: 15px; border-radius: 4px; }
.skeleton .sk.ic { width: 32px; height: 32px; border-radius: 8px; }
.skeleton .sk.line { width: 60%; margin-left: 4px; }
.skeleton .sk.short { width: 50px; justify-self: end; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .skeleton .sk { animation: none; } }

.more { display: flex; justify-content: center; }
.more:empty { display: none; }
.more .muted { margin-left: 4px; }

/* Grid of tiles. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-l); background: var(--card); color: var(--fg); text-decoration: none; text-align: left; cursor: pointer; min-width: 0; font: inherit; }
.tile:hover { border-color: var(--border-strong); background: var(--raise); }
.tile.picked { border-color: var(--info); background: var(--info-soft); }
.tile-art { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); background: var(--muted); display: grid; place-items: center; overflow: hidden; }
.tile-art [data-icon] { width: 34px; height: 34px; opacity: .85; }
.tile-art img { width: 100%; height: 100%; object-fit: cover; }
.tile-art .ext { position: absolute; right: 6px; bottom: 6px; font: 600 10px var(--mono); text-transform: uppercase; background: var(--bg); color: var(--fg-2); padding: 1px 5px; border-radius: 4px; }
.tile-name { font: 500 12.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-meta { font-size: 12px; color: var(--muted-fg); }

/* Treemap. */
.treemap { position: relative; height: max(420px, calc(100vh - var(--top-h) - 220px)); border-radius: var(--radius-l); overflow: hidden; background: var(--muted); }
.tm-cell { position: absolute; box-sizing: border-box; border: 2px solid var(--bg); border-radius: 6px; padding: 8px; display: flex; flex-direction: column; gap: 2px; overflow: hidden; color: #fff; text-decoration: none; font: inherit; text-align: left; cursor: pointer;
  background: color-mix(in oklab, currentColor 55%, var(--bg)); }
.tm-cell b, .tm-cell span { color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgb(0 0 0 / 45%); }
.tm-cell span { opacity: .85; font-size: 11px; }
.tm-cell:hover { filter: brightness(1.15); }
.tm-cell.k-folder { color: hsl(var(--hue, 205) 60% 52%); }

/* Phones and narrow windows: the tree becomes a drawer. */
@media (max-width: 900px) {
  .explorer { grid-template-columns: minmax(0, 1fr); }
  .tree-pane { position: fixed; z-index: 35; left: 0; top: var(--top-h); width: min(86vw, 340px); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow-l); }
  .tree-open .tree-pane { transform: none; }
  .tree-toggle { display: inline-grid; }
  .main-pane { padding: 12px 16px 32px; }
  .grid-table { --cols: 36px 40px minmax(0, 1fr) 76px 40px; }
  .gt-head .c-items, .gt-head .c-share, .gt-head .c-modified, .gt-row .c-items, .gt-row .c-share, .gt-row .c-modified { display: none; }
  .seg { margin-left: 0; }
  .summary .sorted { margin-left: 0; }
  .wm-long { display: none; } .wm-short { display: inline; }
  .crumbs .far { display: none; }
  .crumbs h1 { font-size: 18px; }
  .badge.ro, .indexed { display: none; }
}
@media (max-width: 560px) {
  .toolbar select { flex: 1 1 30%; }
  .chips { flex: 1 1 100%; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Folder actions beside the crumbs. */
.folder-actions { margin-left: auto; display: flex; gap: 6px; flex: none; }
@media (max-width: 900px) { .folder-actions .btn { padding: 6px 8px; } }
@media (max-width: 560px) { .crumbs-row { flex-wrap: wrap; } .folder-actions { margin-left: 0; } }

/* One file opened: filmstrip | stage | inspector. */
.explorer.viewing { grid-template-columns: var(--tree-w) minmax(0, 1fr); }
.viewer-host[hidden], .main-pane[hidden] { display: none; }
.viewer { display: grid; grid-template-columns: 220px minmax(0, 1fr) 360px; min-height: calc(100vh - var(--top-h)); }
@media (min-width: 2200px) { .viewer { grid-template-columns: 260px minmax(0, 1fr) 440px; } }
.strip { border-right: 1px solid var(--border); padding: 12px 10px; overflow: auto; max-height: calc(100vh - var(--top-h)); position: sticky; top: var(--top-h); display: flex; flex-direction: column; gap: 6px; }
.strip-item { display: flex; gap: 10px; align-items: center; padding: 6px; border-radius: var(--radius); border: 1px solid transparent; background: none; color: var(--fg); text-align: left; cursor: pointer; font: inherit; min-height: 60px; }
.strip-item:hover { background: var(--muted); }
.strip-item.on { background: var(--muted); border-color: var(--border-strong); }
.sk-item { background: var(--muted); animation: pulse 1.4s ease-in-out infinite; }
.strip-art { width: 46px; height: 46px; flex: none; border-radius: 6px; background: var(--raise); display: grid; place-items: center; overflow: hidden; }
.strip-art img { width: 100%; height: 100%; object-fit: cover; }
.strip-art [data-icon] { width: 18px; height: 18px; }
.strip-text { display: flex; flex-direction: column; min-width: 0; }
.strip-text b { font: 500 12.5px var(--mono); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-text small { color: var(--muted-fg); font-size: 11.5px; }
.stage-wrap { min-width: 0; padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.vbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 36px; }
.vbar .crumbs h1 { font: 700 18px var(--mono); }
.vactions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.share-box { position: relative; }
.share-pop { width: 360px; }
.share-pop .seg.wide { display: flex; margin: 10px 0 0; }
.seg-btn.txt { width: auto; flex: 1; font-size: 12.5px; border: 0; background: none; cursor: pointer; color: var(--muted-fg); padding: 0 8px; }
.seg-btn.txt.on { background: var(--bg); color: var(--fg); }
.share-out .keybox { margin-top: 10px; max-height: 110px; }
.row.spread { justify-content: space-between; align-items: center; display: flex; gap: 8px; }
.stage { position: relative; flex: 1; min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius-l); background-color: var(--canvas); background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1px); background-size: 16px 16px;
  display: grid; place-items: center; overflow: hidden; }
.stage img { max-width: 100%; max-height: calc(100vh - var(--top-h) - 150px); object-fit: contain; box-shadow: var(--shadow-l); background: #fff; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #fff; }
.stage-open { position: absolute; right: 12px; bottom: 12px; }
.stage .empty-state { margin: 24px; border-style: dashed; }
.stage-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12.5px; }
.textview { align-self: stretch; justify-self: stretch; overflow: auto; padding: 18px; max-height: calc(100vh - var(--top-h) - 150px); background: var(--card); }
.textview pre { margin: 12px 0 0; font: 12.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.csv { overflow: auto; }
.csv table { border-collapse: collapse; font: 12.5px var(--mono); }
.csv th, .csv td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; white-space: nowrap; }
.csv th { background: var(--muted); position: sticky; top: 0; }

.inspector { border-left: 1px solid var(--border); padding: 16px; overflow: auto; max-height: calc(100vh - var(--top-h)); position: sticky; top: var(--top-h); background: var(--card); }
.inspector h4 { margin: 18px 0 8px; font-size: 12px; color: var(--muted-fg); font-weight: 600; padding-top: 14px; border-top: 1px solid var(--border); }
.insp-head { display: flex; gap: 12px; align-items: center; }
.insp-head b { display: block; font: 600 14px var(--mono); overflow-wrap: anywhere; }
.insp-head small { color: var(--muted-fg); font-size: 12px; }
.ftag { width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center; background: var(--muted); font: 700 10.5px var(--mono); flex: none; }
.statcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.statcard { border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 10px; }
.statcard small { display: block; color: var(--muted-fg); font-size: 11.5px; }
.statcard b { font-size: 15px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--muted-fg); }
.kv dd { margin: 0; min-width: 0; }
.mono { font-family: var(--mono); }
.wrap { overflow-wrap: anywhere; }
.keybox { margin: 0 0 10px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--raise); font: 12px/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; }
.inspector .row { display: flex; gap: 6px; flex-wrap: wrap; }
.warn-text { color: var(--warn-ink); }
@media (max-width: 1400px) { .viewer { grid-template-columns: 180px minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) {
  .viewer { grid-template-columns: minmax(0, 1fr); }
  .strip { position: static; max-height: none; flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .strip .pane-head, .strip .note { display: none; }
  .strip-item { flex: none; width: 200px; }
  .inspector { position: static; max-height: none; border-left: 0; border-top: 1px solid var(--border); }
  .stage { min-height: 60vh; }
}
@media (max-width: 900px) { .explorer.viewing { grid-template-columns: minmax(0, 1fr); } .share-pop { width: min(360px, calc(100vw - 32px)); } }

/* Overview. */
.ov { display: flex; flex-direction: column; gap: 14px; padding-top: 16px; }
.ov-skel { display: grid; gap: 14px; }
.sk-card { height: 160px; animation: pulse 1.4s ease-in-out infinite; }
.health { display: flex; flex-wrap: wrap; gap: 8px; }
.health .badge { padding: 3px 10px; }
.health .badge [data-icon] { width: 13px; height: 13px; display: block; }
.stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; }
.stat small { color: var(--muted-fg); font-size: 12.5px; }
.stat b { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.stat .muted { font-size: 12px; }
.stat.warn b { color: var(--warn-ink); }
.ov-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 2200px) { .ov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .stats { gap: 18px; } }
.ov-card .card-head .sub { margin-left: auto; flex: none; }
.ov-tm { height: 300px; position: relative; background: none; }
.tm-cell.flat { color: #fff; background: color-mix(in oklab, var(--c) 70%, var(--bg)); cursor: default; }
.stackbar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; gap: 2px; }
.stackbar i { min-width: 3px; background: currentColor; }
.legend { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; font-size: 13px; }
.legend li { display: grid; grid-template-columns: 12px 1fr auto 60px; gap: 10px; align-items: center; }
.legend .muted { text-align: right; }
.dot { width: 10px; height: 10px; border-radius: 3px; background: currentColor; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bars li { display: grid; grid-template-columns: minmax(110px, 160px) 1fr 80px; gap: 12px; align-items: center; font-size: 13px; }
.bars a { color: var(--fg); text-decoration: none; }
.bars a:hover { text-decoration: underline; }
.bars .bar { height: 8px; border-radius: 99px; background: var(--muted); overflow: hidden; }
.bars .bar i { display: block; height: 100%; border-radius: inherit; background: var(--info); }
.bars b { text-align: right; }
.cols { height: 160px; display: flex; align-items: flex-end; gap: 4px; }
.col { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.col i { width: 100%; background: var(--info); border-radius: 3px 3px 0 0; }
.col.peak i { background: var(--brand); }
.col:hover i { filter: brightness(1.2); }
.cols-axis { display: flex; justify-content: space-between; font-size: 11.5px; margin-top: 6px; }
.largest, .attention { list-style: none; margin: 0; padding: 0; display: grid; }
.largest li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-2); }
.largest li:first-child { border-top: 0; }
.largest a { color: var(--fg); text-decoration: none; display: flex; flex-direction: column; min-width: 0; }
.largest a .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; }
.largest a small { color: var(--muted-fg); font-size: 12px; }
.largest a:hover .mono { text-decoration: underline; }
.attention li { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--border-2); }
.attention li:first-child { border-top: 0; }
.attention [data-icon] { width: 16px; height: 16px; margin-top: 2px; }
.attention .warn [data-icon] { color: var(--warn-ink); }
.attention .info [data-icon] { color: var(--info); }
.attention .later { opacity: .65; }
.attention b { font-size: 13px; display: block; }
.attention small { color: var(--muted-fg); font-size: 12px; overflow-wrap: anywhere; }
@media (max-width: 1200px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 900px) { .ov-grid { grid-template-columns: minmax(0, 1fr); } .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pagewrap { --pad: 16px; } }

/* Activity. */
.act { padding-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.act-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.act-head h1 { margin: 0; font-size: 22px; }
.act-head .chips { flex-wrap: wrap; }
.act-table { display: grid; }
.act-row { display: grid; grid-template-columns: 170px 80px 260px minmax(0, 1fr) 140px; gap: 12px; align-items: center; padding: 9px 16px; border-top: 1px solid var(--border-2); font-size: 13px; }
.ov .act-row { padding: 9px 0; }
.act-row:first-child { border-top: 0; }
.act-what { display: inline-flex; gap: 8px; align-items: center; font-weight: 500; }
.act-what [data-icon] { width: 15px; height: 15px; color: var(--muted-fg); }
.act-row.bad .act-what { color: var(--bad-ink); }
.act-row.bad .act-what [data-icon] { color: var(--bad-ink); }
.act-detail { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--fg-2); font-size: 12.5px; }
.pad { padding: 16px; }
.act .more { padding: 12px; }
@media (max-width: 900px) { .act-row { grid-template-columns: 1fr; gap: 2px; } }

/* Names read from the database (FB-D5): marked, because they aren't part of the key. */
.dbname { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-2); font-weight: 500; }
.dbname [data-icon] { width: 12px; height: 12px; color: var(--info); flex: none; }
.dbname.trash { color: var(--warn-ink); }
.dbtag { font-size: 10.5px; font-weight: 500; color: var(--muted-fg); border: 1px dashed var(--border-strong); border-radius: 4px; padding: 0 5px; margin-left: 4px; }
.crumb-id { font: 500 12px var(--mono); color: var(--muted-fg); margin-left: 8px; }
.tile-db { font-size: 12px; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .who { display: flex; flex-direction: column; min-width: 0; }
.bars .who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars .who small { font-size: 11px; }
.block { display: block; }
.btn.wide { width: 100%; margin-top: 12px; }
.attention .ok [data-icon] { color: var(--ok); }

/* Whole rows are links: the name's link stretches over the row; the tick box and the row's own
   buttons sit above it. */
.gt-row { cursor: pointer; }
.gt-row .rname::after { content: ""; position: absolute; inset: 0; }
.gt-row input[type=checkbox], .gt-row .open-all, .gt-row .dbname { position: relative; z-index: 1; }
.gt-row:hover .rname { text-decoration: underline; }
.c-name { flex-direction: row; flex-wrap: wrap; align-items: center; column-gap: 10px; }
.c-name .rname, .c-name .rsub { flex: 1 0 100%; }
.c-act { display: grid; place-items: center; }
.open-all { display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--radius-s); border: 1px solid transparent; background: none; color: var(--muted-fg); cursor: pointer; opacity: .5; }
.open-all [data-icon] { width: 16px; height: 16px; }
.gt-row:hover .open-all, .gt-row.focus .open-all, .open-all:focus-visible { opacity: 1; }
.open-all:hover { background: var(--muted); color: var(--fg); border-color: var(--border); }
@media (hover: none) { .open-all { opacity: 1; } }
.chip-link [data-icon] { width: 13px; height: 13px; margin-right: 5px; }

/* The viewer's filmstrip, when it holds every file under a folder: one heading per subfolder. */
.strip-group { display: flex; flex-direction: column; padding: 10px 6px 2px; border-top: 1px solid var(--border-2); margin-top: 4px; font-size: 12px; min-width: 0; }
.strip-group b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-group small { color: var(--muted-fg); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.strip-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1100px) { .strip-group { flex: none; justify-content: center; border-top: 0; border-left: 1px solid var(--border-2); padding: 0 10px; max-width: 180px; } }

/* An id in the inspector: its name above, the id below, the folder on click. */
.idlink { display: flex; flex-direction: column; color: var(--fg); text-decoration: none; border-radius: 4px; }
.idlink:hover .idval, .idlink:hover .idname { text-decoration: underline; }
.idname { font-weight: 500; }
.idname + .idval { font-size: 11.5px; color: var(--muted-fg); }

/* The filmstrip's header stays at the top while it scrolls, and each document's heading sticks
   just under it, so the count and the current document are always in view. */
.strip { padding-top: 0; --strip-head: 38px; }
.strip > .pane-head { position: sticky; top: 0; z-index: 3; flex: none; height: var(--strip-head); box-sizing: border-box; align-items: center;
  margin: 0 -10px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.strip-group { position: sticky; top: var(--strip-head); z-index: 2; background: var(--bg); margin-top: 0; padding-bottom: 6px; }
@media (max-width: 1100px) {
  .strip > .pane-head, .strip-group { position: static; }
  .strip { padding-top: 12px; }
}
.stage-wrap.switching .stage, .stage-wrap.switching + .inspector { opacity: .55; transition: opacity .15s; }

/* Tidy tooltips: a bold name, a line or two of detail, and a small grey id. */
.popover.rich { display: flex; flex-direction: column; gap: 2px; white-space: normal; min-width: 160px; }
.popover .pop-title { font-size: 13px; font-weight: 600; color: var(--fg); }
.popover .pop-line { color: var(--fg-2); }
.popover .pop-meta { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--border-2); color: var(--muted-fg); font: 11px var(--mono); overflow-wrap: anywhere; }

/* Sticky headers: the tree's "Folders / size" bar, the explorer's crumbs and toolbar, the list's
   column headings under them, and the file name in the details panel. */
.tree-pane { padding-top: 0; }
.tree-pane > .pane-head { position: sticky; top: 0; z-index: 2; margin: 0 -10px 4px; padding: 12px 16px 8px; background: var(--card); border-bottom: 1px solid var(--border-2); }
.main-head { position: sticky; top: var(--top-h); z-index: 6; display: flex; flex-direction: column; gap: 12px; margin: -14px -20px 0; padding: 14px 20px 10px; background: var(--bg); }
@media (min-width: 2200px) { .main-head { margin: -18px -32px 0; padding: 18px 32px 12px; } }
.grid-table { overflow: clip; }
.gt-head { position: sticky; top: calc(var(--top-h) + var(--main-head-h, 0px)); z-index: 5; background: var(--card); border-radius: var(--radius-l) var(--radius-l) 0 0; }
.grid-table.skeleton .gt-head { position: static; }
.insp-head { position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 16px; background: var(--card); border-bottom: 1px solid transparent; }
@media (max-width: 1100px) { .insp-head { position: static; margin: 0; padding: 0; } }
@media (max-width: 900px) { .main-head { margin: -12px -16px 0; padding: 12px 16px 10px; } }
.act-head { position: sticky; top: var(--top-h); z-index: 4; background: var(--bg); margin: -16px calc(var(--pad, 24px) * -1) 0; padding: 16px var(--pad, 24px) 10px; }
