/* ============================================================
   grid.landscapes.directory — infinite canvas (light mode)
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f5f1;
  --fg: #0a0a0a;
  --fg-mute: rgba(10, 10, 10, 0.56);
  --fg-faint: rgba(10, 10, 10, 0.32);
  --line: rgba(10, 10, 10, 0.08);
  --line-strong: rgba(10, 10, 10, 0.14);
  --surface: #ffffff;
  --hover: rgba(10, 10, 10, 0.04);
  --accent: #0a0a0a;
  --accent-fg: #ffffff;
  --red: #d23030;
  --red-soft: rgba(210, 48, 48, 0.10);
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-2: 0 8px 24px -6px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06);
  --shadow-3: 0 30px 80px -20px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.06);
  --pill-h: 44px;
  --radius: 8px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --serif: "Times New Roman", "Times", "Iowan Old Style", "Georgia", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Helvetica Neue", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: -0.005em;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  touch-action: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  outline: none;
}

input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

kbd {
  font-family: var(--sans);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
}

/* Phosphor icons — keep crisp at small sizes */
.ph { display: inline-block; line-height: 1; }

/* ============================================================
   Stage + canvas
   ============================================================ */

.stage {
  position: fixed;
  inset: 0;
  cursor: grab;
  background: var(--bg);
  contain: strict;
}

.stage.dragging { cursor: grabbing; }

.canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  will-change: transform;
  transform-origin: 0 0;
}

/* ============================================================
   Tile
   ============================================================ */

.tile {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-alt);
  contain: layout style paint;
  will-change: transform;
  cursor: pointer;
  box-shadow: var(--shadow-1);
}

.tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.45s var(--ease);
  pointer-events: none;
  -webkit-user-drag: none;
  user-select: none;
}

.tile.loaded img { opacity: 1; }

/* Selection: top-left circular checkmark with a generous hit zone */
.tile-select {
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 56px;
  padding: 10px;
  display: inline-flex;
  align-items: flex-start;
  justify-content: flex-start;
  background: transparent;
  z-index: 4;
  opacity: 0;
  transition: opacity 0.18s var(--ease);
  pointer-events: none;
}

.tile-select-circle {
  width: 28px;
  height: 28px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.96);
  color: var(--fg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  font-size: 16px;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
}

/* Show only one icon at a time: plus when unselected, check when selected. */
.tile-select-circle .ph { display: none; }
.tile-select-circle .ph-plus { display: inline-block; }

.tile:hover .tile-select { opacity: 1; pointer-events: auto; }

.tile-select:hover .tile-select-circle {
  background: #fff;
  transform: scale(1.05);
}

.tile.selected .tile-select { opacity: 1; pointer-events: auto; }

.tile.selected .tile-select-circle {
  background: var(--accent);
  color: var(--accent-fg);
}

.tile.selected .tile-select-circle .ph-plus { display: none; }
.tile.selected .tile-select-circle .ph-check { display: inline-block; }

.tile.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--accent);
  border-radius: inherit;
  pointer-events: none;
  z-index: 3;
}

/* Hover overlay (title + artist + download CTA at bottom) */
.tile-info {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 36px 10px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0));
  color: #fff;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
  pointer-events: none;
  z-index: 2;
}

.tile:hover .tile-info { opacity: 1; transform: translateY(0); }

.tile-info-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.tile-title {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.005em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-meta {
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tile-download {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 9px 10px;
  font-size: 12px;
  font-weight: 500;
  color: #0a0a0a;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 6px;
  pointer-events: auto;
  transition: background 0.12s var(--ease), transform 0.12s var(--ease);
}

.tile-download:hover { background: #fff; transform: translateY(-1px); }

.tile-download .ph { font-size: 14px; }

.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  transition: background 0.15s var(--ease);
  pointer-events: none;
  z-index: 1;
}

.tile:hover::before { background: rgba(0, 0, 0, 0.03); }

/* Touch devices — keep actions reachable */
@media (hover: none) {
  .tile-info { opacity: 1; transform: none; }
  .tile-select { opacity: 1; pointer-events: auto; }
}

/* ============================================================
   Bottom dock — search + filter + selection pills, all same height
   ============================================================ */

.dock {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100% - 32px);
}

.dock > * { pointer-events: auto; }

.dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: var(--pill-h);
  padding: 0 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 100px;
  box-shadow: var(--shadow-2);
  letter-spacing: -0.005em;
  white-space: nowrap;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.12s var(--ease);
}

.dock-pill .ph { font-size: 18px; color: currentColor; }

button.dock-pill:hover { border-color: var(--line-strong); transform: translateY(-1px); }
button.dock-pill:active { transform: translateY(0); }

.dock-search {
  cursor: text;
  min-width: 220px;
  max-width: 320px;
  flex: 0 1 280px;
}

.dock-search .ph-magnifying-glass { color: var(--fg-faint); }

.dock-search input {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  padding: 4px 0;
}

.dock-search input::placeholder { color: var(--fg-faint); }

.dock-search-clear {
  width: 22px; height: 22px;
  border-radius: 100px;
  background: var(--bg-alt);
  color: var(--fg-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.dock-search-clear:hover { background: var(--line-strong); color: var(--fg); }

.dock-filter {
  padding-right: 10px;
  gap: 9px;
}

.dock-label { font-weight: 500; }

.dock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 100px;
  background: var(--accent);
  color: var(--accent-fg);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.dock-kbd {
  margin-left: 2px;
  font-size: 10px;
  font-weight: 500;
  color: var(--fg-mute);
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 3px 7px;
  letter-spacing: 0.06em;
}

/* Mode toggle pill (segmented control) — mirrors landscapes.directory */
.dock-mode { padding: 4px; gap: 2px; }
.dock-mode-btn {
  font: inherit;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--fg-mute);
  background: transparent;
  border: 0;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: background 0.12s, color 0.12s;
}
.dock-mode-btn:hover { color: var(--fg); }
.dock-mode-btn.active { background: var(--fg); color: var(--accent-fg); }
.dock-mode-btn .ph { font-size: 13px; }

/* Selection pile — same height as Filter, raw count + plain X + Download CTA */
.dock-selection {
  padding: 0 6px 0 18px;
  gap: 8px;
}

.sel-count {
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--fg);
  min-width: 12px;
  text-align: center;
}

.sel-clear {
  width: 28px; height: 28px;
  border-radius: 100px;
  background: transparent;
  color: var(--fg-mute);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.sel-clear:hover {
  background: var(--bg-alt);
  color: var(--red);
}

.sel-download {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--accent-fg);
  background: var(--accent);
  border-radius: 100px;
  transition: background 0.15s var(--ease);
}

.sel-download:hover { background: #1a1a1a; }

.sel-download[disabled] { cursor: progress; opacity: 0.85; }

.sel-download .ph { font-size: 14px; color: var(--accent-fg); }

/* ============================================================
   Filter modal
   ============================================================ */

.filter {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.filter.hidden { display: none; }

.filter-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.16);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  animation: fadeIn 0.18s var(--ease);
}

.filter-card {
  position: relative;
  width: min(820px, 100%);
  height: min(640px, calc(100vh - 48px));
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-3);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: pop 0.24s var(--ease);
}

@keyframes pop {
  from { opacity: 0; transform: translateY(6px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.filter-head {
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
}

.filter-search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
}

.filter-search-icon { color: var(--fg-faint); font-size: 18px; flex-shrink: 0; }

#filterInput {
  flex: 1;
  font-size: 14px;
  letter-spacing: 0.005em;
  padding: 4px 0;
}

#filterInput::placeholder { color: var(--fg-faint); }

.filter-clear {
  width: 22px; height: 22px;
  border-radius: 100px;
  background: var(--bg-alt);
  color: var(--fg-mute);
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.filter-clear:hover { background: var(--line-strong); color: var(--fg); }

.filter-esc { display: inline-flex; flex-shrink: 0; }

.filter-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.filter-side {
  width: 196px;
  flex-shrink: 0;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
}

.fs-tab {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 13px;
  color: var(--fg);
  border-radius: 8px;
  transition: background 0.12s var(--ease);
  text-align: left;
}

.fs-tab:hover { background: var(--hover); }

.fs-tab.active {
  background: var(--bg-alt);
  font-weight: 500;
}

.fs-tab .ph { font-size: 16px; color: var(--fg-mute); flex-shrink: 0; }

.fs-tab.active .ph { color: var(--fg); }

.filter-panel {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.filter-panel::-webkit-scrollbar { width: 8px; }
.filter-panel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 100px; }

.fp-section { padding: 14px 0; }
.fp-section + .fp-section { border-top: 1px solid var(--line); }

.fp-section-head {
  padding: 0 22px 8px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.fp-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 22px;
  font-size: 14px;
  color: var(--fg);
  text-align: left;
  width: 100%;
  transition: background 0.1s var(--ease);
}

.fp-row:hover { background: var(--hover); z-index: 2; }

/* Desktop-only hover teaser — a tilted thumbnail showing a representative
   painting from the facet. Sits between text and count, never overlaps
   either; lazy-loaded by JS on first hover. */
.fp-row-teaser {
  position: absolute;
  top: 50%;
  right: 64px;
  width: 110px;
  height: 72px;
  margin-top: -36px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-alt);
  box-shadow: 0 8px 22px -6px rgba(0, 0, 0, 0.22), 0 1px 3px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: scale(0.7) rotate(0deg);
  transform-origin: center;
  transition: opacity 0.18s var(--ease), transform 0.32s var(--ease);
  pointer-events: none;
  z-index: 3;
}

.fp-row:hover .fp-row-teaser,
.fp-row:focus-visible .fp-row-teaser {
  opacity: 1;
  transform: scale(1) rotate(var(--teaser-tilt, 0deg));
}

.fp-row-teaser img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

/* On compact viewports / touch devices the teaser would block the row.
   Drop it entirely. */
@media (max-width: 860px), (hover: none) {
  .fp-row-teaser { display: none !important; }
}

.fp-row-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.fp-row-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-check {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1.5px solid var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  background: transparent;
  font-size: 12px;
  flex-shrink: 0;
  transition: background 0.12s var(--ease), border-color 0.12s var(--ease), color 0.12s var(--ease);
}

.fp-row.active .fp-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-fg);
}

.fp-row.active { background: var(--bg-alt); }

/* Color tab — replace the check box with a hue swatch */
.fp-swatch {
  width: 18px; height: 18px;
  border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.10);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10);
  flex-shrink: 0;
}
.fp-row.active .fp-swatch {
  box-shadow: 0 0 0 2px var(--accent), inset 0 0 0 1px rgba(255,255,255,0.20);
}
.fp-row.dim { opacity: 0.55; }
.fp-row.dim .fp-row-count { opacity: 0.6; }
.fa-swatch {
  width: 10px; height: 10px;
  border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.10);
  flex-shrink: 0;
  display: inline-block;
}

.fp-row-count {
  color: var(--fg-faint);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.filter-foot {
  flex-shrink: 0;
  border-top: 1px solid var(--line);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--bg);
}

.filter-active {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 60%;
  overflow: hidden;
}

.filter-active:empty { display: none; }

.fa-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px 5px 10px;
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-alt);
  border-radius: 100px;
}

.fa-pill .x {
  width: 16px; height: 16px;
  border-radius: 100px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--fg-mute);
  font-size: 12px;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
}

.fa-pill .x:hover { background: var(--line-strong); color: var(--fg); }

.filter-foot-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.prim-btn, .ghost-btn {
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 100px;
  font-weight: 500;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.prim-btn { background: var(--accent); color: var(--accent-fg); }
.prim-btn:hover { background: #1a1a1a; }

.ghost-btn { background: transparent; color: var(--fg); border: 1px solid var(--line-strong); }
.ghost-btn:hover { background: var(--hover); }

a.prim-btn, a.ghost-btn { text-decoration: none; }

/* ============================================================
   Lightbox — editorial split, museum-card panel
   ============================================================ */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.lightbox.hidden { display: none; }

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 10, 0.86);
  backdrop-filter: blur(28px) saturate(1.1);
  -webkit-backdrop-filter: blur(28px) saturate(1.1);
  animation: fadeIn 0.22s var(--ease);
}

/* Close + nav float over the dark backdrop, light-on-dark style */
.lb-close {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 40px; height: 40px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 0.12s var(--ease);
}

.lb-close:hover { background: rgba(255, 255, 255, 0.20); }

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.10);
  color: #fff;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: background 0.12s var(--ease);
}

.lb-nav:hover { background: rgba(255, 255, 255, 0.20); }
.lb-prev { left: 18px; }
.lb-next { right: 18px; }

.lb-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: stretch;
  width: 100%;
  max-width: 1400px;
  max-height: 100%;
  animation: pop 0.28s var(--ease);
}

.lb-image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  max-height: calc(100vh - 64px);
}

.lb-image-loading {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 100px;
  animation: bootPulse 1.4s var(--ease) infinite;
  opacity: 0;
  transition: opacity 0.2s var(--ease);
}

.lb-image-wrap.loading .lb-image-loading { opacity: 1; }

#lbImg {
  max-width: 100%;
  max-height: calc(100vh - 64px);
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  background: #0a0a0a;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.35s var(--ease);
}

#lbImg.ready { opacity: 1; }

/* The right-side museum card */
.lb-panel {
  background: var(--surface);
  border-radius: 14px;
  padding: 26px 26px 22px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 22px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.55);
  scrollbar-width: thin;
  scrollbar-color: var(--line-strong) transparent;
}

.lb-panel::-webkit-scrollbar { width: 6px; }
.lb-panel::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 100px; }

.lb-head { display: flex; flex-direction: column; }

.lb-eyebrow {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 8px;
}

.lb-eyebrow:empty { display: none; }

.lb-title {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 26px;
  font-weight: 400;
  line-height: 1.18;
  letter-spacing: 0.003em;
  color: var(--fg);
}

.lb-byline {
  margin: 0;
  font-size: 13px;
  color: var(--fg-mute);
}

.lb-byline span {
  color: var(--fg);
  font-weight: 500;
}

.lb-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lb-stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.lb-stat[hidden] { display: none; }

.lb-stat dt {
  margin: 0;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.lb-stat dd {
  margin: 0;
  font-size: 13px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
}

.lb-section { display: flex; flex-direction: column; }

.lb-section.hidden { display: none; }

.lb-description p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--fg);
}

.lb-inline-link {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--fg-mute);
  text-decoration: none;
  align-self: flex-start;
  transition: color 0.12s var(--ease);
}

.lb-inline-link:hover { color: var(--fg); }

.lb-inline-link.hidden { display: none; }

.lb-section-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-faint);
  margin-bottom: 8px;
}

.lb-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.lb-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--fg);
  background: var(--bg-alt);
  border-radius: 100px;
  letter-spacing: -0.005em;
}

.lb-palette {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.lb-swatch {
  position: relative;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.lb-swatch[data-dominant="true"] {
  width: 36px;
  height: 36px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0,0,0,0.05);
}

.lb-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.lb-action-row {
  display: flex;
  gap: 8px;
}

.lb-action-row > .lb-action { flex: 1; min-width: 0; }

.lb-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 100px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s var(--ease), color 0.12s var(--ease);
  white-space: nowrap;
}

.lb-action-primary {
  background: var(--accent);
  color: var(--accent-fg);
}

.lb-action-primary:hover { background: #1a1a1a; }

.lb-action-primary[data-state="loading"] { cursor: progress; opacity: 0.85; }

.lb-action-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line-strong);
}

.lb-action-ghost:hover { background: var(--hover); }

.lb-action-ghost[data-state="ok"] { color: var(--green-ok, #2a8a4a); border-color: var(--green-ok, #2a8a4a); }

.lb-action-meta {
  margin-left: 4px;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.7;
}

.lb-action-meta:empty { display: none; }

/* Lightbox responsive */
@media (max-width: 1100px) {
  .lb-stage { grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; }
  .lightbox { padding: 24px; }
}

@media (max-width: 860px) {
  .lightbox { padding: 12px 12px 24px; align-items: flex-start; overflow-y: auto; }
  .lb-stage {
    grid-template-columns: 1fr;
    gap: 14px;
    max-height: none;
    padding-top: 50px;
  }
  .lb-image-wrap, #lbImg { max-height: 56vh; }
  .lb-panel { max-height: none; padding: 22px; }
  .lb-prev, .lb-next { display: none; }
  .lb-title { font-size: 22px; }
}

/* ============================================================
   Empty state (search returns nothing)
   ============================================================ */

.empty-state {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  z-index: 20;
  padding: 24px;
  padding-bottom: 120px;
  pointer-events: none;
}

.empty-state > * { pointer-events: auto; }

.empty-state .ph {
  font-size: 32px;
  color: var(--fg-faint);
  margin-bottom: 4px;
}

.empty-state h3 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  font-weight: 400;
  letter-spacing: 0.005em;
  color: var(--fg);
}

.empty-state p {
  margin: 0;
  color: var(--fg-mute);
  font-size: 13px;
  max-width: 360px;
}

.empty-state .ghost-btn { margin-top: 4px; }

.suggest-block {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 440px;
}

.suggest-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}

.suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.suggest-chip {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
  font-size: 12.5px;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.suggest-chip:hover {
  background: var(--hover);
  border-color: var(--fg);
}

/* ============================================================
   Boot overlay
   ============================================================ */

.boot {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s var(--ease), visibility 0.5s var(--ease);
}

.boot.gone {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.boot-mark {
  width: 8px; height: 8px;
  background: var(--fg);
  border-radius: 100px;
  animation: bootPulse 1.4s var(--ease) infinite;
}

@keyframes bootPulse {
  0%, 100% { transform: scale(0.6); opacity: 0.35; }
  50% { transform: scale(1); opacity: 1; }
}

/* ============================================================
   Mobile
   ============================================================ */

@media (max-width: 720px) {
  :root { --pill-h: 42px; }

  .dock { bottom: 14px; gap: 6px; flex-wrap: wrap; justify-content: center; max-width: calc(100% - 16px); }
  .dock-search { min-width: 0; flex: 1 1 100%; max-width: 100%; order: -1; }
  .dock-kbd { display: none; }
  .sel-download-label { display: none; }
  .sel-download { padding: 0 10px; }

  .filter { padding: 0; }
  .filter-card { width: 100%; height: 100%; border-radius: 0; box-shadow: none; }
  .filter-body { flex-direction: column; }
  .filter-side {
    width: 100%;
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 10px 12px;
    gap: 6px;
    scrollbar-width: none;
  }
  .filter-side::-webkit-scrollbar { display: none; }
  .fs-tab { flex-shrink: 0; padding: 8px 14px; }

  .filter-foot { padding: 12px 14px; flex-wrap: wrap; }
  .filter-active { max-width: 100%; flex-basis: 100%; order: 2; }
  .filter-foot-actions { order: 1; width: 100%; justify-content: space-between; }

  .lb-close { top: 10px; right: 10px; }
}

.hidden { display: none !important; }
