/* ============================================================
   AlleySearcher — maiko.cafe default theme
   Warm cream paper, sage primary, terracotta for saved state.
============================================================ */

:root {
  /* palette */
  --bg: #F7F6F2;
  --surface: #FFFFFF;
  --cream: #F5F1EB;
  --cream-dark: #EBE5DC;
  --ink: #3A3834;
  --muted: #6E6A62;
  --muted-2: #9B9B9B;
  --border: #D9D2C7;
  --border-soft: #E5DED2;

  --sage: #7D9B76;
  --sage-dark: #5D7C66;
  --sage-soft: #EDF3EA;
  --sage-wash: #DCE6D7;

  --terracotta: #C49A86;          /* saved state — warm accent */
  --terracotta-dark: #9F7562;
  --terracotta-soft: #F3E4DA;

  --exhibit: #8B7AA8;             /* exhibitor booths */
  --exhibit-soft: #E6DEF0;
  --exhibit-wash: #D4C6E2;

  --gold: #C4A882;
  --gold-soft: #F2E6CC;
  --rose: #C4A4A4;

  --visited-ink: #9AA591;         /* muted sage — visited */
  --visited-soft: #E4E7DE;

  --spine:        #7D9B76;        /* notebook spine accent (matches blog) */
  --spine-dark:   #5C7A55;
  --paper-lines:  repeating-linear-gradient(
                    to bottom,
                    transparent 0,
                    transparent 27px,
                    rgba(58, 56, 52, 0.07) 27px,
                    rgba(58, 56, 52, 0.07) 28px
                  );

  /* type — families */
  --font-display: "Playfair Display", Georgia, serif;
  --font-body: "Inter", "Lato", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-casual: "Lato", "Inter", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* type — semantic scale (1.2 ratio, ~14px base) */
  --text-micro:   0.72rem;   /* 10.1px — eyebrows, meta counts */
  --text-caption: 0.82rem;   /* 11.5px — secondary body, counts, hints */
  --text-body:    0.95rem;   /* 13.3px — list + panel body copy */
  --text-subhead: 1.1rem;    /* 15.4px — artist name, minor titles */
  --text-heading: 1.55rem;   /* 21.7px — side title, drawer head */
  --text-display: 1.8rem;    /* 25.2px — detail name, top brand */

  /* type — tracking */
  --tracking-display: -0.01em;
  --tracking-eyebrow: 0.01em;

  /* shape */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;

  /* shadow */
  --shadow-soft: 0 6px 24px rgba(44, 62, 51, 0.05);
  --shadow-card: 0 8px 24px rgba(44, 62, 51, 0.07);
  --shadow-pop: 0 12px 32px rgba(44, 62, 51, 0.14);
  --shadow-ring-sage: 0 0 0 3px rgba(125, 155, 118, 0.22);
  --shadow-ring-terra: 0 0 0 3px rgba(196, 154, 134, 0.28);

  /* motion */
  --ease: cubic-bezier(.2,.6,.2,1);

  /* map backdrop brightness/contrast — tuned differently in dark mode */
  --map-bg-filter: none;
  --map-dim-filter: grayscale(1) brightness(1.02);
}

/* ============================================================
   Dark theme — deep warm brown paper, cream ink, sage accents
   preserved for brand continuity with the light theme.
============================================================ */
:root[data-theme="dark"] {
  --bg: #1A1814;
  --surface: #24211C;
  --cream: #2C2822;
  --cream-dark: #393429;
  --ink: #E8E2D4;
  --muted: #A89F90;
  --muted-2: #75705F;
  --border: #3F3A2E;
  --border-soft: #332E24;

  --sage: #9BBA92;
  --sage-dark: #BDD4B5;
  --sage-soft: #2E3D2B;
  --sage-wash: #253120;

  --terracotta: #D9AF99;
  --terracotta-dark: #EBC4AF;
  --terracotta-soft: #3D2C23;

  --exhibit: #A594C2;
  --exhibit-soft: #342B44;
  --exhibit-wash: #42375A;

  --gold: #D4B88A;
  --gold-soft: #3A3220;
  --rose: #C4A4A4;

  --visited-ink: #B4BFAA;
  --visited-soft: #2A3226;

  --spine:        #7D9B76;
  --spine-dark:   #5C7A55;
  --paper-lines:  repeating-linear-gradient(
                    to bottom,
                    transparent 0,
                    transparent 27px,
                    rgba(232, 226, 212, 0.06) 27px,
                    rgba(232, 226, 212, 0.06) 28px
                  );

  --shadow-soft: 0 6px 24px rgba(0, 0, 0, 0.35);
  --shadow-card: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-pop:  0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-ring-sage:  0 0 0 3px rgba(155, 186, 146, 0.28);
  --shadow-ring-terra: 0 0 0 3px rgba(217, 175, 153, 0.28);

  /* Invert + warm-tint the grayscale floorplan so the black ink on the PNG
     becomes readable against the dark surface. */
  --map-bg-filter: invert(0.88) hue-rotate(180deg) sepia(0.12) saturate(0.8) brightness(0.95);
  --map-dim-filter: invert(0.88) hue-rotate(180deg) grayscale(1) brightness(0.82);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { overflow: hidden; }

#root { height: 100%; display: flex; flex-direction: column; }

button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
a { color: var(--sage-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============================================================
   App shell
============================================================ */

.app-shell {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;   /* dvh accounts for mobile browser chrome */
  background: var(--bg);
  overflow: hidden;
}

/* ============================================================
   Top bar
============================================================ */

.top-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 28px 14px;
  background: var(--bg);
}
.brand {
  display: flex; align-items: baseline; gap: 10px;
  flex: 1 1 auto; min-width: 0;
}
.brand-name {
  font-family: var(--font-display);
  font-size: 1.7rem;
  color: var(--sage-dark);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.3;
}
.brand-sub em {
  color: var(--ink);
  font-style: normal;
  font-weight: 500;
}
.brand-event-link {
  color: var(--sage-dark);
  font-weight: 600;
  text-decoration: none;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.brand-event-link:hover { color: var(--sage); text-decoration: underline; }
.brand-venue { color: var(--ink); }
.brand-dates { color: var(--muted); }
.top-actions { display: flex; gap: 8px; flex: 0 0 auto; align-items: center; }

/* Round icon buttons in the top bar: FAQ (?) + theme toggle (☾/☀).
   One shared shape so the right-side action cluster reads as a set. */
.icon-round {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--cream-dark);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  transition: background 160ms var(--ease), color 160ms var(--ease),
              border-color 160ms var(--ease);
}
.icon-round:hover {
  background: var(--sage-soft);
  color: var(--sage-dark);
  border-color: var(--sage);
}
.theme-toggle-glyph {
  font-size: 15px;
  line-height: 1;
  display: inline-block;
  color: var(--ink);
}
:root[data-theme="dark"] .theme-toggle-glyph {
  font-size: 16px;
  color: #F7E9C2;              /* warm gold for the sun in dark mode */
  text-shadow: 0 0 6px rgba(247, 233, 194, 0.35);
}

/* ============================================================
   Filter bar
============================================================ */

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 28px 14px;
  background: var(--bg);
  flex-wrap: wrap;
}
.chip-row {
  display: flex; gap: 6px; flex-wrap: wrap; align-items: center;
  flex: 1 1 auto;
}

/* Vertical layout — used in the left filter column (desktop) and the
   mobile filter pane. Stacks the search input and two chip groups. */
.filter-bar-vertical {
  flex-direction: column;
  align-items: stretch;
  padding: 24px 22px 22px;
  gap: 18px;
  min-height: 100%;
}
.filter-bar-vertical .search {
  width: 100%;
  min-width: 0;
  flex: 0 0 auto;
}
/* Stack each scope filter on its own row: saved, visited, w/ notes, w/ catalog. */
.filter-bar-vertical .chip-row {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
}
.filter-bar-vertical .chip-row .chip {
  justify-content: space-between;
  padding: 7px 10px;
  font-size: var(--text-caption);
  font-weight: 500;
  border-radius: 6px;
  transition: background 140ms var(--ease), border-color 140ms var(--ease),
              color 140ms var(--ease);
}
/* 2×2 grid of quick filters: saved | visited / w notes | w catalog. */
.filter-bar-vertical .chip-row-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.filter-bar-vertical .chip-row-grid .chip { width: 100%; }
.filter-bar-vertical .chip-row .chip .chip-count {
  margin-left: auto;
}
/* Fandom section is now an inline scrollable list, no extra overrides needed
   beyond letting it occupy the full column width. */
.filter-bar-vertical .fandom-chip-row { flex-wrap: wrap; }
.filter-bar-vertical .chip-divider { display: none; }

.filter-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--cream-dark);
}
.filter-section:first-of-type { border-top: 0; padding-top: 2px; }

/* Shared editorial eyebrow — small italic lowercase label used above
   any group of controls. Matches `.side-eyebrow` on the right list so
   both columns read in the same voice. */
.filter-section-label,
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-caption);
  font-weight: 500;
  font-style: italic;
  color: var(--muted);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: none;
  padding: 0 2px;
}
.filter-section-label::after { content: ":"; }
/* Fixed-height slot below the fandom list so the "clear all" link never
   shifts surrounding content when it appears. */
.filter-bar-vertical .clear-all-slot {
  height: 28px;
  display: flex;
  align-items: center;
  margin-top: 2px;
}
.filter-bar-vertical .clear-all {
  padding: 4px 8px;
  margin: 0;
}
.chip-divider {
  width: 1px; height: 18px;
  background: var(--cream-dark);
  margin: 0 4px;
}
/* search input + typeahead */
.search-wrap { position: relative; width: 100%; flex: 0 1 240px; }
.filter-bar-vertical .search-wrap { flex: 0 0 auto; }
.search {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  min-width: 200px;
  flex: 0 1 240px;
  transition: box-shadow 160ms var(--ease), border-color 160ms var(--ease);
}
.search:focus-within { border-color: var(--sage); box-shadow: var(--shadow-ring-sage); }
.search svg { color: var(--muted); flex: 0 0 auto; }
.search input {
  border: 0; background: transparent; outline: none;
  padding: 0; width: 100%;
  font-size: 14px;
  color: var(--ink);
}
.search .clear {
  border: 0; background: transparent; color: var(--muted);
  padding: 2px 4px; border-radius: var(--radius-sm);
  font-size: 16px; line-height: 1;
}
.search .clear:hover { background: var(--cream-dark); color: var(--ink); }

/* Typeahead dropdown — appears below the search while typing. */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 40;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  max-height: 320px;
  overflow-y: auto;
}
.sug-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--ink);
}
.sug-row + .sug-row { border-top: 1px solid var(--cream-dark); }
.sug-row.is-active,
.sug-row:hover { background: var(--sage-soft); border-top-color: transparent; }
.sug-row.is-active + .sug-row { border-top-color: transparent; }
.sug-name {
  font-size: var(--text-body);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sug-table {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  color: var(--sage-dark);
  letter-spacing: 0.02em;
}

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface);
  border: 1px solid var(--cream-dark);
  color: var(--ink);
  padding: 0 14px;
  height: 30px;                         /* fixed height — no layout shift on toggle */
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 500;                     /* identical in active + inactive */
  line-height: 1;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.chip:hover { background: var(--cream); border-color: var(--sage); }
.chip.is-active {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-dark);
}
.chip.tone-saved.is-active {
  background: var(--terracotta-soft);
  border-color: var(--terracotta);
  color: var(--terracotta-dark);
}
.chip.tone-visited.is-active {
  background: var(--visited-soft);
  border-color: var(--visited-ink);
  color: #586753;
}
.chip .caret { margin-left: 2px; color: var(--muted); font-size: 10px; }
/* "filters" chip has a fixed width so toggling doesn't bump neighbors */
.chip-filters {
  min-width: 86px;
  justify-content: center;
}
.chip-count {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0;
  color: var(--muted);
  min-width: 18px;                      /* reserves room for up to 3 digits */
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.chip.is-active .chip-count { color: var(--sage-dark); }
.chip.tone-saved.is-active .chip-count { color: var(--terracotta-dark); }
.chip.tone-visited.is-active .chip-count { color: #586753; }

.link {
  border: 0; background: transparent; color: var(--muted);
  font-size: 0.8rem; padding: 4px 6px; border-radius: var(--radius-sm);
}
.link:hover { color: var(--sage-dark); text-decoration: underline; }
.link.danger { color: #b56d6d; }
.link.clear-all { margin-left: 4px; }

/* fandom filter — inline scrollable list, lives directly in the sidebar. */
.fandom-filter {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.fandom-search {
  display: flex; align-items: center; gap: 6px;
}
.fandom-search input {
  flex: 1 1 auto;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  outline: none;
  font-size: var(--text-caption);
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.fandom-search input:focus { border-color: var(--sage); box-shadow: var(--shadow-ring-sage); }
.fandom-clear {
  font-size: var(--text-micro);
  color: var(--terracotta-dark);
  white-space: nowrap;
}
.fandom-list {
  max-height: 120px;    /* ~4 rows visible, scroll for more */
  overflow-y: auto;
  padding: 2px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.pop-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center; gap: 8px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  font-size: var(--text-caption);
  cursor: pointer;
}
.pop-item:hover { background: var(--cream); }
.pop-item.is-checked { color: var(--sage-dark); }
.pop-item.is-checked .pop-count { color: var(--sage-dark); }
.pop-item.is-empty { color: var(--muted-2); }
.pop-item input { accent-color: var(--sage); }
.pop-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-count {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding: 1px 0;
}
.pop-empty { padding: 16px; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* ============================================================
   Desktop main (map + side)
============================================================ */

.desktop-main {
  position: relative;
  display: grid;
  /* filter-col | map-col (1fr, bounded) | list-col */
  grid-template-columns: 272px minmax(0, 1fr) 360px;
  gap: 0;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg);
  overflow: hidden;
}
.desktop-main.side-collapsed {
  grid-template-columns: 272px minmax(0, 1fr) 0px;
}

.filter-col {
  background: var(--surface);
  border-right: 1px solid var(--cream-dark);
  overflow-y: auto;
  overflow-x: hidden;
  min-width: 0;
  min-height: 0;
}

.map-col {
  padding: 20px 20px 20px 24px;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  overflow: auto;
}
.map-col .map-viewport {
  max-width: 880px;    /* default + cap — about 520px tall at 1834:1090 */
  width: 100%;
}

/* ============================================================
   Map
============================================================ */

.map-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1834 / 1090;   /* matches the official reference PNG */
  max-height: calc(100dvh - 240px);
  min-height: 360px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(58, 56, 52, 0.04);
}
.map-viewport svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;   /* pan/pinch via pointer events */
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.map-viewport svg:active { cursor: grabbing; }

/* Backdrop image — desaturates when filters narrow the visible set,
   so non-matching booths read as grayscale background. */
.map-bg {
  filter: var(--map-bg-filter);
  transition: filter 220ms var(--ease);
}
.map-bg.is-dim {
  filter: var(--map-dim-filter);
}

/* Booth hit zones — booth shapes are in the background image. We only overlay
   state decorations and an invisible rect to capture pointer events. */
.booth-hit { cursor: pointer; }
.booth-hit .hit { pointer-events: all; }
.booth-hit.is-dimmed { cursor: pointer; }   /* still clickable even if filtered out */

.ov { pointer-events: none; }

/* Match — opaque colored fill (restores booth hue over the grayscaled
   backdrop) + a gold outline ring so matches pop strongly. */
.ov-match-fill.ov-match-alley   { fill: #9FC495; opacity: 0.82; }
.ov-match-fill.ov-match-exhibit { fill: #A98EC8; opacity: 0.78; }
.ov-match-ring {
  fill: none;
  stroke: var(--gold);
  stroke-width: 3;
}

/* Visited scrim — muted sage wash */
.ov-visited {
  fill: rgba(154, 165, 145, 0.4);
  mix-blend-mode: multiply;
}

/* Saved scrim — terracotta wash */
.ov-saved {
  fill: rgba(196, 154, 134, 0.5);
  stroke: var(--terracotta-dark);
  stroke-width: 1;
  mix-blend-mode: multiply;
}

/* Selection ring — sharp dark outline */
.ov-selected {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
}

/* State badges drawn on top of booth */
.state-badge {
  fill: color-mix(in oklab, var(--surface) 96%, transparent);
  stroke: rgba(58, 56, 52, 0.28);
  stroke-width: 1.5;
  filter: drop-shadow(0 1px 2px rgba(58, 56, 52, 0.26));
  pointer-events: none;
}
.state-badge-saved { stroke: var(--terracotta-dark); }
.state-badge-visited { stroke: var(--sage-dark); }
.state-badge-note { stroke: var(--ink); }
.state-glyph {
  font-size: 11px;
  font-weight: 800;
  stroke: var(--surface);
  stroke-width: 2px;
  stroke-linejoin: round;
  paint-order: stroke;
  pointer-events: none;
  user-select: none;
}
.state-glyph-saved { fill: var(--terracotta-dark); }
.state-glyph-visited { fill: var(--sage-dark); }
.state-glyph-note { fill: var(--ink); }

/* Booth-ID label rendered on top of any state overlay. paint-order: stroke
   paints the stroke first (as a wider outline) then the fill on top, giving
   the text a built-in halo without needing a separate shadow element. This
   keeps labels legible against both the sage alley fill and the purple
   exhibitor fill in either theme. */
.booth-label {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 700;
  fill: var(--ink);
  stroke: var(--surface);
  stroke-width: 3.5px;
  stroke-linejoin: round;
  paint-order: stroke;
  pointer-events: none;
  user-select: none;
  letter-spacing: 0.01em;
}
.booth-label-exhibit {
  fill: #2A223A;     /* deep purple — readable on the exhibitor fill */
  stroke: #E9DFF3;   /* light lavender halo */
}
.booth-label-lg { font-size: 18px; stroke-width: 4.5px; }

/* Dark-mode override: the inverted backdrop flips booth fill tones, so
   flip the label halo/fill to stay contrasting. */
:root[data-theme="dark"] .booth-label {
  fill: var(--ink);
  stroke: rgba(0, 0, 0, 0.75);
}
:root[data-theme="dark"] .booth-label-exhibit {
  fill: #F0E4FF;
  stroke: rgba(38, 28, 60, 0.85);
}

/* Hover tooltip — HTML overlay that tracks the cursor (mouse only) */
.map-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: var(--ink);
  color: var(--surface);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.3;
  box-shadow: 0 4px 14px rgba(58, 56, 52, 0.22);
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateY(-100%);
  max-width: 260px;
}
/* When flipped to the cursor's left side, the tooltip's anchor is its right
   edge — translate horizontally so `left` means "right edge sits here." */
.map-tooltip.map-tooltip-left { transform: translate(-100%, -100%); }
.map-tooltip .tt-id {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--sage-soft);
  font-size: 0.78rem;
}
.map-tooltip .tt-name { font-weight: 500; }

/* map overlays */
.map-overlay {
  position: absolute;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  font-size: 0.8rem;
  padding: 6px 10px;
}
.zoom-ctl {
  right: 14px;
  top: 14px;
  display: inline-flex;
  flex-direction: column;
  padding: 0;
  gap: 0;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  backdrop-filter: blur(6px);
}
.zoom-ctl button {
  background: transparent;
  border: 0;
  width: 34px; height: 34px;
  border-radius: 0;
  font-size: 16px; line-height: 1;
  color: var(--muted);
  font-weight: 500;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.zoom-ctl button + button { border-top: 1px solid var(--cream-dark); }
.zoom-ctl button:hover { background: var(--sage-soft); color: var(--sage-dark); }
.zoom-ctl button:active { background: var(--sage-wash); }
.zoom-ctl .zoom-reset { font-size: 13px; }


/* ============================================================
   Side panel
============================================================ */

.side-panel {
  position: relative;
  background: var(--surface);
  display: flex;
  min-width: 0;
  overflow: hidden;
  transition: width 200ms var(--ease);
}
/* Notebook-spine gradient down the panel's left edge — the signature
   maiko.cafe binding look, stolen straight from the weekly-planner. */
.side-panel::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 6px;
  background: linear-gradient(
    to right,
    var(--spine-dark) 0%,
    var(--spine)     30%,
    var(--spine)     70%,
    var(--spine-dark) 100%
  );
  opacity: 0.92;
  pointer-events: none;
  z-index: 2;
}
.side-panel.is-collapsed { width: 0; }
.side-panel.is-collapsed::before { display: none; }

/* Expand-tab — appears as a full-height bookshelf ribbon on the far right
   when the list is collapsed. Vertical label, mirrors the side-panel spine. */
.expand-tab {
  position: absolute;
  top: 0; bottom: 0;
  right: 0;
  width: 34px;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface);
  border: 0;
  border-left: 1px solid var(--cream-dark);
  box-shadow: inset 6px 0 0 0 var(--spine), inset 12px 0 0 -6px var(--spine-dark);
  color: var(--sage-dark);
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  font-style: italic;
  letter-spacing: 0.08em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);   /* read bottom-to-top, standard book-spine convention */
  cursor: pointer;
  z-index: 30;
  transition: background 160ms var(--ease), color 160ms var(--ease);
}
.expand-tab:hover { background: var(--sage-soft); color: var(--sage-dark); }
.expand-tab::before {
  content: "◀";
  display: inline-block;
  writing-mode: horizontal-tb;
  transform: rotate(90deg);
  margin-bottom: 10px;
  font-size: 10px;
  color: var(--muted);
  font-style: normal;
}

.side-inner {
  display: flex; flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden;
}
.side-head {
  position: relative;
  padding: 18px 24px 12px 28px;
  background: transparent;
}
.side-collapse-inline {
  position: absolute;
  bottom: 14px;
  right: 14px;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--cream-dark);
  color: var(--muted);
  font-size: var(--text-caption);
  padding: 6px 12px;
  border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(58, 56, 52, 0.05);
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}
.side-collapse-inline:hover { background: var(--sage-soft); color: var(--sage-dark); border-color: var(--sage); }
.side-eyebrow {
  display: flex; justify-content: space-between; align-items: baseline;
  color: var(--muted);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-eyebrow);
  margin-bottom: 6px;
  font-style: italic;
}
.side-title {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  line-height: 1.15;
  margin: 0 0 4px;
  color: var(--sage-dark);
  font-weight: 600;
  letter-spacing: var(--tracking-display);
}
.side-sub {
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.5;
  max-width: 38ch;
}
.side-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 14px 64px 20px;   /* bottom padding clears the floating collapse button */
}

/* ============================================================
   Row list
============================================================ */

.row-list { display: flex; flex-direction: column; gap: 0; }
.row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 0;
  border-bottom: 1px solid var(--cream-dark);
  cursor: pointer;
  transition:
    background-color 140ms var(--ease),
    box-shadow 140ms var(--ease);
  align-items: center;
  position: relative;
}
.row:last-child { border-bottom: 0; }
.row:hover { background-color: var(--cream); }
.row.is-match {
  background-color: color-mix(in oklab, var(--gold-soft) 50%, var(--surface));
}
.row.is-match:hover {
  background-color: color-mix(in oklab, var(--gold-soft) 74%, var(--surface));
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--gold) 38%, transparent);
}
.row.is-selected,
.row.is-match.is-selected {
  background-color: color-mix(in oklab, var(--sage-soft) 72%, var(--surface));
}
.row.is-selected::before,
.row.is-match.is-selected::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--sage-dark);
}
.row.is-visited .row-num {
  color: var(--visited-ink);
  background-color: var(--visited-soft);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--visited-ink) 34%, var(--border));
}

.row-num {
  font-family: var(--font-mono);   /* mono is legit here — real booth code */
  font-weight: 700;
  color: var(--sage-dark);
  padding-top: 0;
  font-size: var(--text-micro);
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.row-body { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.row-title-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
  min-width: 0;
}
.row-name {
  min-width: 0;
  flex: 0 1 auto;
  color: var(--ink);
  font-weight: 650;
  font-size: 0.96rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row-state-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  flex: 0 0 auto;
  min-width: fit-content;
}
.row-shared-tag,
.row-noted-tag {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-micro);
  padding: 0 6px;
  height: 17px;
  line-height: 1;
  border-radius: 3px;
  font-weight: 500;
  gap: 4px;
}
.row-shared-tag  { background: var(--gold-soft);    color: #7b6a4a; }
.row-noted-tag   { background: var(--cream);        color: var(--ink); border: 1px solid var(--cream-dark); }
.row-meta {
  color: var(--muted);
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.row-catalog-tag {
  display: inline-flex;
  align-items: center;
  color: var(--sage-dark);
  font-weight: 500;
  font-size: var(--text-micro);
  padding: 0 6px;
  height: 17px;
  line-height: 1;
  background: var(--sage-soft);
  border: 1px solid color-mix(in oklab, var(--sage) 45%, var(--cream-dark));
  border-radius: 3px;
}
.row-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.row-note {
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-micro);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  color: var(--ink);
  font-size: var(--text-micro);
  padding: 0 8px;
  height: 20px;
  line-height: 1;
  border-radius: 4px;     /* flatter — not a pill */
  white-space: nowrap;
}
.mini-tag.niche { background: var(--gold-soft); border-color: #e1d0ac; }
.mini-tag.more  { background: transparent; color: var(--muted); border-color: var(--cream-dark); }

.row-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.icon-btn {
  background: transparent;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  width: 30px; height: 30px;
  display: grid; place-items: center;
  font-size: 13px;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}
.icon-btn:hover { background: var(--cream); border-color: var(--sage-dark); color: var(--ink); }
.icon-btn.save-btn.is-saved {
  color: var(--terracotta-dark);
  background: var(--terracotta-soft);
  border-color: var(--terracotta);
}
.icon-btn.visit-btn.is-visited {
  color: #586753;
  background: var(--visited-soft);
  border-color: var(--visited-ink);
}
.icon-btn.close-btn { width: 34px; height: 34px; font-size: 18px; }

/* empty states */
.empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}
.empty-big {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--ink);
  margin-bottom: 6px;
}

/* ============================================================
   Detail panel
============================================================ */

.detail { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.detail-content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.detail-head {
  padding: 8px 22px 16px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--cream-dark);
}
.detail-info,
.detail-controls {
  min-width: 0;
}
.detail.has-catalog-layout {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.detail.has-catalog-layout .detail-content {
  display: grid;
  grid-template-columns: minmax(205px, 0.76fr) minmax(300px, 1.24fr);
  flex: 1 1 auto;
  min-height: 0;
}
.detail.has-catalog-layout .detail-head {
  min-height: 0;
  overflow-y: auto;
  border-bottom: 0;
  border-right: 1px solid var(--cream-dark);
}
.detail.has-catalog-layout .detail-body {
  min-height: 0;
  border-left: 0;
  overflow-x: hidden;
}
.detail-nav {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex: 0 0 auto;
  margin-bottom: 0;
  padding: 16px 22px 0 24px;
}
.detail-nav-arrows {
  display: inline-flex; gap: 4px; align-items: center;
  background: var(--cream);
  border-radius: var(--radius-pill);
  padding: 2px 4px;
}
.detail-nav-arrows .icon-btn { width: 26px; height: 26px; border: 0; background: transparent; }
.detail-nav-arrows .icon-btn:hover:not(:disabled) { background: var(--surface); }
.detail-nav-arrows .icon-btn:disabled { opacity: 0.35; cursor: default; }
.detail-t-id {
  font-family: var(--font-mono);   /* mono is legit here — it's a table code */
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--sage-dark);
  padding: 0 6px;
}
.back-btn {
  font-family: var(--font-casual);
  font-size: 0.9rem;
  white-space: nowrap;
}
.detail-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  margin: 0;
  color: var(--sage-dark);
  line-height: 1.1;
  font-weight: 600;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  letter-spacing: var(--tracking-display);
}

/* Socials sit on their own row below the title so long names never fight
   for space and the title can flex from short (`Magui`) to long
   (`Bunnysleepover`) without any shift. */
.detail-socials-row {
  display: flex;
  align-items: center;
  margin: 6px 0 2px;
}
.social-icons { display: inline-flex; gap: 6px; align-items: center; flex: 0 0 auto; }
.social-icon {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--cream-dark);
  color: var(--ink);
  font-size: 12px;
  line-height: 1;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
  text-decoration: none;
}
.social-icon:hover { transform: translateY(-1px); text-decoration: none; }
.social-icons.compact .social-icon { width: 24px; height: 24px; font-size: 11px; }

/* Unlinked slot: muted, no interaction. */
.social-empty {
  background: var(--cream);
  border-color: var(--cream-dark);
  color: var(--muted-2);
  cursor: default;
}
.social-empty:hover { transform: none; }

/* Linked slot: brand tint per network. Hover darkens toward the brand. */
.social-linked.social-x {
  background: #111;
  border-color: #111;
  color: #fff;
}
.social-linked.social-x:hover { background: #000; border-color: #000; }
.social-linked.social-ig {
  background: linear-gradient(135deg, #FEDA75 0%, #FA7E1E 25%, #D62976 50%, #962FBF 75%, #4F5BD5 100%);
  border-color: #962FBF;
  color: #fff;
}
.social-linked.social-bsky {
  background: #1185FE;
  border-color: #0e70d7;
  color: #fff;
}
.no-socials { display: none; }

/* Labeled tag groups — label lives on its own line above the tag row. */
.tag-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 8px 0 0;
}
.tag-group-label {
  font-size: var(--text-caption);
  font-style: italic;
  color: var(--muted);
  font-family: var(--font-body);
  letter-spacing: var(--tracking-eyebrow);
}
/* Wrap naturally at content width so short labels don't stretch to fill an
   empty track. Cap each pill at ~45% of the row so one very long tag can't
   hog the line. */
.tag-row-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-row-grid .mini-tag {
  max-width: min(100%, calc(50% - 3px));
  padding: 2px 8px;
  font-size: 0.72rem;
  box-sizing: border-box;
}
/* Button variant — identical look to the span, but clickable. */
.mini-tag-btn {
  display: inline-grid;
  grid-template-columns: minmax(0, 1fr) 0.82rem;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  font: inherit;
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease),
              color 140ms var(--ease);
}
.mini-tag-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mini-tag-btn:hover {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-dark);
}
.mini-tag-btn.niche:hover {
  background: #f1e1bd;
  border-color: #c7b17a;
  color: #7b6a4a;
}
.mini-tag-btn::after {
  content: "+";
  display: inline-block;
  width: 0.82rem;
  text-align: center;
  line-height: 1;
  color: var(--muted-2);
  font-weight: 600;
  font-size: 0.72rem;
}
.mini-tag-btn:hover::after { color: currentColor; }
.detail-artist-note {
  margin-top: 8px;
  font-size: 0.9rem;
  color: var(--ink);
}
.detail-pills {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 12px;
}
.pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0 10px;
  height: 24px;
  line-height: 1;
  border-radius: 4px;
  background: var(--cream);
  color: var(--muted);
  border: 1px solid var(--cream-dark);
  white-space: nowrap;
}
.pill-official { background: var(--sage-soft); color: var(--sage-dark); border-color: var(--sage); }
.pill-artist-submitted { background: var(--gold-soft); color: #7b6a4a; border-color: #d9c8a3; }
.pill-pending { background: #F4EADE; color: #8a7353; border-color: #DDCBAF; }
.pill-exhibitor { background: var(--exhibit-soft); color: #5A4E75; border-color: var(--exhibit); }
.pill-catalog { background: var(--sage-soft); color: var(--sage-dark); border-color: var(--sage); }
.pill-no-catalog { background: var(--cream); color: var(--muted); }
.pill-shared { background: var(--gold-soft); color: #7b6a4a; border-color: #d9c8a3; }
.pill-noted  { background: var(--cream); color: var(--ink); border-color: var(--cream-dark); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  min-height: 36px;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), transform 140ms var(--ease);
}
.btn:hover { background: var(--cream); border-color: var(--sage-dark); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-primary {
  background: var(--sage-dark); color: var(--surface); border-color: var(--sage-dark);
}
.btn-primary:hover { background: var(--sage); border-color: var(--sage); }
.btn-ghost { background: transparent; }
/* Fixed widths so the label can flip between save/saved + visit/visited
   without the button resizing. */
.btn-save  { min-width: 108px; justify-content: center; }
.btn-visit { min-width: 108px; justify-content: center; }
.btn-save.is-saved {
  background: var(--terracotta);
  color: var(--surface);
  border-color: var(--terracotta);
}
.btn-save.is-saved:hover { background: var(--terracotta-dark); border-color: var(--terracotta-dark); }
.btn-visit.is-visited {
  background: var(--visited-soft);
  color: #586753;
  border-color: var(--visited-ink);
}
.detail-actions {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-top: 12px; margin-bottom: 0;
}

/* Action pills — compact, uniform width, three-up row.
   Active states: saved=terracotta, visited=sage-soft, notes=cream. */
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--cream-dark);
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-caption);
  font-weight: 500;
  line-height: 1;
  min-width: 68px;
  min-height: 28px;
  justify-content: center;
  transition: background 140ms var(--ease), border-color 140ms var(--ease),
              color 140ms var(--ease), transform 140ms var(--ease);
}
.pill-btn:hover { background: var(--cream); border-color: var(--sage); }
.pill-btn:active { transform: translateY(1px); }
.pill-btn-icon { font-size: 12px; line-height: 1; }
.pill-btn-label { font-weight: 500; }

.pill-btn.is-saved {
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
  border-color: var(--terracotta);
}
.pill-btn.is-saved:hover { background: var(--terracotta); color: var(--surface); border-color: var(--terracotta-dark); }

.pill-btn.is-visited {
  background: var(--visited-soft);
  color: #586753;
  border-color: var(--visited-ink);
}

.pill-btn.is-noted {
  background: var(--cream);
  color: var(--sage-dark);
  border-color: var(--sage);
}

/* Notes drawer — collapses to zero height when closed instead of being pinned
   below. grid-template-rows animation keeps it smooth without touching layout
   props directly. */
.notes-drawer {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  visibility: hidden;
  transition: grid-template-rows 220ms var(--ease), opacity 140ms var(--ease), visibility 0s linear 220ms;
  margin-top: 0;
}
.notes-drawer.is-open {
  grid-template-rows: 1fr;
  opacity: 1;
  visibility: visible;
  margin-top: 12px;
  transition: grid-template-rows 220ms var(--ease), opacity 140ms var(--ease), visibility 0s;
}
.notes-drawer-inner {
  overflow: hidden;
  min-height: 0;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 7px;
  padding: 0;
  transition: padding 220ms var(--ease);
}
.notes-drawer.is-open .notes-drawer-inner { padding: 12px; }

.detail-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 14px 22px 64px;
  display: flex; flex-direction: column; gap: 14px;
}

/* notes editor — sits on the page like a ruled margin note */
.detail-notes {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.notes-label {
  font-size: var(--text-caption);
  color: var(--sage-dark);
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 6px;
  font-weight: 500;
}
.notes-sub { color: var(--muted-2); font-weight: 400; font-style: italic; }
.notes-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 7px 9px;
  resize: vertical;
  min-height: 40px;
  max-height: 90px;
  font-size: var(--text-caption);
  outline: none;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.notes-input:focus { border-color: var(--sage); box-shadow: var(--shadow-ring-sage); }

/* artist card */
.artist-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.artist-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px;
}
.artist-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.artist-handle { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; }
.niches-row .mini-tag { background: var(--gold-soft); border-color: #e1d0ac; }
.artist-note {
  font-size: 0.92rem;
  color: var(--ink);
  background: var(--cream);
  padding: 10px 14px;
  border-radius: var(--radius);
  font-style: italic;
  line-height: 1.5;
}
.artist-note::before { content: ""; } /* no quote prefix; use typographic quotes inline */
.artist-socials { display: flex; flex-wrap: wrap; gap: 10px; font-size: 0.82rem; }
.artist-socials a { font-family: var(--font-mono); }
.no-socials { color: var(--muted-2); font-style: italic; font-size: 0.82rem; }

.catalog-link-row { margin-top: 2px; }
.catalog-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.85rem;
  background: var(--sage-soft);
  color: var(--sage-dark);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  border: 1px solid transparent;
  align-self: flex-start;
}
.catalog-link:hover { background: var(--sage-wash); text-decoration: none; border-color: var(--sage); }

/* Tweet embed — transparent wrapper; the tweet's own chrome provides the
   card. An outer container made it easy to misclick the "full media" link
   thinking it was part of the tweet, so we dropped it. */
.catalog-embed {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  width: 100%;
  max-width: min(100%, 560px);
  margin-inline: auto;
}
.catalog-embed iframe {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}
.catalog-embed-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
  font-size: 0.82rem; color: var(--muted);
}
.catalog-embed-head a { color: var(--sage-dark); font-weight: 600; }
.catalog-embed blockquote.twitter-tweet { margin: 0 !important; }
.catalog-link-inline { font-size: 0.78rem; }

/* Shared-artist cards (used only when table.shared) */
.shared-artists { display: flex; flex-direction: column; gap: 10px; }
.artist-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }

.catalog-note {
  font-size: 0.78rem;
  color: var(--muted-2);
  font-style: italic;
  padding: 4px 2px;
}

/* ============================================================
   Mobile layout & modal
============================================================ */

.mobile-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: relative;
  overflow: hidden;
}
.mobile-map-pane {
  flex: 0 0 45vh;
  padding: 8px 10px;
  min-height: 0;
  display: flex;
}
.mobile-map-pane .map-viewport {
  flex: 1 1 auto;
  width: 100%;
  aspect-ratio: auto;
  max-height: none;
  min-height: 0;
  border-radius: var(--radius);
}
.mobile-lower {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 35% 1fr;
  min-height: 0;
  border-top: 1px solid var(--cream-dark);
}
.mobile-filters {
  border-right: 1px solid var(--cream-dark);
  overflow-y: auto;
  min-height: 0;
  background: var(--surface);
}
.mobile-filters .filter-bar-vertical {
  padding: 12px 10px;
  gap: 8px;
}
.mobile-filters .filter-bar-vertical .chip {
  width: 100%;
  justify-content: space-between;
}
.mobile-filters .filter-bar-vertical .fandom-filter {
  width: 100%;
}
.mobile-list {
  overflow-y: auto;
  min-height: 0;
  background: var(--surface);
}
.mobile-list .side-panel {
  background: transparent;
  border: 0;
  display: block;
  height: auto;
}
.mobile-list .side-panel::before { display: none; }
.mobile-list .side-collapse-inline { display: none; }
.mobile-list .side-inner { height: auto; display: block; }
.mobile-list .side-head {
  padding: 14px 14px 8px;
}
.mobile-list .side-title { font-size: 1.15rem; }
.mobile-list .side-body { padding: 4px 8px 16px; }

.mobile-settings-root {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.mobile-settings-scrim {
  position: absolute;
  inset: 0;
  background: rgba(58, 56, 52, 0.34);
  backdrop-filter: blur(2px);
}
.mobile-settings-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  border: 1px solid var(--cream-dark);
  border-bottom: 0;
  border-radius: 18px 18px 0 0;
  background: var(--surface);
  box-shadow: 0 -18px 44px rgba(44, 62, 51, 0.18);
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
}
.mobile-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.mobile-settings-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--sage-dark);
  letter-spacing: var(--tracking-display);
}
.mobile-settings-actions {
  display: grid;
  gap: 8px;
}
.mobile-settings-actions button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--surface) 96%, var(--cream));
  color: var(--ink);
  text-align: left;
}
.mobile-settings-actions span {
  font-weight: 650;
}
.mobile-settings-actions small {
  color: var(--muted);
  font-size: var(--text-micro);
}

.export-notes-root {
  position: fixed; inset: 0;
  z-index: 88;
  pointer-events: none;
}
.export-notes-root * { pointer-events: auto; }
.export-notes-scrim {
  position: absolute; inset: 0;
  background: rgba(20, 24, 20, 0.42);
  backdrop-filter: blur(2px);
}
.export-notes-sheet {
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: min(440px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--cream-dark);
  box-shadow: var(--shadow-pop);
  display: grid;
  grid-template-rows: auto 1fr auto;
}
.export-notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 18px;
  border-bottom: 1px solid var(--cream-dark);
}
.export-notes-head h2 {
  font-family: var(--font-display);
  color: var(--sage-dark);
  margin: 0;
  font-size: var(--text-heading);
}
.export-notes-list {
  padding: 12px 14px;
  overflow: auto;
}
.export-note-row {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 8px;
  border-radius: var(--radius);
  color: var(--muted);
}
.export-note-row + .export-note-row { margin-top: 4px; }
.export-note-row:hover { background: var(--cream); }
.export-note-row strong { color: var(--ink); }
.export-note-table {
  color: var(--sage-dark);
  font-family: var(--font-mono);
  font-weight: 700;
}
.export-note-heart { color: var(--terracotta); }
.export-notes-foot {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--cream-dark);
  background: var(--surface-muted);
}

.m-modal-root {
  position: fixed; inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.m-modal-scrim {
  position: absolute; inset: 0;
  background: rgba(58, 56, 52, 0.42);
  backdrop-filter: blur(1px);
}
.m-modal {
  position: relative;
  width: min(calc(100vw - 24px), 430px);
  height: min(86vh, 720px);
  height: min(86dvh, 720px);
  background: var(--surface);
  border-radius: 16px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 18px 42px rgba(44, 62, 51, 0.18);
  animation: m-card-in 180ms var(--ease);
  overflow: hidden;
}
@keyframes m-card-in {
  from { transform: translateY(10px) scale(0.98); opacity: 0; }
  to   { transform: translateY(0) scale(1);       opacity: 1; }
}
.detail-mobile { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.m-modal .detail-mobile .detail-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.detail-mobile .detail-head {
  padding: 14px 16px 8px;
  flex: 0 0 auto;
  max-height: min(42%, 300px);
  overflow-y: auto;
  border-bottom: 1px solid var(--cream-dark);
}
.detail-mobile .detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, 0.42fr);
  align-items: start;
  gap: 10px;
}
.detail-mobile .detail-controls {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  padding-top: 2px;
}
.detail-mobile .detail-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 0;
}
.detail-mobile .pill-btn {
  min-width: 0;
  min-height: 26px;
  width: 100%;
  padding-inline: 6px;
  font-size: var(--text-micro);
}
.detail-mobile .notes-drawer.is-open {
  align-self: flex-end;
  width: min(176px, 100%);
  max-width: 176px;
  margin-top: 7px;
  z-index: 2;
}
.detail-mobile .notes-drawer-inner {
  padding: 0;
}
.detail-mobile .notes-drawer.is-open .notes-drawer-inner {
  padding: 7px;
}
.detail-mobile .notes-label {
  display: block;
  font-size: var(--text-micro);
  margin-bottom: 4px;
}
.detail-mobile .notes-sub {
  display: none;
}
.detail-mobile .notes-input {
  min-height: 42px;
  padding: 6px 7px;
  font-size: var(--text-micro);
}
.detail-mobile .detail-title { font-size: 1.5rem; }
.detail-mobile .detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 16px calc(24px + env(safe-area-inset-bottom));
}
.detail-mobile .close-btn { margin-left: -4px; }

/* ============================================================
   Saved drawer
============================================================ */

.drawer-root {
  position: fixed; inset: 0;
  z-index: 70;
  pointer-events: none;
  visibility: hidden;
}
.drawer-root.is-open { pointer-events: auto; visibility: visible; }
.drawer-scrim {
  position: absolute; inset: 0;
  background: rgba(58, 56, 52, 0.32);
  opacity: 0;
  transition: opacity 200ms var(--ease);
}
.drawer-root.is-open .drawer-scrim { opacity: 1; }
.drawer {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: var(--surface);
  display: flex; flex-direction: column;
  box-shadow: -12px 0 32px rgba(44, 62, 51, 0.14);
  transform: translateX(100%);
  transition: transform 220ms var(--ease);
}
.drawer-root.is-open .drawer { transform: translateX(0); }
.drawer-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.drawer-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  line-height: 1.15;
  letter-spacing: var(--tracking-display);
  color: var(--sage-dark);
  margin: 0;
  font-size: 1.3rem;
}
.drawer-body { flex: 1 1 auto; overflow-y: auto; padding: 10px 12px; }
.drawer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.drawer-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
  border-radius: var(--radius);
}
.drawer-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  text-align: left;
  align-items: baseline;
  min-width: 0;
}
.drawer-row:hover { background: var(--cream); border-color: var(--border-soft); }
.drawer-tid { font-family: var(--font-mono); font-weight: 700; color: var(--sage-dark); }
.drawer-name { font-weight: 600; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-fandom { color: var(--muted); font-size: 0.8rem; }
.drawer-unsave {
  color: var(--terracotta-dark);
  background: var(--terracotta-soft);
  border-color: var(--terracotta);
}
.drawer-unsave:hover { background: var(--terracotta); color: var(--surface); }

.drawer-foot {
  border-top: 1px solid var(--border-soft);
  padding: 14px 20px 18px;
  background: var(--cream);
  display: flex; flex-direction: column; gap: 10px;
}
.export-label-row {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 8px;
}
.export-label {
  font-size: var(--text-caption);
  color: var(--ink);
  font-weight: 500;
  font-style: italic;
}
.export-hint  {
  font-size: var(--text-micro);
  color: var(--muted-2);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
}
.seg {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.seg button {
  background: transparent;
  border: 0;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  color: var(--muted);
}
.seg button[aria-pressed="true"] { background: var(--sage-dark); color: var(--surface); }
.export-textarea {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  min-height: 140px;
  max-height: 180px;
  width: 100%;
  line-height: 1.45;
  resize: vertical;
  outline: none;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.export-textarea:focus { border-color: var(--sage); box-shadow: var(--shadow-ring-sage); }
.export-textarea::selection { background: var(--sage-soft); }
.export-actions { display: flex; gap: 8px; align-items: center; }
.export-actions .btn { flex: 0 0 auto; min-width: 168px; }
.export-actions .link { margin-left: auto; }

/* ============================================================
   Responsive
============================================================ */

@media (max-width: 1100px) {
  .top-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    padding: 10px 12px;
  }
  .brand { flex: 1 1 100%; min-width: 0; }
  .brand-sub { font-size: 0.76rem; }
  .top-actions { flex: 0 0 auto; }

  .desktop-main { display: none; }
  .expand-tab { display: none; }
}

@media (min-width: 1101px) {
  .mobile-main { display: none; }
}

@media (max-width: 520px) {
  .top-meta .venue-line { display: none; }
  .detail-mobile .detail-title { font-size: 1.35rem; }
}

/* make mobile input font >=16px to avoid iOS zoom */
@media (max-width: 1100px) {
  .search input,
  .fandom-search input,
  .notes-input { font-size: 16px; }
}

/* ============================================================
   Site footer — matches the maiko.cafe blog footer rhythm
============================================================ */

.site-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--cream-dark);
  color: var(--muted);
  font-size: var(--text-caption);
  letter-spacing: var(--tracking-eyebrow);
}
.site-footer a,
.site-footer .foot-link {
  color: var(--muted);
  text-decoration: none;
  font: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  transition: color 140ms var(--ease);
}
.site-footer a:hover,
.site-footer .foot-link:hover { color: var(--sage-dark); text-decoration: underline; }
.foot-copy { color: var(--muted); }
.foot-sep { color: var(--cream-dark); }

/* Mobile: footer tucks inside the scrolling mobile-main rather than below it. */
@media (max-width: 820px) {
  .site-footer {
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    font-size: var(--text-micro);
    gap: 6px;
  }
}

/* ============================================================
   Claim-table modal
============================================================ */

.claim-root {
  position: fixed; inset: 0;
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.claim-scrim {
  position: absolute; inset: 0;
  background: rgba(44, 62, 51, 0.34);
  backdrop-filter: blur(2px);
}
.claim-sheet {
  position: relative;
  max-width: min(1120px, calc(100vw - 28px));
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 24px 24px 18px;
  max-height: calc(100dvh - 28px);
  overflow-y: auto;
}
.claim-close {
  position: absolute; top: 10px; right: 10px;
}
.claim-title {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  color: var(--sage-dark);
  letter-spacing: var(--tracking-display);
  margin: 0 40px 8px 0;
  line-height: 1.15;
  font-weight: 600;
}
.claim-lede {
  font-size: var(--text-body);
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.55;
  max-width: 88ch;
}
.claim-list {
  margin: 0 0 18px;
  padding-left: 18px;
  color: var(--ink);
  font-size: var(--text-caption);
  line-height: 1.8;
}
.claim-list-tight { margin-bottom: 14px; }
.claim-list strong {
  color: var(--sage-dark);
  font-weight: 600;
  margin-right: 6px;
}
.claim-opt { font-weight: 400; color: var(--muted-2); font-style: italic; }
.claim-verify {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 4px 0 20px;
}
.claim-verify-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: background 140ms var(--ease), border-color 140ms var(--ease),
              transform 140ms var(--ease);
}
.claim-verify-btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
  border-color: var(--sage);
  background: var(--cream);
}
.claim-verify-glyph {
  display: inline-grid; place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px;
  flex: 0 0 auto;
  color: #fff;
}
.claim-verify-x    .claim-verify-glyph { background: #111; }
.claim-verify-ig   .claim-verify-glyph {
  background: linear-gradient(135deg, #FEDA75 0%, #FA7E1E 25%, #D62976 50%, #962FBF 75%, #4F5BD5 100%);
}
.claim-verify-bsky .claim-verify-glyph { background: #1185FE; }
.claim-verify-label { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.claim-verify-kicker {
  font-size: var(--text-micro);
  color: var(--muted);
  font-style: italic;
  letter-spacing: var(--tracking-eyebrow);
}
.claim-verify-name {
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
}

.claim-review-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 2px;
}
.claim-review-copy,
.claim-review-foot {
  min-width: 0;
}
.claim-how {
  margin-bottom: 0;
  max-width: none;
}
.claim-how-title {
  font-size: var(--text-caption);
  color: var(--muted);
  font-style: italic;
  letter-spacing: var(--tracking-eyebrow);
  margin-bottom: 6px;
}

.claim-foot {
  font-size: var(--text-micro);
  color: var(--muted-2);
  font-style: italic;
  margin: 0;
  max-width: none;
}
.claim-foot a { color: var(--sage-dark); }

.claim-notice {
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: var(--text-caption);
  color: var(--ink);
  margin: -4px 0 14px;
}

/* Form variant of the verify button (Bluesky needs a handle input inline). */
.claim-verify-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-content: center;
  cursor: text;
}
.claim-verify-inline {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.claim-verify-form input {
  border: 1px solid var(--cream-dark);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 6px 9px;
  font: inherit;
  font-size: var(--text-caption);
  width: 100%;
  min-width: 0;
}
.claim-verify-form input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: var(--shadow-ring-sage);
}
.claim-verify-go {
  border: 0;
  background: var(--sage-soft);
  color: var(--sage-dark);
  font-size: var(--text-caption);
  font-weight: 600;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: 0 0 auto;
}
.claim-verify-go:hover { background: var(--sage); color: #fff; }

/* Post-verification edit form */
.claim-edit { display: flex; flex-direction: column; gap: 10px; }
.claim-edit-whoami {
  font-size: var(--text-caption);
  color: var(--muted);
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
}
.claim-edit-whoami strong { color: var(--sage-dark); }
.claim-edit-via { color: var(--muted-2); font-style: italic; }
.claim-signout { margin-left: auto; font-size: var(--text-micro); }
.claim-edit-table {
  font-size: var(--text-caption);
  color: var(--muted);
}
.claim-edit-table strong { color: var(--ink); font-family: var(--font-mono); }

.claim-field { display: flex; flex-direction: column; gap: 4px; }
.claim-field-label {
  font-size: var(--text-caption);
  color: var(--muted);
  font-style: italic;
  letter-spacing: var(--tracking-eyebrow);
}
.claim-field-input {
  border: 1px solid var(--cream-dark);
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font: inherit;
  font-size: var(--text-body);
  color: var(--ink);
  outline: none;
  transition: border-color 140ms var(--ease), box-shadow 140ms var(--ease);
}
.claim-field-input:focus { border-color: var(--sage); box-shadow: var(--shadow-ring-sage); }

.claim-error {
  color: #8a3a3a;
  background: #f5e5e1;
  border: 1px solid #e6b7ae;
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: var(--text-caption);
}
.claim-ok {
  color: var(--sage-dark);
  background: var(--sage-soft);
  border: 1px solid var(--sage);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: var(--text-caption);
}

.claim-offline .claim-lede a { color: var(--sage-dark); }

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.preset-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  padding: 5px 9px;
  font: inherit;
  font-size: var(--text-caption);
  line-height: 1.2;
  min-height: 38px;
  cursor: pointer;
  box-sizing: border-box;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.preset-chip.is-selected {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-dark);
}
.claim-social-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.manual-claim {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--cream-dark);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 16px;
}
.manual-claim-head h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--sage-dark);
}
.manual-claim-head p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-caption);
  line-height: 1.45;
}
.manual-socials {
  display: grid;
  gap: 8px;
}
.manual-social-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}
.manual-remove {
  width: 36px;
  height: 36px;
  min-height: 36px;
  align-self: end;
  color: var(--muted);
}
.manual-add {
  justify-self: start;
}
.manual-ack {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px;
  align-items: start;
  font-size: var(--text-micro);
  color: var(--muted);
  line-height: 1.45;
}
.manual-ack input { margin-top: 2px; }
.claim-dm-note {
  font-size: var(--text-caption);
  color: var(--muted);
  line-height: 1.55;
  padding: 10px 12px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--cream);
}
.claim-dm-note strong {
  color: var(--sage-dark);
  font-weight: 650;
}
.claim-dm-note a { color: var(--sage-dark); }
.file-import-btn {
  position: relative;
  overflow: hidden;
}
.file-import-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

@media (min-width: 900px) {
  .claim-review-stack .claim-lede,
  .claim-review-stack .claim-foot {
    max-width: none;
  }
  .manual-claim {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }
  .manual-claim-head,
  .manual-socials,
  .manual-field-products,
  .claim-dm-note,
  .manual-ack,
  .manual-claim > .claim-ok,
  .manual-claim > .claim-error,
  .manual-claim > .btn {
    grid-column: 1 / -1;
  }
  .manual-field-name,
  .manual-field-fandoms,
  .manual-field-catalog,
  .manual-field-contact {
    min-width: 0;
  }
}

@media (max-width: 520px) {
  .claim-verify { grid-template-columns: 1fr; }
  .claim-social-grid { grid-template-columns: 1fr; }
  .manual-social-row { grid-template-columns: minmax(0, 1fr) auto; }
}

/* ============================================================
   FAQ modal — same shape language as the claim sheet
============================================================ */

.faq-root {
  position: fixed; inset: 0;
  z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.faq-scrim {
  position: absolute; inset: 0;
  background: rgba(44, 62, 51, 0.34);
  backdrop-filter: blur(2px);
}
.faq-sheet {
  position: relative;
  max-width: 620px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 28px 28px 22px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
.faq-close { position: absolute; top: 10px; right: 10px; }
.faq-title {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  color: var(--sage-dark);
  letter-spacing: var(--tracking-display);
  margin: 0 40px 4px 0;
  line-height: 1.15;
  font-weight: 600;
}
.faq-lede {
  font-size: var(--text-caption);
  color: var(--muted);
  font-style: italic;
  margin: 0 0 18px;
}
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.faq-item {
  border-top: 1px solid var(--cream-dark);
  padding-top: 12px;
}
.faq-item:first-child { border-top: 0; padding-top: 0; }
.faq-q {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--sage-dark);
  margin: 0 0 4px;
}
.faq-a {
  margin: 0;
  font-size: var(--text-caption);
  color: var(--ink);
  line-height: 1.6;
}
.faq-a code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 3px;
  padding: 0 4px;
}
.faq-a kbd {
  font-family: var(--font-mono);
  font-size: 0.82em;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 6px;
  color: var(--ink);
  margin: 0 2px;
}
.faq-a .link { font-size: inherit; padding: 0; color: var(--sage-dark); }
.faq-a .link:hover { text-decoration: underline; }

/* ============================================================
   Admin panel
============================================================ */
.admin-root {
  position: fixed; inset: 0;
  z-index: 85;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.admin-scrim {
  position: absolute; inset: 0;
  background: rgba(20, 24, 20, 0.5);
  backdrop-filter: blur(2px);
}
.admin-sheet {
  position: relative;
  max-width: 980px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  padding: 26px 26px 20px;
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
}
.admin-close { position: absolute; top: 10px; right: 10px; }
.admin-title {
  font-family: var(--font-display);
  font-size: var(--text-heading);
  color: var(--sage-dark);
  letter-spacing: var(--tracking-display);
  margin: 0 40px 4px 0;
  line-height: 1.15;
  font-weight: 600;
}
.admin-lede {
  font-size: var(--text-caption);
  color: var(--muted);
  margin: 0 0 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.admin-lede code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  border-radius: 3px;
  padding: 0 4px;
}
.admin-signout { margin-left: auto; font-size: var(--text-micro); }

.admin-section {
  border-top: 1px solid var(--cream-dark);
  padding-top: 14px;
  margin-top: 14px;
}
.admin-section:first-of-type { border-top: 0; padding-top: 0; margin-top: 0; }
.admin-section-title {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.admin-section-sub {
  color: var(--muted);
  font-style: italic;
  font-weight: 400;
  font-size: var(--text-caption);
  margin-left: 8px;
}
.admin-hint {
  font-size: var(--text-micro);
  color: var(--muted-2);
  margin: 0 0 8px;
}
.admin-hint code {
  font-family: var(--font-mono);
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  padding: 0 4px;
  border-radius: 3px;
  font-size: 0.9em;
}
.admin-textarea {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.45;
  padding: 10px 12px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  resize: vertical;
  outline: none;
}
.admin-textarea:focus { border-color: var(--sage); box-shadow: var(--shadow-ring-sage); }
.admin-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px;
}
.admin-count {
  margin-left: auto;
  font-size: var(--text-caption);
  color: var(--muted);
  font-style: italic;
}

.admin-claims {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-caption);
}
.admin-claims th,
.admin-claims td {
  padding: 6px 8px;
  text-align: left;
  border-bottom: 1px solid var(--cream-dark);
  vertical-align: middle;
}
.admin-claims th {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--muted);
  font-style: italic;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: none;
}
.admin-claims tr:last-child td { border-bottom: 0; }
.admin-mono { font-family: var(--font-mono); color: var(--sage-dark); font-weight: 600; }
.admin-dim  { color: var(--muted); font-style: italic; }

.admin-empty {
  font-size: var(--text-caption);
  color: var(--muted);
  font-style: italic;
  padding: 12px 0;
}

.admin-request-list {
  display: grid;
  gap: 8px;
}
.admin-request-card {
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: 10px 12px;
}
.admin-request-card.is-active {
  border-color: var(--sage);
  background: var(--sage-soft);
}
.admin-request-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}
.admin-request-head strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
}
.admin-request-head span {
  display: block;
  font-size: var(--text-micro);
  color: var(--muted);
}
.admin-request-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.admin-request-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.admin-social-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.admin-social-link:hover {
  text-decoration: none;
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-dark);
}
.admin-request-lines {
  display: grid;
  gap: 3px;
  margin-top: 8px;
  font-size: var(--text-micro);
  color: var(--muted);
}
.admin-request-lines a {
  color: var(--sage-dark);
  word-break: break-word;
}

.admin-editor-grid,
.admin-bulk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-editor-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.admin-wide {
  grid-column: 1 / -1;
}

@media (max-width: 760px) {
  .admin-editor-grid,
  .admin-bulk-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   Seed candidate research tool (lives inside AdminPanel)
============================================================ */
.seed-root { display: flex; flex-direction: column; gap: 10px; }
.seed-toolbar {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-size: var(--text-caption);
  color: var(--muted);
}
.seed-toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.seed-toggle input { accent-color: var(--sage); }

.seed-list { display: flex; flex-direction: column; gap: 6px; }
.seed-row {
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--cream);
  overflow: hidden;
}
.seed-row.is-open { background: var(--surface); }
.seed-head {
  display: grid;
  grid-template-columns: 56px 1fr auto auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.seed-head:hover { background: var(--sage-soft); }
.seed-tid {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--sage-dark);
  font-size: 0.88rem;
}
.seed-name {
  font-weight: 500;
  font-size: var(--text-caption);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seed-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.seed-chip {
  display: inline-flex; align-items: center;
  font-size: var(--text-micro);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--cream-dark);
  background: var(--surface);
  color: var(--ink);
}
.seed-chip-x    { background: #111; color: #fff; border-color: #111; }
.seed-chip-ig   {
  background: linear-gradient(135deg, #FEDA75 0%, #FA7E1E 25%, #D62976 50%, #962FBF 75%, #4F5BD5 100%);
  color: #fff; border-color: #962FBF;
}
.seed-chip-bsky { background: #1185FE; color: #fff; border-color: #0e70d7; }
.seed-chip-none { color: var(--muted-2); font-style: italic; }
.seed-caret { color: var(--muted); font-size: 12px; }

.seed-body {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px 12px 14px;
  border-top: 1px solid var(--cream-dark);
}
.seed-plat { display: flex; flex-direction: column; gap: 4px; }
.seed-plat-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--text-caption);
  gap: 10px;
  color: var(--muted);
  font-style: italic;
}
.seed-plat-title { font-weight: 500; color: var(--ink); font-style: normal; }
.seed-plat-hint { font-size: var(--text-micro); color: var(--muted-2); }
.seed-plat-seeded { font-size: var(--text-micro); color: var(--sage-dark); font-style: normal; display: inline-flex; gap: 6px; align-items: baseline; }
.seed-plat-seeded strong { font-family: var(--font-mono); }

.seed-cands { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 3px; }
.seed-cand {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  font-size: var(--text-caption);
}
.seed-cand.is-rej { opacity: 0.45; text-decoration: line-through; }
.seed-cand-link {
  font-family: var(--font-mono);
  color: var(--ink);
  text-decoration: none;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.seed-cand-link:hover { color: var(--sage-dark); text-decoration: underline; }
.seed-cand-actions { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.seed-btn {
  border: 1px solid var(--cream-dark);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-micro);
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--ink);
  transition: background 140ms var(--ease), color 140ms var(--ease);
}
.seed-approve:hover { background: var(--sage-soft); color: var(--sage-dark); border-color: var(--sage); }
.seed-reject:hover  { background: var(--terracotta-soft); color: var(--terracotta-dark); border-color: var(--terracotta); }

.seed-empty {
  font-size: var(--text-caption);
  color: var(--muted-2);
  font-style: italic;
  padding: 4px 0;
}

/* Search-link row shown above the approve input for X + Instagram. */
.seed-searchlinks {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin: 4px 0 6px;
}
.seed-searchlink {
  display: inline-flex;
  font-size: var(--text-micro);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--cream);
  border: 1px solid var(--cream-dark);
  color: var(--ink);
  text-decoration: none;
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease);
}
.seed-searchlink:hover {
  background: var(--sage-soft);
  color: var(--sage-dark);
  border-color: var(--sage);
  text-decoration: none;
}

.seed-approve-row { display: flex; gap: 6px; align-items: center; }
.seed-approve-input {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: var(--text-caption);
  padding: 5px 10px;
  border: 1px solid var(--cream-dark);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  outline: none;
}
.seed-approve-input:focus { border-color: var(--sage); box-shadow: var(--shadow-ring-sage); }

/* Rich Bluesky result row (avatar + display name + bio). */
.seed-cand-rich {
  align-items: flex-start;
  gap: 10px;
  padding: 8px 10px;
}
.seed-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  flex: 0 0 auto;
  object-fit: cover;
  background: var(--cream-dark);
}
.seed-cand-meta { flex: 1 1 auto; min-width: 0; }
.seed-cand-sub {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--text-micro);
  font-weight: 400;
}
.seed-cand-bio {
  font-size: var(--text-micro);
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ============================================================
   Mockup-aligned responsive shell
============================================================ */

body { overflow: hidden; }

.app-shell {
  background:
    radial-gradient(circle at 20% 10%, rgba(125, 155, 118, 0.08), transparent 28%),
    linear-gradient(180deg, color-mix(in oklab, var(--surface) 56%, var(--bg)) 0%, var(--bg) 100%);
}
.app-shell.is-desktop {
  height: 100dvh;
  overflow: hidden;
}

.top-bar {
  position: relative;
  flex: 0 0 auto;
  margin: 14px 20px 10px;
  padding: 14px 18px 14px 86px;
  min-height: 78px;
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(circle at 18% 28%, color-mix(in oklab, var(--sage-soft) 48%, transparent) 0 18%, transparent 42%),
    linear-gradient(90deg, color-mix(in oklab, var(--sage-soft) 18%, transparent) 0 22%, transparent 54%),
    linear-gradient(180deg, color-mix(in oklab, var(--surface) 92%, var(--cream)) 0%, var(--surface) 100%);
  box-shadow:
    inset 0 1px 0 color-mix(in oklab, var(--surface) 88%, transparent),
    inset 0 -1px 0 color-mix(in oklab, var(--border) 32%, transparent);
}
.top-bar::before {
  content: "";
  position: absolute;
  left: 58px;
  top: 10px;
  bottom: 10px;
  width: 14px;
  background:
    radial-gradient(circle at 50% 7px, color-mix(in oklab, var(--surface) 92%, transparent) 0 2.5px, transparent 3.6px) 0 0 / 14px 15px repeat-y;
  opacity: 0.78;
  pointer-events: none;
  z-index: 1;
}
.guide-spine {
  position: absolute;
  inset: 0 auto 0 0;
  width: 58px;
  border-radius: 10px 0 0 10px;
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in oklab, var(--surface) 14%, transparent) 0 1px,
      transparent 1px 8px
    ),
    linear-gradient(180deg, color-mix(in oklab, var(--sage-dark) 88%, var(--ink)), var(--sage)),
    repeating-linear-gradient(
      to bottom,
      color-mix(in oklab, var(--ink) 8%, transparent) 0 1px,
      transparent 1px 12px
    );
  box-shadow:
    inset -1px 0 0 color-mix(in oklab, var(--ink) 12%, transparent),
    inset 0 1px 0 color-mix(in oklab, var(--surface) 28%, transparent);
  pointer-events: none;
}
.guide-spine::after {
  content: "";
  position: absolute;
  right: 7px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background:
    radial-gradient(circle, color-mix(in oklab, var(--surface) 30%, transparent) 0 1.4px, transparent 1.8px) 0 0 / 3px 12px repeat-y;
  opacity: 0.5;
}
.brand,
.top-actions {
  position: relative;
  z-index: 1;
}
.brand {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.brand-name {
  position: relative;
  display: inline-block;
  font-size: clamp(1.72rem, 2.18vw, 2.22rem);
  letter-spacing: 0;
  text-shadow: 0 1px 0 color-mix(in oklab, var(--surface) 84%, transparent);
}
.brand-sub {
  color: var(--ink);
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.brand-event-link {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sage-dark);
  line-height: inherit;
  text-decoration: none;
  font-weight: 650;
}
.brand-event-link:hover {
  color: var(--sage-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.top-actions { gap: 12px; }
.export-open,
.claim-open,
.top-actions .icon-round {
  height: 34px;
  min-height: 34px;
  border-radius: 7px;
  border-color: var(--border);
  background: var(--surface);
  box-shadow:
    0 1px 0 color-mix(in oklab, var(--surface) 80%, transparent),
    0 8px 18px color-mix(in oklab, var(--ink) 5%, transparent);
  transition:
    background-color 150ms var(--ease),
    border-color 150ms var(--ease),
    color 150ms var(--ease),
    box-shadow 150ms var(--ease);
}
.export-open { min-width: 118px; }
.claim-open { min-width: 138px; }
.top-actions .icon-round { width: 34px; border-radius: 8px; }
.export-open:hover,
.claim-open:hover,
.top-actions .icon-round:hover {
  box-shadow:
    0 1px 0 color-mix(in oklab, var(--surface) 80%, transparent),
    0 10px 22px color-mix(in oklab, var(--ink) 7%, transparent);
}
.top-actions .btn:active,
.top-actions .icon-round:active {
  transform: none;
}
.export-open:focus-visible,
.claim-open:focus-visible,
.top-actions .icon-round:focus-visible {
  outline: 0;
  box-shadow:
    var(--shadow-ring-sage),
    0 1px 0 color-mix(in oklab, var(--surface) 80%, transparent);
}

.desktop-main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 10px;
  padding: 0 20px 8px;
  overflow: hidden;
  min-height: 0;
  background: transparent;
}
.desktop-filter-strip {
  position: sticky;
  top: 0;
  z-index: 25;
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: minmax(300px, 0.95fr) minmax(470px, 1fr);
  grid-template-areas:
    "search status"
    "groups groups";
  gap: 8px 18px;
  align-items: center;
  padding: 9px 14px;
  font-size: var(--text-caption);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: color-mix(in oklab, var(--surface) 94%, var(--cream));
  box-shadow: 0 8px 22px rgba(58, 56, 52, 0.04);
}

.desktop-filter-search {
  grid-area: search;
  padding-right: 16px;
  border-right: 1px solid var(--cream-dark);
}
.desktop-filter-search .search-wrap,
.desktop-filter-search .search { width: 100%; min-width: 0; }
.desktop-filter-search .search {
  height: 32px;
  border-radius: 7px;
  padding: 0 12px;
}
.desktop-filter-strip .search input {
  font-size: var(--text-caption);
}
.desktop-status-row {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
  min-height: 32px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}
.desktop-status-row::-webkit-scrollbar {
  display: none;
}
.status-label,
.filter-group-line > span:first-child {
  font-size: var(--text-caption);
  font-weight: 650;
  color: var(--ink);
}
.status-label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  height: 30px;
  line-height: 1;
  white-space: nowrap;
}
.status-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 30px;
  min-width: 68px;
  padding: 0 10px;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-caption);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  transition: background 140ms var(--ease), border-color 140ms var(--ease), color 140ms var(--ease);
}
.status-chip span {
  font-variant-numeric: tabular-nums;
}
.status-chip.is-active {
  background: var(--sage-dark);
  border-color: var(--sage-dark);
  color: var(--surface);
}
.status-chip.tone-saved.is-active {
  background: var(--terracotta-soft);
  border-color: var(--terracotta);
  color: var(--terracotta-dark);
}
.desktop-filter-groups {
  grid-area: groups;
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: center;
  gap: 10px;
  width: min(100%, 920px);
  min-width: 0;
  padding-right: 84px;
}
.filter-group-line {
  min-width: 0;
}
.desktop-filter-clear {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  min-width: 0;
}
.clear-all-inline {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
}
.clear-all-inline:hover,
.clear-all-inline:focus-visible {
  color: var(--sage-dark);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.summary-card {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: none;
  min-height: 34px;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  background: color-mix(in oklab, var(--surface) 82%, var(--cream));
  padding: 0 9px;
  text-align: left;
  cursor: pointer;
  transition: background 140ms var(--ease), border-color 140ms var(--ease);
}
.summary-card:hover {
  background: var(--surface);
  border-color: var(--cream-dark);
}
.summary-card:focus-visible {
  outline: 2px solid color-mix(in oklab, var(--sage) 60%, transparent);
  outline-offset: 2px;
}
.summary-label {
  display: block;
  color: var(--ink);
  font-size: var(--text-caption);
  font-weight: 650;
}
.summary-values {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}
.summary-caret {
  align-self: center;
  color: var(--muted);
  width: 18px;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 0;
  border-left: 0;
  line-height: 1;
}

.export-open:focus-visible,
.claim-open:focus-visible,
.top-actions .icon-round:focus-visible {
  outline: 0;
  box-shadow:
    var(--shadow-ring-sage),
    0 1px 0 color-mix(in oklab, var(--surface) 80%, transparent);
}
.filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 160px;
  height: 23px;
  padding: 0 8px;
  border: 1px solid var(--cream-dark);
  border-radius: 5px;
  background: var(--cream);
  font-size: var(--text-micro);
  line-height: 1;
  white-space: nowrap;
}
.filter-pill > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-pill button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0;
}
.filter-pill-count {
  min-width: 36px;
  justify-content: center;
  background: var(--surface);
}
.summary-empty {
  color: var(--muted);
  font-size: var(--text-caption);
  white-space: nowrap;
}

.desktop-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.95fr);
  gap: 12px;
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  position: sticky;
  top: 0;
}
.map-card,
.desktop-list-card {
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(58, 56, 52, 0.035);
}
.map-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 12px 12px 8px;
}
.map-frame {
  position: relative;
  display: flex;
  flex: 1 1 0;
  min-height: 0;
}
.map-frame .map-viewport {
  width: 100%;
}
.section-card-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 24px;
  padding: 0 2px 8px;
  font-weight: 550;
}
.map-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.map-title {
  flex: 0 0 auto;
  font-weight: 650;
}
.map-event-line {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: var(--text-caption);
  font-weight: 450;
  font-variant-numeric: tabular-nums;
}
.map-card .map-viewport {
  max-width: none;
  max-height: none;
  min-height: 0;
  flex: 1 1 0;
  height: 100%;
  aspect-ratio: auto;
  border: 1px solid var(--ink);
  border-radius: 4px;
  box-shadow: none;
}
.desktop-list-card {
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  container-type: inline-size;
  container-name: detail-card;
}
.desktop-list-card .side-panel {
  height: 100%;
  background: transparent;
}
.desktop-list-card .side-panel::before,
.mobile-list-sheet .side-panel::before { display: none; }
.desktop-list-card .side-head {
  padding: 14px 18px 8px;
  border-bottom: 1px solid var(--cream-dark);
}
.desktop-list-card .side-eyebrow {
  font-style: normal;
  font-size: 0.98rem;
}
.desktop-list-card .side-title,
.desktop-list-card .side-sub { display: none; }
.desktop-list-card .side-body {
  padding: 0;
}
.desktop-list-card .row-list { gap: 0; }
.desktop-list-card .row {
  grid-template-columns: 48px minmax(0, 1fr) auto;
  padding: 13px 14px;
  border: 0;
  border-bottom: 1px solid var(--cream-dark);
  border-radius: 0;
}
.desktop-list-card .row:first-child {
  border-radius: 0;
}
.desktop-list-card .row:last-child { border-radius: 0; }
.desktop-list-card .row-num {
  width: 42px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--sage-dark);
  background-color: color-mix(in oklab, var(--sage-soft) 70%, var(--surface));
  box-shadow:
    inset 0 0 0 1px color-mix(in oklab, var(--sage) 36%, var(--border)),
    0 1px 0 color-mix(in oklab, var(--surface) 80%, transparent);
  transition:
    transform 140ms var(--ease),
    background-color 140ms var(--ease),
    color 140ms var(--ease),
    box-shadow 140ms var(--ease);
}
.desktop-list-card .row:hover .row-num {
  transform: translateX(1px);
}
.desktop-list-card .row:active .row-num {
  transform: scale(0.96);
}
.desktop-list-card .row-name {
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.1;
  min-height: auto;
}
.desktop-list-card .row-actions {
  flex-direction: row;
  align-items: center;
}
.desktop-workspace.has-catalog-detail .detail.has-catalog-layout .detail-content {
  grid-template-columns: minmax(210px, 0.46fr) minmax(0, 1fr);
}
.desktop-workspace.has-catalog-detail .detail.has-catalog-layout .detail-head {
  padding-inline: 18px 14px;
}
.desktop-workspace.has-catalog-detail .detail.has-catalog-layout .detail-body {
  padding-inline: clamp(12px, 1.1vw, 18px);
}

@container detail-card (max-width: 520px) {
  .detail.has-catalog-layout .detail-content {
    display: flex;
    flex-direction: column;
  }
  .detail.has-catalog-layout .detail-head {
    flex: 0 0 auto;
    max-height: 46%;
    border-right: 0;
    border-bottom: 1px solid var(--cream-dark);
  }
  .detail.has-catalog-layout .detail-body {
    flex: 1 1 54%;
    overflow-y: auto;
  }
}

.desktop-view-tabs {
  display: none;
}

.filter-dialog-root,
.mobile-filter-sheet-root {
  position: fixed;
  inset: 0;
  z-index: 90;
}
.filter-dialog-scrim,
.mobile-filter-scrim {
  position: absolute;
  inset: 0;
  background: rgba(58, 56, 52, 0.24);
  backdrop-filter: blur(1px);
}
.filter-dialog-card {
  position: relative;
  width: min(420px, calc(100vw - 32px));
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 48px rgba(44, 62, 51, 0.18);
  padding: 18px 20px 16px;
}
.filter-dialog-root {
  display: grid;
  place-items: center;
  padding: 22px;
}
.filter-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.filter-dialog-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.18rem;
  color: var(--ink);
  letter-spacing: 0;
}
.filter-dialog-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: var(--text-caption);
}
.sort-chip {
  height: 26px;
  padding: 0 12px;
  border: 1px solid var(--cream-dark);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: var(--text-caption);
}
.sort-chip.is-active {
  background: var(--sage-soft);
  border-color: var(--sage);
  color: var(--sage-dark);
}
.filter-dialog-card .fandom-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 8px;
}
.filter-dialog-card .fandom-list {
  max-height: 210px;
  border: 0;
  border-radius: 0;
  background: transparent;
}
.status-sheet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.status-sheet-grid .status-chip {
  width: 100%;
  min-height: 34px;
  justify-content: space-between;
}
.filter-dialog-card .pop-item {
  padding: 5px 0;
}
.filter-dialog-card .fandom-clear {
  display: none;
}
.filter-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 1px solid var(--cream-dark);
  color: var(--muted);
  font-size: var(--text-caption);
}
.filter-dialog-actions {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.clear-selection {
  font-size: var(--text-caption);
  color: var(--muted);
}
.clear-selection:disabled {
  opacity: 0.45;
  cursor: default;
  text-decoration: none;
}
.filter-dialog-foot .btn {
  min-width: 96px;
  height: 30px;
  min-height: 30px;
  border-radius: 6px;
  font-size: var(--text-caption);
}

.site-footer {
  flex: 0 0 auto;
  display: flex !important;
  min-height: 28px;
  padding: 3px 20px 5px;
  border-top: 0;
  background: transparent;
  font-size: var(--text-micro);
}

/* Mobile optimized experience */
@media (max-width: 820px) {
  body {
    background: var(--bg);
    overflow: hidden;
  }
  .app-shell.is-mobile {
    width: 100%;
    max-width: none;
    height: 100dvh;
    margin: 0;
    border-left: 0;
    border-right: 0;
    background: var(--surface);
    overflow: hidden;
    font-size: 12px;
  }
  .app-shell.is-mobile .site-footer {
    display: none !important;
  }
  .mobile-main {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--surface);
    overflow: hidden;
  }
  .mobile-statusbar {
    display: flex;
    justify-content: space-between;
    padding: 12px 22px 6px;
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 650;
  }
  .mobile-top {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 12px;
  }
  .mobile-top .brand-name {
    font-size: 1.35rem;
    justify-self: center;
  }
  .mobile-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .mobile-icon,
  .mobile-saved {
    height: 32px;
    border: 1px solid var(--cream-dark);
    border-radius: 9px;
    background: var(--surface);
    display: inline-grid;
    place-items: center;
  }
  .mobile-icon { width: 32px; }
  .mobile-saved {
    min-width: 50px;
    padding: 0 9px;
    color: var(--terracotta-dark);
    border-color: color-mix(in oklab, var(--terracotta) 52%, var(--border));
    background: color-mix(in oklab, var(--terracotta-soft) 48%, var(--surface));
  }
  .mobile-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    padding: 2px 16px 8px;
  }
  .mobile-shortcuts button,
  .mobile-bottom-nav button {
    display: grid;
    gap: 3px;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-size: 1.05rem;
  }
  .mobile-shortcuts button:disabled {
    opacity: 0.32;
    cursor: default;
  }
  .mobile-shortcuts span,
  .mobile-bottom-nav span {
    font-size: var(--text-micro);
    color: var(--muted);
  }
  .mobile-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--cream-dark);
  }
  .mobile-tabs button {
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--ink);
    position: relative;
  }
  .mobile-tabs button.is-active::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: -1px;
    height: 2px;
    background: var(--sage-dark);
  }
  .mobile-tabs span {
    color: var(--muted);
    margin-left: 8px;
  }
  .mobile-filter-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px 14px 8px;
  }
  .summary-card-mobile {
    min-height: 54px;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "label caret"
      "values caret";
    padding: 10px;
  }
  .summary-card-mobile .summary-label {
    display: block;
    grid-area: label;
    font-size: var(--text-caption);
  }
  .summary-card-mobile .summary-values { grid-area: values; }
  .summary-card-mobile .summary-caret { grid-area: caret; border-left: 0; padding-left: 0; }
  .mobile-search-row {
    padding: 0 14px 12px;
  }
  .mobile-search-row .search-wrap,
  .mobile-search-row .search {
    width: 100%;
    min-width: 0;
  }
  .mobile-search-row .search {
    height: 34px;
    border-radius: 7px;
  }
  .mobile-search-row .search input {
    font-size: 0.9rem;
  }
  .mobile-map-pane {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0 14px 0;
    overflow: hidden;
    display: block;
  }
  .mobile-map-pane .map-viewport {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    width: 100%;
    aspect-ratio: 1834 / 1090;
    max-height: none;
    border-radius: 4px;
    border: 0;
    box-shadow: none;
  }
  .mobile-list-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 60px;
    height: 36%;
    min-height: 220px;
    border-radius: 22px 22px 0 0;
    background: var(--surface);
    box-shadow: 0 -10px 24px rgba(58, 56, 52, 0.12);
    overflow: hidden;
    z-index: 15;
  }
  .mobile-grabber {
    position: absolute;
    left: 50%;
    top: 8px;
    width: 30px;
    height: 4px;
    border-radius: 999px;
    background: var(--cream-dark);
    transform: translateX(-50%);
    z-index: 5;
  }
  .mobile-list-sheet .side-panel {
    height: 100%;
    background: transparent;
  }
  .mobile-list-sheet .side-head {
    padding: 22px 16px 8px;
    border-bottom: 0;
  }
  .mobile-list-sheet .side-eyebrow {
    font-style: normal;
    font-size: 0.95rem;
  }
  .mobile-list-sheet .side-title,
  .mobile-list-sheet .side-sub { display: none; }
  .mobile-list-sheet .side-body {
    padding: 4px 14px 18px;
  }
  .mobile-list-sheet .row {
    grid-template-columns: 42px 1fr auto;
    padding: 11px 0;
    border-bottom: 1px solid var(--cream-dark);
  }
  .mobile-list-sheet .row-num {
    width: 38px;
    height: 24px;
    display: inline-grid;
    place-items: center;
    border-radius: var(--radius-sm);
    color: var(--sage-dark);
    background-color: color-mix(in oklab, var(--sage-soft) 70%, var(--surface));
    box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--sage) 36%, var(--border));
    font-size: 0.68rem;
    transition:
      transform 140ms var(--ease),
      background-color 140ms var(--ease),
      color 140ms var(--ease),
      box-shadow 140ms var(--ease);
  }
  .mobile-list-sheet .row:active .row-num {
    transform: scale(0.96);
  }
  .mobile-list-sheet .row-name {
    font-family: var(--font-display);
    font-size: 1rem;
    min-height: auto;
    line-height: 1.1;
  }
  .mobile-list-sheet .row-actions {
    flex-direction: row;
  }
  .mobile-list-sheet.is-full {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    border-radius: 0;
    border-top: 1px solid var(--cream-dark);
    box-shadow: none;
    transform: none;
    z-index: 1;
  }
  .mobile-list-sheet.is-full .side-panel {
    min-height: 0;
  }
  .mobile-list-sheet.is-full .side-body {
    padding-bottom: 76px;
  }
  .mobile-bottom-nav {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 60px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border-top: 1px solid var(--cream-dark);
    background: var(--surface);
    z-index: 20;
  }
  .mobile-bottom-nav button.is-active,
  .mobile-bottom-nav button.is-active span {
    color: var(--sage-dark);
    font-weight: 650;
  }
  .m-modal {
    width: min(calc(100vw - 24px), 406px);
    height: min(86vh, 720px);
    height: min(86dvh, 720px);
    flex: 0 0 auto;
  }
  .m-modal .detail-mobile .detail-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  .m-modal .detail-mobile .detail-head {
    flex: 0 0 auto;
    max-height: 48%;
    overflow-y: auto;
    border-bottom: 1px solid var(--cream-dark);
  }
  .m-modal .detail-mobile .detail-body {
    flex: 1 1 52%;
    min-height: 0;
    overflow-y: auto;
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .m-modal.has-catalog-content .catalog-embed {
    width: 100%;
  }

  .mobile-filter-sheet-root {
    display: flex;
    align-items: flex-end;
  }
  .mobile-filter-sheet {
    position: relative;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    border-radius: 18px 18px 0 0;
    background: var(--surface);
    box-shadow: 0 -18px 44px rgba(44, 62, 51, 0.18);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .mobile-filter-sheet .filter-dialog-card {
    width: 100%;
    border: 0;
    border-radius: 18px 18px 0 0;
    box-shadow: none;
  }
  .mobile-filter-sheet .filter-dialog-card .fandom-list {
    max-height: 250px;
  }
}

@media (min-width: 821px) and (max-width: 1100px) {
  .app-shell.is-compact-desktop {
    height: 100dvh;
    overflow: hidden;
  }
  .app-shell.is-compact-desktop .top-bar {
    margin: 10px 12px 8px;
    min-height: 66px;
    padding-top: 10px;
    padding-bottom: 10px;
  }
  .app-shell.is-compact-desktop .top-actions {
    gap: 8px;
  }
  .app-shell.is-compact-desktop .claim-open,
  .app-shell.is-compact-desktop .export-open {
    min-width: 0;
  }
  .desktop-main.is-compact-desktop {
    padding: 0 12px 6px;
    gap: 8px;
  }
  .desktop-main.is-compact-desktop .desktop-filter-strip {
    position: relative;
    grid-template-columns: 1fr;
    grid-template-areas:
      "search"
      "status"
      "groups";
    gap: 8px;
    padding: 10px 12px;
  }
  .desktop-main.is-compact-desktop .desktop-filter-search {
    padding-right: 0;
    border-right: 0;
  }
  .desktop-main.is-compact-desktop .desktop-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .desktop-main.is-compact-desktop .status-label {
    align-self: center;
  }
  .desktop-main.is-compact-desktop .desktop-filter-groups {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-right: 84px;
  }
  .desktop-view-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    flex: 0 0 auto;
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    background: var(--surface);
    overflow: hidden;
  }
  .desktop-view-tabs button {
    position: relative;
    min-height: 38px;
    border: 0;
    border-right: 1px solid var(--cream-dark);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: var(--text-caption);
    font-weight: 600;
  }
  .desktop-view-tabs button:last-child {
    border-right: 0;
  }
  .desktop-view-tabs button.is-active {
    color: var(--sage-dark);
    background: color-mix(in oklab, var(--sage-soft) 42%, var(--surface));
  }
  .desktop-view-tabs button.is-active::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 0;
    height: 2px;
    background: var(--sage-dark);
  }
  .desktop-view-tabs span {
    margin-left: 6px;
    color: var(--muted);
    font-weight: 500;
  }
  .desktop-workspace.is-compact-workspace {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    position: relative;
    top: auto;
  }
  .desktop-workspace.is-compact-workspace .map-card,
  .desktop-workspace.is-compact-workspace .desktop-list-card {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
  }
  .desktop-workspace.is-compact-workspace .desktop-list-card .side-head {
    padding: 12px 16px 8px;
  }
  .desktop-workspace.is-compact-workspace .desktop-list-card .row {
    grid-template-columns: 58px minmax(0, 1fr) auto;
    padding: 12px 16px;
  }
  .desktop-workspace.is-compact-workspace .map-card {
    padding: 10px;
  }
  .desktop-workspace.is-compact-workspace .map-card .map-viewport {
    min-height: 0;
  }
}

@media (max-width: 1320px) {
  .desktop-filter-strip {
    grid-template-columns: 1fr;
    grid-template-areas:
      "search"
      "status"
      "groups";
    gap: 10px;
  }
  .desktop-filter-search {
    padding-right: 0;
    border-right: 0;
  }
  .desktop-filter-groups {
    width: 100%;
  }
  .status-chip {
    min-width: 0;
  }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .desktop-list-card .row:hover .row-num,
  .desktop-list-card .row:active .row-num,
  .mobile-list-sheet .row:active .row-num,
  .export-open:hover,
  .claim-open:hover,
  .top-actions .icon-round:hover,
  .export-open:active,
  .claim-open:active,
  .top-actions .icon-round:active {
    transform: none;
  }
}
