/*
 * The board: a cropped piece of the Folderplane interface (data-ui). Values follow the app's own
 * tokens and modules in web/src/styles/tokens.css, web/src/board and web/src/frames, so its
 * borders, shadows, glass and radii are the product's, not the page's.
 */
/* taste-skill-ignore-file: product interface fragment */

.board {
  --board: #09090b;
  --board-grid: rgb(255 255 255 / 0.055);
  --surface: #111113;
  --surface-raised: #1a1a1d;
  --surface-sunken: #0d0d0f;
  --surface-overlay: rgb(24 24 27 / 0.94);
  --glass: rgb(22 22 25 / 0.66);
  --field: rgb(255 255 255 / 0.055);
  --hover: rgb(255 255 255 / 0.055);
  --line-soft: rgb(255 255 255 / 0.05);
  --line: rgb(255 255 255 / 0.08);
  --line-strong: rgb(255 255 255 / 0.14);
  --text: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-faint: #6b6b74;
  --primary: #f4f4f5;
  --primary-on: #0b0b0d;
  --accent: #3b8bff;
  --accent-on: #ffffff;
  --accent-on-muted: color-mix(in srgb, #fff 72%, transparent);
  --focus-ring: rgb(59 139 255 / 0.8);
  --selection: rgb(59 139 255 / 0.16);
  --selection-line: rgb(59 139 255 / 0.6);
  --guide: #ff4fa3;
  --group-fill: color-mix(in srgb, var(--text) 3%, transparent);
  --group-line: color-mix(in srgb, var(--text) 12%, transparent);
  --type-folder: #5aa2ff;
  --type-folder-back: #2f6fd6;
  --type-image: #3ecf8e;
  --type-text: #9b9ba5;
  --paper: #f4f4f5;
  --paper-fold: #c9c9cf;
  --shadow-object: 0 0 0 1px var(--line), inset 0 1px 0 rgb(255 255 255 / 0.04), 0 10px 30px -6px rgb(0 0 0 / 0.55), 0 2px 6px rgb(0 0 0 / 0.3);
  --shadow-object-active: 0 18px 44px -8px rgb(0 0 0 / 0.65), 0 3px 10px rgb(0 0 0 / 0.35);
  --shadow-panel: 0 0 0 1px rgb(255 255 255 / 0.1), inset 0 1px 0 rgb(255 255 255 / 0.07), 0 16px 40px -8px rgb(0 0 0 / 0.6), 0 4px 12px rgb(0 0 0 / 0.3);
  --shadow-lift: inset 0 0 0 1px var(--line), 0 10px 22px -10px rgb(0 0 0 / 0.7);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: linear(0, 0.012 0.6%, 0.05 1.3%, 0.2 2.8%, 0.42 4.6%, 0.63 6.5%, 0.79 8.5%, 0.9 10.6%, 0.97 12.8%, 1.015 15.2%, 1.035 17.8%, 1.04 20.5%, 1.032 24%, 1.015 29%, 1.003 35%, 0.998 43%, 1);
  --zoom: 1;

  position: relative;
  height: clamp(560px, 82svh, 900px);
  overflow: hidden;
  border-radius: 14px;
  background: var(--board);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: -0.011em;
  -webkit-user-select: none;
  user-select: none;
  box-shadow: 0 0 0 1px var(--line);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .board {
    --board: #f2f2f4;
    --board-grid: rgb(0 0 0 / 0.07);
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --surface-sunken: #f6f6f8;
    --surface-overlay: rgb(255 255 255 / 0.96);
    --glass: rgb(255 255 255 / 0.72);
    --field: rgb(0 0 0 / 0.045);
    --hover: rgb(0 0 0 / 0.045);
    --line-soft: rgb(0 0 0 / 0.05);
    --line: rgb(0 0 0 / 0.08);
    --line-strong: rgb(0 0 0 / 0.14);
    --text: #18181b;
    --text-muted: #5b5b63;
    --text-faint: #8e8e96;
    --primary: #18181b;
    --primary-on: #ffffff;
    --accent: #1f74ff;
    --focus-ring: rgb(31 116 255 / 0.7);
    --guide: #e0217f;
    --type-folder: #4a95ff;
    --type-folder-back: #2d72e0;
    --type-image: #12a26a;
    --type-text: #7b7b85;
    --paper: #ffffff;
    --paper-fold: #d4d4da;
    --shadow-object: 0 0 0 1px var(--line), 0 10px 28px -8px rgb(20 20 30 / 0.14), 0 1px 3px rgb(20 20 30 / 0.08);
    --shadow-object-active: 0 18px 44px -10px rgb(20 20 30 / 0.22), 0 2px 8px rgb(20 20 30 / 0.1);
    --shadow-panel: 0 0 0 1px rgb(0 0 0 / 0.07), inset 0 1px 0 rgb(255 255 255 / 0.8), 0 12px 32px -8px rgb(20 20 30 / 0.18), 0 2px 6px rgb(20 20 30 / 0.08);
    --shadow-lift: inset 0 0 0 1px var(--line), 0 10px 22px -10px rgb(20 20 30 / 0.25);
  }
}
:where(.board) :where(button) { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: default; }
:where(.board) .ic { display: block; flex: none; }

/* ---------- Viewport, grid, world ---------- */

.bd-viewport { position: absolute; inset: 0; outline: none; cursor: default; touch-action: pan-y; }
.bd-viewport[data-marquee] { cursor: crosshair; }
.bd-viewport[data-pan], .bd-viewport[data-pan] * { cursor: grab !important; }
.bd-viewport:focus-visible { box-shadow: inset 0 0 0 2px var(--focus-ring); }
.bd-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--board-grid) 1px, transparent 1.25px);
  pointer-events: none;
  transition: opacity 200ms;
}
.bd-world { position: absolute; top: 0; left: 0; width: 0; height: 0; transform-origin: 0 0; }
.bd-guides { position: absolute; inset: 0; z-index: 100000; pointer-events: none; }
.guide { position: absolute; background: var(--guide); }
.guide[data-axis="x"] { width: calc(1px / var(--zoom)); margin-left: calc(-0.5px / var(--zoom)); }
.guide[data-axis="y"] { height: calc(1px / var(--zoom)); margin-top: calc(-0.5px / var(--zoom)); }
.bd-marquee {
  position: absolute;
  display: none;
  z-index: 40;
  border: 1px solid var(--selection-line);
  border-radius: 2px;
  background: var(--selection);
  pointer-events: none;
}

/* ---------- Objects (ObjectFrame.module.css) ---------- */

.bo { position: absolute; }
.bo-label {
  position: absolute;
  bottom: 100%;
  left: 0;
  display: flex;
  align-items: center;
  max-width: calc(100% * min(1, var(--zoom)));
  height: 31px;
  padding-bottom: 6px;
  transform: scale(max(1, calc(1 / var(--zoom))));
  transform-origin: bottom left;
}
.bo-tab {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 25px;
  padding-right: 1px;
  border-radius: 9px;
  transition: background-color 200ms, color 200ms;
}
.bo-tab:hover { background: color-mix(in srgb, var(--text) 8%, var(--board)); }
.bo[data-selected] .bo-tab { background: var(--accent); color: var(--accent-on); }
.bo-handle {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 100%;
  padding: 0 9px 0 8px;
  border-radius: inherit;
  color: var(--text-muted);
  cursor: grab !important;
  text-align: left;
  touch-action: none;
}
.bo:hover .bo-handle { color: var(--text); }
.bo[data-selected] .bo-handle { color: inherit; }
.bo[data-dragging] .bo-handle, .bo-handle:active { cursor: grabbing !important; }
.bo-handle:focus-visible { outline: none; }
.bo-tab:has(> .bo-handle:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.bo-icon { display: grid; flex: none; place-items: center; }
.bo-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 600; letter-spacing: -0.011em; }
.bo-sub { flex: none; color: var(--text-faint); font-size: 12.5px; white-space: nowrap; }
.bo[data-selected] .bo-sub { color: var(--accent-on-muted); }
.bo-actions { display: none; flex: none; }
.bo:hover .bo-actions, .bo[data-selected] .bo-actions, .bo-label:focus-within .bo-actions { display: flex; }
.bo-act { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 7px; color: var(--text-muted) !important; }
.bo[data-selected] .bo-act { color: var(--accent-on) !important; }
.bo-act:hover { background: var(--hover); }
.bo[data-selected] .bo-act:hover { background: color-mix(in srgb, #fff 18%, transparent); }
.bo[data-detail="map"]:not([data-kind="group"]) .bo-label { visibility: hidden; }

.bo-body {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: min(64px, clamp(calc(6px / var(--zoom)), 10px, calc(14px / var(--zoom))));
  background: var(--surface);
  box-shadow: var(--shadow-object);
  container: object / size;
  transition: box-shadow 200ms var(--ease-out);
}
.bo[data-selected] .bo-body {
  box-shadow:
    0 0 0 calc(2px / var(--zoom)) var(--accent),
    0 0 0 calc(6px / var(--zoom)) color-mix(in srgb, var(--accent) 14%, transparent),
    var(--shadow-object-active);
}
.bo[data-kind="note"] .bo-body { background: var(--surface-raised); }
.bo[data-kind="group"] .bo-body {
  border-radius: 18px;
  background: var(--group-fill);
  box-shadow: inset 0 0 0 calc(1px / var(--zoom)) var(--group-line);
}
.bo[data-kind="group"][data-selected] .bo-body { box-shadow: inset 0 0 0 calc(2px / var(--zoom)) var(--accent); }

.bo-rs { --grip: calc(8px / var(--zoom)); position: absolute; z-index: 3; display: none; }
.bo[data-selected][data-detail="full"] .bo-rs { display: block; }
.bo-n, .bo-s { left: var(--grip); right: var(--grip); height: var(--grip); cursor: ns-resize; }
.bo-e, .bo-w { top: var(--grip); bottom: var(--grip); width: var(--grip); cursor: ew-resize; }
.bo-n { top: calc(var(--grip) / -2); }
.bo-s { bottom: calc(var(--grip) / -2); }
.bo-e { right: calc(var(--grip) / -2); }
.bo-w { left: calc(var(--grip) / -2); }
.bo-ne, .bo-nw, .bo-se, .bo-sw { width: calc(var(--grip) * 1.75); height: calc(var(--grip) * 1.75); }
.bo-ne { top: calc(var(--grip) / -1.5); right: calc(var(--grip) / -1.5); cursor: nesw-resize; }
.bo-nw { top: calc(var(--grip) / -1.5); left: calc(var(--grip) / -1.5); cursor: nwse-resize; }
.bo-se { bottom: calc(var(--grip) / -1.5); right: calc(var(--grip) / -1.5); cursor: nwse-resize; }
.bo-sw { bottom: calc(var(--grip) / -1.5); left: calc(var(--grip) / -1.5); cursor: nesw-resize; }

/* ---------- Glyphs (FileIcon.module.css) ---------- */

.glyph-folder .fb { fill: var(--type-folder-back); }
.glyph-folder .ff { fill: var(--type-folder); }
.glyph-folder .fs { fill: #fff; fill-opacity: 0.22; }
.glyph-file .paper { fill: var(--paper); stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.glyph-file .fold { fill: var(--paper-fold); }
.glyph-file .band { fill: var(--type-text); }
.glyph-file[data-category="image"] .band { fill: var(--type-image); }
.glyph-file text { fill: #fff; font-weight: 650; letter-spacing: 0.03em; }

/* ---------- Folder frame (FolderView, EntryGrid, EntryList, PathBar) ---------- */

.fv { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.fv-bar { display: flex; flex: none; align-items: center; gap: 6px; height: 40px; padding: 0 6px; border-bottom: 1px solid var(--line-soft); }
.fv-nav { display: flex; flex: none; }
@container object (width < 460px) { .fv-nav > :nth-child(2) { display: none; } }
.ibtn {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  color: var(--text-muted) !important;
  transition: background-color 120ms, color 120ms, transform 90ms;
}
.ibtn:hover:not(:disabled) { background: var(--hover); color: var(--text) !important; }
.ibtn:active:not(:disabled) { transform: scale(0.94); }
.ibtn:disabled { opacity: 0.35; }
.ibtn[aria-pressed="true"] { background: var(--line); color: var(--text) !important; }
.ibtn.round { width: 32px; height: 32px; border-radius: 999px; }
.pb { display: flex; flex: 1; align-items: center; min-width: 0; height: 24px; overflow: hidden; border-radius: 7px; }
.pb-sep { flex: none; color: var(--text-faint); }
.pb-crumb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; height: 24px; padding: 0 6px; border-radius: 7px; color: var(--text-muted) !important; font-size: 12.5px; flex-shrink: 1; }
.pb-crumb:hover { background: var(--hover); color: var(--text) !important; }
.pb-crumb[aria-current="page"] { flex-shrink: 0; max-width: 240px; color: var(--text) !important; font-weight: 600; }
.fv-filter {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  width: 168px;
  height: 26px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--field);
  color: var(--text-faint);
  transition: width 200ms var(--ease-out);
  cursor: text;
}
.fv-filter:focus-within { border-color: var(--focus-ring); color: var(--text-muted); }
.fv-filter input { width: 100%; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: 12.5px; outline: none; -webkit-user-select: text; user-select: text; }
.fv-filter input::placeholder { color: var(--text-faint); }
.fv-filter input::-webkit-search-cancel-button { display: none; }
@container object (width < 560px) {
  .fv-filter { width: 30px; }
  .fv-filter:focus-within { width: 128px; }
}
.seg { display: flex; flex: none; gap: 2px; padding: 2px; border-radius: 9px; background: var(--field); }
.seg .ibtn { width: 26px; height: 22px; border-radius: 6px; }
.fv-content { position: relative; flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto; outline: none; overscroll-behavior: contain; padding-top: 2px; }
.fv-status { display: flex; flex: none; align-items: center; justify-content: space-between; gap: 12px; height: 26px; padding: 0 12px; border-top: 1px solid var(--line-soft); color: var(--text-faint); font-size: 11.5px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.fv-ro { display: inline-flex; align-items: center; gap: 4px; }
.fv-message { padding: 24px; color: var(--text-faint); font-size: 12.5px; text-align: center; }

.eg { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); padding: 0 10px 10px; }
.eg-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 10px 7px 0; }
.eg-tile:focus-visible { outline: none; }
.eg-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  max-width: calc(98px * 1.35);
  height: 98px;
  overflow: hidden;
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  outline: 2px solid transparent;
  outline-offset: 6px;
  transition: outline-color 200ms, outline-offset 520ms var(--ease-spring), transform 520ms var(--ease-spring), box-shadow 320ms var(--ease-out);
}
.eg-thumb img { width: 100%; height: 100%; object-fit: cover; background: #000; transition: transform 520ms var(--ease-spring); }
.eg-tile:hover .eg-thumb { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.eg-tile:hover .eg-thumb img { transform: scale(1.035); }
.eg-tile[aria-selected="true"] .eg-thumb { outline-color: var(--accent); outline-offset: 2px; }
.eg-tile:focus-visible .eg-thumb { outline-color: var(--focus-ring); outline-offset: 2px; }
.eg-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 1px 7px; border-radius: 7px; color: var(--text); font-size: 12.5px; line-height: 1.4; }
.eg-tile[aria-selected="true"] .eg-name { background: var(--accent); color: var(--accent-on); }
.eg-detail { margin-top: -5px; color: var(--text-faint); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.thumb-glyph { display: grid; place-items: center; }
.thumb-page {
  display: block;
  width: 62%;
  height: 86%;
  margin-top: 14%;
  padding: 8px 7px;
  overflow: hidden;
  background: var(--paper);
  color: #3f3f46;
  font-size: 5px;
  line-height: 1.5;
  text-align: left;
  border-radius: 2px 2px 0 0;
}

.el { padding: 0 6px 6px; font-size: 13px; }
.el-head, .el-row { display: grid; grid-template-columns: minmax(0, 1fr) 96px 76px 84px; align-items: center; gap: 0 12px; padding: 0 10px; }
.el-head { height: 30px; color: var(--text-faint); font-size: 11.5px; border-bottom: 1px solid var(--line-soft); }
.el-head span:nth-child(3), .el-row span:nth-child(3) { text-align: right; }
.el-row { width: 100%; height: 30px; border-radius: 7px; text-align: left; color: var(--text-muted) !important; font-variant-numeric: tabular-nums; }
.el-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.el-row:hover { background: var(--hover); }
.el-row[aria-selected="true"] { background: var(--accent); color: var(--accent-on-muted) !important; }
.el-row:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.el-name { display: flex; align-items: center; gap: 9px; color: var(--text); }
.el-row[aria-selected="true"] .el-name { color: var(--accent-on); }
@container object (width < 480px) { .el-head, .el-row { grid-template-columns: minmax(0, 1fr) 76px; } .el-head span:nth-child(2), .el-row > span:nth-child(2), .el-head span:nth-child(4), .el-row > span:nth-child(4) { display: none; } }

/* Overview and map detail (FolderOverview.module.css) */
.fo-overview { position: relative; height: 100%; overflow: hidden; padding: 16px; }
.fo-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); grid-auto-rows: 72px; gap: 10px; }
.fo-tile { display: grid; place-items: center; overflow: hidden; border-radius: 9px; background: var(--surface-raised); box-shadow: inset 0 0 0 1px var(--line-soft); }
.fo-tile img { width: 100%; height: 100%; object-fit: cover; }
.fo-tile .thumb-page { font-size: 0; }
.fo-count {
  position: absolute;
  right: 12px;
  bottom: 10px;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-overlay);
  box-shadow: var(--shadow-panel);
  color: var(--text-muted);
  font-size: 12.5px;
  transform: scale(calc(1 / var(--zoom)));
  transform-origin: bottom right;
}
.fo-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: calc(6px / var(--zoom));
  height: 100%;
  padding: 8%;
  background: color-mix(in oklch, var(--type-folder) 7%, var(--surface));
  text-align: center;
}
.fo-map .glyph-folder { width: min(calc(28px / var(--zoom)), 22cqh); height: min(calc(28px / var(--zoom)), 22cqh); }
.fo-map-title { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: min(calc(15px / var(--zoom)), 18cqw, 16cqh); font-weight: 650; line-height: 1.25; }
.fo-map-count { color: var(--text-muted); font-size: min(calc(12px / var(--zoom)), 12cqw); }

/* ---------- File frames ---------- */

.file-image { height: 100%; display: grid; place-items: center; background: #000; }
.file-image img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.file-doc { height: 100%; overflow: auto; overscroll-behavior: contain; }
.md { padding: 22px 26px; color: var(--text); font-size: 13.5px; line-height: 1.6; }
.md h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; margin: 0 0 14px; }
.md h3 { font-size: 16px; font-weight: 650; margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md p { margin: 0 0 10px; color: var(--text); }
.md-task { display: flex; align-items: center; gap: 9px; padding: 2px 0; }
.md-task input { width: 14px; height: 14px; margin: 0; accent-color: var(--accent); }
.txt { margin: 0; padding: 18px 20px; font: inherit; font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; color: var(--text); }
.file-map { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; height: 100%; padding: 12px; background: var(--surface-sunken); }
.file-map-pic, .file-map-page { flex: 1; min-height: 0; width: 100%; display: grid; place-items: center; overflow: hidden; }
.file-map-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-map-page .md, .file-map-page .txt { width: 70%; height: 100%; overflow: hidden; background: var(--paper); color: #18181b; font-size: 6px; padding: 10px; }
.file-map-page .md h2 { font-size: 10px; color: #18181b; }
.file-map-page .md h3 { font-size: 8px; color: #18181b; }
.map-name { flex: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: min(calc(13px / var(--zoom)), 14cqw); font-weight: 600; }

/* ---------- Notes (NoteFrame.module.css) ---------- */

.note-text {
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  line-height: 1.6;
  outline: none;
  resize: none;
  -webkit-user-select: text;
  user-select: text;
}
.note-preview { height: 100%; padding: 14px 16px; overflow: hidden; color: var(--text-muted); font-size: calc(13.5px / max(var(--zoom), 0.5)); line-height: 1.4; white-space: pre-wrap; }

/* ---------- Floating chrome (chrome.module.css) ---------- */

.surface, .bar { background: var(--glass); box-shadow: var(--shadow-panel); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.surface { border-radius: 18px; }
.bar { display: flex; align-items: center; gap: 2px; height: 40px; padding: 0 4px; border-radius: 999px; }
.plate { border-radius: 7px; background: var(--surface-overlay); box-shadow: var(--shadow-panel); }
.popover { border-radius: 14px; background: var(--glass); box-shadow: var(--shadow-panel); -webkit-backdrop-filter: blur(24px) saturate(1.6); backdrop-filter: blur(24px) saturate(1.6); }
.tb-divider { flex: none; width: 1px; height: 16px; margin: 0 4px; background: var(--line-strong); }

.bd-title { position: absolute; top: 12px; left: 12px; z-index: 60; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 9px; border-radius: 999px; font-size: 13.5px; }
.bd-title b { font-weight: 600; }
.bd-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ecf8e; transition: background-color 200ms; }
.bd-dot[data-state="saving"] { background: var(--text-faint); }

.bd-toolbar { position: absolute; left: 50%; bottom: 12px; z-index: 60; transform: translateX(-50%); }
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px 0 11px;
  border-radius: 999px;
  color: var(--text-muted) !important;
  font-size: 13px !important;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color 120ms, color 120ms, transform 90ms;
}
.tb-btn:hover { background: var(--hover); color: var(--text) !important; }
.tb-btn:active { transform: scale(0.94); }
.tb-primary { background: var(--primary) !important; color: var(--primary-on) !important; font-weight: 600; }
.tb-primary:hover { background: #fff !important; }
.tb-primary:disabled { opacity: 0.55; }
.tb-menu { position: absolute; bottom: calc(100% + 8px); left: 0; display: grid; min-width: 200px; padding: 6px; }
.tb-menu[hidden] { display: none; }
.tb-menu-head { padding: 6px 10px 4px; color: var(--text-faint); font-size: 11.5px; }
.tb-menu button { display: flex; align-items: center; gap: 9px; height: 30px; padding: 0 10px; border-radius: 7px; font-size: 13px; }
.tb-menu button .ic { color: var(--type-folder); }
.tb-menu button:hover, .tb-menu button:focus-visible { background: var(--accent); color: var(--accent-on); outline: none; }
.tb-menu button:hover .ic, .tb-menu button:focus-visible .ic { color: inherit; }

.navigator { position: absolute; right: 12px; bottom: 12px; z-index: 60; padding: 6px; }
.minimap { display: block; width: 200px; height: 120px; border-radius: 12px; cursor: pointer; }
.navigator[data-collapsed] .minimap { display: none; }
.mm-o { fill: var(--line-strong); }
.mm-o[data-kind="folder"] { fill: color-mix(in srgb, var(--type-folder) 45%, transparent); }
.mm-o[data-kind="file"] { fill: color-mix(in srgb, var(--text-muted) 35%, transparent); }
.mm-o[data-kind="group"] { fill: var(--group-fill); stroke: var(--line-strong); stroke-width: 1; }
.mm-o[data-selected] { fill: var(--accent); }
.mm-view { fill: color-mix(in srgb, var(--accent) 8%, transparent); stroke: var(--accent); stroke-width: 1.25; }
.nav-row { display: flex; align-items: center; justify-content: space-between; gap: 2px; height: 32px; margin-top: 4px; }
.nav-zoom { min-width: 48px; height: 32px; border-radius: 999px; color: var(--text-muted) !important; font-size: 11.5px !important; font-variant-numeric: tabular-nums; }
.nav-zoom:hover { background: var(--hover); color: var(--text) !important; }

/* ---------- Quick Look ---------- */

.quicklook {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  justify-items: center;
  gap: 16px;
  padding: 14px 16px 16px;
  background: color-mix(in srgb, var(--board) 80%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  backdrop-filter: blur(20px) saturate(1.2);
  animation: ql-in 220ms var(--ease-out);
}
.quicklook[hidden] { display: none; }
@keyframes ql-in { from { opacity: 0; } }
.ql-bar { gap: 6px; padding: 0 4px 0 12px; max-width: 100%; }
.ql-icon { display: grid; }
.ql-meta { display: grid; min-width: 0; line-height: 1.25; margin-right: 8px; }
.ql-meta b { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ql-meta span { color: var(--text-muted); font-size: 11.5px; white-space: nowrap; }
.ql-count { color: var(--text-faint); font-size: 11.5px; white-space: nowrap; padding: 0 6px; font-variant-numeric: tabular-nums; }
.ql-stage { display: grid; place-items: center; width: 100%; height: 100%; min-height: 0; overflow: hidden; }
.ql-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; background: #000; box-shadow: var(--shadow-object-active); animation: ql-pic 320ms var(--ease-out); }
@keyframes ql-pic { from { opacity: 0; transform: scale(0.97); } }
.ql-doc { width: min(560px, 100%); max-height: 100%; overflow: auto; border-radius: 8px; background: var(--surface); box-shadow: var(--shadow-object); }
.ql-strip { display: flex; gap: 6px; padding: 5px; border-radius: 12px; }
.ql-thumb { width: 56px; height: 42px; overflow: hidden; border-radius: 7px; display: grid; place-items: center; background: var(--surface-raised); outline: 2px solid transparent; outline-offset: 1px; transition: outline-color 200ms; }
.ql-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ql-thumb .thumb-page { font-size: 0; margin-top: 18%; }
.ql-thumb[aria-current="true"] { outline-color: var(--primary); }

/* ---------- Phones ---------- */

@media (max-width: 900px) {
  .board { height: 74svh; min-height: 520px; border-radius: 12px; }
  .minimap { display: none !important; }
  /* Phones: the zoom row joins the title along the top, clear of the toolbar and the frames. */
  .navigator { top: 12px; right: 12px; bottom: auto; padding: 2px; border-radius: 999px; }
  .nav-row .ibtn.round { width: 32px; height: 32px; }
  .nav-zoom { min-width: 44px; }
  .bd-title { padding-right: 10px; }
  .nav-row { margin: 0; }
  .nav-row .tb-divider, .nav-row [data-map-toggle] { display: none; }
  .bd-toolbar { bottom: 10px; }
  .tb-btn { padding: 0 11px 0 9px; }
  .ql-meta span, .ql-count { display: none; }
  .ql-bar [data-ql-pin] span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .quicklook, .ql-stage img { animation: none; }
  .eg-thumb, .eg-thumb img { transition: outline-color 120ms; }
}
