:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro", "Helvetica Neue", "Inter", system-ui, sans-serif;
  --accent: #0a7aff;
  --sel: #0064e1;
  --hair: rgba(0, 0, 0, .09);
  --fg: rgba(0, 0, 0, .85);
  --win-bg: #ffffff; --win-edge: rgba(0, 0, 0, .3); --win-rim: rgba(255, 255, 255, .5); --tl-off: #d7d7d9;
  --side-bg: rgba(240, 239, 244, .78); --side-rim: rgba(0, 0, 0, .07); --side-head: rgba(0, 0, 0, .4);
  --side-fg: rgba(0, 0, 0, .85); --side-ico: rgba(0, 0, 0, .55); --side-sel: rgba(0, 0, 0, .08);
  --marquee-bg: rgba(0, 0, 0, .1); --marquee-rim: rgba(0, 0, 0, .25);
  --pill-bg: rgba(255, 255, 255, .85); --pill-rim: rgba(0, 0, 0, .1); --tb-fg: rgba(0, 0, 0, .72);
  --tb-hover: rgba(0, 0, 0, .06); --tb-on: rgba(0, 0, 0, .09);
  /* Finder icon (light appearance) */
  --fi-bg1: #ffffff; --fi-bg2: #e4e7ec; --fi-feat-l: #1d1d1f; --fi-feat-r: #1d1d1f; --fi-rim: rgba(0, 0, 0, .1);
  /* Dock and its tooltips, solved from the real Dock over black and white wallpaper */
  --dock-bg: rgba(168, 168, 168, .345); --dock-rim: rgba(255, 255, 255, .2); --dock-shadow: rgba(0, 0, 0, .06);
  --dock-sep: none; --dock-sep-fx: brightness(.687) contrast(1.455); --dock-dot: none; --dock-dot-fx: brightness(.465) contrast(1.268);
  --tip-bg: rgba(250, 250, 250, .69); --tip-rim: rgba(255, 255, 255, .61); --tip-fg: rgba(0, 0, 0, .85); --tip-sep: rgba(0, 0, 0, .1); --menu-bg: rgba(248, 248, 248, .706);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  font: 13px/1.25 var(--font); color: #1d1d1f;
  /* Default smoothing: macOS thickens glyphs slightly, as in Finder; 'antialiased' renders them thinner. */ user-select: none; cursor: default;
  background: #1a1f6e url(wallpaper.jpg) center / cover no-repeat;
}
button { font: inherit; color: inherit; cursor: default; }
svg { display: block; }

/* ---------- Menu bar ---------- */
.menubar {
  position: fixed; inset: 0 0 auto 0; height: 25px; z-index: 50;
  display: flex; justify-content: space-between; align-items: center; padding: 0 8px 0 10px;
  color: #fff; font-size: 13px; font-weight: 500;
  background: rgba(16, 18, 70, .22); backdrop-filter: blur(40px) saturate(1.7);
}
.mb-left, .mb-right { display: flex; align-items: center; height: 100%; }
.mb-item { height: 22px; line-height: 22px; padding: 0 9px; border-radius: 5px; }
.mb-item.app { font-weight: 700; }
.mb-item.open { background: rgba(255, 255, 255, .24); }
.mb-apple { padding: 0 12px 0 9px; }
.mb-apple svg { width: 15px; height: 22px; padding: 3px 0 4px; }
.mb-icon { padding: 0 8px; height: 22px; display: flex; align-items: center; }
.mb-icon svg { width: 16px; height: 16px; }
.mb-icon.battery svg { width: 25px; height: 12px; }
.mb-icon.battery { border-radius: 5px; }
.mb-icon.battery.open { background: rgba(255, 255, 255, .24); }
.clock { padding: 0 6px 0 9px; white-space: pre; }

/* ---------- Window (macOS Tahoe) ---------- */
.window {
  position: absolute; display: flex; border-radius: 26px; overflow: hidden; z-index: 10;
  background: transparent;
  box-shadow: 0 0 0 .5px var(--win-edge), 0 28px 80px rgba(0, 0, 0, .42), 0 8px 24px rgba(0, 0, 0, .2);
}
.window::after { content: ""; position: absolute; inset: 0; border-radius: 26px; pointer-events: none; box-shadow: inset 0 0 0 1px var(--win-rim); z-index: 5; }
.window.dragover::after { box-shadow: inset 0 0 0 3px var(--accent); }

.traffic { position: absolute; left: 19.5px; top: 19px; display: flex; gap: 9px; z-index: 6; }
.tl { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; display: flex; }
.tl svg { width: 14px; height: 14px; opacity: 0; }
.traffic:hover .tl svg { opacity: 1; }
.tl.close { background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.tl.min { background: #febc2e; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.tl.zoom { background: #28c840; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .12); }
.window.inactive .traffic .tl { background: var(--tl-off); box-shadow: none; }

/* ---------- Sidebar: a floating glass panel inset from the window ---------- */
.sidebar {
  width: 175.5px; flex: none; display: flex; flex-direction: column; margin: 8px 0 8px 8px; border-radius: 19px;
  background: var(--side-bg); backdrop-filter: blur(50px) saturate(1.2);
  border: .5px solid var(--side-rim);
  /* The window paints only around the sidebar (via the spread shadow), so the glass blurs the desktop like Tahoe's. */
  box-shadow: 0 1px 6px rgba(0, 0, 0, .08), 0 0 0 40px var(--win-bg);
}
.sidebar-top { height: 44px; flex: none; }
.side-scroll { flex: 1; overflow: auto; padding: 0 8px 12px; }
.side-section { font-size: 11px; font-weight: 600; color: var(--side-head); padding: 18px 7px .5px; }
.side-item { display: flex; align-items: center; gap: 7.25px; height: 31.5px; padding: 0 8.75px; border-radius: 9px; color: var(--side-fg); font-size: 13px; }
.side-item .sico { width: 21px; height: 21px; flex: none; color: var(--side-ico); }
.side-item .sico svg { overflow: visible; }
.side-item .sico svg { width: 21px; height: 21px; }
.side-item .slabel { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item.active { background: var(--side-sel); color: var(--accent); }
.side-item.active .sico { color: var(--accent); }
.side-item.locked .slabel { opacity: .5; }
.side-item.add { opacity: .7; }
.dot { width: 12px; height: 12px; border-radius: 50%; margin: 0 4px 0 3px; flex: none; }

/* ---------- Main area and toolbar ---------- */
.main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--win-bg); }
.toolbar { height: 52px; flex: none; display: flex; align-items: center; gap: 16.5px; padding: 0 7.5px 0 5.5px; }
.window.nosidebar .toolbar { padding-left: 92px; }
.pill {
  height: 37.5px; display: flex; align-items: center; padding: 0 3px; border-radius: 19px;
  background: var(--pill-bg); backdrop-filter: blur(30px) saturate(1.6);
  box-shadow: inset 0 0 0 .5px var(--pill-rim), 0 1px 3px rgba(0, 0, 0, .1);
}
.pill-sep { width: 1px; height: 18px; background: var(--hair); }
.tb {
  height: 31px; min-width: 35px; padding: 0 6px; border: 0; background: none; border-radius: 16px;
  color: var(--tb-fg); display: flex; align-items: center; justify-content: center; gap: 2px;
}
.tb svg { width: 20px; height: 20px; }
.tb:hover:not(:disabled) { background: var(--tb-hover); }
.tb:disabled { opacity: .35; }
.tb .chev svg { width: 12.5px; height: 12.5px; stroke-width: 1.75; }
.tb.wide { min-width: 44px; }
#group { padding: 0 4.5px; min-width: 0; }
.pill:has(> #group) { margin-right: 1.5px; }
.nav .tb { min-width: 31.5px; }
.title { margin-left: -4px; font-size: 15px; font-weight: 620; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.window.inactive .title { opacity: .45; }
.spacer { flex: 1; }
/* Per-button widths measured from Finder: the glyphs aren't evenly spaced in the capsule. */
.pill.viewseg { padding: 0 2.5px 0 3.5px; margin-right: 1px; }
.viewseg .tb { flex: none; min-width: 0; padding: 0; height: 30px; border-radius: 15px; }
.viewseg [data-view="icons"] { width: 32.5px; }
.viewseg [data-view="list"] { width: 39px; }
.viewseg [data-view="columns"] { width: 34px; }
.viewseg [data-view="gallery"] { width: 32px; }
.viewseg [data-view="gallery"] svg { transform: translateX(1.25px); }
.viewseg .tb.on { background: var(--tb-on); color: var(--fg); }
.viewseg .pill-sep { height: 17px; flex: none; }
.pill.round { width: 37.5px; padding: 0; justify-content: center; }
.pill.round .tb { min-width: 37.5px; height: 37.5px; border-radius: 19px; }
.search.open { width: 210px; padding: 0 10px 0 0; justify-content: flex-start; }
.search.open #search-btn { min-width: 30px; pointer-events: none; opacity: .6; background: none; }
.search.open #search-btn svg { width: 16px; height: 16px; }
#filter { flex: 1; min-width: 0; height: 30px; padding: 0; border: 0; outline: none; font: inherit; color: var(--fg); background: none; }

/* ---------- Content ---------- */
.content { flex: 1; overflow: auto; position: relative; outline: none; }
.marquee { position: absolute; z-index: 3; pointer-events: none; background: var(--marquee-bg); border: 1px solid var(--marquee-rim); }
.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: rgba(0, 0, 0, .55); text-align: center; padding: 20px; }
.empty-icon svg { width: 84px; height: 84px; }
.empty p { margin: 6px 0 12px; }
.empty .hint { margin: 10px 0 0; font-size: 11px; color: rgba(0, 0, 0, .35); }
.pushbtn {
  height: 24px; padding: 0 14px; border: 0; border-radius: 6px; color: #fff; font-weight: 500;
  background: linear-gradient(#2b8bff, #0a6fea); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .12), 0 1px 1.5px rgba(0, 0, 0, .2);
}
.pushbtn:active { background: linear-gradient(#1a7cf0, #075fd0); }

/* List view */
.listview { min-height: 100%; display: flex; flex-direction: column; }
.lhead, .row { display: grid; grid-template-columns: minmax(200px, 1fr) 200px 84px 160px; }
.lhead {
  position: sticky; top: 0; z-index: 2; height: 28px; padding: 0 10px; align-items: center;
  background: rgba(255, 255, 255, .96); backdrop-filter: blur(20px); border-bottom: 1px solid var(--hair);
  font-size: 11px; color: rgba(0, 0, 0, .5);
}
.lhead > div { position: relative; height: 100%; display: flex; align-items: center; gap: 3px; padding: 0 8px; white-space: nowrap; }
.lhead > div:first-child { padding-left: 22px; }
.lhead > div + div::before { content: ""; position: absolute; left: 0; top: 7px; bottom: 7px; width: 1px; background: rgba(0, 0, 0, .1); }
.lhead > div.num { justify-content: flex-end; }
.lhead > div.num .sortchev { order: -1; }
.lhead > div:hover { color: rgba(0, 0, 0, .7); }
.sortchev { visibility: hidden; color: rgba(0, 0, 0, .45); margin-left: auto; }
.num .sortchev { margin: 0 auto 0 0; }
.sortchev svg { width: 11px; height: 11px; }
.lhead .sorted .sortchev { visibility: visible; }
.lhead .sorted.asc .sortchev { transform: rotate(180deg); }
.rows { flex: 1; padding: 0 10px 10px; background: repeating-linear-gradient(transparent 0 24px, #f4f5f5 24px 48px) content-box; }
.row { height: 24px; align-items: center; border-radius: 5px; content-visibility: auto; contain-intrinsic-size: auto 24px; }
.row .c { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(0, 0, 0, .5); }
.row .name { display: flex; align-items: center; color: rgba(0, 0, 0, .88); }
.row .size { text-align: right; }
.disc { width: 14px; height: 14px; flex: none; margin-right: 2px; color: rgba(0, 0, 0, .4); transition: transform .12s ease; }
.disc svg { width: 14px; height: 14px; }
.disc.open { transform: rotate(90deg); }
.row .icon { width: 18px; height: 18px; flex: none; margin-right: 6px; display: flex; align-items: center; justify-content: center; }
.row .icon .ico { width: 18px; height: 18px; }
.row .icon img.thumb { width: auto; height: auto; max-width: 18px; max-height: 16px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .2); }
.row .label { overflow: hidden; text-overflow: ellipsis; }
.row.selected { background: var(--sel); }
.row.selected .c, .row.selected .disc { color: #fff; }
.window.inactive .row.selected { background: #dcdcdc; }
.window.inactive .row.selected .c { color: rgba(0, 0, 0, .5); }
.window.inactive .row.selected .name { color: rgba(0, 0, 0, .88); }
.window.inactive .row.selected .disc { color: rgba(0, 0, 0, .4); }

/* Icon view. Finder leaves a wide right margin: in a 1021pt window it shows 6 columns where 7 would fit
   (and 5 with a 52pt wider sidebar), which a 135px right inset reproduces. */
.iconview { --isz: 69px; min-height: 100%; display: grid; grid-template-columns: repeat(auto-fill, max(108px, calc(var(--isz) + 39px))); grid-auto-rows: calc(var(--isz) + 40px); gap: 17px 4px; padding: 8px 135px 8px 8.5px; align-content: start; justify-content: start; }
/* Off-screen items skip layout and paint, so folders with thousands of items open quickly. */
.cell { display: flex; flex-direction: column; align-items: center; gap: 1px; content-visibility: auto; contain-intrinsic-size: auto 108px auto 109px; }
.cicon { width: calc(var(--isz) + 11px); height: calc(var(--isz) + 3px); margin-top: 2px; padding: 4px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.cicon .ico { width: var(--isz); height: var(--isz); }
.cicon img.thumb { width: auto; height: auto; max-width: calc(var(--isz) - 9px); max-height: calc(var(--isz) - 9px); border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
.cname { margin-top: .5px; max-width: max(104px, calc(var(--isz) + 35px)); padding: 1px 6px; border-radius: 5px; font-size: 12px; line-height: 15px; text-align: center; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cell.selected .cicon { background: rgba(0, 0, 0, .1); }
.cell.selected .cname { background: var(--sel); color: #fff; }
.window.inactive .cell.selected .cname { background: #dcdcdc; color: inherit; }

.rename-input {
  font: inherit; color: #1d1d1f; min-width: 0; flex: 1; height: 20px; margin-right: 8px; padding: 0 4px; border: 0; border-radius: 3px;
  background: #fff; outline: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 4px rgba(10, 122, 255, .45); user-select: text;
}
.cell .rename-input { flex: none; width: 100px; margin: 0; text-align: center; font-size: 12px; }

/* Path bar and status bar */
.pathbar {
  height: 25px; flex: none; display: flex; align-items: center; gap: 1px; padding: 0 10px; overflow: hidden; white-space: nowrap;
  font-size: 11px; color: rgba(0, 0, 0, .75); border-top: 1px solid var(--hair); background: #fff;
}
.pseg { display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 4px; }
.pseg:hover { background: rgba(0, 0, 0, .05); }
.pseg .ico, .pseg img { width: 15px; height: 15px; object-fit: contain; }
.psep { color: rgba(0, 0, 0, .3); }
.psep svg { width: 10px; height: 10px; }
.statusbar {
  height: 28px; flex: none; display: flex; align-items: center; justify-content: center; position: relative;
  font-size: 12px; color: rgba(0, 0, 0, .5);
}
.zoomslider {
  position: absolute; right: 11.5px; top: 50%; width: 80px; height: 14px; margin: -7px 0 0; padding: 0;
  appearance: none; background: none; --z-fill: var(--accent); --z-track: rgba(0, 0, 0, .1); --z-knob: #fff;
}
.zoomslider::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--z-fill) var(--p, 22%), var(--z-track) var(--p, 22%)); }
.zoomslider::-webkit-slider-thumb { appearance: none; width: 18px; height: 14px; margin-top: -5px; border-radius: 7px; background: var(--z-knob); box-shadow: 0 .5px 2px rgba(0, 0, 0, .3); }

.resize { position: absolute; right: 0; bottom: 0; width: 14px; height: 14px; cursor: nwse-resize; z-index: 6; }

/* ---------- Menus ---------- */
.menu {
  position: fixed; z-index: 100; min-width: 210px; padding: 5px; border-radius: 7px; font-size: 13px; color: rgba(0, 0, 0, .86);
  background: rgba(242, 241, 244, .94); backdrop-filter: blur(40px) saturate(1.9);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25), inset 0 0 0 .5px rgba(255, 255, 255, .6), 0 12px 34px rgba(0, 0, 0, .24);
}
.menu-item { display: flex; align-items: center; height: 22px; padding: 0 10px 0 3px; border-radius: 4px; white-space: nowrap; }
.menu-check { width: 17px; text-align: center; font-size: 12px; font-weight: 600; }
.menu-label { flex: 1; padding-right: 28px; }
.menu-key { color: rgba(0, 0, 0, .4); letter-spacing: .06em; }
.menu-item:not(.disabled):hover { background: var(--accent); color: #fff; }
.menu-item:not(.disabled):hover .menu-key { color: rgba(255, 255, 255, .85); }
.menu-item.disabled { color: rgba(0, 0, 0, .26); }
.menu-item.disabled .menu-key { color: rgba(0, 0, 0, .2); }
.menu-sep { height: 1px; margin: 5px 10px; background: rgba(0, 0, 0, .11); }

/* ---------- Alerts ---------- */
.alert-overlay { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; padding-top: 20vh; }
.alert {
  width: 260px; padding: 20px 16px 16px; border-radius: 12px; text-align: center;
  background: rgba(238, 237, 241, .97); backdrop-filter: blur(40px) saturate(1.9);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .25), inset 0 0 0 .5px rgba(255, 255, 255, .6), 0 22px 60px rgba(0, 0, 0, .38);
}
.alert-icon svg { width: 64px; height: 64px; margin: 0 auto 14px; }
.alert-icon { color: rgba(0, 0, 0, .42); }
.alert-title { font-size: 13px; font-weight: 700; line-height: 16px; word-wrap: break-word; }
.alert-msg { margin-top: 8px; font-size: 11px; line-height: 14px; color: rgba(0, 0, 0, .85); }
.alert-buttons { display: flex; gap: 8px; margin-top: 20px; }
.abtn {
  flex: 1; height: 28px; border: 0; border-radius: 7px; font-size: 13px;
  background: rgba(255, 255, 255, .95); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .14), 0 .5px 1.5px rgba(0, 0, 0, .18);
}
.abtn:active { background: #e6e6e6; }
.abtn.primary { color: #fff; font-weight: 500; background: linear-gradient(#2b8bff, #0a6fea); }
.abtn.destructive { color: #ff3b30; }
.unsupported { position: fixed; left: 50%; top: 30%; transform: translateX(-50%); width: 300px; }

/* ---------- Quick Look ---------- */
.ql {
  position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(780px, 86vw); height: min(580px, 78vh); display: flex; flex-direction: column; border-radius: 12px; overflow: hidden;
  background: rgba(246, 245, 248, .96); backdrop-filter: blur(50px) saturate(1.9);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 255, 255, .5), 0 28px 80px rgba(0, 0, 0, .45);
}
.ql-head { height: 42px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 8px; border-bottom: 1px solid var(--hair); }
.ql-head .tb svg { width: 15px; height: 15px; }
.ql-name { flex: 1; text-align: center; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(0, 0, 0, .8); }
.ql-open { height: 24px; padding: 0 10px; border: 0; border-radius: 6px; background: rgba(0, 0, 0, .07); color: rgba(0, 0, 0, .8); }
.ql-open:hover { background: rgba(0, 0, 0, .11); }
.ql-body { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; }
.ql-body img, .ql-body video { max-width: 100%; max-height: 100%; }
.ql-body iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.ql-body pre { align-self: stretch; width: 100%; margin: 0; padding: 14px 18px; background: #fff; font: 12px/1.45 ui-monospace, "SF Mono", Menlo, monospace; white-space: pre-wrap; word-break: break-word; user-select: text; }
.ql-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; color: rgba(0, 0, 0, .55); }
.ql-meta .ico, .ql-meta img { width: 128px; height: 128px; object-fit: contain; margin-bottom: 8px; }
.ql-meta-name { font-size: 15px; font-weight: 600; color: rgba(0, 0, 0, .85); }

/* ---------- Dock ---------- */
/* Measured on Tahoe's default Dock: 72pt tall, 5pt above the screen edge, 21pt corners,
   icons on a 56pt pitch (52pt images, 42pt visible), each tile the Dock's full height. */
.dock {
  position: fixed; left: 50%; bottom: 5px; transform: translateX(-50%); z-index: 40;
  display: flex; align-items: center; padding: 0 8px; border-radius: 21px;
}
/* The glass is a layer behind the icons: on the Dock itself it would stop the tooltips' own glass from seeing the wallpaper. */
.dock::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
  background: var(--dock-bg); backdrop-filter: blur(30px) saturate(1.5);
  box-shadow: inset 0 0 0 1px var(--dock-rim), inset 0 0 0 .5px var(--dock-rim), 0 2px 30px var(--dock-shadow);
}
.dock-app { position: relative; display: block; width: 56px; height: 72px; padding: 10px 2px; cursor: default; }
.dock-app img { display: block; width: 52px; height: 52px; -webkit-user-drag: none; }
/* Pressing an icon darkens it to about 43% at once (brightness .49 renders as .43 in Chrome); launching an app bounces it once, 16pt in 0.71s, like a falling ball. */
.dock-app:active img, .dock-app.menu-open img { filter: brightness(.49); }
.dock-app.launching img { animation: dock-bounce .71s .035s; }
@keyframes dock-bounce {
  0% { transform: none; animation-timing-function: cubic-bezier(.33, .67, .67, 1); }
  50% { transform: translateY(-16px); animation-timing-function: cubic-bezier(.33, 0, .67, .33); }
  100% { transform: none; }
}
.dock-app.running::after { content: ""; position: absolute; left: 50%; bottom: 4.25px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--dock-dot); backdrop-filter: var(--dock-dot-fx); }
/* App name above the icon: a 26pt glass capsule with a 7pt pointer ending 7.5pt above the Dock (shape set in app.js).
   It appears at once and switches between icons at once, and only fades when the pointer leaves the Dock. */
.dock-tip {
  position: absolute; left: 50%; bottom: 79px; transform: translateX(-50%); pointer-events: none;
  min-width: 42px; height: 33px; padding: 0 13px 7px; white-space: nowrap; text-align: center;
  font-size: 14px; line-height: 26px; color: var(--tip-fg);
  background: var(--tip-bg); backdrop-filter: blur(20px) saturate(3); clip-path: var(--shape);
  opacity: 0; transition: opacity .27s ease-in-out;
}
/* 1pt rim, brighter on its outer half */
.dock-tip::before, .dock-glass::before { content: ""; position: absolute; inset: 0; background: var(--tip-rim); mask: var(--rim) 0 0 / 100% 100%; }
.dock-app:hover .dock-tip { opacity: 1; transition: none; }
.dock:hover .dock-app:not(:hover) .dock-tip { transition: none; }
/* No names while a Dock menu is open or an icon is being dragged. */
.dock:has(.menu-open) .dock-tip, .dock:has(.dragging) .dock-tip { opacity: 0; transition: none; }
.dock-app.dragging { z-index: 1; }
.dock-app.dragging img { filter: none; }
/* Dock menus, measured: 5pt padding, 24pt rows with 12pt text inset, 11.5pt separators, 12pt corners. */
.menu.dock-menu {
  padding: 5px; min-width: 0; border-radius: 12px; font-size: 13px; color: var(--tip-fg);
  background: none; backdrop-filter: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .16);
}
.dock-menu.sub { position: absolute; top: 0; }
.dock-glass { position: absolute; left: 0; top: 0; width: 100%; z-index: -1; background: var(--menu-bg); backdrop-filter: blur(20px) saturate(3); clip-path: var(--shape); }
.dock-menu .menu-item { position: relative; height: 24px; padding: 0 15px 0 12px; border-radius: 8px; }
.dock-menu.has-sub > .menu-item { padding-right: 43px; }
.dock-menu .menu-label { padding-right: 0; }
.dock-menu .menu-item.open, .dock-menu .menu-item:not(.disabled):hover { background: #0b6dd4; color: #fff; }
.dock-menu .menu-sep { margin: 5.25px 11px; background: var(--tip-sep); }
.dock-chev { position: absolute; right: 13px; top: 6px; }
.dock-check { position: absolute; left: 1px; width: 11px; text-align: center; font-size: 11px; font-weight: 600; }
.dock-chev svg { width: 12px; height: 12px; stroke-width: 2.2; }
/* A minimised window: its thumbnail, centred in the icon box, badged with the app's icon. */
.dock-min { overflow: hidden; }
.dock-thumb { position: relative; overflow: hidden; margin: 26px auto 0; translate: 0 -50%; }
.dock-thumb .window { position: absolute; }
.dock-badge { position: absolute; right: 2px; bottom: 9px; width: 20px !important; height: 20px !important; }
/* In light mode the separator and dot subtract the glass's grey veil (58/255) from what's behind them, and the dot
   then darkens it to 59%, which the backdrop filters do exactly; in dark mode both are plain light marks. */
.dock-sep { width: 1px; height: 54px; margin: 0 13px; background: var(--dock-sep); backdrop-filter: var(--dock-sep-fx); }

/* ---------- Tags, cut items, drop targets ---------- */
.tagdots { display: inline-flex; margin-left: 6px; flex: none; }
.tagdots span { width: 9px; height: 9px; border-radius: 50%; margin-left: -3px; box-shadow: 0 0 0 1.25px #fff; }
.tagdots span:first-child { margin-left: 0; }
.row.selected .tagdots span, .citem.selected .tagdots span { box-shadow: 0 0 0 1.25px var(--sel); }
.cname { display: flex; align-items: center; justify-content: center; }
.cname .tagdots { margin: 0 4px 0 0; }
.cut .icon, .cut .cicon, .cut.gthumb { opacity: .45; }
.drophi.row, .drophi.citem, .drophi.cell .cicon { background: var(--sel) !important; color: #fff; }
.drophi.row .c { color: #fff; }
.drophi.side-item, .drophi.pseg { background: rgba(10, 122, 255, .25); }
.content.drophi, .col.drophi { box-shadow: inset 0 0 0 3px rgba(10, 122, 255, .55); }
.menu-tags { display: flex; gap: 7px; padding: 5px 10px 4px 20px; }
.mtag { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.mtag:hover { transform: scale(1.18); }
.mtag.on { box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15), 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .35); }
.menu-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }

/* ---------- Column view ---------- */
.columnview { height: 100%; display: flex; overflow-x: auto; overflow-y: hidden; }
.col { width: 196px; flex: none; height: 100%; overflow-y: auto; padding: 4px 6px; border-right: 1px solid var(--hair); }
.citem { display: flex; align-items: center; height: 22px; padding: 0 4px 0 6px; border-radius: 5px; color: rgba(0, 0, 0, .88); white-space: nowrap; }
.citem .icon { width: 16px; height: 16px; flex: none; margin-right: 6px; display: flex; align-items: center; justify-content: center; }
.citem .icon .ico { width: 16px; height: 16px; }
.citem .icon img.thumb { width: auto; height: auto; max-width: 16px; max-height: 14px; }
.citem .label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.cchev { flex: none; color: rgba(0, 0, 0, .35); margin-left: 4px; }
.cchev svg { width: 10px; height: 10px; }
.citem.path { background: rgba(0, 0, 0, .09); }
.citem.selected { background: var(--sel); color: #fff; }
.citem.selected .cchev { color: rgba(255, 255, 255, .85); }
.window.inactive .citem.selected { background: #dcdcdc; color: inherit; }
.colpreview { width: auto; min-width: 250px; flex: 1; display: flex; justify-content: center; padding: 18px 16px; }

/* Preview pane shared by columns and gallery */
.pane { width: 100%; display: flex; flex-direction: column; align-items: center; text-align: center; }
.pane-art { width: 100%; height: 170px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.pane-art .ico { width: 128px; height: 128px; }
.pane-art img { max-width: 100%; max-height: 170px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.pane-name { font-size: 13px; font-weight: 600; word-break: break-word; }
.pane-sub { font-size: 11px; color: rgba(0, 0, 0, .5); margin-top: 2px; }
.pane .tagdots { margin: 8px 0 0; }
.pane-info { align-self: stretch; margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--hair); text-align: left; font-size: 11px; }
.pane-h { font-weight: 700; font-size: 12px; margin-bottom: 6px; }
.pane-row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--hair); }
.pane-row span:first-child { color: rgba(0, 0, 0, .5); }
.pane-row span:last-child { text-align: right; }

/* ---------- Gallery view ---------- */
.galleryview { height: 100%; display: flex; }
.g-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.g-stage { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 24px; }
.g-stage img { max-width: 100%; max-height: 100%; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.g-stage .ico { width: 200px; height: 200px; }
.g-strip { flex: none; height: 78px; display: flex; align-items: center; gap: 6px; padding: 0 14px; overflow-x: auto; overflow-y: hidden; }
.gthumb { width: 54px; height: 54px; flex: none; padding: 4px; border-radius: 7px; display: flex; align-items: center; justify-content: center; }
.gthumb .ico { width: 44px; height: 44px; }
.gthumb img { max-width: 44px; max-height: 44px; }
.gthumb.selected { background: rgba(0, 0, 0, .12); box-shadow: inset 0 0 0 2px var(--sel); }
.g-pane { width: 250px; flex: none; overflow-y: auto; padding: 16px; border-left: 1px solid var(--hair); }
.g-pane .pane { align-items: flex-start; text-align: left; }

/* ---------- Get Info ---------- */
.info {
  position: fixed; z-index: 55; right: 40px; top: 60px; width: 270px; max-height: calc(100vh - 150px); display: flex; flex-direction: column;
  border-radius: 10px; overflow: hidden; background: rgba(240, 239, 242, .97); backdrop-filter: blur(50px) saturate(1.9);
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .35), inset 0 0 0 .5px rgba(255, 255, 255, .5), 0 22px 60px rgba(0, 0, 0, .38);
}
.info-head { height: 28px; flex: none; position: relative; display: flex; align-items: center; justify-content: center; }
.mini-traffic { position: absolute; left: 9px; display: flex; gap: 8px; }
.mini-traffic .tl svg { opacity: 0; }
.mini-traffic:hover .tl svg { opacity: 1; }
.tl.off { background: #d6d6d6; box-shadow: inset 0 0 0 .5px #c4c4c4; }
.info-title { font-weight: 600; font-size: 13px; color: rgba(0, 0, 0, .8); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.info-body { overflow-y: auto; padding: 8px 14px 14px; font-size: 11px; }
.info-top { display: flex; gap: 10px; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--hair); }
.info-art { width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center; }
.info-art .ico, .info-art img { max-width: 44px; max-height: 44px; }
.info-meta { min-width: 0; }
.info-name { font-size: 13px; font-weight: 600; word-break: break-word; }
.info-size, .info-sub { color: rgba(0, 0, 0, .55); margin-top: 1px; }
.info-tags { display: flex; gap: 7px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.itag { width: 14px; height: 14px; padding: 0; border: 0; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15); }
.itag.on { box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .15), 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .35); }
.info-sec { padding-top: 8px; }
.info-h { font-weight: 700; margin-bottom: 4px; }
.info-row { display: grid; grid-template-columns: 70px 1fr; gap: 6px; padding: 2px 0; }
.info-row .k { text-align: right; color: rgba(0, 0, 0, .55); }
.info-row .v { word-break: break-word; }
.info-empty { padding: 20px 0; text-align: center; color: rgba(0, 0, 0, .5); }

/* ---------- Dark appearance: follows the system setting, like macOS ---------- */
:root { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
  :root {
    --sel: #0a5bd3; --hair: rgba(255, 255, 255, .1); --fg: rgba(255, 255, 255, .9); --accent: #0091ff;
    --win-bg: #1e2021; --win-edge: rgba(0, 0, 0, .85); --win-rim: rgba(255, 255, 255, .16); --tl-off: #48484b;
    --side-bg: rgba(22, 24, 30, .88); --side-rim: rgba(255, 255, 255, .17); --side-head: rgba(255, 255, 255, .56);
    --side-fg: rgba(255, 255, 255, .96); --side-ico: rgba(255, 255, 255, .96); --side-sel: rgba(255, 255, 255, .1);
    --marquee-bg: rgba(255, 255, 255, .1); --marquee-rim: rgba(255, 255, 255, .3);
    --pill-bg: #212425; --pill-rim: rgba(255, 255, 255, .12); --tb-fg: rgba(255, 255, 255, .85);
    --tb-hover: rgba(255, 255, 255, .08); --tb-on: rgba(255, 255, 255, .16);
    --fi-bg1: #2b2b2e; --fi-bg2: #0c0c0d; --fi-feat-l: #1ea4ff; --fi-feat-r: #0b0b0c; --fi-rim: rgba(255, 255, 255, .14);
    --dock-bg: rgba(60, 60, 60, .28); --dock-rim: rgba(255, 255, 255, .1); --dock-shadow: rgba(0, 0, 0, .03);
    --dock-sep: rgba(255, 255, 255, .27); --dock-sep-fx: none; --dock-dot: rgba(255, 255, 255, .55); --dock-dot-fx: none;
    --tip-bg: rgba(39, 39, 39, .77); --tip-rim: rgba(255, 255, 255, .15); --tip-fg: rgba(255, 255, 255, .9); --tip-sep: rgba(255, 255, 255, .12); --menu-bg: var(--tip-bg);
  }
  body { color: rgba(255, 255, 255, .88); background-image: linear-gradient(rgba(0, 0, 10, .42), rgba(0, 0, 10, .42)), url(wallpaper.jpg); }

  .dot, .mtag, .itag { box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .18); }

  .statusbar { color: rgba(255, 255, 255, .55); }
  .zoomslider { --z-fill: #397af5; --z-track: #343637; --z-knob: #dedede; }
  .zoomslider::-webkit-slider-thumb { box-shadow: none; }

  .empty { color: rgba(255, 255, 255, .55); }
  .empty .hint { color: rgba(255, 255, 255, .32); }
  .lhead { background: rgba(30, 30, 30, .96); color: rgba(255, 255, 255, .5); }
  .lhead > div:hover { color: rgba(255, 255, 255, .75); }
  .lhead > div + div::before { background: rgba(255, 255, 255, .1); }
  .sortchev { color: rgba(255, 255, 255, .45); }
  .rows { background: repeating-linear-gradient(transparent 0 24px, rgba(255, 255, 255, .045) 24px 48px) content-box; }
  .row .c { color: rgba(255, 255, 255, .55); }
  .row .name, .citem { color: rgba(255, 255, 255, .9); }
  .disc, .cchev { color: rgba(255, 255, 255, .45); }
  .window.inactive .row.selected, .window.inactive .citem.selected { background: #464646; }
  .window.inactive .row.selected .c, .window.inactive .row.selected .name, .window.inactive .citem.selected { color: rgba(255, 255, 255, .9); }
  .window.inactive .row.selected .disc { color: rgba(255, 255, 255, .5); }
  .tagdots span { box-shadow: 0 0 0 1.25px #1e1e1e; }
  .cell.selected .cicon, .citem.path, .gthumb.selected { background: rgba(255, 255, 255, .12); }
  .window.inactive .cell.selected .cname { background: #464646; }
  .cicon img.thumb { border-color: #3a3a3a; }
  .rename-input { background: #1e1e1e; color: #fff; box-shadow: 0 0 0 1px rgba(255, 255, 255, .2), 0 0 0 4px rgba(10, 122, 255, .55); }
  .pathbar { color: rgba(255, 255, 255, .75); background: transparent; }
  .pseg:hover { background: rgba(255, 255, 255, .08); }
  .psep { color: rgba(255, 255, 255, .3); }
  .pane-sub, .pane-row span:first-child, .info-size, .info-sub, .info-row .k, .info-empty { color: rgba(255, 255, 255, .5); }

  .menu { background: rgba(42, 42, 46, .95); color: rgba(255, 255, 255, .88); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .6), inset 0 0 0 .5px rgba(255, 255, 255, .16), 0 12px 34px rgba(0, 0, 0, .45); }
  .menu-key { color: rgba(255, 255, 255, .4); }
  .menu-item.disabled { color: rgba(255, 255, 255, .26); }
  .menu-item.disabled .menu-key { color: rgba(255, 255, 255, .2); }
  .menu-sep { background: rgba(255, 255, 255, .12); }
  .mtag.on, .itag.on { box-shadow: 0 0 0 2px #2a2a2e, 0 0 0 3px rgba(255, 255, 255, .6); }

  .alert { background: rgba(44, 44, 48, .97); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .6), inset 0 0 0 .5px rgba(255, 255, 255, .16), 0 22px 60px rgba(0, 0, 0, .55); }
  .alert-msg { color: rgba(255, 255, 255, .8); }
  .alert-icon { color: rgba(255, 255, 255, .55); }
  .abtn { background: rgba(255, 255, 255, .16); color: #fff; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .3), 0 .5px 1.5px rgba(0, 0, 0, .3); }
  .abtn:active { background: rgba(255, 255, 255, .24); }
  .abtn.primary { background: linear-gradient(#2b8bff, #0a6fea); }
  .abtn.destructive { color: #ff6961; }

  .ql, .info { background: rgba(38, 38, 42, .96); box-shadow: 0 0 0 .5px rgba(0, 0, 0, .6), inset 0 0 0 .5px rgba(255, 255, 255, .14), 0 28px 80px rgba(0, 0, 0, .55); }
  .ql-name, .info-title { color: rgba(255, 255, 255, .85); }
  .ql-open { background: rgba(255, 255, 255, .1); color: rgba(255, 255, 255, .85); }
  .ql-open:hover { background: rgba(255, 255, 255, .16); }
  .ql-body pre { background: #1e1e1e; color: rgba(255, 255, 255, .88); }
  .ql-body iframe { background: #1e1e1e; }
  .ql-meta { color: rgba(255, 255, 255, .55); }
  .ql-meta-name { color: rgba(255, 255, 255, .9); }
}
