/* Layout: a drop-off strip (images + text) over a masonry-like shelf; the editor is a full-screen workbench. */
:root {
  --bg: #eef0ed;
  --surface: #ffffff;
  --surface-2: #f6f7f5;
  --ink: #1a1f1d;
  --muted: #5f6a66;
  --line: #d8ddd9;
  --accent: #0b6e64;
  --accent-ink: #ffffff;
  --accent-soft: #d7ebe7;
  --danger: #b42318;
  --check-a: #e6e9e6;
  --check-b: #f8f9f8;
  --stage: #dfe3df;
  --shadow: 0 1px 2px rgba(20, 30, 26, .06), 0 4px 16px rgba(20, 30, 26, .06);

  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r-md: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121615;
    --surface: #1a1f1e;
    --surface-2: #202624;
    --ink: #e6ebe9;
    --muted: #9aa5a1;
    --line: #2d3432;
    --accent: #3cb5a5;
    --accent-ink: #062320;
    --accent-soft: #173733;
    --danger: #f2796e;
    --check-a: #262c2a;
    --check-b: #1d2221;
    --stage: #0d100f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
kbd {
  font: 500 11px/1 var(--font-mono);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- Buttons & fields ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink);
  font-weight: 500; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: default; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { border-color: var(--accent); filter: brightness(1.08); }
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--line); }
.btn--block { width: 100%; }
.btn--small { height: 30px; padding: 0 10px; font-size: 13px; }
.btn--sq { width: 36px; padding: 0; font-size: 18px; }
.linkish {
  background: none; border: 0; padding: 0; color: var(--accent);
  font-weight: 500; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.field input {
  height: 42px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink); font-size: 15px;
}
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }

/* ---------- Wordmark ---------- */
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font: 700 22px/1 var(--font-display); letter-spacing: -.02em;
}
.wordmark--lg { font-size: 28px; line-height: 1.1; text-wrap: balance; align-items: flex-start; }
@media (max-width: 520px) { .topbar .wordmark { font-size: 18px; } }
.mark { position: relative; width: 22px; height: 22px; flex: none; }
.wordmark--lg .mark { width: 30px; height: 30px; }
.mark::before, .mark::after { content: ""; position: absolute; width: 68%; height: 68%; border-radius: 3px; }
.mark::before { left: 0; bottom: 0; background: var(--accent); }
.mark::after { right: 0; top: 0; border: 2.5px solid var(--accent); }

/* ---------- Login ---------- */
.gate { min-height: 100%; display: grid; place-items: center; padding: 24px 16px; }
.gate-card {
  width: 100%; max-width: 380px; display: grid; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 32px 28px; box-shadow: var(--shadow);
}
.gate-lede { margin: 0; color: var(--muted); }
.gate-error { margin: 0; padding: 10px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size: 14px; }
.gate-form { display: grid; gap: 16px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 12px max(16px, calc((100% - 1240px) / 2));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.topbar-actions form { margin: 0; }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; margin-right: 6px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.sync.is-off::before { background: var(--danger); }
.sync.is-busy::before { background: var(--muted); animation: pulse 1s infinite alternate; }
@keyframes pulse { to { opacity: .3; } }

/* ---------- Board ---------- */
.board { max-width: 1240px; margin: 0 auto; padding: 24px 16px 64px; display: grid; gap: 32px; }
.dropoff { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 760px) { .dropoff { grid-template-columns: 1fr; } }

.drop-target {
  position: relative; display: grid; place-content: center; justify-items: center; text-align: center; gap: 4px;
  min-height: 210px; padding: 24px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: 14px; background: var(--surface); cursor: pointer;
  transition: background .15s, border-color .15s;
}
.drop-target:hover, .drop-target.is-over { background: var(--accent-soft); border-color: var(--accent); }
.drop-art { position: relative; width: 56px; height: 46px; margin-bottom: 10px; }
.drop-art span { position: absolute; width: 38px; height: 30px; border-radius: 5px; }
.drop-art span:first-child { left: 0; bottom: 0; background: var(--accent); }
.drop-art span:last-child { right: 0; top: 0; border: 2px solid var(--accent); background: var(--surface); opacity: .9; }
.drop-title { margin: 0; font: 600 20px/1.2 var(--font-display); }
.drop-sub { margin: 0; color: var(--muted); font-size: 14px; }
.upload-bar { position: absolute; left: 16px; right: 16px; bottom: 14px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.upload-bar div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }

.composer {
  display: grid; grid-template-rows: auto 1fr auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
}
.composer-name {
  border: 0; border-bottom: 1px solid var(--line); background: transparent;
  padding: 12px 16px; font-weight: 600; outline: none;
}
.composer-body {
  min-height: 120px; resize: vertical; border: 0; background: transparent; outline: none;
  padding: 12px 16px; font: 13.5px/1.55 var(--font-mono); tab-size: 2;
}
.composer:focus-within { border-color: var(--accent); }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; background: var(--surface-2); border-top: 1px solid var(--line); }
.composer-btns { display: flex; gap: 8px; margin-left: auto; }

/* Hidden-character warnings */
.scan-panel {
  display: grid; gap: 8px; padding: 10px 16px 12px;
  border-top: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 7%, var(--surface));
}
.scan-panel.is-notice { border-top-color: var(--line); background: var(--surface-2); }
.scan-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.scan-head strong { color: var(--danger); }
.scan-panel.is-notice .scan-head strong { color: var(--muted); }
.scan-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.scan-item { font-size: 12px; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); }
.scan-item--problem { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); color: var(--danger); }
.scan-item--notice { color: var(--muted); }
.scan-preview {
  margin: 0; max-height: 260px; overflow: auto; padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface); border: 1px solid var(--line);
  font: 12.5px/1.6 var(--font-mono); white-space: pre-wrap; word-break: break-word;
}
.hc { border-radius: 3px; padding: 0 1px; color: inherit; font: inherit; }
.hc--problem { background: color-mix(in srgb, var(--danger) 22%, transparent); outline: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); color: var(--danger); }
.hc--notice { background: color-mix(in srgb, var(--muted) 25%, transparent); }
.hc--tag { font: 600 9.5px/1 var(--font-body); letter-spacing: .04em; padding: 1px 3px; margin: 0 1px; vertical-align: 1px; cursor: help; }
.scan-badge {
  justify-self: start; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px;
  border: 1px solid color-mix(in srgb, var(--danger) 45%, var(--line)); border-radius: 999px;
  background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger);
  font-size: 12px; font-weight: 500; padding: 2px 9px; cursor: pointer;
}
.scan-badge.is-notice { border-color: var(--line); background: var(--surface-2); color: var(--muted); }
.card .scan-list { padding: 0 12px 4px; }
.hint { font-size: 12px; color: var(--muted); display: inline-flex; gap: 3px; align-items: center; }

/* ---------- Shelf ---------- */
.shelf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); }
.tab { border: 0; background: transparent; padding: 6px 12px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 14px; color: var(--muted); }
.tab span { font: 500 11px/1 var(--font-mono); margin-left: 4px; opacity: .8; font-variant-numeric: tabular-nums; }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.search { height: 36px; width: min(280px, 100%); padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }

/* Two columns: images left (masonry thumbnails), text right (one card per row). Phones show one at a time. */
.columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.col { min-width: 0; }
.col-title {
  margin: 0 0 12px; display: flex; align-items: baseline; gap: 8px;
  font: 600 18px/1.2 var(--font-display); letter-spacing: -.01em;
}
.col-title span { font: 500 12px/1 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.col-grid { columns: 2 180px; column-gap: 12px; }
.col-grid .card { margin-bottom: 12px; }
.col-list { display: grid; gap: 12px; }
.col-list .card { margin: 0; }
.col-empty { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--r-md); font-size: 14px; }
.shelf-tabs { display: none; }
@media (max-width: 760px) {
  .columns { grid-template-columns: 1fr; }
  .shelf-tabs { display: inline-flex; }
  .col-title { display: none; }
  .columns[data-show="image"] .col--text, .columns[data-show="text"] .col--image { display: none; }
}
.card {
  break-inside: avoid; margin: 0 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; display: flex; flex-direction: column;
}
.card.is-pinned { border-color: var(--accent); }
.card.is-new { animation: arrive .4s ease-out; }
@keyframes arrive { from { transform: translateY(-6px); opacity: 0; } }
.thumb {
  display: block; width: 100%; padding: 0; border: 0; cursor: zoom-in;
  background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0 / 16px 16px;
}
.thumb img { width: 100%; height: auto; max-height: 420px; object-fit: contain; }
.snippet {
  position: relative; margin: 0; padding: 14px 16px; max-height: 220px; overflow: hidden;
  font: 12.5px/1.55 var(--font-mono); white-space: pre-wrap; word-break: break-word;
  background: var(--surface-2);
}
.snippet.is-long::after { content: ""; position: absolute; inset: auto 0 0; height: 48px; background: linear-gradient(transparent, var(--surface-2)); }
.snippet.is-open { max-height: none; }
.snippet.is-open::after { display: none; }
.text-edit { width: 100%; min-height: 200px; border: 0; padding: 14px 16px; background: var(--surface-2); font: 12.5px/1.55 var(--font-mono); resize: vertical; outline: none; display: block; }
.card-meta { padding: 10px 12px 4px; display: grid; gap: 2px; min-width: 0; }
.card-name {
  border: 1px solid transparent; border-radius: 4px; background: transparent;
  padding: 2px 4px; margin: 0 -4px; font-weight: 600; font-size: 14px; width: calc(100% + 8px);
  text-overflow: ellipsis;
}
.card-name:hover { border-color: var(--line); }
.card-name:focus { border-color: var(--accent); outline: none; background: var(--surface-2); }
.card-sub { font: 12px/1.4 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.card-actions { display: flex; flex-wrap: wrap; gap: 2px; padding: 4px 6px 8px; }
.act {
  border: 0; background: transparent; padding: 5px 8px; border-radius: 5px;
  font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center;
}
.act:hover { background: var(--surface-2); color: var(--ink); }
.act--primary { color: var(--accent); }
.act--danger:hover { color: var(--danger); }
.act.is-on { color: var(--accent); }
.act-spacer { flex: 1; }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); max-width: 420px; margin: 0 auto; }
.empty-title { font: 600 18px/1.3 var(--font-display); color: var(--ink); margin: 0 0 6px; }

/* ---------- Toasts & drag cover ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; justify-items: center; width: max-content; max-width: calc(100% - 32px); }
.toast {
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 8px;
  font-size: 14px; box-shadow: var(--shadow); animation: arrive .2s ease-out;
}
.toast.is-error { background: var(--danger); color: #fff; }
.dragcover {
  position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  border: 3px dashed var(--accent);
}
.dragcover p { font: 700 28px/1 var(--font-display); background: var(--surface); padding: 16px 24px; border-radius: 12px; box-shadow: var(--shadow); margin: 0; }

/* ---------- Editor ---------- */
.editor { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.ed-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.ed-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
#ed-zoom-label { font: 500 13px/1 var(--font-mono); min-width: 44px; font-variant-numeric: tabular-nums; }
.ed-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; min-height: 0; }
.ed-stage { position: relative; background: var(--stage); overflow: hidden; touch-action: none; }
.ed-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.ed-empty { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; color: var(--muted); text-align: center; pointer-events: none; padding: 0 16px; }
.ed-side { overflow-y: auto; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; }
@media (max-width: 820px) {
  .editor { overflow-y: auto; grid-template-rows: auto auto; }
  .ed-body { grid-template-columns: 1fr; }
  .ed-stage { height: 60vh; }
  .ed-side { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
}
.panel { padding: 14px 16px; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.panel h3 { margin: 0; font: 600 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.panel h3 small { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 4px; }
.panel--export { margin-top: auto; border-bottom: 0; background: var(--surface-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); height: 32px; overflow: hidden; min-width: 0; }
.mini span { padding: 0 8px; font: 500 11px/1 var(--font-mono); color: var(--muted); border-right: 1px solid var(--line); height: 100%; display: grid; place-items: center; background: var(--surface-2); }
.mini input, .mini select { border: 0; background: transparent; height: 100%; width: 100%; min-width: 0; padding: 0 8px; font: 13px/1 var(--font-mono); outline: none; font-variant-numeric: tabular-nums; }
.mini:focus-within { border-color: var(--accent); }
.mini--inline { width: 96px; }
.color-pair { display: flex; gap: 6px; align-items: center; }
.eyedrop {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--muted);
}
.eyedrop:hover { color: var(--accent); border-color: var(--accent); }
.eyedrop.is-on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.save-row { display: flex; gap: 6px; align-items: center; }
.small-link { font-size: 12.5px; justify-self: start; }
.sub-head { font-size: 12px; font-weight: 600; color: var(--muted); }
.backdrop-only { display: grid; gap: 8px; padding: 10px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.chip--strong { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.btn-row { display: flex; gap: 8px; }
.btn-row .btn { flex: 1; }
.crop-tip { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.panel--crop { background: var(--accent-soft); }
.t-text { width: 100%; min-height: 64px; resize: vertical; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); font: 14px/1.4 var(--font-body); }
.t-text:focus { outline: none; border-color: var(--accent); }
.text-only { display: grid; gap: 8px; }
.seg--2 { grid-template-columns: repeat(2, 1fr); }
.row-rot { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; align-items: center; }
.fx { display: grid; gap: 8px; }
.fx-body { display: grid; gap: 8px; padding: 10px; border-radius: var(--r-sm); background: var(--surface-2); }
.ex-note { margin: 0; font-size: 12px; color: var(--muted); }
.layer-swatch--text { display: grid; place-items: center; font: 700 15px/1 var(--font-display); color: var(--ink); background: var(--surface-2); }
.cv-hint { margin: 0; padding: 8px 10px; border-radius: var(--r-sm); background: var(--accent-soft); font-size: 12.5px; line-height: 1.45; }
.row-bg, .row-fit, .row-color { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.mini--grow { flex: 1; }
input[type="color"] { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; flex: none; }
.range { display: grid; grid-template-columns: auto 1fr 44px; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.range input { accent-color: var(--accent); }
.range output { font: 12px var(--font-mono); text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip--danger:hover { border-color: var(--danger); color: var(--danger); }
.rect-only { display: grid; gap: 10px; }
.grad-only, .linear-only { display: grid; gap: 8px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; padding: 3px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; padding: 5px 0; border-radius: 5px; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; }
.seg button.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.chip.is-on { border-color: var(--accent); color: var(--accent); }
.layers { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.layer {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 8px;
  padding: 5px 6px; border-radius: var(--r-sm); cursor: pointer; font-size: 13px; border: 1px solid transparent;
}
.layer:hover { background: var(--surface-2); }
.layer.is-sel { background: var(--accent-soft); border-color: var(--accent); }
.layer.is-hidden .layer-name { opacity: .45; }
.layer-swatch { width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line); object-fit: cover; background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0 / 8px 8px; }
.layer-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.layer-btns { display: flex; gap: 0; }
.layer-btns button { border: 0; background: transparent; width: 24px; height: 24px; border-radius: 4px; cursor: pointer; color: var(--muted); font-size: 12px; padding: 0; }
.layer-btns button:hover { background: var(--surface); color: var(--ink); }
.layers-empty { font-size: 13px; color: var(--muted); margin: 0; }
.ex-dims { margin: 0; font: 12px var(--font-mono); color: var(--muted); }

.pop-wrap { position: relative; }
.popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 5;
  width: min(360px, 90vw); max-height: 60vh; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); box-shadow: var(--shadow);
  padding: 12px;
}
.popover-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 14px; }
.picker-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.picker-grid button {
  aspect-ratio: 1; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); cursor: pointer; overflow: hidden;
  background: repeating-conic-gradient(var(--check-a) 0 25%, var(--check-b) 0 50%) 0 0 / 10px 10px;
}
.picker-grid button:hover { border-color: var(--accent); }
.picker-grid img { width: 100%; height: 100%; object-fit: contain; }
.picker-grid p { grid-column: 1 / -1; margin: 0; font-size: 13px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
