/* ---------- Tokens ---------- */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Helvetica Neue", Arial, sans-serif;

  /* folder palette */
  --tangerine: #ff9a3c; --bubblegum: #ff6fb5; --sky: #43b0ff; --cobalt: #3d6bff;
  --grape: #9a5cff; --tomato: #ff5a4e; --lemon: #ffcf33; --violet: #c77dff;
  --latte: #c9a07a; --mint: #2fd08f; --teal: #15b8a6; --lime: #9ddc2f;
  --graphite: #707884; --slate: #8fa3bd;
  --folder: #a3abb6;

  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --accent: #0a66ff;
  --accent-soft: rgba(10, 102, 255, .14);
  --win-bg: #ffffff;
  --win-shadow: 0 0 0 .5px rgba(0,0,0,.22), 0 24px 70px rgba(30, 20, 60, .28), 0 6px 18px rgba(30,20,60,.14);
  --toolbar-bg: rgba(246, 245, 248, .92);
  --sidebar-bg: rgba(236, 234, 242, .78);
  --border: rgba(0, 0, 0, .09);
  --hover: rgba(0, 0, 0, .05);
  --menubar-bg: rgba(255, 255, 255, .5);
  --menubar-text: #111;
  --dropdown-bg: rgba(246, 246, 248, .86);
  --dock-bg: rgba(255, 255, 255, .38);
  --paper: #ffffff;
  --row-alt: rgba(0, 0, 0, .025);
  --wall-1: #ffe9d6; --wall-2: #ffc3dd; --wall-3: #bfdcff; --wall-4: #d9ccff; --wall-base: #fbf3ec;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --folder: #7d8692;
    --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
    --accent: #3b8bff; --accent-soft: rgba(59, 139, 255, .22);
    --win-bg: #1e1e21;
    --win-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 24px 70px rgba(0,0,0,.6), 0 6px 18px rgba(0,0,0,.35);
    --toolbar-bg: rgba(42, 42, 46, .94); --sidebar-bg: rgba(34, 33, 40, .82);
    --border: rgba(255, 255, 255, .09); --hover: rgba(255, 255, 255, .06);
    --menubar-bg: rgba(20, 18, 30, .42); --menubar-text: #f5f5f7;
    --dropdown-bg: rgba(40, 40, 46, .88); --dock-bg: rgba(40, 36, 56, .42);
    --paper: #2a2a2e; --row-alt: rgba(255, 255, 255, .03);
    --wall-1: #3a1f4f; --wall-2: #5a1f45; --wall-3: #13325e; --wall-4: #2c2167; --wall-base: #120f1f;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --folder: #7d8692;
  --text: #f5f5f7; --text-2: #a1a1a6; --text-3: #6e6e73;
  --accent: #3b8bff; --accent-soft: rgba(59, 139, 255, .22);
  --win-bg: #1e1e21;
  --win-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 24px 70px rgba(0,0,0,.6), 0 6px 18px rgba(0,0,0,.35);
  --toolbar-bg: rgba(42, 42, 46, .94); --sidebar-bg: rgba(34, 33, 40, .82);
  --border: rgba(255, 255, 255, .09); --hover: rgba(255, 255, 255, .06);
  --menubar-bg: rgba(20, 18, 30, .42); --menubar-text: #f5f5f7;
  --dropdown-bg: rgba(40, 40, 46, .88); --dock-bg: rgba(40, 36, 56, .42);
  --paper: #2a2a2e; --row-alt: rgba(255, 255, 255, .03);
  --wall-1: #3a1f4f; --wall-2: #5a1f45; --wall-3: #13325e; --wall-4: #2c2167; --wall-base: #120f1f;
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--wall-base);
  background-image:
    radial-gradient(60% 55% at 12% 18%, var(--wall-1) 0%, transparent 70%),
    radial-gradient(50% 50% at 88% 12%, var(--wall-3) 0%, transparent 70%),
    radial-gradient(55% 60% at 78% 88%, var(--wall-2) 0%, transparent 70%),
    radial-gradient(50% 50% at 20% 90%, var(--wall-4) 0%, transparent 70%);
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before { /* film grain */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .22; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
img { display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------- Menu bar ---------- */
.menubar {
  position: fixed; top: 0; left: 0; right: 0; height: 28px; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; padding: 0 10px;
  background: var(--menubar-bg); color: var(--menubar-text);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  font-size: 13px; font-weight: 500;
}
.menubar-left, .menubar-right { display: flex; align-items: center; gap: 2px; min-width: 0; }
.menu-title { padding: 3px 9px; border-radius: 5px; white-space: nowrap; }
.menu-title:hover, .menu-title.open { background: rgba(127, 127, 127, .22); }
.menu-brand { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.menu-brand img { width: 16px; height: 16px; border-radius: 4px; object-fit: contain; }
.menu-clock { padding: 3px 9px; font-variant-numeric: tabular-nums; }
.menu-dropdown {
  position: fixed; top: 28px; z-index: 60; min-width: 230px; padding: 5px;
  background: var(--dropdown-bg); color: var(--text);
  backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  border-radius: 8px; box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 12px 32px rgba(0,0,0,.2);
}
.mi { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 10px; border-radius: 4px; text-align: left; font-size: 13px; }
.mi:hover:not([disabled]) { background: var(--accent); color: #fff; }
.mi[disabled] { color: var(--text-3); }
.mi .kbd { margin-left: auto; color: var(--text-3); font-size: 12px; }
.mi:hover .kbd { color: rgba(255,255,255,.8); }
.mi .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.mi .check { width: 12px; text-align: center; }
.msep { height: 1px; margin: 5px 10px; background: var(--border); }

/* ---------- Desktop ---------- */
.desktop { position: fixed; inset: 28px 0 0 0; z-index: 1; }
.desk-icons { position: absolute; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.desk-icon { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 92px; padding: 6px 4px; border-radius: 8px; }
.desk-icon .folder { font-size: 11px; }
.desk-icon:hover .desk-label, .desk-icon:focus-visible .desk-label { background: var(--accent); color: #fff; }
.desk-label { font-size: 12px; font-weight: 500; color: var(--text); padding: 1px 6px; border-radius: 4px; text-shadow: 0 1px 2px rgba(255,255,255,.4); }

/* ---------- Windows ---------- */
.window {
  position: absolute; display: flex; flex-direction: column; overflow: hidden;
  background: var(--win-bg); border-radius: 12px; box-shadow: var(--win-shadow);
  transition: opacity .18s ease, transform .22s cubic-bezier(.2,.8,.2,1);
}
.window[hidden] { display: none; }
.window.is-min { opacity: 0; transform: translateY(40vh) scale(.2); pointer-events: none; }
.finder {
  top: 20px; left: max(20px, calc(50% - 640px));
  width: min(1180px, calc(100vw - 170px)); height: min(780px, calc(100vh - 28px - 130px));
  z-index: 5;
}
.finder.is-max { top: 0 !important; left: 0 !important; width: 100vw; height: calc(100vh - 28px); border-radius: 0; transform: none !important; box-shadow: none; }
.window.is-front { z-index: 8; }

.toolbar {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 14px; flex: none;
  background: var(--toolbar-bg); border-bottom: 1px solid var(--border); user-select: none; position: relative;
}
.toolbar-slim { height: 38px; justify-content: flex-start; }
.toolbar-slim .win-title { position: absolute; left: 0; right: 0; text-align: center; justify-content: center; pointer-events: none; }
.lights { display: flex; gap: 8px; margin-right: 6px; position: relative; z-index: 1; }
.light { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); position: relative; }
.light.red { background: #ff5f57; } .light.yellow { background: #febc2e; } .light.green { background: #28c840; }
.light[disabled] { background: rgba(127,127,127,.35); }
.lights:hover .light::after { position: absolute; inset: 0; display: grid; place-items: center; font-size: 9px; font-weight: 800; line-height: 1; color: rgba(0,0,0,.55); }
.lights:hover .red::after { content: "×"; font-size: 11px; }
.lights:hover .yellow::after { content: "–"; }
.lights:hover .green:not([disabled])::after { content: "+"; }
.nav-btns { display: flex; gap: 2px; }
.tb-btn { width: 28px; height: 26px; display: grid; place-items: center; border-radius: 6px; color: var(--text-2); }
.tb-btn svg, .seg-btn svg, .search svg, .ql-btn svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.seg-btn svg rect { fill: none; }
.tb-btn:hover:not(:disabled) { background: var(--hover); color: var(--text); }
.tb-btn:disabled { opacity: .35; }
.win-title { margin: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 8px; }
.win-title .tdot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); flex: none; }
.tb-spacer { flex: 1; }
.seg { display: flex; padding: 2px; border-radius: 7px; background: var(--hover); }
.seg-btn { width: 32px; height: 24px; display: grid; place-items: center; border-radius: 5px; color: var(--text-2); }
.seg-btn.active { background: var(--win-bg); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.search { display: flex; align-items: center; gap: 6px; height: 28px; padding: 0 9px; border-radius: 7px; background: var(--hover); color: var(--text-2); width: 180px; }
.search input { border: 0; background: none; outline: none; font: inherit; color: var(--text); width: 100%; }
.search input::-webkit-search-cancel-button { filter: grayscale(1); }
.search:focus-within { box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }

.win-body { flex: 1; display: flex; min-height: 0; }
.sidebar {
  width: 200px; flex: none; overflow-y: auto; padding: 10px 10px 20px;
  background: var(--sidebar-bg); border-right: 1px solid var(--border);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
}
.sb-group + .sb-group { margin-top: 14px; }
.sb-head { font-size: 11px; font-weight: 700; color: var(--text-3); padding: 0 8px 4px; }
.sb-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; border-radius: 6px; text-align: left; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-item svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sb-item:hover { background: var(--hover); }
.sb-item.active { background: rgba(127, 127, 127, .2); font-weight: 600; }
.sb-item .mini-folder { width: 16px; height: 13px; flex: none; border-radius: 2px 3px 3px 3px; background: var(--c); position: relative; margin-top: 2px; }
.sb-item .mini-folder::before { content: ""; position: absolute; left: 0; top: -2px; width: 7px; height: 3px; border-radius: 2px 2px 0 0; background: var(--c); filter: brightness(.85); }
.sb-item .tagdot { width: 11px; height: 11px; border-radius: 50%; background: var(--c); flex: none; margin: 0 2px; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.15); }
.sb-item .count { margin-left: auto; font-size: 11px; color: var(--text-3); }

.main-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.content-wrap { flex: 1; display: flex; min-height: 0; }
.content { flex: 1; overflow-y: auto; outline: none; position: relative; }
.info {
  width: 300px; flex: none; overflow-y: auto; padding: 22px 22px 30px;
  border-left: 1px solid var(--border); background: var(--win-bg);
}
.info[hidden] { display: none; }
.pathbar {
  display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 12px; flex: none;
  border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden;
}
.crumb { display: inline-flex; align-items: center; gap: 5px; padding: 1px 4px; border-radius: 4px; }
button.crumb:hover { background: var(--hover); color: var(--text); }
.crumb .mini-folder { width: 13px; height: 10px; border-radius: 2px; background: var(--c, var(--folder)); }
.crumb-sep { color: var(--text-3); }
.statusbar { height: 22px; flex: none; display: grid; place-items: center; font-size: 11px; color: var(--text-2); background: var(--toolbar-bg); border-top: 1px solid var(--border); }

/* ---------- Folder icon ---------- */
.folder {
  --dk: color-mix(in srgb, var(--c) 72%, #000);
  --lt: color-mix(in srgb, var(--c) 78%, #fff);
  position: relative; display: block; width: 6em; height: 4.8em; font-size: 16px; flex: none;
}
.folder .back {
  position: absolute; left: 0; right: 0; top: .45em; bottom: 0; border-radius: .5em;
  background: linear-gradient(180deg, var(--dk), color-mix(in srgb, var(--c) 82%, #000));
}
.folder .back::before {
  content: ""; position: absolute; left: 0; top: -.4em; width: 2.6em; height: .8em; border-radius: .4em .5em 0 0;
  background: var(--dk);
}
.folder .paper {
  position: absolute; left: .6em; right: .6em; top: .3em; height: 3.3em; border-radius: .18em; overflow: hidden;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transform-origin: 50% 100%;
  transition: transform .45s cubic-bezier(.2,.9,.25,1.25), box-shadow .3s ease;
}
.folder .paper img { width: 100%; height: 100%; object-fit: cover; }
.folder .p0 { transform: rotate(-2deg); }
.folder .p1 { transform: translateX(-.15em) rotate(-6deg); }
.folder .p2 { transform: translateX(.15em) rotate(5deg); }
.folder .front {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3.55em; border-radius: .5em;
  background: linear-gradient(180deg, var(--lt) 0%, var(--c) 55%, color-mix(in srgb, var(--c) 92%, #000) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55), 0 1px 2px rgba(0,0,0,.18);
  transform-origin: 50% 100%; transition: transform .35s cubic-bezier(.2,.9,.25,1.2);
}
.folder .front::after { /* subtle emboss line */
  content: ""; position: absolute; left: .5em; right: .5em; top: .45em; height: 1px; background: rgba(255,255,255,.35);
}
.folder .sticker {
  position: absolute; right: .45em; bottom: .4em; font-size: .5em; font-weight: 700; letter-spacing: .02em;
  padding: .15em .55em; border-radius: 1em; background: rgba(255,255,255,.75); color: var(--dk);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.folder .glyph { position: absolute; left: 50%; top: 56%; transform: translate(-50%, -50%); width: 1.5em; height: 1.5em; opacity: .55; }
.folder .glyph svg { width: 100%; height: 100%; fill: none; stroke: var(--dk); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Hover: the folder tips open and its first three files fan out above it as a sneak peek. */
.item:hover, .content:focus .item.selected { position: relative; z-index: 3; }
.item:hover .folder .paper, .content:focus .item.selected .folder .paper { box-shadow: 0 6px 18px rgba(0,0,0,.28), 0 0 0 .5px rgba(0,0,0,.12); }
.item:hover .folder .p0, .content:focus .item.selected .folder .p0 { transform: translateY(-2.5em) scale(1.12); transition-delay: .04s; }
.item:hover .folder .p1, .content:focus .item.selected .folder .p1 { transform: translate(-1.7em, -1.7em) rotate(-14deg); }
.item:hover .folder .p2, .content:focus .item.selected .folder .p2 { transform: translate(1.7em, -1.7em) rotate(14deg); transition-delay: .02s; }
.item:hover .folder .front, .content:focus .item.selected .folder .front { transform: perspective(12em) rotateX(-30deg); }
.desk-icon:hover .folder .front { transform: perspective(12em) rotateX(-16deg); }

/* doc icon */
.doc {
  position: relative; display: block; width: 3.6em; height: 4.6em; font-size: 16px; border-radius: .25em;
  background: linear-gradient(180deg, #fff, #f1f1f4); box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 2px 5px rgba(0,0,0,.15);
  clip-path: polygon(0 0, 72% 0, 100% 22%, 100% 100%, 0 100%);
}
.doc::before { content: ""; position: absolute; right: 0; top: 0; width: 28%; height: 22%; background: linear-gradient(225deg, transparent 50%, #d9d9de 50%); }
.doc::after { content: ""; position: absolute; left: 18%; right: 18%; top: 36%; height: 30%; background: repeating-linear-gradient(180deg, #c6c6cc 0 1px, transparent 1px 5px); }
.doc-ext { position: absolute; left: 0; right: 0; bottom: .55em; text-align: center; font-size: .55em; font-weight: 800; color: #8e8e93; letter-spacing: .06em; }
.doc-link::after { background: none; }
.doc-link .doc-ext { color: var(--accent); }
.doc-link::after { content: "↗"; left: 0; right: 0; top: 28%; height: auto; text-align: center; font-size: 1.3em; color: var(--accent); background: none; }

/* ---------- Icon view ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 26px 10px;
  padding: 22px 18px 30px; align-items: start;
}
.grid.files { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.item {
  display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 4px 6px; border-radius: 10px;
  text-align: center; min-width: 0; cursor: pointer;
}
.item .ic { --ih: 96px; width: 100%; display: flex; align-items: center; justify-content: center; height: var(--ih); }
.grid.files .item .ic { --ih: 128px; }
.grid:not(.files) { padding-top: 52px; }
.grid:not(.files) .item .ic { --ih: 128px; align-items: flex-end; }
.grid:not(.files) .item .folder { font-size: 24px; }
.grid:not(.files) .item .doc { font-size: 22px; }
.grid:not(.files) .item .label { font-size: 13px; }
.item .thumb {
  max-width: 100%; max-height: 100%; border-radius: 3px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.14);
  transition: transform .2s ease;
}
.item .thumb-wrap { position: relative; display: block; flex: none; max-width: 100%; }
.item .thumb-wrap.tall { height: var(--ih); }
.item .thumb-wrap.wide { width: 100%; max-height: var(--ih); }
.item .thumb-wrap .thumb { width: 100%; height: 100%; object-fit: cover; }
.item .play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,.5); backdrop-filter: blur(6px); display: grid; place-items: center;
}
.item .play::after { content: ""; border-left: 10px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; margin-left: 3px; }
.item .label {
  max-width: 100%; padding: 1px 6px; border-radius: 4px; font-size: 12px; line-height: 1.3; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-word;
}
.item .sub { font-size: 11px; color: var(--text-3); margin-top: -4px; }
.item:hover .ic { filter: brightness(1.02); }
.item:hover .label { background: var(--hover); }
.item.selected .label { background: var(--accent); color: #fff; }
.item.selected .thumb, .item.selected .folder { filter: drop-shadow(0 0 0 transparent); }
.item.selected .ic { background: var(--hover); border-radius: 8px; }
.item.tagged .label::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-right: 5px; vertical-align: 1px; }

/* intro banner on root */
.hello {
  display: flex; align-items: center; gap: 18px; margin: 18px 18px 0; padding: 16px 18px; border-radius: 12px;
  background: linear-gradient(110deg, color-mix(in srgb, var(--bubblegum) 16%, transparent), color-mix(in srgb, var(--sky) 14%, transparent) 60%, color-mix(in srgb, var(--lemon) 16%, transparent));
  border: 1px solid var(--border);
}
.hello img { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: 50% 30%; flex: none; box-shadow: 0 0 0 2px var(--win-bg), 0 0 0 3px var(--bubblegum); }
.hello h2 { margin: 0 0 3px; font-size: 18px; letter-spacing: -.01em; }
.hello p { margin: 0; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.hello .hello-cta { margin-left: auto; flex: none; }

/* ---------- List view ---------- */
.list { width: 100%; border-collapse: collapse; font-size: 13px; }
.list th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2);
  padding: 6px 10px; background: var(--win-bg); border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
.list th button { display: inline-flex; gap: 4px; align-items: center; }
.list th button:hover { color: var(--text); }
.list th .arrow { font-size: 9px; color: var(--text-3); }
.list td { padding: 5px 10px; white-space: nowrap; color: var(--text-2); }
.list td:first-child { color: var(--text); width: 52%; }
.list tbody tr:nth-child(even) { background: var(--row-alt); }
.list tbody tr { cursor: pointer; }
.list tbody tr:hover { background: var(--hover); }
.list tbody tr.selected { background: var(--accent); }
.list tbody tr.selected td { color: #fff; }
.list .name { display: flex; align-items: center; gap: 9px; }
.list .name .folder { font-size: 4px; }
.list .name .lthumb { width: 22px; height: 22px; object-fit: cover; border-radius: 3px; box-shadow: 0 0 0 .5px rgba(0,0,0,.2); flex: none; }
.list .tagdots { display: inline-flex; gap: 3px; }
.list .tagdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: block; box-shadow: 0 0 0 1px var(--win-bg); }

/* ---------- Gallery view ---------- */
.gallery { display: flex; flex-direction: column; height: 100%; }
.g-stage { flex: 1; min-height: 0; position: relative; overflow: hidden; }
.g-stage > * { position: absolute; inset: 22px; margin: auto; max-width: calc(100% - 44px); max-height: calc(100% - 44px); }
.g-stage > div { width: max-content; height: max-content; }
.g-stage img, .g-stage video { width: auto; height: auto; border-radius: 4px; cursor: zoom-in; }
.g-stage video { box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.g-stage .folder { font-size: 34px; cursor: pointer; }
.g-cap { text-align: center; font-size: 12px; color: var(--text-2); padding: 0 0 8px; }
.g-cap b { color: var(--text); font-weight: 600; }
.g-strip { flex: none; display: flex; gap: 8px; overflow-x: auto; padding: 10px 14px 14px; border-top: 1px solid var(--border); scroll-snap-type: x proximity; }
.g-thumb { flex: none; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; scroll-snap-align: center; opacity: .75; cursor: pointer; }
.g-thumb img { width: 100%; height: 100%; object-fit: cover; }
.g-thumb .folder { font-size: 9px; }
.g-thumb:hover { opacity: 1; }
.g-thumb.selected { opacity: 1; box-shadow: 0 0 0 2.5px var(--accent); }

/* ---------- Info pane ---------- */
.info .folder { font-size: 26px; margin: 4px auto 16px; }
.info h2 { margin: 0; font-size: 20px; line-height: 1.2; letter-spacing: -.015em; text-align: center; }
.info .kind { text-align: center; color: var(--text-2); font-size: 12px; margin: 4px 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-bottom: 16px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 99px; font-size: 11.5px; font-weight: 500; background: color-mix(in srgb, var(--c) 16%, transparent); cursor: pointer; }
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip:hover { background: color-mix(in srgb, var(--c) 28%, transparent); }
.info-h { font-size: 12px; font-weight: 700; margin: 16px 0 6px; padding-top: 14px; border-top: 1px solid var(--border); }
.info dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0; font-size: 12px; }
.info dt { color: var(--text-2); }
.info dd { margin: 0; text-align: right; }
.info details summary { list-style: none; cursor: pointer; }
.info details summary::-webkit-details-marker { display: none; }
.info details summary::after { content: 'Show'; float: right; font-weight: 500; color: var(--accent); }
.info details[open] summary::after { content: 'Hide'; }
.info p { font-size: 13px; line-height: 1.55; margin: 0 0 10px; color: var(--text); }

/* ---------- About window ---------- */
.about-win { top: 70px; left: calc(50% - 300px); width: min(620px, calc(100vw - 32px)); z-index: 6; }
.about-body { display: flex; gap: 22px; padding: 22px; overflow-y: auto; }
.about-photo { width: 190px; height: 250px; object-fit: cover; border-radius: 8px; flex: none; box-shadow: 0 0 0 .5px rgba(0,0,0,.15); }
.about-hi { margin: 4px 0 0; color: var(--text-2); font-size: 13px; }
.about-name { margin: 0 0 10px; font-size: 30px; letter-spacing: -.025em; line-height: 1.05; }
.about-role { margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.about-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 16px; font-size: 12px; }
.about-dl dt { color: var(--text-2); font-weight: 600; }
.about-dl dd { margin: 0; line-height: 1.45; }
.about-connect { margin: 0 0 8px; font-size: 12px; font-weight: 700; text-transform: lowercase; color: var(--text-2); }
.about-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-btn { display: inline-flex; align-items: center; height: 30px; padding: 0 14px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 600; font-size: 12.5px; }
.pill-btn:hover { filter: brightness(1.08); }
.pill-btn.ghost { background: var(--hover); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }

/* ---------- Dock ---------- */
.dock {
  position: fixed; left: 50%; bottom: 10px; transform: translate(-50%, calc(100% + 14px)); z-index: 40;
  transition: transform .28s cubic-bezier(.2,.8,.2,1) .25s;
  display: flex; align-items: flex-end; gap: 8px; padding: 7px 9px; border-radius: 20px;
  background: var(--dock-bg); backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 0 0 .5px rgba(255,255,255,.35) inset, 0 0 0 .5px rgba(0,0,0,.15), 0 10px 30px rgba(0,0,0,.18);
}
/* Auto-hiding dock: a thin strip along the bottom edge reveals it, like macOS. */
.dock-hot { position: fixed; left: 0; right: 0; bottom: 0; height: 6px; z-index: 41; }
.dock-hot:hover + .dock, .dock:hover, .dock:focus-within { transform: translate(-50%, 0); transition-delay: 0s; }
.dock-item { position: relative; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.dock-ico {
  width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .18s cubic-bezier(.3,.7,.4,1.4);
}
.dock-item:hover .dock-ico { transform: translateY(-8px) scale(1.18); }
.dock-item::before {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 16px); left: 50%; transform: translateX(-50%);
  padding: 3px 9px; border-radius: 6px; background: var(--dropdown-bg); color: var(--text); font-size: 12px; white-space: nowrap;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 4px 12px rgba(0,0,0,.15); opacity: 0; pointer-events: none; transition: opacity .12s;
}
.dock-item:hover::before { opacity: 1; }
.dock-ico svg { width: 100%; height: 100%; }
.ico-finder { background: linear-gradient(90deg, #7fd0ff 0 50%, #e9f4ff 50% 100%); }
.ico-notes img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.ico-mail { background: linear-gradient(180deg, #5ab6ff, #1f7cf5); }
.ico-web { background: linear-gradient(180deg, #8a7bff, #4f3df0); }
.ico-stack { background: linear-gradient(180deg, #fff, #ececf1); position: relative; }
.ico-stack img { position: absolute; width: 30px; height: 30px; object-fit: contain; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.ico-stack img:nth-child(1) { transform: rotate(-12deg) translate(-6px, 2px); }
.ico-stack img:nth-child(2) { transform: rotate(8deg) translate(6px, 0); }
.ico-stack img:nth-child(3) { transform: translateY(-2px); }
.dock-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--text); opacity: 0; margin-top: 3px; }
.dock-dot.on { opacity: .7; }
.dock-sep { width: 1px; align-self: stretch; margin: 4px 2px 8px; background: rgba(127,127,127,.35); }

/* ---------- Quick Look ---------- */
.ql { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 48px 32px 32px; background: rgba(10, 8, 20, .35); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .16s ease; }
.ql[hidden] { display: none; }
.ql-win {
  display: flex; flex-direction: column; max-width: min(1200px, 100%); max-height: 100%; min-width: min(420px, 100%);
  background: rgba(30, 30, 34, .82); backdrop-filter: blur(30px) saturate(160%); -webkit-backdrop-filter: blur(30px) saturate(160%);
  border-radius: 12px; overflow: hidden; color: #f5f5f7;
  box-shadow: 0 0 0 .5px rgba(255,255,255,.18), 0 30px 90px rgba(0,0,0,.55);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.2);
}
.ql-bar { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 8px; flex: none; }
.ql-title { flex: 1; text-align: center; font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-title small { font-weight: 400; color: rgba(255,255,255,.5); margin-left: 8px; }
.ql-btn { width: 30px; height: 28px; border-radius: 6px; display: grid; place-items: center; color: rgba(255,255,255,.8); cursor: pointer; }
.ql-btn:hover { background: rgba(255,255,255,.1); color: #fff; }
.ql-stage { min-height: 0; display: grid; place-items: center; overflow: hidden; }
.ql-stage img, .ql-stage video { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(100vh - 140px); }
.ql-stage video { background: #000; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }

.empty { padding: 60px 20px; text-align: center; color: var(--text-3); }

.mobile-tabs { display: none; gap: 6px; padding: 8px 10px; overflow-x: auto; border-bottom: 1px solid var(--border); background: var(--toolbar-bg); flex: none; scrollbar-width: none; }
.mobile-tabs::-webkit-scrollbar { display: none; }
.mobile-tabs .chip { flex: none; padding: 5px 11px 5px 9px; font-size: 12px; }
.mobile-tabs .chip.active { background: var(--c); color: #fff; }
.mobile-tabs .chip.active::before { background: #fff; }


/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .info { width: 260px; }
}
@media (max-width: 900px) {
  .desk-icons { display: none; }
  .finder { top: 0 !important; left: 0 !important; width: 100vw; height: calc(100dvh - 28px); border-radius: 0; transform: none !important; }
  .about-win { top: 40px !important; left: 16px !important; width: calc(100vw - 32px); max-height: calc(100dvh - 100px); transform: none !important; }
  .content-wrap { flex-direction: column; overflow-y: auto; }
  .content { overflow: visible; flex: none; }
  .content.is-gallery { flex: 1; min-height: 70dvh; }
  .info { order: -1; width: auto; border-left: 0; border-bottom: 1px solid var(--border); padding: 16px; display: grid; grid-template-columns: auto 1fr; gap: 0 16px; overflow: visible; }
  .info > * { grid-column: 2; }
  .info .folder { grid-column: 1; grid-row: 1 / span 3; font-size: 14px; margin: 0; }
  .info h2, .info .kind { text-align: left; }
  .info .chips { justify-content: flex-start; }
  .info .info-h, .info dl, .info details { grid-column: 1 / -1; }
  .dock { display: none; }
  .finder .lights { display: none; }
}
@media (max-width: 720px) {
  .hide-sm { display: none; }
  .sidebar { display: none; }
  .toolbar { gap: 6px; padding: 0 10px; height: 48px; }
  .search { width: 38px; padding: 0 11px; transition: width .2s; }
  .search:focus-within { width: 150px; }
  .win-title { font-size: 13px; }
  .seg-btn { width: 28px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); padding: 14px 10px 24px; gap: 16px 2px; }
  .grid:not(.files) { padding-top: 40px; }
  .grid:not(.files) .item .ic { --ih: 112px; }
  .grid.files { grid-template-columns: repeat(2, 1fr); }
  .item .ic { --ih: 80px; }
  .grid:not(.files) .item .folder { font-size: 20px; }
  .grid:not(.files) .item .doc { font-size: 18px; }
  .grid.files .item .ic { --ih: 150px; }
  .hello { margin: 12px 12px 0; padding: 12px; gap: 12px; flex-wrap: wrap; }
  .hello .hello-cta { margin-left: 0; }
  .list td:nth-child(n+3), .list th:nth-child(n+3) { display: none; }
  .about-body { flex-direction: column; padding: 16px; }
  .about-photo { width: 100%; height: 220px; object-position: 50% 25%; }
  .ql { padding: 12px; }
  .pathbar { display: none; }
  .mobile-tabs { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* Dark-on-transparent logos need a light surface to stay visible. */
.ql.light-stage .ql-win { background: rgba(246, 246, 248, .9); color: #1d1d1f; }
.ql.light-stage .ql-btn { color: rgba(0,0,0,.65); }
.ql.light-stage .ql-btn:hover { background: rgba(0,0,0,.06); color: #000; }
.ql.light-stage .ql-title small { color: rgba(0,0,0,.45); }
/* Transparent artwork has no checkerboard: it sits on the window, except one-colour marks,
   which get a plain contrasting surface so they stay visible in either theme. */
.tone-logo { background-color: #fff !important; }
.tone-light { background-color: #1d1d1f !important; }
.item .thumb.alpha:not(.tone-logo):not(.tone-light), .g-stage img.alpha:not(.tone-logo):not(.tone-light) { background: none; box-shadow: none; border-radius: 0; }
.g-stage img:not(.alpha) { box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 8px 30px rgba(0,0,0,.18); }

/* Tag dots under folder names in icon view */
.item .sub { display: inline-flex; align-items: center; gap: 6px; }
.item .tagdots { display: inline-flex; }
.item .tagdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 1.5px var(--win-bg); margin-left: -2px; display: block; }
.item .tagdots i:first-child { margin-left: 0; }

/* Transparent files peek out of folders as cut-outs: no white sheet, shadow follows the artwork. */
.folder .paper.cutout, .item:hover .folder .paper.cutout, .content:focus .item.selected .folder .paper.cutout { background: none; box-shadow: none; border-radius: 0; overflow: visible; }
.folder .paper.cutout img { object-fit: contain; background: none; filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); }
.item:hover .folder .paper.cutout img, .content:focus .item.selected .folder .paper.cutout img { filter: drop-shadow(0 6px 10px rgba(0,0,0,.3)); }

/* Tag views list files: crumb dot and "in Project" link */
.crumb .tagdot { width: 9px; height: 9px; border-radius: 50%; background: var(--c); }
.cap-link { font: inherit; color: var(--accent); padding: 0; background: none; border: 0; cursor: pointer; }
.cap-link:hover { text-decoration: underline; }

/* PDF documents: badge on the cover, scrollable pages in Quick Look */
.pdf-badge { position: absolute; right: 6px; bottom: 6px; background: #e5483b; color: #fff; font: 700 10px/1 Inter, system-ui, sans-serif; letter-spacing: .06em; padding: 4px 6px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.g-stage .g-pdf { width: max-content; height: max-content; cursor: zoom-in; }
.g-stage .g-pdf img { display: block; max-width: 100%; max-height: calc(100vh - 330px); box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 8px 30px rgba(0,0,0,.18); }
.g-stage .g-pdf .pdf-badge { right: 10px; bottom: 10px; font-size: 12px; }
.ql.pdf-stage .ql-win { width: min(1200px, 100%); }
.ql.pdf-stage .ql-stage { display: block; overflow-y: auto; overscroll-behavior: contain; max-height: calc(100vh - 140px); }
.ql-pdf { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 16px 16px 20px; }
.ql-stage .ql-pdf img { width: 100%; max-width: 1120px; height: auto; max-height: none; border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.ql-pdf-open { position: sticky; bottom: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
