﻿/* ============================================================
   BASE RESET
============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
input, button { font-family: var(--font-ui); }
img { display: block; max-width: 100%; }

/* ============================================================
   CSS VARIABLES — LIGHT MODE (default)
============================================================ */
:root {
  --font-ui:      'DM Mono', monospace;
  --font-display: 'Cormorant Garamond', serif;

  --bg:           #F7F5F2;
  --bg-panel:     #F2F0ED;
  --bg-card:      #EEECEA;
  --ink:          #1A1A18;
  --ink-2:        #6B6960;
  --ink-3:        #B0ADA6;
  --accent:       #C8B89A;
  --line:         rgba(26,26,24,0.08);
  --line-strong:  rgba(26,26,24,0.16);

  --t-fast:       0.15s ease;
  --t-normal:     0.3s ease;
  --t-slow:       0.5s ease;
}

/* ============================================================
   DARK MODE — system preference
============================================================ */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0E0E0D;
    --bg-panel:     #141413;
    --bg-card:      #1C1C1A;
    --ink:          #E8E6E1;
    --ink-2:        #9A9890;
    --ink-3:        #4A4940;
    --accent:       #C8B89A;
    --line:         rgba(232,230,225,0.07);
    --line-strong:  rgba(232,230,225,0.14);
  }
}

/* DARK MODE — manual toggle */
body.dark {
  --bg:           #0E0E0D;
  --bg-panel:     #141413;
  --bg-card:      #1C1C1A;
  --ink:          #E8E6E1;
  --ink-2:        #9A9890;
  --ink-3:        #4A4940;
  --accent:       #C8B89A;
  --line:         rgba(232,230,225,0.07);
  --line-strong:  rgba(232,230,225,0.14);
}

/* LIGHT MODE — manual toggle (overrides system dark) */
body.light {
  --bg:           #F7F5F2;
  --bg-panel:     #F2F0ED;
  --bg-card:      #EEECEA;
  --ink:          #1A1A18;
  --ink-2:        #6B6960;
  --ink-3:        #B0ADA6;
  --accent:       #C8B89A;
  --line:         rgba(26,26,24,0.08);
  --line-strong:  rgba(26,26,24,0.16);
}

/* ============================================================
   SCROLLBARS
============================================================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--line); }
::-webkit-scrollbar-thumb {
  background: var(--line-strong);
  border-radius: 0;
}

/* ============================================================
   LAYOUT
============================================================ */
html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
}

#app {
  display: flex;
  height: 100dvh;
  overflow: hidden;
  background: var(--bg);
  position: relative;
}

#sidebar {
  width: 240px;
  flex-shrink: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 24px;
}

#canvas {
  flex: 1;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  position: relative;
  transition: opacity 0.2s ease;
}

/* Restrict scroll in board and 3D modes */
#canvas.view-board,
#canvas.view-3d {
  overflow: hidden;
}

#panel {
  width: 280px;
  flex-shrink: 0;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg-panel);
  border-left: 1px solid var(--line);
  padding: 24px 20px;
  transform: translateX(100%);
  transition: transform 0.4s ease;
}

#panel.open {
  transform: translateX(0);
}

/* ============================================================
   COMPONENT — LOGO
============================================================ */
.logo {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* ============================================================
   COMPONENT — SEARCH INPUT
============================================================ */

.search-input {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  width: 100%;
  padding: 8px 0;
  outline: none;
  caret-color: var(--accent);
  transition: font-size 0.2s, padding 0.2s;
}

.search-input--large {
  font-size: 16px;
  padding: 14px 0 12px 0;
}

.search-input::placeholder { color: var(--ink-3); }
.search-input:focus { border-bottom-color: var(--accent); }


.search-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.search-row--block {
  display: block;
  margin-bottom: 6px;
}

.search-row--controls {
  display: flex;
  gap: 8px;
}

.search-row .search-input {
  flex: 1;
  min-width: 0;
}

.search-mode-toggle {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 6px 10px;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}

.search-mode-toggle:hover { opacity: 0.6; }

.search-mode-toggle.exact {
  border-color: rgba(95, 172, 110, 0.65);
  color: #5fac6e;
}

/* ============================================================
   COMPONENT — SEARCH HISTORY DROPDOWN
============================================================ */
.search-history-dropdown {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  z-index: 10;
  overflow: hidden;
}

.search-history-item {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 300;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 7px 8px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
}

.search-history-item:last-child { border-bottom: none; }
.search-history-item:hover,
.search-history-item:focus { background: var(--line); color: var(--ink); outline: none; }

/* ============================================================
   COMPONENT — "DID YOU MEAN?" SUGGESTION
============================================================ */
.empty-state-suggestion {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin-top: 4px;
}

.empty-suggestion-btn {
  background: none;
  border: none;
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.15s;
}

.empty-suggestion-btn:hover { opacity: 0.7; }

/* ============================================================
   COMPONENT — DATE RANGE FILTER
============================================================ */
.date-range-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.date-input {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 4px 6px;
  width: 60px;
  outline: none;
  text-align: center;
  -moz-appearance: textfield;
}
.date-input::-webkit-inner-spin-button,
.date-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.date-input:focus { border-color: var(--accent); }
.date-input::placeholder { color: var(--ink-3); }

.date-dash {
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-3);
}

.date-filter-clear {
  background: none;
  border: none;
  color: var(--ink-3);
  font-size: 14px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  transition: opacity 0.15s;
}
.date-filter-clear:hover { opacity: 0.6; }

/* ============================================================
   COMPONENT — ASPECT RATIO FILTER
============================================================ */
.aspect-btn-group {
  display: flex;
  gap: 4px;
}

.aspect-btn {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 4px 8px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.aspect-btn:hover { opacity: 0.7; }
.aspect-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================================
   COMPONENT — LIGHTBOX SLIDESHOW
============================================================ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  transition: opacity 0.3s ease;
}

.lightbox-caption {
  font-family: var(--font-ui);
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.04em;
  margin-top: 12px;
  text-align: center;
  max-width: 600px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 36px;
  cursor: pointer;
  padding: 20px;
  transition: color 0.2s;
  user-select: none;
}
.lightbox-nav:hover { color: #fff; }
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
}
.lightbox-close:hover { color: #fff; }

.lightbox-counter {
  font-family: var(--font-ui);
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.1em;
  position: absolute;
  bottom: 16px;
}

/* ============================================================
   COMPONENT — TAG PILL
============================================================ */
.tag {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line-strong);
  padding: 3px 8px;
  cursor: pointer;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tag:hover { opacity: 0.5; }

.tag.active {
  color: var(--ink);
  border-color: var(--accent);
  font-weight: 400;
}

.tag.ai {
  border-style: dashed;
  color: var(--accent);
}

/* Keyword pills container */
#keyword-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 0;
  max-height: 120px;
  overflow-y: auto;
  padding-bottom: 4px;
}

#cache-indicator {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 0 2px 0;
}

#cache-indicator #cache-age-text {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink-3);
  flex: 1;
}

#cache-indicator #btn-refresh-cache {
  width: auto;
  padding: 3px 8px;
  font-size: 12px;
  line-height: 1;
  flex-shrink: 0;
}

#more-container {
  display: none;
  justify-content: center;
  padding: 24px 0;
  grid-column: 1 / -1;
}

#btn-load-more {
  width: auto;
  padding: 8px 32px;
  text-align: center;
}

/* ============================================================
   COMPONENT — UI BUTTON
============================================================ */
.btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--line);
  padding: 6px 12px;
  cursor: pointer;
  transition: opacity 0.3s ease;
  width: 100%;
  text-align: left;
}

.btn:hover { opacity: 0.5; }

.btn.active {
  color: var(--ink);
  border-color: var(--line-strong);
  font-weight: 400;
}

/* View toggle button group */
.btn-group {
  display: flex;
  gap: 4px;
}

.btn-group .btn {
  flex: 1;
  text-align: center;
}

/* ============================================================
   COMPONENT — SECTION LABEL
============================================================ */
.section-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 8px;
}

/* ============================================================
   COMPONENT — SLIDER
============================================================ */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 3px;
  background: var(--line-strong);
  outline: none;
  cursor: pointer;
  padding: 8px 0;
  box-sizing: content-box;
  background-clip: content-box;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  background: var(--ink);
  cursor: pointer;
  border-radius: 0;
}

.slider::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--ink);
  cursor: pointer;
  border-radius: 0;
  border: none;
}

/* ============================================================
   COMPONENT — DIVIDER
============================================================ */
.divider {
  width: 100%;
  height: 1px;
  background: var(--line);
  flex-shrink: 0;
}

/* ============================================================
   COMPONENT — COLOR DOT (palette extraction)
============================================================ */
/* ── Color palette rows ── */
.swatches-row {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.color-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 0;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
  position: relative;
  transition: background 0.15s ease;
}
.color-row:last-child { border-bottom: none; }
.color-row:hover { background: var(--bg-card); }
.color-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1px solid var(--line);
  transition: transform 0.15s ease;
}
.color-row:hover .color-dot { transform: scale(1.2); }
.color-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.color-name {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.color-hex {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.color-row .dot-copied-badge {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.15s;
  flex-shrink: 0;
}
.color-row.copied .dot-copied-badge { opacity: 1; }

/* Legacy .swatch compatibility */
.swatch {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

/* ============================================================
   IMAGE CARD
============================================================ */
.image-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  aspect-ratio: 1;
  content-visibility: auto;
  contain-intrinsic-size: auto 202px;
  animation: cardFadeIn 0.35s ease both;
}
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.image-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.image-card img.loaded { opacity: 1; }

.image-card.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.image-card .source-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--bg);
  background: rgba(26,26,24,0.6);
  padding: 2px 6px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.image-card:hover .source-badge { opacity: 1; }

.source-badge .badge-refresh {
  display: none;
  margin-left: 3px;
  cursor: pointer;
  opacity: 0.7;
}

.source-badge:hover .badge-refresh {
  display: inline;
}

.source-badge .badge-refresh:hover { opacity: 1; }

/* Phase 5.1+5.2 — verified cultural institution indicator */
.source-badge .badge-verified {
  opacity: 0.65;
  margin-left: 2px;
  color: #7ec8a0;
  font-size: 8px;
  vertical-align: middle;
}

/* Deep Zoom button on image cards */
.image-card .zoom-btn {
  position: absolute;
  bottom: 8px;
  right: 8px;
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--bg);
  background: rgba(26,26,24,0.6);
  border: none;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 0;
  line-height: 1;
}
.image-card:hover .zoom-btn { opacity: 1; }
.image-card .zoom-btn:hover { background: rgba(26,26,24,0.85); }

@media (hover: none) {
  .image-card .source-badge,
  .image-card .zoom-btn {
    opacity: 1 !important;
  }
}

/* Similar button */
.image-card .sim-btn {
  position: absolute; bottom: 8px; right: 36px;
  font-family: var(--font-ui); font-size: 14px;
  color: var(--bg); background: rgba(26,26,24,0.6);
  border: none; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; opacity: 0; transition: opacity 0.3s ease;
  padding: 0; line-height: 1;
}
.image-card:hover .sim-btn { opacity: 1; }
.image-card .sim-btn:hover { background: rgba(26,26,24,0.85); }

.sim-banner {
  grid-column: 1 / -1; display: flex; align-items: center;
  justify-content: space-between; padding: 8px 14px;
  background: var(--bg-panel); border: 1px solid var(--accent);
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.04em; color: var(--ink-2);
}
.sim-banner-close {
  background: none; border: none; color: var(--ink-3);
  cursor: pointer; font-size: 14px; line-height: 1;
}
.sim-banner-close:hover { color: var(--ink); }

/* OpenSeadragon deep-zoom modal */
#osd-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.92);
  align-items: center;
  justify-content: center;
}
#osd-modal.open { display: flex; }
#osd-container {
  width: 90vw;
  height: 85dvh;
  background: #111;
}
#osd-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
  z-index: 10001;
  font-family: var(--font-ui);
  opacity: 0.7;
  transition: opacity 0.2s;
}
#osd-close:hover { opacity: 1; }

/* Sketch mode — Sobel canvas overlay; CSS filter fallback for tainted images */
.sketch-overlay {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

/* ============================================================
   IMAGE GRID
============================================================ */
#image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 4px;
  padding: 4px;
  min-height: 100dvh;
}

/* ============================================================
   EMPTY STATE
============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--ink-3);
}

.empty-state p {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  font-style: italic;
}

.empty-state span {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.1em;
}

/* ============================================================
   LOADING STATE
============================================================ */
.loading-indicator {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  animation: pulse 1.5s ease infinite;
  min-height: 14px;
}

.sources-active-counter {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  min-height: 12px;
}

.sources-health-indicator {
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 0.04em;
  color: #c47a5a;
  min-height: 10px;
  cursor: pointer;
}
.sources-health-indicator:hover { text-decoration: underline; }

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slideInLeft {
  from { transform: translateX(-100%); }
  to   { transform: translateX(0); }
}

/* ============================================================
   TOAST NOTIFICATION
============================================================ */
.toast {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  padding: 8px 16px;
  z-index: 300;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}
.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ============================================================
   SKIP TO CONTENT (accessibility)
============================================================ */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--accent);
  color: var(--bg);
  padding: 8px 16px;
  z-index: 999;
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
}
.skip-link:focus {
  top: 0;
}

/* ============================================================
   PANEL — RELATED SEARCH LINK
============================================================ */
.related-link {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 300;
  color: var(--ink-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
  transition: opacity 0.3s ease;
}

.related-link:hover { opacity: 0.5; }
.related-link::before { content: '→'; color: var(--accent); }

/* ============================================================
   DARK MODE TOGGLE
============================================================ */
.theme-toggle {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease;
}

.theme-toggle:hover { opacity: 0.5; }

/* ============================================================
   SIDEBAR LAYOUT HELPERS
============================================================ */
.sidebar-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.logo-subtitle {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  margin-top: 2px;
  padding: 0 0 6px 0;
  min-height: 12px;
}
.logo-subtitle .ls-up { color: var(--ink-2); }

.sidebar-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-spacer {
  flex: 1;
}

.slider-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.slider-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ============================================================
   PANEL LAYOUT HELPERS
============================================================ */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.panel-close {
  font-family: var(--font-ui);
  font-size: 14px;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease;
  line-height: 1;
}

.panel-close:hover { opacity: 0.5; }

.panel-section {
  margin-bottom: 24px;
}

.panel-empty-hint {
  display: none;
  margin: 8px 0 18px;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.06em;
  line-height: 1.6;
}

/* Source info */
.source-info {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-2);
  line-height: 1.6;
}

.source-info a {
  color: var(--accent);
  border-bottom: 1px solid var(--line-strong);
}

.source-identity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.source-identity .source-icon-wrap {
  width: 14px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
}

.source-identity .source-icon {
  width: 14px;
  height: 14px;
  object-fit: cover;
  display: block;
}

.source-identity .source-mono {
  width: 14px;
  height: 14px;
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 7px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
}

.source-identity .source-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#source-info .source-identity {
  margin-bottom: 6px;
}

#source-info .source-identity .source-icon-wrap,
#source-info .source-identity .source-icon,
#source-info .source-identity .source-mono {
  width: 16px;
  height: 16px;
}

#source-info .source-identity .source-mono {
  font-size: 8px;
}

/* AI label inline badge */
.ai-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--accent);
  text-transform: lowercase;
}

/* No-key note */
.no-key-note {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  padding-top: 8px;
}

/* ============================================================
   KEYS OVERLAY PANEL (slides in from left over sidebar)
============================================================ */
#keys-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  height: 100dvh;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 0;
  transform: translateX(-100%);
  transition: transform 0.4s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#keys-panel.open {
  transform: translateX(0);
}

/* ============================================================
   SETTINGS OVERLAY PANEL (slides in from left over sidebar)
============================================================ */
#settings-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 240px;
  height: 100dvh;
  background: var(--bg-panel);
  border-right: 1px solid var(--line);
  z-index: 50;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 0;
  transform: translateX(-100%);
  transition: transform 0.4s ease;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#settings-panel.open {
  transform: translateX(0);
}

.settings-gear-btn {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: opacity 0.3s ease;
  line-height: 1;
}

.settings-gear-btn:hover { opacity: 0.5; }

.settings-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.settings-row-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

.settings-toggle-row .btn-group {
  flex-shrink: 0;
}

.settings-toggle-row .btn {
  width: auto;
  flex: none;
  padding: 4px 10px;
  text-align: center;
}

.settings-value-text {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  padding: 4px 0;
}

.settings-danger-btn {
  color: #B04040;
  border-color: rgba(176,64,64,0.3);
}

.no-badges .source-badge { opacity: 0 !important; pointer-events: none; }

.keys-panel-subheader {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.keys-panel-footer {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  line-height: 1.5;
  margin-top: auto;
  padding-top: 16px;
}

.keys-panel-actions {
  display: flex;
  gap: 4px;
  margin-top: 12px;
}

.keys-panel-actions .btn {
  flex: 1;
  text-align: center;
}

.source-toggle {
  font-family: var(--font-ui);
  font-size: 8px;
  color: var(--ink-3);
  background: none;
  border: none;
  padding: 0 4px 0 0;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}

.source-toggle.enabled { color: var(--ink); }

.key-source-row.source-disabled { opacity: 0.4; }

.preset-btn {
  font-size: 9px;
  padding: 2px 6px;
  flex-shrink: 0;
}

.preset-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Key source row --- */
.key-source-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.key-source-row:last-child {
  border-bottom: none;
}

.key-source-top {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key-source-name {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: 0.04em;
  flex: 1;
  min-width: 0;
  overflow: hidden; /* clips source-identity to flex width */
}

.key-status-badge {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.08em;
  padding: 2px 6px;
  white-space: nowrap;
  cursor: default;
  flex-shrink: 0;
}

.key-status-badge.badge-active {
  background: rgba(60,140,60,0.12);
  color: #3c8c3c;
}

.key-status-badge.badge-inactive {
  background: var(--line);
  color: var(--ink-3);
}

.key-status-badge.badge-cors {
  background: rgba(60,120,60,0.08);
  color: #5a8c5a;
}

.key-get-link {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-decoration: none;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.key-get-link:hover { opacity: 0.5; }

.key-source-desc {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}

.key-source-input-row {
  display: none;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.key-source-input-row.visible {
  display: flex;
}

.key-source-input {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 300;
  color: var(--ink);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--line-strong);
  flex: 1;
  padding: 6px 0;
  outline: none;
  caret-color: var(--accent);
  min-width: 0;
}

.key-source-input::placeholder { color: var(--ink-3); }
.key-source-input:focus { border-bottom-color: var(--accent); }

/* --- api keys button in sidebar --- */
.btn-keys {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-keys-dot {
  width: 5px;
  height: 5px;
  background: var(--accent);
  flex-shrink: 0;
}

/* Source badge tints */
.source-badge       { background: rgba(26,26,24,0.75); }
.badge-wiki         { background: rgba(26,26,24,0.75); }
.badge-met          { background: rgba(184,92,56,0.7); }
.badge-archive      { background: rgba(56,100,184,0.7); }
.badge-nasa         { background: rgba(20,60,120,0.75); }
.badge-rijks        { background: rgba(140,40,40,0.7); }
.badge-euro         { background: rgba(10,114,204,0.8); }
.badge-harvard      { background: rgba(180,30,30,0.7); }
.badge-smithsonian  { background: rgba(20,80,160,0.7); }
.badge-pexels       { background: rgba(5,160,100,0.7); }
.badge-inaturalist  { background: rgba(40,140,80,0.75); }
.badge-loc          { background: rgba(140,20,20,0.75); }
.badge-openlibrary  { background: rgba(100,60,160,0.75); }
.badge-chicago      { background: rgba(180,30,50,0.75); }
.badge-cleveland    { background: rgba(20,80,140,0.75); }
.badge-va           { background: rgba(160,20,100,0.75); }
.badge-flickr       { background: rgba(255,0,132,0.6); }
.badge-pixabay      { background: rgba(32,173,73,0.75); }
.badge-wikiart      { background: rgba(80,40,120,0.75); }
.badge-nordic       { background: rgba(0,100,160,0.75); }
.badge-getty        { background: rgba(180,140,20,0.75); }
.badge-nga          { background: rgba(20,60,120,0.75); }
.badge-gbif         { background: rgba(20,140,60,0.75); }
.badge-eol          { background: rgba(0,120,80,0.75); }
.badge-apod         { background: rgba(10,20,80,0.8); }
.badge-gallica      { background: rgba(0,80,160,0.75); }
.badge-chronicling  { background: rgba(120,20,20,0.75); }
.badge-openverse    { background: rgba(200,80,0,0.75); }
.badge-trove        { background: rgba(0,100,60,0.75); }
.badge-digitalnz    { background: rgba(0,60,140,0.75); }
.badge-bhl          { background: rgba(60,120,20,0.75); }
.badge-carnegie     { background: rgba(160,40,40,0.75); }
.badge-prado        { background: rgba(140,0,20,0.8); }
.badge-parismusees  { background: rgba(0,60,120,0.8); }
.badge-yale         { background: rgba(0,40,100,0.8); }
.badge-picsum       { background: rgba(80,80,80,0.6); }
.badge-usgs         { background: rgba(80,60,20,0.75); }
.badge-cooperhewitt { background: rgba(200,60,0,0.75); }
.badge-tate         { background: rgba(0,0,0,0.75); }
.badge-finna        { background: rgba(0,80,160,0.75); }
.badge-soch         { background: rgba(180,0,0,0.75); }
.badge-joconde      { background: rgba(0,60,120,0.8); }
.badge-mnw          { background: rgba(180,0,40,0.75); }
.badge-tepapa       { background: rgba(0,120,80,0.75); }
.badge-dpla         { background: rgba(40,100,180,0.75); }
.badge-artsy        { background: rgba(0,0,0,0.8); }
.badge-pas          { background: rgba(100,80,20,0.75); }
.badge-smg          { background: rgba(20,60,120,0.75); }
.badge-auckland     { background: rgba(0,100,100,0.75); }
.badge-photogrammar { background: rgba(80,60,20,0.8); }
.badge-wellcome     { background: rgba(180,0,80,0.75); }
.badge-maas         { background: rgba(200,80,0,0.75); }
.badge-smk          { background: rgba(180,40,0,0.75); }
.badge-thyssen      { background: rgba(0,80,40,0.75); }
.badge-wdl          { background: rgba(100,0,60,0.75); }
.badge-walters      { background: rgba(120,60,0,0.75); }
.badge-princeton    { background: rgba(255,140,0,0.75); }
.badge-wikidata     { background: rgba(0,90,160,0.75); }
.badge-noaa         { background: rgba(0,60,120,0.8); }
.badge-hubble       { background: rgba(10,0,60,0.85); }
.badge-cornell      { background: rgba(180,30,30,0.75); }
.badge-folger       { background: rgba(80,40,0,0.8); }
.badge-onb          { background: rgba(180,0,60,0.75); }
.badge-nypl         { background: rgba(0,60,120,0.8); }
.badge-mak          { background: rgba(0,80,80,0.75); }
.badge-mna              { background: rgba(180,80,0,0.8); }
.badge-louvre           { background: rgba(100,80,20,0.8); }
/* Batch 7 badge tints */
.badge-mia              { background: rgba(180,0,40,0.8); }
.badge-lacma            { background: rgba(0,60,120,0.8); }
.badge-munch            { background: rgba(180,80,0,0.8); }
.badge-mauritshuis      { background: rgba(0,80,40,0.8); }
.badge-nationalmuseumse { background: rgba(0,60,80,0.8); }
.badge-naturalis        { background: rgba(0,100,40,0.8); }
.badge-nmaahc           { background: rgba(40,20,0,0.85); }
.badge-nasm             { background: rgba(0,40,100,0.85); }
.badge-whitney          { background: rgba(0,0,60,0.85); }
.badge-nationalzoo      { background: rgba(0,100,20,0.8); }
.badge-gbiflit          { background: rgba(40,100,0,0.8); }
.badge-freersackler     { background: rgba(120,60,0,0.8); }
.badge-ago              { background: rgba(180,60,0,0.8); }
.badge-pem              { background: rgba(0,80,100,0.8); }
.badge-npg              { background: rgba(40,0,80,0.8); }
.badge-louvread         { background: rgba(180,120,0,0.85); }
.badge-idigbio          { background: rgba(20,120,60,0.8); }
.badge-ala              { background: rgba(0,140,70,0.8); }
.badge-nasa_images      { background: rgba(11,61,145,0.9); }

/* Fallback for dynamically-added sources without a custom badge color */
.source-badge[class*="badge-"] { background: rgba(80,80,80,0.65); }
.badge-loc              { background: rgba(140,20,20,0.9); }

/* ============================================================
   BOARD VIEW
============================================================ */
#board-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

.board-card {
  position: absolute;
  cursor: move;
  user-select: none;
}

.board-card img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}

.board-card .resize-handle {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  cursor: se-resize;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.board-card:hover .resize-handle { opacity: 1; }

/* Board card title overlay (visible on hover) */
.board-card .board-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: #E8E6E1;
  background: rgba(20,20,18,0.72);
  padding: 3px 7px;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.board-card:hover .board-title { opacity: 1; }

/* ============================================================
   BOARD OVERLAY (floating panel — coexists with all views)
============================================================ */
#board-overlay {
  position: fixed;
  right: 16px;
  bottom: 16px;
  width: 480px;
  height: 520px;
  min-width: 280px;
  min-height: 200px;
  z-index: 200;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2), 0 2px 8px rgba(0,0,0,0.1);
  display: none;
  flex-direction: column;
  resize: both;
  overflow: hidden;
}

#board-overlay.open { display: flex; }

#board-overlay-header {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  cursor: move;
  user-select: none;
  gap: 6px;
  flex-shrink: 0;
  background: var(--bg-panel);
}

#board-overlay-content {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.board-delete-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  background: rgba(20,20,18,0.72);
  color: #E8E6E1;
  border: none;
  cursor: pointer;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.board-card:hover .board-delete-btn { opacity: 1; }

/* ============================================================
   3D VIEW CONTAINER
============================================================ */
#three-canvas {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

#three-canvas.active {
  display: block;
}

/* ============================================================
   FLOATING ACTION BAR (cross-reference)
============================================================ */
#floating-bar {
  position: fixed;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  padding: 8px 12px;
  width: fit-content;
  max-width: 520px;
  overflow-x: auto;
  scrollbar-width: none;
  z-index: 50;
  font-family: var(--font-ui);
  cursor: grab;
  user-select: none;
}
#floating-bar.dragging {
  cursor: grabbing;
  transition: none;
  opacity: 0.92;
}
#floating-bar::-webkit-scrollbar { display: none; }

#floating-bar.visible {
  transform: translateX(-50%) translateY(0);
}
#floating-bar.visible.bar-positioned {
  transform: none;
}
#floating-bar.bar-hidden {
  display: none !important;
}

.bar-thumbs {
  display: flex;
  gap: 3px;
  align-items: center;
}

.bar-count {
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.bar-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
  margin: 0 2px;
  flex-shrink: 0;
}

.bar-thumb {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  object-fit: cover;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.bar-thumb:hover { opacity: 0.6; }

/* Icon buttons in floating bar */
.bar-icon-btn {
  background: none;
  border: 1px solid transparent;
  color: var(--ink-2);
  cursor: pointer;
  padding: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.15s ease;
  position: relative;
}
.bar-icon-btn:hover {
  color: var(--ink);
  background: var(--line);
  border-color: var(--line-strong);
}
.bar-icon-btn svg { display: block; pointer-events: none; }
.bar-icon-muted { color: var(--ink-3); }
.bar-icon-muted:hover { color: var(--ink-2); }

#interpret-btn.disabled {
  opacity: 0.25;
  cursor: default;
  pointer-events: none;
}

#interpret-btn {
  position: relative;
}

#interpret-btn.disabled:hover::after {
  content: 'add an ai key to unlock';
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  border: 1px solid var(--line);
  padding: 4px 8px;
  font-size: 9px;
  white-space: nowrap;
  color: var(--ink-2);
  pointer-events: none;
}

#canvas.bar-active { padding-bottom: 80px; }

/* ============================================================
   ONBOARDING OVERLAY
============================================================ */
#onboarding {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.4s ease;
}
#onboarding.visible { opacity: 1; }
#onboarding.hidden { pointer-events: none; }

.ob-inner {
  width: 100%;
  max-width: 600px;
  padding: 40px 32px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  max-height: 100dvh;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.35);
}

.ob-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.ob-track {
  display: flex;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.ob-step {
  min-width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 8px;
}

.ob-logo {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 300;
  font-size: 42px;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.ob-tagline {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  margin-bottom: 28px;
}

.ob-big-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 48px;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 6px;
}

.ob-big-label {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--ink-3);
  text-transform: uppercase;
  margin-bottom: 24px;
}

/* Hero statement slide */
.ob-step-hero {
  justify-content: center;
  padding-top: 0;
}
.ob-step-hero .ob-logo {
  font-size: 36px;
  margin-bottom: 32px;
}
.ob-hero-statement {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 36px;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 28px;
  letter-spacing: -0.01em;
}
.ob-hero-sub {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  max-width: 380px;
}

/* Persistent source info bar (top of canvas) */
#source-info-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  gap: 6px;
  flex-shrink: 0;
  position: relative;
}
#sib-docs-link {
  position: absolute;
  right: 12px;
  font-family: var(--font-ui);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-decoration: none;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: opacity 0.2s ease;
}
#sib-docs-link:hover { opacity: 0.7; }

/* API badge button */
#sib-api-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: transparent;
  font-family: var(--font-ui);
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #c47a20;
  border-color: rgba(196,122,32,0.33);
}
#sib-api-badge:hover { opacity: 0.7; }
#sib-api-badge.all-connected {
  color: #4a9;
  border-color: rgba(68,170,153,0.33);
}
#sib-api-count {
  font-size: 7px;
  opacity: 0.7;
}

/* API dropdown panel */
#sib-api-dropdown {
  position: absolute;
  top: 100%;
  right: 16px;
  width: 340px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 900;
  padding: 10px 0;
  font-family: var(--font-ui);
}
#sib-api-dropdown.hidden { display: none; }

.sib-dd-header {
  padding: 0 12px 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 6px;
}
.sib-dd-title {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.sib-dd-hint {
  display: block;
  font-size: 9px;
  font-weight: 300;
  color: var(--ink-3);
  margin-top: 3px;
  line-height: 1.5;
}
.sib-dd-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  transition: background 0.15s ease;
}
.sib-dd-row:hover { background: var(--bg-hover); }
.sib-dd-row.connected { opacity: 0.45; }
.sib-dd-name {
  font-size: 10px;
  font-weight: 400;
  color: var(--ink);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sib-dd-status {
  font-size: 8px;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.sib-dd-status.active { color: #4a9; }
.sib-dd-status.missing { color: #c47a20; }
.sib-dd-link {
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-decoration: none;
  flex-shrink: 0;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: all 0.15s ease;
}
.sib-dd-link:hover {
  color: var(--ink);
  border-color: var(--ink-3);
}
.sib-dd-footer {
  padding: 8px 12px 2px;
  border-top: 1px solid var(--line);
  margin-top: 6px;
  font-size: 8px;
  font-weight: 300;
  color: var(--ink-3);
  line-height: 1.5;
}

.ob-heading {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 16px;
}

.ob-text {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 300;
  line-height: 1.7;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  max-width: 440px;
  margin-bottom: 20px;
}

.ob-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
  width: 100%;
  max-width: 520px;
  margin-bottom: 20px;
}

.ob-feat {
  border-left: 1px solid var(--ink-3);
  padding: 10px 0 10px 16px;
  text-align: left;
  transition: border-color 0.35s ease;
}

.ob-feat:hover { border-color: var(--ink); }

.ob-feat-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 300;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin-bottom: 5px;
}

.ob-feat-desc {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.03em;
  line-height: 1.6;
}

/* DB summary step */
.ob-stats-row {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-bottom: 20px;
}

.ob-stat {
  text-align: center;
}

.ob-stat-num {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 32px;
  color: var(--ink);
  line-height: 1.1;
}

.ob-stat-label {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  text-transform: uppercase;
}

.ob-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  max-width: 440px;
  margin-bottom: 16px;
}

.ob-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}

.ob-cat-count {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 9px;
}

.ob-source-list {
  width: 100%;
  max-width: 440px;
  max-height: 140px;
  overflow-y: auto;
  border: 1px solid var(--line);
  padding: 8px 12px;
  margin-bottom: 16px;
}

.ob-source-list::-webkit-scrollbar { width: 3px; }
.ob-source-list::-webkit-scrollbar-thumb { background: var(--line-strong); }

.ob-src-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 3px 0;
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink-2);
  letter-spacing: 0.04em;
}

.ob-src-count {
  color: var(--ink-3);
}

.ob-src-key {
  color: var(--accent);
  font-size: 8px;
  margin-left: 4px;
}

/* Navigation */
.ob-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 20px;
}

.ob-dots {
  display: flex;
  gap: 8px;
}

.ob-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-strong);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.ob-dot.active {
  background: var(--accent);
  transform: scale(1.3);
}

.ob-btn {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: lowercase;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 8px 20px;
  cursor: pointer;
  transition: border-color 0.3s ease, opacity 0.3s ease;
}

.ob-btn:hover { border-color: var(--accent); }

.ob-btn-primary {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}

.ob-btn-primary:hover { opacity: 0.8; border-color: var(--ink); }

.ob-skip {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: none;
  border: none;
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 16px;
  transition: opacity 0.3s ease;
}

.ob-skip:hover { opacity: 0.5; }

.ob-note {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 300;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  margin-top: 12px;
}

.quiet-tip {
  position: fixed;
  z-index: 12000;
  max-width: 220px;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.quiet-tip.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── Source view filters (Phase 2) ── */
#source-view-filters {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 5px;
  flex-wrap: wrap;
}
.filter-group-label {
  font-size: 10px;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  min-width: 38px;
  flex-shrink: 0;
}
.filter-pill {
  background: none;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--ink-3);
  font-family: var(--font-ui);
  font-size: 10px;
  padding: 2px 6px;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}
.filter-pill:hover { border-color: var(--line); color: var(--ink-2); }
.filter-pill.active {
  border-color: var(--accent);
  color: var(--bg);
  background: var(--accent);
}
.license-pill-row {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-top: 4px;
}
#filter-source-count {
  font-size: 10px;
  color: var(--ink-3);
  margin-top: 3px;
  display: block;
}

/* Help button in sidebar */
.btn-help {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: none;
  border: 1px solid var(--line);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 50%;
  transition: border-color 0.3s ease, color 0.3s ease;
  margin-bottom: 8px;
}

.btn-help:hover {
  border-color: var(--accent);
  color: var(--ink);
}

@media (max-width: 640px) {
  .ob-features { grid-template-columns: 1fr; }
  .ob-cat-grid { grid-template-columns: 1fr; }
  .ob-big-num { font-size: 36px; }
  .ob-logo { font-size: 32px; }
  .ob-inner { padding: 24px 16px 20px; }
  .ob-stats-row { gap: 16px; }
  .ob-stat-num { font-size: 24px; }
}

/* ============================================================
   MOBILE LAYOUT (≤ 480px)
   At 375px the fixed-width sidebar (240px) + panel (280px)
   overflow the viewport and crush #canvas to 0. Fix: sidebar
   becomes a fixed overlay; canvas takes full width.
============================================================ */
#mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 110;
  background: var(--bg-panel);
  border: 1px solid var(--line-strong);
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1;
  padding: 6px 9px;
  cursor: pointer;
  transition: opacity 0.2s;
}
#mobile-menu-btn:hover { opacity: 0.6; }

#sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 99;
}
#sidebar-backdrop.visible { display: block; }

@media (max-width: 480px) {
  #mobile-menu-btn { display: block; }

  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85vw;
    max-width: 320px;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: calc(24px + env(safe-area-inset-top));
    padding-bottom: env(safe-area-inset-bottom);
  }
  #sidebar.mobile-open { transform: translateX(0); }

  /* Panel becomes full-width when open */
  #panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    z-index: 90;
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Keys & settings panels full-width */
  #keys-panel,
  #settings-panel {
    width: 85vw;
    max-width: 320px;
  }

  /* Image grid works at small widths */
  #image-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  /* Floating bar fits on narrow screens */
  #floating-bar {
    max-width: calc(100vw - 24px);
    flex-wrap: wrap;
    gap: 6px;
  }

  /* AI chat panel full-width */
  #ai-chat-panel {
    width: 100vw;
  }

  /* Board overlay full-screen on mobile */
  #board-overlay {
    width: 100vw !important;
    height: 100dvh !important;
    right: 0;
    bottom: 0;
    top: 0;
    left: 0;
    border: none;
  }

  /* ── Hover-gated elements → always visible ── */
  .image-card .source-badge { opacity: 1; }
  .image-card .zoom-btn { opacity: 1; font-size: 16px; padding: 6px 8px; }
  .image-card .sim-btn { opacity: 1; font-size: 14px; padding: 4px 6px; }
  .board-card .resize-handle { opacity: 0.7; width: 20px; height: 20px; }
  .board-card .board-title { opacity: 1; }
  .board-card .board-delete-btn { opacity: 1; width: 28px; height: 28px; font-size: 16px; line-height: 28px; }

  /* Color dot tooltips — tap-accessible via :active */
  .color-dot-tooltip { pointer-events: auto; }
  .color-dot:active .color-dot-tooltip { opacity: 1; }

  /* ── Minimum font sizes ── */
  .source-badge,
  .board-title,
  .chat-pill,
  .chat-provider-badge,
  .chat-msg-label,
  .chat-empty-label,
  #btn-chat-snapshot { font-size: 11px; }

  /* ── Tap targets minimum 44px ── */
  .chat-pill { min-height: 36px; padding: 6px 10px; }
  .chat-starter { min-height: 44px; padding: 10px 12px; font-size: 13px; }
  .ob-dot { width: 28px; height: 28px; }
  #ob-prev, #ob-next { font-size: 28px; min-width: 44px; min-height: 44px; }

  /* Sidebar buttons — WCAG 2.5.8 minimum 44px touch targets */
  .btn,
  .aspect-btn,
  .filter-pill,
  .search-mode-toggle,
  .btn-help,
  .btn-keys,
  .settings-gear-btn,
  .theme-toggle,
  #mobile-menu-btn,
  #btn-advanced-search,
  #date-filter-apply {
    min-height: 44px;
    min-width: 44px;
  }
  .btn-group .btn { min-width: unset; /* flex items share width */ }
  .aspect-btn-group .aspect-btn { min-width: unset; }
  .image-card .zoom-btn,
  .image-card .sim-btn {
    min-width: 44px;
    min-height: 44px;
    font-size: 18px;
  }

  /* ── OSD fullscreen on mobile ── */
  #osd-container { width: 100vw; height: 100dvh; }
  #osd-close { top: calc(8px + env(safe-area-inset-top)); right: 12px; font-size: 32px; padding: 8px; }

  /* ── Concept pills scrollable ── */
  #concept-pills {
    overflow-x: auto;
    flex-wrap: nowrap !important;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Mobile menu button safe area ── */
  #mobile-menu-btn {
    top: calc(12px + env(safe-area-inset-top));
    left: calc(12px + env(safe-area-inset-left));
  }

  /* ── Source info bar compact ── */
  #source-info-bar {
    font-size: 9px;
    padding: 3px 10px 3px calc(10px + env(safe-area-inset-left));
  }
  #sib-docs-link { display: none; }
}

/* ============================================================
   AI CHAT PANEL
============================================================ */
#ai-chat-panel {
  position: fixed;
  right: 0;
  bottom: 0;
  top: auto;
  width: 280px;
  height: 40dvh;
  background: var(--bg-panel);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
#ai-chat-panel.open { transform: translateX(0); }
/* Give the concepts panel scroll room so content stays visible behind the chat */
body:has(#ai-chat-panel.open) #panel.open { padding-bottom: 40dvh; }
.chat-panel-header {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  gap: 6px;
  flex-shrink: 0;
}
.chat-panel-title {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0.12em;
  color: var(--ink);
  flex: 1;
}
.chat-provider-badge {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 1px 5px;
  text-transform: lowercase;
}
#btn-chat-snapshot {
  font-size: 9px;
  padding: 2px 7px;
  letter-spacing: 0.05em;
  color: var(--ink-3);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink);
}
.chat-msg.user { color: var(--ink-2); text-align: right; padding-left: 20%; }
.chat-msg.assistant { padding-right: 8%; }
.chat-msg .chat-msg-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 3px;
}
.chat-pills { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.chat-pill {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.06em;
  background: none;
  border: 1px solid var(--line-strong);
  color: var(--ink);
  padding: 2px 7px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.chat-pill:hover { border-color: var(--accent); color: var(--accent); }
.chat-empty {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 4px;
}
.chat-empty-label {
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.chat-starter {
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.03em;
  color: var(--ink-3);
  cursor: pointer;
  padding: 6px 8px;
  border: 1px solid var(--line);
  text-align: left;
  background: none;
  transition: color 0.2s, border-color 0.2s;
  width: 100%;
}
.chat-starter:hover { color: var(--ink); border-color: var(--line-strong); }
.chat-input-row { display: flex; border-top: 1px solid var(--line); flex-shrink: 0; }
#chat-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink);
  padding: 10px 12px;
  resize: none;
  height: 68px;
  line-height: 1.4;
}
#chat-input::placeholder { color: var(--ink-3); }
#btn-chat-send {
  padding: 0 14px;
  font-size: 13px;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--font-ui);
}
#btn-chat-send:hover { color: var(--ink); }
.chat-thinking {
  font-family: var(--font-ui);
  font-size: 10px;
  color: var(--ink-3);
  font-style: italic;
}
.ai-provider-pill.active {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ============================================================
   SCREEN-READER ONLY (sr-only)
============================================================ */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   FOCUS-VISIBLE — keyboard-only focus ring
============================================================ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible),
input:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================================
   PREFERS-REDUCED-MOTION — respect user preference
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   GPU ACCELERATION — sketch/bw filter modes
============================================================ */
body.bw-mode .image-card img,
body.sketch-mode .image-card img {
  will-change: filter;
  transform: translateZ(0);
}

/* ============================================================
   TABLET — panel width cap for mid-size screens
============================================================ */
@media (max-width: 768px) and (min-width: 481px) {
  #panel {
    width: min(280px, 50vw);
  }
}

/* ============================================================
   MOBILE EXTRA — sub-360px screens
============================================================ */
@media (max-width: 360px) {
  #image-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

/* h1, h2 reset for semantic heading usage */
h1.logo, h2.section-label {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

/* ============================================================
   COLOR FILTER
============================================================ */
.color-filter-grid {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 0;
}
.color-swatch-btn {
  width: 24px; height: 24px; border-radius: 50%; padding: 2px;
  border: 2px solid transparent; background: none; cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}
.color-swatch-btn span {
  display: block; width: 100%; height: 100%; border-radius: 50%;
}
.color-swatch-btn:hover { transform: scale(1.15); }
.color-swatch-btn.active { border-color: var(--accent); }

/* ============================================================
   SIDE-BY-SIDE COMPARISON VIEW
============================================================ */
.compare-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.92); display: flex; flex-direction: column;
}
.compare-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.compare-header .section-label { color: var(--ink-2); margin: 0; }
.compare-close {
  background: none; border: none; color: var(--ink-2); font-size: 24px;
  cursor: pointer; padding: 4px 8px; transition: color 0.15s;
}
.compare-close:hover { color: var(--ink); }
.compare-grid {
  flex: 1; display: grid; gap: 8px; padding: 12px;
  overflow: auto; align-items: start;
}
.compare-grid[data-count="2"] { grid-template-columns: 1fr 1fr; }
.compare-grid[data-count="3"] { grid-template-columns: 1fr 1fr 1fr; }
.compare-grid[data-count="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.compare-card {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; height: 100%;
}
.compare-card img {
  max-width: 100%; max-height: 60vh; object-fit: contain;
  border-radius: 4px;
}
.compare-meta {
  font-family: var(--font-ui); font-size: 10px; color: var(--ink-2);
  text-align: center; line-height: 1.5; letter-spacing: 0.04em;
}
.compare-meta .title { color: var(--ink); font-size: 11px; margin-bottom: 2px; }

/* ============================================================
   DOWNLOAD + ATTRIBUTION MODAL
============================================================ */
.dl-overlay {
  position: fixed; inset: 0; z-index: 9998;
  background: rgba(0,0,0,0.85); display: flex; align-items: center; justify-content: center;
}
.dl-panel {
  background: var(--bg-panel); border: 1px solid var(--line-strong);
  max-width: 520px; width: 90%; max-height: 80vh; overflow-y: auto;
  padding: 24px; position: relative;
}
.dl-panel-close {
  position: absolute; top: 8px; right: 12px; background: none; border: none;
  color: var(--ink-2); font-size: 20px; cursor: pointer;
}
.dl-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.dl-item:last-child { border-bottom: none; }
.dl-item img {
  width: 80px; height: 80px; object-fit: cover; border-radius: 3px; flex-shrink: 0;
}
.dl-item-info { flex: 1; font-family: var(--font-ui); font-size: 10px; color: var(--ink-2); line-height: 1.6; }
.dl-item-info .title { color: var(--ink); font-size: 11px; font-weight: 500; }
.dl-item-info .attribution {
  background: var(--bg-card); padding: 6px 8px; margin-top: 6px;
  font-size: 9px; letter-spacing: 0.03em; user-select: all;
}
.dl-item-actions { display: flex; gap: 6px; margin-top: 8px; }
.dl-item-actions button {
  font-family: var(--font-ui); font-size: 9px; padding: 4px 10px;
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--ink-2); cursor: pointer; letter-spacing: 0.05em;
  transition: border-color 0.15s, color 0.15s;
}
.dl-item-actions button:hover { border-color: var(--accent); color: var(--accent); }

/* ============================================================
   BOARD TEMPLATE PICKER
============================================================ */
.tmpl-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 8px;
}
.tmpl-card {
  background: var(--bg-card); border: 1px solid var(--line);
  padding: 12px 8px; text-align: center; cursor: pointer;
  font-family: var(--font-ui); font-size: 10px; color: var(--ink-2);
  letter-spacing: 0.05em; transition: border-color 0.15s, color 0.15s;
}
.tmpl-card:hover { border-color: var(--accent); color: var(--ink); }
.tmpl-card .tmpl-preview {
  display: grid; gap: 2px; width: 48px; height: 48px; margin: 0 auto 8px;
}
.tmpl-card .tmpl-preview span {
  background: var(--line); border-radius: 1px;
}

/* ============================================================
   DISCOVER LANDING
============================================================ */
.discover-landing {
  display: flex; flex-direction: column; gap: 40px;
  padding: 60px 0 40px; max-width: 720px; margin: 0 auto; width: 100%;
}

/* ── Hero ── full-bleed image, text on lower-third gradient ── */
.discover-hero {
  position: relative;
  min-height: 360px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.5s ease;
}
.discover-hero:hover { transform: scale(1.01); }

/* gradient scrim — text lives here */
.discover-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    rgba(14,14,13,0.80) 0%,
    rgba(14,14,13,0.30) 45%,
    rgba(14,14,13,0.05) 100%
  );
  transition: background 0.3s;
}
.discover-hero:hover::before {
  background: linear-gradient(
    to top,
    rgba(14,14,13,0.85) 0%,
    rgba(14,14,13,0.35) 50%,
    rgba(14,14,13,0.08) 100%
  );
}

/* light mode scrim */
body.light .discover-hero::before,
:root:not(.dark) .discover-hero::before {
  background: linear-gradient(
    to top,
    rgba(14,14,13,0.75) 0%,
    rgba(14,14,13,0.25) 50%,
    transparent 100%
  );
}

.discover-hero-content {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px 36px;
  text-align: left;
}

.discover-hero-label {
  font-family: var(--font-ui); font-size: 9px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(232,230,225,0.65);
  margin-bottom: 10px;
}
.discover-hero-title {
  font-family: var(--font-display); font-size: 34px;
  font-weight: 300; font-style: italic;
  color: #F7F5F2;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.discover-hero-sub {
  font-family: var(--font-ui); font-size: 10px;
  color: rgba(232,230,225,0.70);
  margin-top: 10px; letter-spacing: 0.04em;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
}

/* no image fallback — keep old bordered look */
.discover-hero:not([style*="background-image"])::before { display: none; }
.discover-hero:not([style*="background-image"]) {
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.discover-hero:not([style*="background-image"]) .discover-hero-content {
  position: static; padding: 48px 24px; text-align: center;
}
.discover-hero:not([style*="background-image"]) .discover-hero-label { color: var(--ink-3); }
.discover-hero:not([style*="background-image"]) .discover-hero-title { color: var(--ink); font-size: 28px; text-shadow: none; }
.discover-hero:not([style*="background-image"]) .discover-hero-sub   { color: var(--ink-2); text-shadow: none; }

/* ── Section labels / pills ─────────────────────────── */
.discover-section {
  display: flex; flex-direction: column; gap: 12px;
}
.discover-section-label {
  font-family: var(--font-ui); font-size: 9px;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3);
}
.discover-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.discover-pill {
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.04em; padding: 5px 12px;
  border: 1px solid var(--line); background: none;
  color: var(--ink-2); cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.discover-pill:hover { border-color: var(--accent); color: var(--ink); }

/* ── Category grid — image-backed cards ─────────────── */
.discover-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
}
.discover-cat {
  position: relative;
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-card);
  border: 1px solid var(--line);
  overflow: hidden;
  cursor: pointer;
  display: flex; align-items: flex-end;
  padding: 0;
  transition: transform 0.35s ease, border-color 0.2s;
}
.discover-cat:hover { transform: scale(1.03); border-color: transparent; }

/* gradient scrim on each card */
.discover-cat::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(14,14,13,0.72) 0%, rgba(14,14,13,0.10) 60%, transparent 100%);
  transition: background 0.25s;
}
.discover-cat:hover::before {
  background: linear-gradient(to top, rgba(14,14,13,0.82) 0%, rgba(14,14,13,0.20) 65%, transparent 100%);
}

/* no image fallback */
.discover-cat:not([style*="background-image"])::before { display: none; }
.discover-cat:not([style*="background-image"]) { align-items: center; justify-content: center; }
.discover-cat:not([style*="background-image"]):hover { border-color: var(--accent); }

.discover-cat-name {
  position: relative; /* above scrim */
  width: 100%;
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.07em; text-transform: lowercase;
  color: #F7F5F2;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  padding: 0 12px 12px;
  display: block;
}
/* no-image fallback text color */
.discover-cat:not([style*="background-image"]) .discover-cat-name {
  color: var(--ink);
  text-shadow: none;
  padding: 0;
  text-align: center;
}

@media (max-width: 600px) {
  .discover-landing { padding: 32px 16px 24px; gap: 28px; }
  .discover-hero { min-height: 260px; }
  .discover-hero-title { font-size: 24px; }
  .discover-hero-content { padding: 24px 20px; }
  .discover-categories { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   HEX COLOR PALETTE
============================================================ */
.hex-palette-row {
  display: flex; align-items: center; gap: 4px; margin-top: 8px;
}
.hex-picker {
  width: 24px; height: 24px; border: 1px solid var(--line);
  padding: 0; cursor: pointer; background: none;
}
.hex-picker::-webkit-color-swatch-wrapper { padding: 1px; }
.hex-picker::-webkit-color-swatch { border: none; border-radius: 1px; }
.hex-input {
  flex: 1; min-width: 0; padding: 4px 6px;
  font-family: var(--font-ui); font-size: 10px;
  background: var(--bg-input, var(--bg-card)); color: var(--ink);
  border: 1px solid var(--line); outline: none; letter-spacing: 0.04em;
}
.hex-add-btn {
  padding: 4px 8px !important; font-size: 12px !important; line-height: 1;
}
.hex-chips {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px;
}
.hex-chip {
  display: flex; align-items: center; gap: 3px;
  padding: 2px 8px 2px 4px; border: 1px solid var(--line);
  background: none; cursor: default; font-family: var(--font-ui); font-size: 9px;
  color: var(--ink-2); letter-spacing: 0.04em;
}
.hex-chip-swatch {
  width: 10px; height: 10px; border-radius: 1px; flex-shrink: 0;
}
.hex-chip-remove {
  background: none; border: none; color: var(--ink-3);
  cursor: pointer; font-size: 11px; line-height: 1; padding: 0 0 0 3px;
}
.hex-chip-remove:hover { color: var(--ink); }

/* ============================================================
   TAXONOMY BROWSE
============================================================ */
.taxonomy-tree { display: flex; flex-direction: column; gap: 2px; }
.taxonomy-group {
  border: 1px solid var(--line); overflow: hidden;
  transition: border-color 0.15s;
}
.taxonomy-group.open { border-color: var(--accent); }
.taxonomy-group-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 10px; cursor: pointer; background: none; border: none;
  width: 100%; font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.06em; color: var(--ink); text-align: left;
  transition: color 0.15s;
}
.taxonomy-group-header:hover { color: var(--accent); }
.taxonomy-group-arrow {
  font-size: 8px; color: var(--ink-3); transition: transform 0.2s;
}
.taxonomy-group.open .taxonomy-group-arrow { transform: rotate(90deg); }
.taxonomy-group-body {
  display: none; padding: 0 10px 8px;
  flex-wrap: wrap; gap: 4px;
}
.taxonomy-group.open .taxonomy-group-body { display: flex; }
.taxonomy-tag {
  font-family: var(--font-ui); font-size: 9px;
  padding: 3px 8px; border: 1px solid var(--line);
  background: none; color: var(--ink-2); cursor: pointer;
  letter-spacing: 0.04em; transition: border-color 0.15s, color 0.15s;
}
.taxonomy-tag:hover { border-color: var(--accent); color: var(--ink); }

/* ============================================================
   MOBILE TOUCH TARGETS
============================================================ */
@media (pointer: coarse) {
  .source-badge     { min-height: 36px; min-width: 36px; display: inline-flex; align-items: center; }
  .zoom-btn,
  .sim-btn          { min-height: 44px; min-width: 44px; font-size: 18px; }
  .badge-refresh    { min-height: 36px; min-width: 28px; display: inline-flex; align-items: center; justify-content: center; }
  .btn-help         { width: 44px; height: 44px; font-size: 14px; }
  .keyword-pill     { min-height: 36px; padding: 6px 12px; }
  .keyword-pill .keyword-x { min-width: 24px; min-height: 24px; font-size: 12px; }
  .ob-btn           { min-height: 44px; padding: 10px 24px; }
  .ob-dot           { width: 10px; height: 10px; }
  .ob-skip          { min-height: 44px; min-width: 44px; display: flex; align-items: center; justify-content: center; }
  .filter-pill      { min-height: 36px; padding: 6px 10px; }
  #panel .act-btn   { min-height: 44px; min-width: 44px; }
  .color-swatch     { min-height: 36px; min-width: 36px; }
  .preset-btn       { min-height: 36px; padding: 6px 12px; }
}

/* ============================================================
   GUIDED TOUR TOOLTIPS
============================================================ */
.guided-tip {
  position: fixed;
  z-index: 11000;
  max-width: 260px;
  font-family: var(--font-ui);
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg-panel);
  border: 1px solid var(--accent);
  padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.guided-tip.visible {
  opacity: 1;
  transform: translateY(0);
}
.guided-tip-label {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 300;
  color: var(--accent);
  margin-bottom: 4px;
}
.guided-tip-dismiss {
  display: inline-block;
  margin-top: 8px;
  font-family: var(--font-ui);
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-3);
  background: none;
  border: 1px solid var(--line);
  padding: 4px 10px;
  cursor: pointer;
  transition: border-color 0.2s;
}
.guided-tip-dismiss:hover { border-color: var(--accent); color: var(--ink); }
.guided-tip-counter {
  font-size: 8px;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  float: right;
  margin-top: 10px;
}
.guided-overlay {
  position: fixed;
  inset: 0;
  z-index: 10500;
  background: rgba(10, 10, 10, 0.25);
  transition: opacity 0.3s ease;
}

/* ============================================================
   ARTIST ENTITY PANEL
============================================================ */
.artist-overlay {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
}
.artist-panel {
  background: var(--bg-panel); border: 1px solid var(--line);
  width: 90%; max-width: 520px; max-height: 80vh;
  overflow-y: auto; padding: 32px; position: relative;
}
.artist-panel-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--ink-3);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.artist-panel-close:hover { color: var(--ink); }
.artist-panel-name {
  font-family: var(--font-display); font-size: 26px;
  font-weight: 300; font-style: italic; color: var(--ink);
  margin-bottom: 4px;
}
.artist-panel-meta {
  font-family: var(--font-ui); font-size: 10px;
  color: var(--ink-2); letter-spacing: 0.04em; margin-bottom: 20px;
}
.artist-panel-works {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 6px; margin-bottom: 16px;
}
.artist-panel-thumb {
  aspect-ratio: 1; object-fit: cover; width: 100%;
  cursor: pointer; border: 1px solid var(--line);
  transition: border-color 0.15s;
}
.artist-panel-thumb:hover { border-color: var(--accent); }
.artist-panel-search {
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.06em; padding: 6px 16px;
  border: 1px solid var(--accent); background: none;
  color: var(--accent); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.artist-panel-search:hover { background: var(--accent); color: #0E0E0D; }

/* ============================================================
   STORIES / EDITORIAL
============================================================ */
.story-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
}
.story-reader {
  background: var(--bg-panel); border: 1px solid var(--line);
  padding: 40px; max-width: 520px; width: 90%;
  max-height: 80vh; overflow-y: auto; position: relative;
}
.story-close {
  position: absolute; top: 12px; right: 16px;
  background: none; border: none; color: var(--ink-3);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.story-close:hover { color: var(--ink); }
.story-reader-title {
  font-family: var(--font-display); font-size: 26px;
  font-weight: 300; font-style: italic; color: var(--ink);
  margin-bottom: 16px; line-height: 1.3;
}
.story-reader-intro {
  font-family: var(--font-ui); font-size: 11px;
  color: var(--ink-2); line-height: 1.7; letter-spacing: 0.03em;
  margin-bottom: 24px;
}
.story-reader-label {
  font-family: var(--font-ui); font-size: 9px;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-3); margin-bottom: 10px;
}
.story-reader-searches {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.story-search-btn {
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.04em; padding: 6px 14px;
  border: 1px solid var(--accent); background: none;
  color: var(--accent); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.story-search-btn:hover { background: var(--accent); color: #0E0E0D; }

.stories-list-panel {
  background: var(--bg-panel); border: 1px solid var(--line);
  padding: 32px; max-width: 600px; width: 90%;
  max-height: 80vh; overflow-y: auto; position: relative;
}
.stories-list-heading {
  font-family: var(--font-display); font-size: 24px;
  font-weight: 300; font-style: italic; color: var(--ink);
  margin-bottom: 20px;
}
.stories-list-grid {
  display: flex; flex-direction: column; gap: 8px;
}
.stories-list-card {
  display: block; text-align: left; padding: 14px 16px;
  border: 1px solid var(--line); background: none;
  cursor: pointer; transition: border-color 0.15s;
}
.stories-list-card:hover { border-color: var(--accent); }
.stories-list-title {
  font-family: var(--font-ui); font-size: 11px;
  color: var(--ink); letter-spacing: 0.04em; margin-bottom: 4px;
}
.stories-list-intro {
  font-family: var(--font-ui); font-size: 9px;
  color: var(--ink-3); letter-spacing: 0.03em;
}

/* ============================================================
   ONBOARDING TOUR & HELP
============================================================ */
.tour-backdrop {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0,0,0,0.45);
  transition: opacity 0.2s;
}
.tour-tooltip {
  position: fixed; z-index: 10002;
  background: var(--bg-panel); border: 1px solid var(--accent);
  padding: 16px 20px; max-width: 280px;
  font-family: var(--font-ui); font-size: 11px;
  color: var(--ink); letter-spacing: 0.03em;
  line-height: 1.5; box-shadow: 0 4px 24px rgba(0,0,0,0.25);
}
.tour-tooltip-title {
  font-size: 10px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent);
  margin-bottom: 8px;
}
.tour-tooltip-body { color: var(--ink-2); }
.tour-tooltip-footer {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 14px;
}
.tour-tooltip-step {
  font-size: 9px; color: var(--ink-3); letter-spacing: 0.06em;
}
.tour-tooltip-btn {
  font-family: var(--font-ui); font-size: 10px;
  letter-spacing: 0.06em; padding: 5px 14px;
  border: 1px solid var(--accent); background: none;
  color: var(--accent); cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tour-tooltip-btn:hover { background: var(--accent); color: #0E0E0D; }
.tour-tooltip-skip {
  font-family: var(--font-ui); font-size: 9px;
  background: none; border: none; color: var(--ink-3);
  cursor: pointer; letter-spacing: 0.04em;
  text-decoration: underline; text-underline-offset: 2px;
}
.tour-highlight {
  position: relative; z-index: 10001 !important;
  box-shadow: 0 0 0 3px var(--accent), 0 0 0 6px rgba(200,184,154,0.2) !important;
}
.help-btn {
  background: none; border: 1px solid var(--line); color: var(--ink-3);
  width: 22px; height: 22px; font-family: var(--font-ui);
  font-size: 11px; display: flex; align-items: center;
  justify-content: center; cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.help-btn:hover { border-color: var(--accent); color: var(--ink); }
.cheat-overlay {
  position: fixed; inset: 0; z-index: 10003;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
}
.cheat-panel {
  background: var(--bg-panel); border: 1px solid var(--line);
  padding: 32px; max-width: 480px; width: 90%;
  max-height: 80vh; overflow-y: auto;
  font-family: var(--font-ui); font-size: 11px;
  color: var(--ink); letter-spacing: 0.03em; line-height: 1.6;
}
.cheat-panel h2 {
  font-family: var(--font-display); font-weight: 300;
  font-size: 22px; margin-bottom: 20px; color: var(--ink);
}
.cheat-panel h3 {
  font-size: 9px; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--accent);
  margin: 18px 0 8px;
}
.cheat-panel code {
  background: var(--bg-card); padding: 1px 5px;
  font-family: var(--font-ui); font-size: 10px; color: var(--ink-2);
}
.cheat-panel dt { color: var(--ink); margin-top: 6px; }
.cheat-panel dd { color: var(--ink-2); margin-left: 12px; }
.cheat-close {
  position: absolute; top: 16px; right: 16px;
  background: none; border: none; color: var(--ink-3);
  font-size: 18px; cursor: pointer; line-height: 1;
}

/* ── Advanced Search Panel ── */
.adv-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 10000;
  background: rgba(0,0,0,0.4);
  animation: fadeIn 0.15s ease;
}
.adv-panel {
  position: absolute; top: 0; left: 0;
  width: min(400px, 88vw); height: 100vh;
  background: var(--bg);
  border-right: 1px solid var(--line-strong);
  display: flex; flex-direction: column;
  font-family: var(--font-ui);
  animation: slideInLeft 0.2s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
}
.adv-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.adv-title {
  font-size: 14px; letter-spacing: 0.08em; color: var(--ink);
  font-weight: 400;
}
.adv-close {
  background: none; border: none; color: var(--ink-2);
  font-size: 22px; cursor: pointer; line-height: 1;
  padding: 4px;
}
.adv-close:hover { color: var(--ink); }
.adv-body {
  flex: 1; overflow-y: auto;
  padding: 20px 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.adv-field {
  display: flex; flex-direction: column; gap: 6px;
}
.adv-field-label {
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--ink); text-transform: lowercase;
  font-weight: 400;
}
.adv-panel .adv-input,
.adv-panel .adv-select {
  font-family: var(--font-ui); font-size: 13px;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--line-strong);
  padding: 8px 10px;
  letter-spacing: 0.03em; outline: none;
  transition: border-color 0.15s;
  width: 100%;
}
.adv-panel .adv-input:focus,
.adv-panel .adv-select:focus {
  border-color: var(--accent);
}
.adv-panel .adv-input::placeholder {
  color: var(--ink-3); font-size: 12px;
}
.adv-input--sm { width: 100px !important; flex: 1; }
.adv-row { display: flex; align-items: center; gap: 8px; }
.adv-sep { color: var(--ink-3); font-size: 13px; }
.adv-hr {
  border: none; border-top: 1px solid var(--line-strong);
  margin: 4px 0 0;
}
.adv-section-title {
  font-size: 10px; letter-spacing: 0.12em; color: var(--ink-2);
  text-transform: uppercase; margin-bottom: -4px;
}
.adv-color-picker {
  width: 32px; height: 32px; border: 1px solid var(--line-strong);
  padding: 0; cursor: pointer; background: none; flex-shrink: 0;
}
.adv-color-picker::-webkit-color-swatch-wrapper { padding: 2px; }
.adv-color-picker::-webkit-color-swatch { border: none; }
.adv-check-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-2); cursor: pointer;
}
.adv-check-row input { accent-color: var(--accent); }
.adv-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--line-strong);
  flex-shrink: 0;
}
.adv-btn {
  font-family: var(--font-ui); font-size: 12px;
  padding: 8px 20px; border: 1px solid var(--line-strong);
  background: var(--bg); color: var(--ink-2);
  cursor: pointer; letter-spacing: 0.05em;
  transition: all 0.15s;
}
.adv-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.adv-btn--primary {
  background: var(--ink); color: var(--bg);
  border-color: var(--ink);
}
.adv-btn--primary:hover { opacity: 0.85; }
