/* DeepDriveFLUSH v1 — web app styles.
   Cloned from the DeepGearFLUSH design tokens (brief §2):
   pure-black background, steel-blue accent, flat tool panels,
   3-pane layout: sidebar 216px / center / inspector 272px. */

/* Self-hosted FLUSH fonts (same files as GearFlush): variable woff2,
   latin subset, font-display: swap. Files live in web/fonts/. */
@font-face { font-family: "Unbounded"; src: url("../fonts/Unbounded.woff2") format("woff2"); font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/InstrumentSans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono.woff2") format("woff2"); font-weight: 100 800; font-display: swap; }

:root {
  /* Steel is the default identity: steel blue for the tool's working
     accent, amber reserved for warnings (quota nearly full). */
  --bg: #000000;
  --bg-base: #0a0f14;
  --pane: rgba(17, 23, 30, 0.92);
  --pane-solid: #11171e;
  --center-bg: rgba(14, 19, 26, 0.90);
  --hairline: #1d2733;
  --divider: rgba(255, 255, 255, 0.2);
  --accent: #35618e;
  --accent-deep: #24425f;
  --accent-light: #8fb8dd;
  --accent-border: #4a7ca8;
  --accent-rgb: 53, 97, 142;
  --warn: #f59e0b;
  --text: #ebebf0;
  --dim: #b2b2c0;
  --muted: #8a8a9a;
  --sel-blue: #0a84ff;
  --danger: #7f1d1d;
  --danger-border: #b93c3c;
  --danger-fill: #78242c;
  --btn-fill: #1c2632;
  --btn-border: #3a4a5c;
  --radius: 16px;
  /* Pane sizes — the three draggable separators write these (app.js,
     persisted in localStorage). Defaults match the original layout. */
  --sbw: 216px;
  --insw: 272px;
  --charth: 38vh;
  /* FLUSH family type system (shared with GearFlush, set 2026-11-01):
     Unbounded for display, Instrument Sans for body, JetBrains Mono for
     file data. All OFL, self-hosted variable fonts (see @font-face at
     the top of this file); the system stacks stay as fallbacks. */
  --font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Unbounded", "Instrument Sans", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---------- Themes (Settings → Customize, persisted as ddf.settings) ----------
   Each theme is a full identity: background tint, pane tint, hairlines,
   button fills and the whole accent family shift together. The accent
   drives buttons, splitters, scrollbars, badges, the logo glow and the
   rain tint via --accent / --accent-rgb, so everything follows at once.
   Default (no data-theme / "steel") is the :root set above. */
html[data-theme="cyan"] {
  --bg: #020608; --bg-base: #050f16;
  --pane: rgba(9, 25, 34, 0.92); --pane-solid: #0a1a24;
  --center-bg: rgba(7, 20, 28, 0.90); --hairline: #10303f;
  --accent: #0e7490; --accent-deep: #155e75; --accent-light: #22d3ee; --accent-border: #06b6d4;
  --btn-fill: #122b38; --btn-border: #2e4d5f;
  --accent-rgb: 6, 182, 212;
}
html[data-theme="ember"] {
  --bg: #060302; --bg-base: #140b05;
  --pane: rgba(30, 19, 11, 0.92); --pane-solid: #20140c;
  --center-bg: rgba(26, 16, 9, 0.90); --hairline: #38220f;
  --accent: #b45309; --accent-deep: #92400e; --accent-light: #fbbf24; --accent-border: #d97706;
  --btn-fill: #2e1d0e; --btn-border: #5a4023;
  --accent-rgb: 217, 119, 6;
}
html[data-theme="crimson"] {
  --bg: #070203; --bg-base: #150408;
  --pane: rgba(33, 11, 16, 0.92); --pane-solid: #210b10;
  --center-bg: rgba(28, 9, 13, 0.90); --hairline: #3a1219;
  --accent: #e11d48; --accent-deep: #9f1239; --accent-light: #fb7185; --accent-border: #f43f5e;
  --btn-fill: #30121a; --btn-border: #5c2733;
  --accent-rgb: 225, 29, 72;
}
/* Violet survives only as an opt-in theme — it is no longer the lead. */
html[data-theme="violet"] {
  --bg: #000000; --bg-base: #0b0b10;
  --pane: rgba(21, 21, 28, 0.92); --pane-solid: #15151c;
  --center-bg: rgba(18, 18, 24, 0.90); --hairline: #1c1c22;
  --accent: #7c3aed; --accent-deep: #5b21b6; --accent-light: #a78bfa; --accent-border: #9364fa;
  --btn-fill: #26262e; --btn-border: #464654;
  --accent-rgb: 124, 58, 237;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  overflow: hidden;
}
::selection { background: var(--accent); color: #fff; }

/* Visible focus everywhere — keyboard users always see where they are. */
:focus-visible { outline: 2px solid var(--accent-light); outline-offset: 2px; }

/* Scrollbars stay black like the rest of the app — the OS default
   light-gray bars were the brightest thing on screen (his Oct 30 shot).
   Thin dark thumb on a black track; accent on hover, theme-matched. */
* { scrollbar-width: thin; scrollbar-color: #2c2c36 #050507; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #050507; }
::-webkit-scrollbar-thumb { background: #2c2c36; border-radius: 6px; border: 2px solid #050507; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }
::-webkit-scrollbar-corner { background: #050507; }
button, input { font-family: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
a { color: var(--accent-light); }
.muted { color: var(--muted); }

/* ---------- App grid: sidebar | split | center | split | inspector ---------- */
/* The center is minmax(0, 1fr) on purpose: it must be able to SHRINK below
   its content's preferred width, or the whole grid overflows the window and
   the panes get clipped with a horizontal scrollbar (the Oct 30 bug). */
#app {
  display: grid;
  grid-template-columns: var(--sbw) 8px minmax(0, 1fr) 8px var(--insw);
  grid-template-rows: minmax(0, 1fr) auto auto;
  height: 100vh;
}
#sidebar { grid-row: 1; grid-column: 1; }
#splitLeft { grid-row: 1; grid-column: 2; }
#center { grid-row: 1; grid-column: 3; }
#splitRight { grid-row: 1; grid-column: 4; }
#inspector { grid-row: 1; grid-column: 5; }
#breadcrumb { grid-row: 2; grid-column: 1 / -1; }
#statusBar { grid-row: 3; grid-column: 1 / -1; }

/* ---------- Draggable separators ---------- */
.splitter { position: relative; z-index: 5; touch-action: none; }
.splitter-v { cursor: col-resize; }
.splitter-h { cursor: row-resize; height: 12px; flex: 0 0 auto; margin: 1px 18px -3px; }
.splitter::after {
  content: ""; position: absolute;
  background: linear-gradient(180deg, transparent, rgba(var(--accent-rgb), 0.6), transparent);
  opacity: 0.3; transition: opacity 0.15s ease;
}
.splitter-v::after { top: 0; bottom: 0; left: 50%; width: 2px; transform: translateX(-50%); }
.splitter-h::after {
  left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%);
  background: linear-gradient(90deg, transparent, rgba(var(--accent-rgb), 0.6), transparent);
}
.splitter:hover::after, .splitter.dragging::after { opacity: 1; }
.splitter:focus-visible { outline: 2px solid var(--accent-border); outline-offset: -2px; }
.splitter:focus-visible::after { opacity: 1; }

/* Reduced motion: no breathing logo, no transitions (standing rule). */
@media (prefers-reduced-motion: reduce) {
  .logo-mark::after { animation: none; }
  .btn, .tm-cell, .quota-fill, .splitter::after { transition: none; }
}

/* ---------- Sidebar ---------- */
#sidebar {
  background: var(--bg-base);
  border-right: 1px solid var(--hairline);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
/* flex-wrap is the badge fix: mark + title + DEMO badge need more room than
   a narrow sidebar has, so the badge wraps under the title instead of
   sliding under the center pane and getting clipped (the Oct 30 bug). */
.logo-block { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.logo-text { min-width: 0; }
.logo-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  position: relative;
  border-radius: 10px;
  background: radial-gradient(circle at 35% 30%, var(--accent-light), var(--accent) 55%, var(--accent-deep));
  box-shadow: 0 0 12px rgba(var(--accent-rgb), 0.35);
}
/* The breathing glow sits on its own layer and animates OPACITY only.
   The old version animated box-shadow itself, which repaints on the CPU
   every single frame — that's what dragged the screen to ~3-4 fps.
   Same pulse, same timing; the compositor (GPU) does the work now. */
.logo-mark::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(var(--accent-rgb), 0.7);
  opacity: 0;
  pointer-events: none;
  animation: logo-breathe 3.2s ease-in-out infinite;
}
@keyframes logo-breathe {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}
.logo-title { font-family: var(--display); font-size: 12px; font-weight: 600; letter-spacing: 0.3px; white-space: nowrap; }
.logo-mark .lg-b { fill: var(--accent-light); }
.logo-mark .lg-c { fill: var(--accent); }
.logo-title span { color: inherit; } /* one-colour headline — no accent word */
.logo-byline { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.badge {
  margin-left: auto;
  font-family: var(--mono); font-size: 10px; font-weight: 700;
  padding: 3px 7px; border-radius: 999px; letter-spacing: 0.5px;
}
.badge.demo { background: rgba(245, 158, 11, 0.16); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.45); }
.badge.live { background: rgba(52, 211, 153, 0.16); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.45); }

.side-heading {
  font-size: 12px; font-weight: 600;
  color: var(--muted); margin-bottom: 8px;
}
.location {
  background: var(--pane);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 10px 12px;
}
.location.active { border-color: rgba(var(--accent-rgb), 0.55); }
.loc-name { font-weight: 700; }
.loc-quota { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 4px; }
.quota-bar { height: 5px; border-radius: 3px; background: #26262e; margin-top: 7px; overflow: hidden; }
.quota-fill { height: 100%; background: var(--accent); border-radius: 3px; transition: width 0.4s ease; }
/* Amber means something here: the drive is 85%+ full (set in renderSidebar). */
.quota-fill.warn { background: var(--warn); }
.loc-trash { font-family: var(--mono); font-size: 11px; color: var(--muted); margin-top: 6px; }

.side-tab {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 1px solid transparent; border-radius: 10px;
  color: var(--dim); padding: 8px 12px; font-size: 13.5px; margin-bottom: 2px;
}
.side-tab:hover { background: var(--pane-solid); color: var(--text); }
.side-tab.active { background: rgba(var(--accent-rgb), 0.18); color: #fff; border-color: rgba(var(--accent-rgb), 0.4); }

.side-actions { display: flex; flex-direction: column; gap: 8px; }
.side-stats {
  margin-top: auto;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--hairline); padding-top: 12px; line-height: 1.7;
}

/* ---------- Buttons ---------- */
.btn {
  background: var(--btn-fill); color: var(--text);
  border: 1px solid var(--btn-border); border-radius: 999px;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
  transition: filter 0.15s ease, transform 0.05s ease;
}
.btn:hover { filter: brightness(1.25); }
.btn:active { filter: brightness(0.78); }
.btn.primary { background: var(--accent); border-color: var(--accent-border); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger-border); color: #fff; }
.btn.connect { background: var(--accent-deep); border-color: var(--accent-border); color: #fff; }
.btn.ghost { background: transparent; }
.icon-btn {
  background: var(--btn-fill); color: var(--text);
  border: 1px solid var(--btn-border); border-radius: 8px;
  width: 30px; height: 30px; font-size: 18px; line-height: 1;
}
.icon-btn:hover { filter: brightness(1.3); }

/* ---------- Center ---------- */
#center {
  background: var(--center-bg);
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}
#centerHeader { padding: 14px 18px 10px; }
.nav-row { display: flex; align-items: center; gap: 8px; }
.last-scan { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }

/* Segmented pill toggle: one glass capsule, active pill white + dark text */
.seg-toggle {
  display: inline-flex;
  background: rgb(20, 20, 28);
  border: 1px solid rgb(56, 56, 68);
  border-radius: 15px;
  padding: 2px;
  margin-left: 8px;
}
.seg-btn {
  border: 0; background: transparent; color: rgb(190, 190, 205);
  font-size: 12.5px; font-weight: 600;
  padding: 5px 14px; border-radius: 13px;
}
.seg-btn.active { background: rgb(240, 240, 246); color: rgb(10, 10, 14); }

#viewTitle { font-family: var(--display); font-size: 17px; font-weight: 600; margin: 12px 0 2px; }
.view-path { font-size: 11.5px; color: rgba(255, 255, 255, 0.62); }
.view-stats { font-family: var(--mono); font-size: 11.5px; color: var(--dim); margin-top: 6px; }

/* ---------- Chart area ---------- */
#chartWrap {
  position: relative;
  margin: 0 18px;
  background: var(--center-bg);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  min-height: 140px;
  height: var(--charth);
  flex: 0 0 auto;
  overflow: hidden;
}
#rainCanvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.5; transform: translateZ(0); }
#chart { position: absolute; inset: 0; }
.chart-empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--muted); font-size: 13px;
}

/* Treemap cells */
.tm-cell {
  position: absolute;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: outline 0.1s ease;
}
.tm-cell:hover { outline: 1.5px solid rgba(255, 255, 255, 0.85); outline-offset: -1.5px; }
.tm-cell.selected { outline: 2.5px solid #fff; outline-offset: -2.5px; z-index: 2; }
.tm-head {
  font-size: 12px; font-weight: 600; color: #fff;
  padding: 3px 7px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.tm-size {
  font-family: var(--mono); font-size: 10.5px; color: rgba(255, 255, 255, 0.88);
  padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.tm-inner { position: absolute; inset: 0; }
.tm-folder-label {
  height: 18px; line-height: 18px;
  font-size: 12px; font-weight: 600; color: #fff;
  padding: 0 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Sunburst */
#chart svg { display: block; width: 100%; height: 100%; }
.sun-seg { cursor: pointer; stroke: rgb(8, 8, 10); stroke-width: 1; }
.sun-seg:hover { stroke: rgba(255, 255, 255, 0.85); stroke-width: 1.5; }
.sun-seg.selected { stroke: #fff; stroke-width: 3; }
.sun-label { font-size: 11px; font-weight: 600; fill: #fff; pointer-events: none; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }

/* ---------- Contents list ---------- */
#contentsWrap {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  margin: 12px 18px 14px;
  background: var(--pane);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  overflow: hidden;
}
.contents-head {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-bottom: 1px solid var(--hairline);
  font-family: var(--display); font-size: 11.5px; font-weight: 600;
}
.contents-head #filterBox { font-family: var(--font); letter-spacing: normal; }
#filterBox {
  margin-left: auto;
  background: rgb(8, 8, 10); color: var(--text);
  border: 1px solid var(--btn-border); border-radius: 999px;
  padding: 6px 12px; font-size: 12.5px; width: 220px; max-width: 38%; outline: none;
}
#filterBox:focus { border-color: var(--accent-border); }
#contentsList { flex: 1; overflow-y: auto; overflow-x: hidden; }
.cl-row {
  display: grid;
  /* minmax(0, 1fr) on the name: it gives up its width first (ellipsis
     handles the text) instead of forcing a horizontal scrollbar. */
  grid-template-columns: minmax(0, 1fr) 78px 96px 48px 118px;
  gap: 8px; align-items: center;
  padding: 7px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 13px; cursor: pointer;
}
.cl-row:hover { background: rgba(var(--accent-rgb), 0.08); }
.cl-row.selected { background: rgba(10, 132, 255, 0.18); }
.cl-row.header {
  position: sticky; top: 0; z-index: 1;
  background: rgb(8, 8, 10); color: var(--muted);
  font-size: 11.5px; font-weight: 600;
  cursor: default; padding: 8px 14px;
}
.cl-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cl-name .kind-icon { margin-right: 7px; }
.cl-size, .cl-files { font-family: var(--mono); font-size: 12px; text-align: right; }
.cl-kind, .cl-modified { color: var(--dim); font-size: 12.5px; }
.cl-modified { font-family: var(--mono); font-size: 11.5px; }
.cl-empty { padding: 24px; text-align: center; color: var(--muted); }
.cl-row .row-trash {
  grid-column: 5; justify-self: end;
  background: transparent; border: 1px solid var(--danger-border);
  color: #fca5a5; border-radius: 999px; font-size: 11.5px; padding: 3px 10px;
}
.cl-row .row-trash:hover { background: var(--danger); color: #fff; }

/* Biggest / duplicates lists reuse the contents list styles */
.big-row { grid-template-columns: minmax(0, 1fr) 78px minmax(0, 1fr) 118px 96px; }
.dup-group { border-bottom: 1px solid var(--hairline); padding: 10px 14px; }
.dup-group-head { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.dup-group-head .dup-size { font-family: var(--mono); font-weight: 400; color: var(--dim); margin-left: 8px; }
.dup-file { display: flex; gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.dup-file .dup-path { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dup-file .dup-name { font-weight: 600; white-space: nowrap; }

/* ---------- Inspector ---------- */
#inspector {
  background: rgb(5, 5, 7);
  border-left: 1px solid var(--hairline);
  padding: 16px 14px;
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
}
.insp-name { font-family: var(--display); font-size: 13px; font-weight: 600; line-height: 1.45; word-break: break-word; }
.insp-path { font-size: 10.5px; color: rgba(255, 255, 255, 0.62); margin-top: 4px; word-break: break-all; }
.insp-rows { margin-top: 14px; border-top: 1px solid var(--hairline); }
.insp-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 13px;
}
.insp-row .k { color: var(--muted); }
.insp-row .v { font-family: var(--mono); font-size: 12px; text-align: right; word-break: break-all; }
.insp-heading {
  font-size: 12px; font-weight: 600;
  color: var(--muted); margin: 18px 0 8px;
}
.lc-row {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 5px 6px; border-radius: 6px; font-size: 12.5px; cursor: pointer;
}
.lc-row:hover { background: rgba(var(--accent-rgb), 0.12); }
.lc-row .lc-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lc-row .lc-size { font-family: var(--mono); font-size: 11.5px; color: var(--dim); flex: 0 0 auto; }
.insp-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.insp-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }

/* ---------- Breadcrumb + status bar ---------- */
#breadcrumb {
  background: rgb(17, 17, 23);
  border-top: 1px solid var(--hairline);
  padding: 7px 14px;
  font-size: 12.5px;
  display: flex; align-items: center; gap: 4px;
  overflow-x: auto; white-space: nowrap;
}
#breadcrumb button {
  background: none; border: 0; color: rgba(255, 255, 255, 0.62);
  font-size: 12.5px; padding: 2px 4px; border-radius: 4px;
}
#breadcrumb button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
#breadcrumb button.current { color: #fff; font-weight: 700; }
#breadcrumb button.selected-node { color: var(--accent-light); font-weight: 700; }
#breadcrumb .sep { color: rgba(255, 255, 255, 0.4); }
#statusBar {
  background: var(--pane-solid);
  padding: 6px 14px;
  font-size: 11px; color: rgba(255, 255, 255, 0.75);
}

/* ---------- Modals ---------- */
/* BUGFIX: author `display` on .modal-backdrop beats the browser's built-in
   [hidden] { display: none }, so every modal stayed visible forever and
   Close / Escape / backdrop clicks could never hide one. This rule restores it. */
[hidden] { display: none !important; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(0, 0, 0, 0.65);
  display: grid; place-items: center;
  backdrop-filter: blur(3px);
}
.modal {
  width: 420px; max-width: calc(100vw - 32px); max-height: 80vh;
  background: var(--pane-solid);
  border: 1px solid var(--btn-border); border-radius: var(--radius);
  padding: 20px; overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}
.modal.wide { width: 560px; }
.modal h2 { margin: 0 0 10px; font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 1.4; }
.modal p { line-height: 1.55; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.folder-picker { border: 1px solid var(--hairline); border-radius: 10px; max-height: 300px; overflow-y: auto; padding: 6px; }
.fp-row {
  display: block; width: 100%; text-align: left;
  background: transparent; border: 0; color: var(--text);
  padding: 7px 10px; border-radius: 8px; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.fp-row:hover { background: rgba(var(--accent-rgb), 0.12); }
.fp-row.selected { background: rgba(10, 132, 255, 0.22); }

/* ---------- Toast ---------- */
#toast {
  position: fixed; bottom: 52px; left: 50%; transform: translateX(-50%);
  background: var(--pane-solid); border: 1px solid var(--accent-border);
  color: var(--text); border-radius: 999px; padding: 9px 18px;
  font-size: 13px; z-index: 60; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55);
}

/* Narrow windows: slimmer default panes (the separators can still be
   dragged wider; a saved layout wins over these defaults). */
@media (max-width: 1100px) {
  :root { --sbw: 196px; --insw: 236px; }
}

/* ---------- Settings / Customize ---------- */
.settings-modal { width: 430px; }
.set-label {
  font-size: 12px; font-weight: 600;
  color: var(--muted); margin: 18px 0 8px;
}
.set-label:first-of-type { margin-top: 4px; }
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--btn-fill); border: 1px solid var(--btn-border);
  color: var(--text); border-radius: 12px; padding: 10px 12px;
  font-size: 13px; font-weight: 600; text-align: left;
}
.theme-card .swatches { display: inline-flex; }
.theme-card .swatches i {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.45);
}
.theme-card .swatches i + i { margin-left: -5px; }
.theme-card.active { border-color: var(--accent-border); box-shadow: 0 0 0 1px var(--accent-border); }
.opt-row { display: flex; gap: 8px; }
.opt-btn {
  flex: 1; background: var(--btn-fill); border: 1px solid var(--btn-border);
  color: var(--dim); border-radius: 999px; padding: 8px 6px;
  font-size: 12.5px; font-weight: 600;
}
.opt-btn.active { background: var(--accent); border-color: var(--accent-border); color: #fff; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--btn-fill); border: 1px solid var(--btn-border);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; font-weight: 600;
}
.switch-row small { display: block; font-weight: 400; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-row .switch {
  flex: none; width: 40px; height: 22px; border-radius: 999px;
  background: #33333e; border: 1px solid var(--btn-border); position: relative;
  transition: background 0.15s ease;
}
.switch-row .switch::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px; border-radius: 50%; background: #cfcfe0;
  transition: transform 0.15s ease;
}
.switch-row input:checked + .switch { background: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(18px); background: #fff; }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent-border); outline-offset: 2px; }
.set-note { font-size: 12px; margin: 14px 0 0; }

/* ---------- Custom cursor (Dot / Orb / Ring; Native = system) ----------
   GPU-cheap by construction: two fixed layers moved with transform only,
   opacity for show/hide. The dot carries a bright core ring + dark edge
   so it never blends into the theme accent behind it. Fine pointers
   only — touch keeps the native experience. */
#cursorFX {
  position: fixed; left: 0; top: 0; width: 0; height: 0;
  z-index: 9999; pointer-events: none;
}
#cursorFX .fx-dot, #cursorFX .fx-ring {
  position: absolute; left: 0; top: 0; border-radius: 50%;
  will-change: transform; /* centered by their negative margins; app.js moves them with translate() */
}
#cursorFX .fx-dot {
  width: 10px; height: 10px; margin: -5px 0 0 -5px;
  background: var(--accent-light);
  border: 1.5px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0 0 0 1.5px rgba(255, 255, 255, 0.85);
}
#cursorFX .fx-ring {
  width: 34px; height: 34px; margin: -17px 0 0 -17px;
  border: 2px solid var(--accent-light); opacity: 0.85;
}
html[data-cursor="dot"] #cursorFX .fx-ring { display: none; }
html[data-cursor="ring"] #cursorFX .fx-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; }
html[data-cursor="orb"] #cursorFX .fx-ring { width: 40px; height: 40px; margin: -20px 0 0 -20px; opacity: 0.6; }
@media (hover: hover) and (pointer: fine) {
  html[data-cursor="dot"] *, html[data-cursor="orb"] *, html[data-cursor="ring"] * { cursor: none !important; }
  html[data-cursor="dot"] input, html[data-cursor="dot"] textarea,
  html[data-cursor="orb"] input, html[data-cursor="orb"] textarea,
  html[data-cursor="ring"] input, html[data-cursor="ring"] textarea { cursor: text !important; }
}

/* ---------- Animations OFF (fleet default; master toggle in Customize) ----------
   Ambient motion only: the logo pulse and the rain stop, and the cursor
   snaps instead of gliding (handled in app.js). Interaction feedback
   (hovers, presses) is not ambient and stays. */
html.anim-off .logo-mark::after { animation: none; opacity: 0; }
html.anim-off #rainCanvas { display: none; }

/* ---------- Phone layout (≤820px) ----------
   The desktop grid needs sidebar + inspector + separators (~500px)
   before the center gets anything, so on a phone the center was
   crushed to zero — left and right visible, no middle. Phones get one
   scrolling column in task order instead: sidebar (compact) →
   breadcrumb → chart + contents → inspector. Separators retire, the
   table trims to name + size, targets stay ≥44px, safe-area counts.
   Desktop is untouched. */
@media (max-width: 820px) {
  body { overflow-y: auto; }
  #app { display: flex; flex-direction: column; height: auto; min-height: 100dvh; }
  .splitter { display: none; }

  /* Sidebar becomes a compact top block; views turn into a tab row */
  #sidebar { order: 1; overflow: visible; padding: 14px 14px 12px; gap: 12px; }
  #sidebar .side-section:nth-of-type(3) { display: flex; flex-wrap: wrap; gap: 8px; }
  #sidebar .side-section:nth-of-type(3) .side-heading { flex: 0 0 100%; }
  #sidebar .side-section:nth-of-type(3) .side-tab { flex: 1 1 0; min-height: 44px; text-align: center; }
  .side-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .side-actions .btn { min-height: 44px; width: 100%; }
  #btnScan, #btnConnect { grid-column: 1 / -1; }

  /* Breadcrumb rides above the center and scrolls sideways if long */
  #breadcrumb { order: 2; overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* Center: full width, natural height, the page scrolls */
  #center { order: 3; overflow: visible; }
  #centerHeader { padding: 12px 14px 8px; }
  .icon-btn { width: 40px; height: 40px; }
  .seg-btn { padding: 9px 14px; }
  .last-scan { display: none; }
  #chartWrap { height: 290px; margin: 0 12px; }
  #contentsWrap { flex: none; margin: 12px 12px 14px; }
  .contents-head { flex-wrap: wrap; }
  #filterBox { flex: 1 0 100%; width: 100%; max-width: none; margin-left: 0; min-height: 40px; }
  #contentsList { flex: none; overflow: visible; }
  .cl-row { grid-template-columns: minmax(0, 1fr) 74px; padding: 11px 12px; }
  .cl-row.big-row { grid-template-columns: minmax(0, 1fr) 74px 58px; }
  .cl-kind, .cl-files, .cl-modified { display: none; }
  .cl-row .row-trash { padding: 5px 8px; }

  /* Inspector becomes a full-width section under the contents */
  #inspector { order: 4; overflow: visible; border-left: 0; border-top: 1px solid var(--hairline); padding: 16px 14px 22px; }
  .insp-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .insp-actions .btn { min-height: 44px; width: 100%; }
  #btnZoom { grid-column: 1 / -1; }

  #statusBar { order: 5; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  .modal { padding: 16px; }
}
