/* ── the FOLDER BROWSER (folder-browser.js): pinned folders as chips, the
   chosen one's directories in Finder columns, the selected file's preview
   as the last column. It fills its parent (give that a height). Leans on
   the host's colour variables — --line, --surface, --ink, --muted,
   --accent, --accent-soft, --mono — and its .note / button.small looks. ── */
.fb{display:flex;flex-direction:column;gap:8px;min-height:0;height:100%}

/* the pins */
.fblocs{display:flex;flex-wrap:wrap;gap:6px;flex:none}
.fbloc{position:relative;display:inline-flex;align-items:center;border:1px solid var(--line);border-radius:999px;background:var(--surface);
  color:var(--ink);overflow:hidden}
.fbloc button{border:0;background:none;color:inherit;font:600 .78rem system-ui;cursor:pointer;border-radius:0;min-width:0}
.fblocb{padding:4px 11px;max-width:220px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fblocx{padding:4px 9px 4px 2px;opacity:.75}
.fblocx:hover{opacity:1}
.fbloc:hover{border-color:var(--accent)}
.fbloc.on{background:var(--accent);border-color:var(--accent);color:#fff}
.fbloc.quiet{border-style:dashed;color:var(--muted)}
.fbloc.quiet:hover{color:var(--accent)}
/* a pin being dragged to a new place, and where it would land */
.fbloc[draggable="true"]{cursor:grab}
.fbloc.dragging{opacity:.45}
.fbloc.dropb,.fbloc.dropa{overflow:visible}
.fbloc.dropb::before,.fbloc.dropa::after{content:'';position:absolute;top:-3px;bottom:-3px;width:3px;border-radius:2px;background:var(--accent)}
.fbloc.dropb::before{left:-6px}
.fbloc.dropa::after{right:-6px}

/* the columns */
.fbcols{flex:1;min-height:0;display:flex;overflow-x:auto;overflow-y:hidden;border:1px solid var(--line);border-radius:10px;
  background:var(--surface)}
.fbcols.lone{flex-direction:column;align-items:flex-start;gap:8px;padding:14px;overflow:auto}
/* every column is the SAME fixed width, the last one too — a folder of
   files alone still reads as the first of a row of columns */
.fbcol{flex:0 0 220px;min-width:0;overflow-y:auto;padding:4px;border-right:1px solid var(--line);position:relative}
/* the dividing line is a handle: 7px to catch, over the column's own hairline */
.fbcgrip{flex:0 0 7px;margin:0 -3px 0 -4px;position:relative;z-index:1;cursor:col-resize;touch-action:none}
.fbcgrip:hover::before,.fbcgrip:active::before{content:'';position:absolute;top:0;bottom:0;left:3px;width:2px;background:var(--accent)}
.fbcol .fbnote{margin:8px}
.fbcol > button.small{margin:0 8px 8px}
.fbrow{display:flex;align-items:center;gap:7px;padding:5px 8px;border-radius:7px;cursor:default;user-select:none;
  font:500 .85rem system-ui;color:var(--ink)}
.fbrow:hover{background:color-mix(in srgb, var(--accent-soft) 55%, transparent)}
.fbrow.on{background:var(--accent-soft);color:var(--accent)}
.fbrow.act{background:var(--accent);color:#fff}
.fbrow svg{flex:none;color:var(--accent)}
.fbrow.act svg{color:#fff}
/* the sidecar's dot: a place of its own at the front of every row */
.fbdot{flex:none;width:6px;height:6px;margin-right:-2px;border-radius:50%}
.fbrow.noted .fbdot{background:currentColor;opacity:.7}
/* a small mark after a name (an infinified deck: viewer's `mark`) */
.fbmark{flex:none;margin-left:5px;font:700 .6rem var(--mono);letter-spacing:.04em;padding:0 4px;border-radius:4px;
  color:var(--accent);background:color-mix(in srgb, var(--accent) 12%, transparent);line-height:1.5}
.fbrow.act .fbmark{color:inherit;background:color-mix(in srgb, currentColor 18%, transparent)}
.fbgo{flex:none;color:var(--muted);font-weight:600}
.fbrow.on .fbgo{color:inherit}
/* a name too long for its column FADES out — the last 18px of the name's
   room; a name that fits never reaches it */
.fbname{flex:1;min-width:0;white-space:nowrap;overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 18px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 18px),transparent)}
.fbsub{flex:none;max-width:55%;font:.72rem var(--mono);color:var(--muted);white-space:nowrap;overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 14px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 14px),transparent)}
.fbrow.act .fbsub{color:inherit}

/* the blank TAIL: room given back by a column made narrower while the row
   is scrolled — so nothing hidden at the left slides back in */
.fbtail{flex:none;width:0}
/* the PREVIEW: the last column — as tall as the others, any width */
.fbpv{position:relative;flex:none;width:280px;min-height:0;display:flex;flex-direction:column;gap:8px;box-sizing:border-box;
  padding:10px;border-right:1px solid var(--line)}
.fbpv[hidden]{display:none}
.fbpvhead{flex:none;display:flex;flex-direction:column;gap:4px;min-width:0}
.fbpvtop{display:flex;align-items:center;gap:8px;min-width:0}
.fbpvname{flex:1;min-width:0;font:600 .9rem system-ui;white-space:nowrap;overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,#000 calc(100% - 18px),transparent);mask-image:linear-gradient(90deg,#000 calc(100% - 18px),transparent)}
.fbpvmeta{font:.74rem var(--mono);color:var(--muted);line-height:1.4;min-height:1em}
.fbopen{flex:none}
/* − | + : the preview's zoom, left of Open */
.fbzoom{flex:none;display:inline-flex;height:22px;box-sizing:border-box;border:1px solid color-mix(in srgb, var(--muted) 42%, var(--line));
  border-radius:7px;overflow:hidden;background:var(--surface)}
.fbzoom button{min-width:24px;height:100%;margin:0;padding:0 6px 1px;border:0;border-radius:0;background:none;color:var(--ink);
  font:600 .82rem system-ui;line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center}
.fbzoom button:not(:disabled):hover{background:var(--accent-soft);color:var(--accent)}
.fbzoom button:disabled{opacity:.35;cursor:default}
/* the bar AFTER it — its right edge — drags it wider or narrower (the line
   before it belongs to the last file column) */
.fbpvgrip{position:absolute;right:-1px;top:0;bottom:0;width:8px;cursor:col-resize;touch-action:none;z-index:1}
.fbpvgrip:hover::before,.fbpvgrip:active::before{content:'';position:absolute;top:0;bottom:0;right:0;width:2px;border-radius:2px;background:var(--accent)}
.fbstrip{position:relative;flex:1;min-height:0;display:flex;flex-direction:column;gap:8px;overflow-y:auto;overflow-x:hidden;padding:3px}
.fbthumb{position:relative;flex:none;width:100%;height:auto;aspect-ratio:var(--fb-asp, 1.333);display:flex;align-items:center;
  justify-content:center;padding:0;border:1px solid var(--line);border-radius:6px;background:var(--surface);cursor:pointer;overflow:hidden}
.fbthumb canvas,.fbthumb img{display:block}
.fbthumb.on{border-color:var(--accent);box-shadow:0 0 0 2px var(--accent)}
.fbthumb .fbtn{position:absolute;right:4px;bottom:3px;font:600 .62rem var(--mono);color:var(--muted);
  background:color-mix(in srgb, var(--surface) 85%, transparent);padding:0 3px;border-radius:3px;line-height:1.4}
