/* Styles of the features in web/js/features/ (pins, boards, ratings and labels, saved searches, filters
   bar, command palette, compare, video hover preview...). Use the tokens from style.css; keep each
   feature's rules under its own class prefix (.pin-, .board-, .rate-, .pal-, .cmp-, .hov-...). */

/* ---------- video previews (js/features/videopreview.js): hover, tap badge, "Play videos" ---------- */
/* the <video> over a tile's thumbnail, faded in once it plays; the play badge steps aside */
.hov-video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: cover; pointer-events: none;
  opacity: 0; transition: opacity .2s ease; }
.hov-video.on { opacity: 1; }
.tile.hov-live:not(.hov-tapped) .play { opacity: 0; transition: opacity .15s ease; }
/* the thin progress line at the bottom of the picture (hover and tap previews) */
.hov-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none; opacity: 0; transition: opacity .15s ease;
  background: color-mix(in srgb, var(--text) 24%, transparent); }
.hov-live .hov-bar { opacity: 1; }
.hov-fill { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: 0 50%; }
/* phones and touch screens: the play badge is a button (a tap previews in place, the pause badge stops it) */
.hov-tap { display: none; }
@media (hover: none), (pointer: coarse) {
  .hov-tap { display: block; position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; padding: 0;
    border: 0; border-radius: 50%; background: transparent; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tile.hov-tapped .play .ic { visibility: hidden; }
  .tile.hov-tapped .hov-tap::before, .tile.hov-tapped .hov-tap::after { content: ""; position: absolute; top: 18px; width: 4px; height: 12px;
    border-radius: 1px; background: var(--text); }
  .tile.hov-tapped .hov-tap::before { left: 18px; }
  .tile.hov-tapped .hov-tap::after { right: 18px; }
}
/* the toggle: pressed = on; dimmed while a phone waits for Wi-Fi. Only a wide toolbar shows its label (at
   1440 px with the inspector docked it is the icon); phones hide the toolbar and show the header row's copy. */
.hov-btn.hov-wait { opacity: .6; }
@container (max-width: 900px) {
  .hov-tb { width: 34px; padding: 0; justify-content: center; }
  .hov-tb span { display: none; }
}
@media (min-width: 768px) {
  .hov-hd { display: none; }
}

/* ---------- filters bar (js/features/filters.js): "Filter" button, the row under the toolbar, menus ---------- */
/* button + row are items of the toolbar (desktop) or of the header row (phones); the row wraps onto its own line */
.flt-host { display: contents; }
.flt-badge { min-width: 18px; height: 18px; padding: 0 5px; display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; }
.flt-btn.on:not([aria-pressed=true]) { border-color: rgba(59, 130, 246, .5); color: var(--accent-text); }
.flt-row { order: 1; flex: 1 0 100%; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding-top: 2px; }
.flt-group { display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 9px; }
.flt-label { padding: 0 8px 0 7px; color: var(--faint); font-size: 12px; }
.flt-chip { height: 26px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent;
  color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.flt-chip:hover { color: var(--text); }
.flt-chip[aria-pressed=true] { background: var(--accent-soft); color: var(--accent-text); }
.flt-chip.zero:not([aria-pressed=true]) { opacity: .5; }
.flt-n { color: var(--dim); font-size: 11px; font-weight: 400; }
.flt-chip[aria-pressed=true] .flt-n { color: var(--accent-text); opacity: .7; }
.flt-menu { height: 34px; display: inline-flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; flex: none; background: transparent;
  border: 1px solid var(--line-2); border-radius: 9px; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.flt-menu:hover { background: var(--hover); }
.flt-menu .ic { color: var(--faint); }
.flt-menu[aria-pressed=true] { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.flt-menu[aria-pressed=true] .ic { color: var(--accent-text); }
.flt-tail { margin-left: auto; display: flex; align-items: center; gap: 14px; white-space: nowrap; }
.flt-tail:empty { display: none; }
.flt-count { color: var(--muted); font-variant-numeric: tabular-nums; }
.flt-clear { height: 30px; padding: 0 4px; border: 0; background: none; color: var(--accent-text); font-weight: 500; cursor: pointer; }
.flt-clear:hover { color: var(--accent-ink); }
.flt-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.flt-pop { position: fixed; z-index: 80; min-width: 220px; max-width: calc(100vw - 16px); max-height: min(60vh, 460px); overflow-y: auto; overscroll-behavior: contain;
  padding: 6px; display: flex; flex-direction: column; gap: 1px; background: #202125; border: 1px solid var(--line-3); border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .55); scrollbar-width: thin; }
.flt-pop-t { padding: 6px 10px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.flt-opt { display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 10px 0 6px; border: 0; border-radius: 8px; background: none;
  color: var(--text-2); text-align: left; cursor: pointer; white-space: nowrap; }
.flt-opt:hover, .flt-opt:focus-visible { background: var(--raised); color: var(--text); outline: none; }
.flt-tick { width: 16px; display: grid; place-items: center; color: var(--accent-text); flex: none; }
.flt-opt-l { flex: 1; }
.flt-opt-n { color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.flt-pop-empty { padding: 8px 10px; color: var(--muted); font-size: 12px; }
.flt-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 8px 6px 4px; margin-top: 4px; border-top: 1px solid var(--line-2); }
.flt-range label { display: flex; flex-direction: column; gap: 4px; color: var(--faint); font-size: 11.5px; }
.flt-date { height: 32px; min-width: 0; padding: 0 8px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; color: var(--text); color-scheme: dark; }
.flt-date:focus { border-color: var(--accent); outline: none; }
.flt-apply { grid-column: span 2; height: 32px; border: 0; border-radius: 8px; background: var(--accent-strong); color: #fff; font-weight: 600; cursor: pointer; }
.flt-apply:hover { background: #3474f0; }
@container (max-width: 760px) {
  .flt-btn > span:not(.flt-badge) { display: none; }
}
@media (max-width: 767px) {
  /* phones: one row of chips that scrolls sideways, edge to edge (the header row takes the full width) */
  .vtools:has(> .flt-host.ph:not([hidden])) { flex: 1 1 100%; min-width: 0; }
  .flt-host.ph .flt-btn { height: 36px; }
  .flt-host.ph .flt-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--pad)); padding: 2px var(--pad) 2px; }
  .flt-host.ph .flt-row::-webkit-scrollbar { display: none; }
  .flt-host.ph .flt-group, .flt-host.ph .flt-menu, .flt-host.ph .flt-tail { flex: none; }
  /* the search view hides the view header (it has its own band); its results keep the Filter row above them */
  #main:has(> #searchView:not([hidden])) > .vhead:has(.flt-host.ph:not([hidden])) { display: flex; padding-top: 12px; }
  .flt-chip { height: 32px; }
  .flt-menu { height: 40px; }
  .flt-opt { min-height: 44px; }
}

/* ---------- command palette (js/features/palette.js): Ctrl K ---------- */
.pal-scrim { position: fixed; inset: 0; z-index: 88; display: flex; justify-content: center; align-items: flex-start;
  padding: max(16px, 12vh) 16px 16px; background: rgba(8, 8, 10, .55); }
.pal { width: min(640px, 100%); max-height: min(72vh, 640px); display: flex; flex-direction: column; overflow: hidden; background: var(--pane);
  border: 1px solid var(--line-3); border-radius: 16px; box-shadow: 0 30px 90px rgba(0, 0, 0, .6); animation: pal-in .12s ease-out; }
@keyframes pal-in { from { opacity: 0; transform: translateY(-6px) scale(.99); } }
.pal-field { flex: none; display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 14px 0 18px; border-bottom: 1px solid var(--line-2); color: var(--faint); }
.pal-input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; }
.pal-input::placeholder { color: var(--faint); }
.pal-list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 6px; scrollbar-width: thin; }
.pal-sec { padding: 10px 10px 5px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.pal-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 6px 10px; border-radius: 10px; color: var(--text-2); cursor: pointer; }
.pal-item > .ic { color: var(--faint); }
.pal-item[aria-selected=true] { background: var(--accent-sel); color: var(--text); }
.pal-item[aria-selected=true] > .ic { color: var(--accent-icon); }
.pal-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pal-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-name mark { background: none; color: var(--accent-text); font-weight: 650; }
.pal-name b { color: var(--text); font-weight: 600; }
/* right-to-left with an ellipsis: the parent path is trimmed from the left, its deepest folders stay visible */
.pal-sub { color: var(--faint); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.pal-hint { flex: none; color: var(--faint); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.pal-keys { flex: none; display: inline-flex; gap: 3px; }
.pal-keys kbd { min-width: 22px; text-align: center; font: 500 11px/1.5 var(--font); color: var(--text-2); background: var(--panel); border: 1px solid var(--line-3);
  border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; }
.pal-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.pal-foot { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--line-2); color: var(--faint); font-size: 12px; }
.pal-foot span + .pal-keys { margin-left: 10px; }
@media (max-width: 767px) {
  .pal-scrim { padding: calc(10px + env(safe-area-inset-top)) 10px 10px; }
  .pal { max-height: 80vh; border-radius: 14px; }
  .pal-foot { display: none; }
}

/* ---------- compare (js/features/compare.js): 2-4 images, synced zoom, before / after ---------- */
.cmp { --cmp-bg: #0b0b0c; position: fixed; inset: 0; z-index: 61; display: flex; flex-direction: column; background: var(--cmp-bg); color: var(--text);
  overscroll-behavior: contain; animation: v-in .16s ease; }
.cmp:focus { outline: none; }
html:has(> body > .cmp:not([hidden])) { background: #0b0b0c; }
.cmp-top { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: calc(14px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 14px max(20px, env(safe-area-inset-left)); }
.cmp-title { flex: 1 1 auto; min-width: 0; font-size: 14px; white-space: nowrap; }
.cmp-title b { font-weight: 650; }
.cmp-title span { color: var(--muted); }
.cmp-seg { display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.cmp-seg button { height: 32px; padding: 0 12px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); font-weight: 500; cursor: pointer; }
.cmp-seg button:hover { color: var(--text); }
.cmp-seg button[aria-pressed=true] { background: rgba(255, 255, 255, .14); color: var(--text); }
.cmp-zoomctl { display: flex; align-items: center; gap: 4px; }
.cmp-btn { width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 10px; background: rgba(255, 255, 255, .07); color: var(--text); cursor: pointer; }
.cmp-btn:hover { background: rgba(255, 255, 255, .14); }
.cmp-pct { min-width: 62px; height: 38px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); font-variant-numeric: tabular-nums; cursor: pointer; }
.cmp-pct:hover { background: rgba(255, 255, 255, .07); }
.cmp-stage { flex: 1; min-height: 0; display: grid; grid-auto-rows: minmax(0, 1fr); gap: 14px;
  padding: 0 max(20px, env(safe-area-inset-right)) 6px max(20px, env(safe-area-inset-left)); }
.cmp-stage.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cmp-stage.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cmp-stage.n4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cmp-stage.ba { grid-template-columns: minmax(0, 1fr); }
.cmp-pane { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 10px; }
.cmp-view { position: relative; flex: 1; min-height: 0; overflow: hidden; border-radius: 10px; background: #121315; touch-action: none; cursor: zoom-in; user-select: none; }
.cmp.zoomed .cmp-view { cursor: grab; }
.cmp.zoomed .cmp-view:active { cursor: grabbing; }
.cmp-layer, .cmp-zoom { position: absolute; inset: 0; }
.cmp-zoom { transform-origin: 0 0; will-change: transform; }
.cmp-pic { position: absolute; }
.cmp-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.cmp-hi { opacity: 0; transition: opacity .18s; }
.cmp-hi.ld { opacity: 1; }
.cmp-cap { flex: none; min-width: 0; display: flex; flex-direction: column; gap: 2px; text-align: center; }
.cmp-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-meta { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-caps { flex: none; display: flex; gap: 24px; }
.cmp-caps .cmp-cap { flex: 1; }
.cmp-caps .cmp-cap:first-child { text-align: left; }
.cmp-caps .cmp-cap:last-child { text-align: right; }
.cmp-divider { position: absolute; top: 0; bottom: 0; z-index: 2; width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); cursor: ew-resize; touch-action: none; }
.cmp-divider::before { content: ""; position: absolute; inset: 0 -16px; }
.cmp-divider:focus-visible { outline: none; }
.cmp-divider:focus-visible .cmp-knob { box-shadow: 0 0 0 3px var(--accent), 0 8px 24px rgba(0, 0, 0, .5); }
.cmp-knob { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: #fff; color: #111; box-shadow: 0 8px 24px rgba(0, 0, 0, .5); }
.cmp-knob .ic { stroke-width: 2.4; margin: 0 -2px; }
.cmp-tag { position: absolute; top: 12px; z-index: 1; padding: 4px 10px; border-radius: 999px; background: rgba(11, 11, 12, .72); font-size: 11.5px; font-weight: 600; pointer-events: none; }
.cmp-tag.a { left: 12px; }
.cmp-tag.b { right: 12px; }
.cmp-keys { flex: none; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; padding: 8px 20px calc(14px + env(safe-area-inset-bottom));
  color: var(--faint); font-size: 12px; }
.cmp-keys kbd { font: inherit; border: 1px solid var(--line-2); border-radius: 6px; padding: 3px 8px; }
.cmp-keys span + kbd { margin-left: 6px; }
@media (max-width: 1199px) {
  .cmp-stage.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  .cmp-top { gap: 8px; padding-left: 12px; padding-right: 12px; }
  .cmp-title { flex-basis: calc(100% - 52px); }
  .cmp-stage { gap: 8px; padding: 0 8px 8px; }
  .cmp-stage.n2 { grid-template-columns: minmax(0, 1fr); }
  .cmp-stage.n3, .cmp-stage.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-pane { gap: 6px; }
  .cmp-keys { display: none; }
}

/* ---------- versions (js/features/versions.js): inspector "Versions", the source PSD ---------- */
.ver { --ver-src: #a78bfa; --ver-src-soft: rgba(167, 139, 250, .1); display: flex; flex-direction: column; gap: 10px; }
.ver-head { display: flex; align-items: center; gap: 6px; }
.ver-info { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--faint); cursor: help; }
.ver-info:hover, .ver-info:focus-visible { color: var(--text); }
.ver-info .ic { stroke-width: 2.4; }
.ver-thr { margin-left: auto; color: var(--faint); font: 400 11px var(--mono); }
.ver-box { display: flex; flex-direction: column; gap: 8px; }
.ver-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.ver-note.err { color: var(--danger); }
.ver-note .spin { width: 14px; height: 14px; }
.ver-go { height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px;
  background: transparent; color: var(--text-2); cursor: pointer; }
.ver-go:hover { background: var(--raised); color: var(--text); }
.ver-sum { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ver-list { display: flex; flex-direction: column; gap: 4px; }
.ver-row { width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 6px; border: 1px solid transparent; border-radius: 10px; background: transparent;
  color: var(--text-2); text-align: left; cursor: pointer; }
.ver-row:hover { background: var(--hover); }
.ver-row:disabled { opacity: .6; cursor: progress; }
.ver-row.src { background: var(--ver-src-soft); border-color: rgba(167, 139, 250, .3); }
.ver-row.src:hover { background: rgba(167, 139, 250, .16); }
.ver-thumb { width: 40px; height: 40px; flex: none; border-radius: 6px; overflow: hidden; background: var(--ph); }
.ver-thumb img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity .2s; }
.ver-thumb img.ld { opacity: 1; }
.ver-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ver-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ver-n { min-width: 0; color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ver-src { flex: none; padding: 1px 5px; border-radius: 4px; background: rgba(167, 139, 250, .18); color: #c4b5fd; font-size: 9.5px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; }
.ver-meta { color: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* right-to-left with an ellipsis: the folder is trimmed from the left, its deepest folders stay visible */
.ver-path { color: var(--faint); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: rtl; text-align: left; }
.ver-pct { flex: none; color: var(--accent-text); font: 500 12px var(--mono); }
.ver-row.src .ver-pct { color: #c4b5fd; }
.ver-more { align-self: flex-start; padding: 2px 0; border: 0; background: none; color: var(--accent-text); font-size: 12px; cursor: pointer; }
.ver-more:hover { color: var(--accent-ink); }

/* ========== personal library (js/features/personal.js and kit, pins, boards, boardview, ratings, saved) ========== */
:root {
  --star: #fbbf24;
  --lbl-red: #ef4444; --lbl-orange: #f97316; --lbl-yellow: #eab308; --lbl-green: #22c55e;
  --lbl-blue: #3b82f6; --lbl-purple: #a855f7; --lbl-gray: #8b8c93;
}

/* ---------- shared: popovers (name, confirm, board picker), the right-click anchor ---------- */
.lib-anchor { position: fixed; width: 1px; height: 1px; pointer-events: none; }
.lib-pop { position: fixed; z-index: 92; width: min(300px, calc(100vw - 16px)); padding: 12px; display: flex; flex-direction: column; gap: 10px;
  background: #202125; border: 1px solid var(--line-3); border-radius: 12px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); }
.lib-pop-title { font-size: 13px; font-weight: 650; color: var(--text); overflow-wrap: anywhere; }
.lib-pop-text { color: var(--muted); font-size: 12.5px; line-height: 1.45; }
.lib-input { height: 36px; width: 100%; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text); outline: none; }
.lib-input:focus { border-color: var(--accent); }
.lib-input::placeholder { color: var(--faint); }
.lib-pop-row { display: flex; justify-content: flex-end; gap: 8px; }
.lib-btn { height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); color: var(--text-2); font-weight: 500; cursor: pointer; }
.lib-btn:hover { background: var(--raised); color: var(--text); }
.lib-btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 600; }
.lib-btn.primary:hover { background: #3474f0; }
.lib-btn.danger { background: rgba(239, 125, 114, .14); border-color: transparent; color: var(--danger); font-weight: 600; }
.lib-btn.danger:hover { background: rgba(239, 125, 114, .24); }
/* "Link to <folder>" in the create steps (kit.js askNew, the board picker) */
.lib-check { display: flex; align-items: center; gap: 8px; min-height: 28px; color: var(--text-2); font-size: 12.5px; cursor: pointer; user-select: none; }
.lib-check span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-check-box { width: 15px; height: 15px; margin: 0; flex: none; accent-color: var(--accent); cursor: pointer; }

/* ---------- sidebar rows: pinned folders, boards, saved searches ---------- */
button.navrow { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
.lib-row.lib-dragging { opacity: .45; }
.lib-row.lib-drop-before { box-shadow: inset 0 2px 0 var(--accent); }
.lib-row.lib-drop-after { box-shadow: inset 0 -2px 0 var(--accent); }
.lib-empty { padding: 2px 8px 4px; color: var(--faint); font-size: 12px; line-height: 1.45; }
.saved-thumb { width: 16px; height: 16px; flex: none; border-radius: 4px; object-fit: cover; background: var(--panel); }
.saved-row .nn { font-size: 11px; }
.ins-btn.lib-pin-btn.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }

/* a board's 2x2 cover: 1 image fills it, 2 split it, 3 = one large + two small */
.board-cover { width: 20px; height: 20px; flex: none; display: grid; gap: 1px; border-radius: 5px; overflow: hidden; background: var(--mosaic);
  box-shadow: inset 0 0 0 1px var(--line-2); color: var(--faint); place-items: center; }
.board-cover.n2 { grid-template-columns: 1fr 1fr; }
.board-cover.n3, .board-cover.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.board-cover.n3 img:first-child { grid-row: span 2; }
.board-cover img { width: 100%; height: 100%; min-height: 0; display: block; object-fit: cover; opacity: 0; transition: opacity .2s; }
.board-cover img.ld { opacity: 1; }
.board-cover.add { background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }

/* ---------- board picker (B, "Add to board") ---------- */
.board-pick { width: min(320px, calc(100vw - 16px)); }
.board-pick-list { display: flex; flex-direction: column; gap: 1px; max-height: min(300px, 50vh); overflow-y: auto; overscroll-behavior: contain; margin: 0 -4px; }
.board-opt { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 8px; border-radius: 8px; color: var(--text-2); cursor: pointer; }
.board-opt .nl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-opt .nn { color: var(--faint); font-variant-numeric: tabular-nums; }
.board-opt.on { background: var(--raised); color: var(--text); }
.board-opt.new .nl { color: var(--accent-text); }

/* ---------- board inspector, board view ---------- */
.board-ins { display: flex; flex-direction: column; gap: 8px; }
.board-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.board-chip { text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-ins-btns { display: flex; gap: 8px; }
.board-ins-btns .ins-btn:first-child { flex: 1; }
.board-ins-btns .ins-btn + .ins-btn { flex: none; padding: 0 14px; }
.board-tools { display: flex; gap: 8px; }
.board-grid .board-moving { opacity: .4; }
/* where the dragged tiles go: a bar on that side of the tile under the pointer */
.board-grid .board-drop-l { box-shadow: -5px 0 0 -1px var(--accent); }
.board-grid .board-drop-r { box-shadow: 5px 0 0 -1px var(--accent); }
.board-grid .board-drop-t { box-shadow: 0 -5px 0 -1px var(--accent); }
.board-grid .board-drop-b { box-shadow: 0 5px 0 -1px var(--accent); }
.board-grid.board-sortable .vcell { cursor: grab; }
.board-grid.board-dragging .vcell { cursor: grabbing; }

/* ---------- ratings and colour labels: tile badges ---------- */
.rate-badge { position: absolute; top: 8px; right: 8px; z-index: 1; display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px;
  border-radius: 999px; background: rgba(12, 12, 14, .72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; color: var(--star); pointer-events: none; }
.rate-badge:not(:has(.rate-n)) { padding: 0 6px; }
.s-frame .rate-badge { top: auto; bottom: 8px; right: auto; left: 8px; }
.rate-badge.in-list { position: static; height: 18px; margin-right: 8px; vertical-align: -3px; background: none; padding: 0; backdrop-filter: none; -webkit-backdrop-filter: none; }
.rate-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); }
.lbl-red { --lbl: var(--lbl-red); } .lbl-orange { --lbl: var(--lbl-orange); } .lbl-yellow { --lbl: var(--lbl-yellow); }
.lbl-green { --lbl: var(--lbl-green); } .lbl-blue { --lbl: var(--lbl-blue); } .lbl-purple { --lbl: var(--lbl-purple); } .lbl-gray { --lbl: var(--lbl-gray); }
.rate-dot, .rate-label { background: var(--lbl); }

/* ---------- ratings and colour labels: inspector ---------- */
.rate-ins { display: flex; flex-direction: column; gap: 12px; }
.rate-line { display: flex; flex-direction: column; gap: 4px; }
.rate-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.rate-stars { display: flex; margin-left: -4px; }
.rate-star { width: 26px; height: 28px; padding: 0; border: 0; background: none; font-size: 18px; line-height: 1; color: var(--dim); cursor: pointer; transition: color .1s, transform .1s; }
.rate-star.on { color: var(--star); }
.rate-stars:hover .rate-star { color: var(--star); }
.rate-stars:hover .rate-star:hover ~ .rate-star { color: var(--dim); }
.rate-star:active { transform: scale(.9); }
.rate-hint { color: var(--faint); font-size: 11px; white-space: nowrap; }
.rate-labels { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 0 2px; }
.rate-label { width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  transition: transform .1s; }
.rate-label:hover { transform: scale(1.12); }
.rate-label[aria-checked=true] { box-shadow: 0 0 0 2px var(--pane), 0 0 0 4px var(--lbl); }
.rate-label.none { --lbl: transparent; position: relative; box-shadow: inset 0 0 0 1px var(--line-3); }
.rate-label.none::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 1.5px; margin-top: -.75px; background: var(--faint); transform: rotate(-45deg); }
.rate-label.none:disabled { opacity: .35; cursor: default; transform: none; }

@media (max-width: 767px) {
  .rate-star { width: 36px; height: 40px; font-size: 22px; }
  .rate-label { width: 28px; height: 28px; }
  .rate-hint { display: none; }
  .lib-input { height: 44px; font-size: 16px; }   /* 16 px: iOS does not zoom into the field */
  .lib-btn { height: 40px; }
  .lib-check { min-height: 44px; font-size: 13px; }
  .lib-check-box { width: 18px; height: 18px; }
  .board-opt { min-height: 44px; }
  .board-cover { width: 22px; height: 22px; }
}
@media (hover: none) { .board-grid.board-sortable .vcell { cursor: auto; } }
