/* ============================================================
   TROVE — Personal Asset Ledger
   assets/style.css  ·  pure CSS, no build step
   ============================================================ */

/* --------------------------------------------------------
   Reset & box model
   -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Brand-tinted text selection — replace the browser-default blue highlight
   with a subtle gold tint so selecting any text matches the premium
   dark-gold theme. var(--gold) resolves per-theme, so one value covers both
   dark (:root) and light (html.light). Background-only (text colour kept) so
   selected text stays legible on any surface. Kept as TWO separate rules: a
   grouped `::selection, ::-moz-selection` list is dropped wholesale by any
   engine that doesn't understand one of the two pseudo-elements. */
::selection { background: color-mix(in srgb, var(--gold) 35%, transparent); text-shadow: none; }
::-moz-selection { background: color-mix(in srgb, var(--gold) 35%, transparent); text-shadow: none; }

:root {
  /* Surfaces — warm-tinted, matched to the reference design */
  --bg:             #0C0B0A;
  --surface:        #161412;
  --surface-1:      #121110;
  --surface-2:      #1A1815;
  --surface-3:      #24211C;
  --surface-raised: #1E1B17;
  --border:         #302C26;
  --border-strong:  #484237;

  /* Gold */
  --gold:        #C9A84C;
  --gold-light:  #E8C96A;
  --gold-bright: #DCBE64;
  --gold-dim:    rgba(201,168,76,0.15);
  --gold-border: rgba(201,168,76,0.30);

  /* Text */
  --text:  #F5F2EB;
  --muted: #918A78;
  --muted-strong: #B9B29E;
  --text-dim: #918A78; /* was referenced by ~15 selectors but never defined → they rendered bright white; = --muted */
  --faint: rgba(245,240,232,0.28);

  /* Signals */
  --gain: #56BA78;
  --loss: #E45A5A; /* AA 5.17:1 on --surface (was #DC3C3C, 4.16:1) */
  --info: #6FA8DC;
  --warn: #DCA83C;

  /* Geometry — one ladder for every corner so radii stay systematic, not hand-tuned */
  --r-sm:    10px;   /* small icon/thumbnail swatches (~28–60px chips) */
  --r-input: 8px;
  --r-card:  12px;
  --r-lg:    16px;   /* larger list/message cards */
  --r-sheet: 20px;   /* bottom-sheet top corners */
  --r-pill:  999px;
  --nav-h:   64px;
  --safe-b:  env(safe-area-inset-bottom, 0px);
  --safe-t:  env(safe-area-inset-top, 0px);
  --safe-l:  env(safe-area-inset-left, 0px);
  --safe-r:  env(safe-area-inset-right, 0px);

  --mono:    'SF Mono', ui-monospace, 'Fira Code', 'Roboto Mono', Menlo, monospace;
  --display: 'Cormorant Garamond', Georgia, serif;
  --body:    'Geist', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Glass system */
  --glass-bg:        color-mix(in srgb, var(--surface-1) 68%, transparent);
  --glass-bg-2:      color-mix(in srgb, var(--surface-2) 60%, transparent);
  --glass-border:    color-mix(in srgb, white 9%, transparent);
  --glass-highlight: color-mix(in srgb, white 13%, transparent);
  --glass-shadow:
    0 1px 0 0 var(--glass-highlight) inset,
    0 -1px 0 0 color-mix(in srgb, black 30%, transparent) inset,
    0 12px 40px -4px color-mix(in srgb, black 65%, transparent),
    0 3px 10px color-mix(in srgb, black 35%, transparent);
  --glass-blur: blur(28px) saturate(180%);
  --btn-gold-glow: color-mix(in srgb, var(--gold) 45%, transparent);

  /* Motion system — one house easing curve + a 3-step duration scale.
     Everything that moves should pull from these so the app feels of one hand. */
  --ease:        cubic-bezier(0.22, 1, 0.36, 1);   /* expo-out: quick out, soft landing */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast:    0.14s;   /* taps, micro-feedback */
  --dur-base:    0.2s;    /* default control transitions */
  --dur-slow:    0.34s;   /* surfaces, expands, hero moves */

  /* Elevation scale — single warm light source, top-down. Three steps so
     depth reads consistently instead of 28 ad-hoc shadows. */
  --elev-1:
    0 1px 0 var(--glass-highlight) inset,
    0 2px 6px color-mix(in srgb, black 22%, transparent),
    0 1px 2px color-mix(in srgb, black 16%, transparent);
  --elev-2:
    0 1px 0 var(--glass-highlight) inset,
    0 10px 26px -12px color-mix(in srgb, black 52%, transparent),
    0 3px 8px color-mix(in srgb, black 22%, transparent);
  --elev-3:
    0 1px 0 var(--glass-highlight) inset,
    0 26px 50px -14px color-mix(in srgb, black 62%, transparent),
    0 8px 18px color-mix(in srgb, black 30%, transparent);
  /* Floating tier — modals, sheets, lightbox: the highest resting plane. */
  --elev-4:
    0 1px 0 var(--glass-highlight) inset,
    0 40px 80px -20px color-mix(in srgb, black 70%, transparent),
    0 14px 30px color-mix(in srgb, black 38%, transparent);

  /* One slower beat — reserved for self-drawing charts + count-up tallies. */
  --dur-slower: 0.56s;
  /* Gesture spring settle (swipe snap-back / sheet flick) — restrained overshoot. */
  --ease-spring: cubic-bezier(0.34, 1.32, 0.5, 1);

  /* Blur scale — one home for backdrop blur instead of ~10 inlined variants. */
  --blur-1: 8px;
  --blur-2: 16px;
  --blur-3: 22px;
  --blur-4: 28px;

  /* Z-index scale — formalize the ad-hoc 3 → 9999 bands. Defined to match the
     existing stacking so it can be adopted incrementally without re-layering. */
  --z-base:    1;
  --z-sticky:  50;
  --z-nav:     300;
  --z-panel:   350;
  --z-scrim:   360;
  --z-modal:   1000;
  --z-sheet:   1100;
  --z-toast:   9999;
}

html { height: 100%; -webkit-text-size-adjust: 100%; }

body {
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overscroll-behavior-y: none;
  min-height: 100dvh;
  /* Ambient warm gold radial glow at the top so glass panels have depth */
  background:
    radial-gradient(
      ellipse 130% 28% at 50% -4%,
      color-mix(in srgb, var(--gold) 18%, var(--bg)) 0%,
      var(--bg) 100%
    );
  background-attachment: fixed;
}

/* --------------------------------------------------------
   Light theme — token overrides (applied via <html class="light">)
   -------------------------------------------------------- */
html.light {
  --bg:             #FAF8F4;
  --surface:        #FFFFFD;
  --surface-1:      #FFFFFD;
  --surface-2:      #F5F2EC;
  --surface-3:      #EBE6DC;
  --surface-raised: #FFFFFD;
  --border:         #DCD7CC;
  --border-strong:  #B9B2A2;

  --text:  #1A1712;
  --muted: #6B6557;
  --muted-strong: #423E36;
  --faint: rgba(26,23,18,0.34);

  --gold:        #8A6B22;
  --gold-light:  #C9A84C;
  --gold-bright: #B8923A;
  --gold-dim:    rgba(169,132,47,0.14);
  --gold-border: rgba(169,132,47,0.34);

  --gain: #188043;
  --loss: #C8372F;
  --info: #2F6FB0;
  --warn: #9C6F1C;

  --glass-bg:        color-mix(in srgb, white 80%, transparent);
  --glass-bg-2:      color-mix(in srgb, var(--surface-2) 80%, transparent);
  --glass-border:    rgba(26,23,18,0.10);
  --glass-highlight: rgba(255,255,255,0.92);
  --glass-shadow:
    0 1px 0 0 var(--glass-highlight) inset,
    0 -1px 0 0 rgba(0,0,0,0.04) inset,
    0 12px 36px -6px rgba(60,50,30,0.16),
    0 3px 10px rgba(60,50,30,0.08);
  --btn-gold-glow: color-mix(in srgb, var(--gold) 30%, transparent);
}

/* --------------------------------------------------------
   Reduced transparency — honor the OS "Reduce Transparency" accessibility
   preference. Default-inert: this block applies ONLY when the user has the
   preference on, so it never changes the default glass look for anyone else.
   Token-level so it covers every surface using the --glass-* tokens (panels,
   cards, inputs, wizard rows, pills…) in BOTH themes (:root + html.light):
   translucent backgrounds become opaque surfaces and the now-pointless
   backdrop blur is dropped (also a small compositing win for these users).
   Surfaces with hardcoded blur/backgrounds keep theirs — no regression.
   -------------------------------------------------------- */
@media (prefers-reduced-transparency: reduce) {
  :root, html.light {
    --glass-bg:   var(--surface-1);
    --glass-bg-2: var(--surface-2);
    --glass-blur: none;
  }
}

/* --------------------------------------------------------
   Increased contrast — honor the OS "Increase Contrast" accessibility
   preference. Default-inert like the block above: applies ONLY when the
   user has the preference on, so the default look is unchanged for everyone
   else. Token-level, so one block lifts contrast everywhere in BOTH themes
   (:root + html.light): borders/secondary text are promoted to their
   already-defined "-strong" siblings (which are higher-contrast against the
   background in each theme), and the translucent glass surfaces become opaque
   so text sits on a solid, predictable background. Every change strictly
   raises contrast — it never lowers it — and resolves per-theme because the
   var() substitutions follow the using element's cascade.
   -------------------------------------------------------- */
@media (prefers-contrast: more) {
  :root, html.light {
    --border:     var(--border-strong);
    --muted:      var(--muted-strong);
    --text-dim:   var(--muted-strong);
    --glass-bg:   var(--surface-1);
    --glass-bg-2: var(--surface-2);
    --glass-blur: none;
  }
}
html.light body {
  background:
    radial-gradient(
      ellipse 130% 28% at 50% -4%,
      color-mix(in srgb, var(--gold) 13%, var(--bg)) 0%,
      var(--bg) 100%
    );
  background-attachment: fixed;
}
/* Light-mode fixes for elements that used hardcoded white-alpha overlays */
html.light .cat-row-track,
html.light .donut-svg circle[stroke^="rgba(255"],
html.light .bulk-bar { /* tracks/dividers need a dark-on-light tint */ }
html.light .cat-row-track { background: rgba(26,23,18,0.07); }
/* Switch OFF-track: the base rgba(255,255,255,0.14) overlay is invisible on the
   ivory surfaces, leaving only a floating thumb. Dark tint so the pill reads. */
html.light .toggle-track { background: rgba(26,23,18,0.12); }
html.light #bottom-nav { background: color-mix(in srgb, var(--bg) 78%, transparent); border-top-color: rgba(26,23,18,0.08); }
html.light .nav-blur { background: color-mix(in srgb, var(--bg) 78%, transparent); }
html.light .total-value { text-shadow: 0 0 24px rgba(169,132,47,0.20); }
html.light .item-card, html.light .mini-card { background: var(--surface-1); border-color: var(--border); }
/* (inputs/textareas/selects no longer pinned here — the reskin's base border is
   already var(--border), and this pin outranked its hover/focus states in light) */
html.light .search-bar, html.light .filter-chip, html.light .price-pill,
html.light .cond-badge, html.light .notused-btn { border-color: var(--border); }
html.light .sparkline-line { filter: drop-shadow(0 2px 4px rgba(169,132,47,0.30)); }

img { display: block; max-width: 100%; }
button { cursor: pointer; font: inherit; color: inherit; }
input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }

/* Consistent keyboard focus ring across interactive controls. Uses :where()
   so it has zero specificity — component-specific focus styles still win. */
:where(button, a, [role="button"], summary, select, input, textarea):focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.hidden { display: none !important; }

/* --------------------------------------------------------
   Glass surface utilities
   -------------------------------------------------------- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.glass-panel-2 {
  background: var(--glass-bg-2);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}
.glass-inset {
  background: color-mix(in srgb, var(--surface-1) 82%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow:
    0 2px 5px color-mix(in srgb, black 45%, transparent) inset,
    0 1px 2px color-mix(in srgb, black 25%, transparent) inset,
    0 -1px 0 0 color-mix(in srgb, white 7%, transparent) inset;
}

/* --------------------------------------------------------
   3D buttons
   -------------------------------------------------------- */
.btn-gold-3d {
  background: linear-gradient(175deg, var(--gold-bright) 0%, var(--gold) 52%, color-mix(in srgb, var(--gold) 70%, black) 100%);
  border: 1px solid color-mix(in srgb, var(--gold) 42%, black);
  color: #1A1407;
  box-shadow:
    0 1px 0 0 color-mix(in srgb, white 44%, transparent) inset,
    0 -2px 0 0 color-mix(in srgb, black 30%, transparent) inset,
    0 6px 24px -2px var(--btn-gold-glow),
    0 2px 6px color-mix(in srgb, black 45%, transparent);
  transition: all 160ms cubic-bezier(0.22,1,0.36,1);
}
.btn-gold-3d:not(:disabled):hover {
  box-shadow:
    0 1px 0 0 color-mix(in srgb, white 52%, transparent) inset,
    0 -2px 0 0 color-mix(in srgb, black 22%, transparent) inset,
    0 10px 32px -2px var(--btn-gold-glow),
    0 3px 10px color-mix(in srgb, black 40%, transparent);
  transform: translateY(-1.5px);
}
.btn-gold-3d:not(:disabled):active { transform: translateY(1px); }

.btn-glass {
  background: color-mix(in srgb, var(--surface-2) 58%, transparent);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
  color: var(--text);
  box-shadow:
    0 1px 0 0 var(--glass-highlight) inset,
    0 4px 16px color-mix(in srgb, black 35%, transparent);
  transition: all 160ms cubic-bezier(0.22,1,0.36,1);
}
.btn-glass:not(:disabled):hover {
  background: color-mix(in srgb, var(--surface-3) 64%, transparent);
  border-color: color-mix(in srgb, white 15%, transparent);
  transform: translateY(-1px);
}
.btn-glass:not(:disabled):active { transform: translateY(1px); }

/* Interactive card lift */
.card-interactive { transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms cubic-bezier(0.22,1,0.36,1); }
@media (hover: hover) {
  .card-interactive:hover {
    border-color: color-mix(in srgb, white 14%, transparent);
    box-shadow:
      0 1px 0 0 color-mix(in srgb, white 16%, transparent) inset,
      0 18px 52px -4px color-mix(in srgb, black 70%, transparent);
    transform: translateY(-2px);
  }
}
.card-interactive:active { transform: translateY(0); }

/* Condition badges */
.cond-badge {
  display: inline-block; font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 7px; border-radius: var(--r-pill);
  border: 1px solid var(--glass-border);
  background: color-mix(in srgb, var(--surface-3) 70%, transparent);
  color: var(--muted-strong);
}

/* --------------------------------------------------------
   App shell + screens
   -------------------------------------------------------- */
#app-shell { min-height: 100dvh; }

#screens { position: relative; }

.screen {
  display: none;
  padding: calc(16px + var(--safe-t)) calc(16px + var(--safe-r)) calc(var(--nav-h) + 24px + var(--safe-b)) calc(16px + var(--safe-l));
  max-width: 640px;
  margin: 0 auto;
  animation: screen-in 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
.screen.active { display: block; }

@keyframes screen-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}
.screen.from-left { animation-name: screen-in-left; }
@keyframes screen-in-left {
  from { opacity: 0; transform: translateX(-14px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --------------------------------------------------------
   Cross-screen view transitions
   When document.startViewTransition() is supported, the whole-page snapshot
   cross-fades + slides directionally (back vs forward). The doc carries
   .vt-back (earlier tab) and .vt-reduce (reduced-motion) which steer the
   keyframes below. Snapshots are captured AFTER the destination renders.
   -------------------------------------------------------- */
::view-transition-group(root) { animation-duration: var(--dur-slow); animation-timing-function: var(--ease); }
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: var(--dur-slow);
  animation-timing-function: var(--ease);
  mix-blend-mode: normal;
}
/* Forward (default): outgoing slides left + fades, incoming rises from the right. */
::view-transition-old(root) { animation-name: vt-old-out; }
::view-transition-new(root) { animation-name: vt-new-in; }
/* Back: mirror the horizontal direction. */
.vt-back::view-transition-old(root) { animation-name: vt-old-out-back; }
.vt-back::view-transition-new(root) { animation-name: vt-new-in-back; }

@keyframes vt-old-out      { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-22px); } }
@keyframes vt-new-in       { from { opacity: 0; transform: translateX(22px); } to { opacity: 1; transform: translateX(0); } }
@keyframes vt-old-out-back { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(22px); } }
@keyframes vt-new-in-back  { from { opacity: 0; transform: translateX(-22px); } to { opacity: 1; transform: translateX(0); } }

/* Reduced-motion (or user pref via the media query): plain cross-fade, no slide. */
.vt-reduce::view-transition-old(root) { animation-name: vt-fade-out; }
.vt-reduce::view-transition-new(root),
.vt-reduce.vt-back::view-transition-new(root) { animation-name: vt-fade-in; }
.vt-reduce.vt-back::view-transition-old(root) { animation-name: vt-fade-out; }
@keyframes vt-fade-out { from { opacity: 1; } to { opacity: 0; } }
@keyframes vt-fade-in  { from { opacity: 0; } to { opacity: 1; } }

/* Fallback for browsers without the View-Transition API: the outgoing screen is
   held one extra frame with .is-leaving so it animates out under it while the
   incoming screen plays its own screen-in keyframe. */
.screen.is-leaving {
  display: block !important;
  position: absolute; top: 0; left: 0; right: 0;
  pointer-events: none;
  animation: screen-out var(--dur-slow) var(--ease) forwards;
}
.screen.is-leaving.leaving-back { animation-name: screen-out-back; }
@keyframes screen-out      { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-18px); } }
@keyframes screen-out-back { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(18px); } }

@media (prefers-reduced-motion: reduce) {
  /* Snap to a plain fade — no horizontal travel. */
  ::view-transition-old(root) { animation-name: vt-fade-out !important; }
  ::view-transition-new(root) { animation-name: vt-fade-in  !important; }
  .screen.is-leaving { animation-name: screen-out-fade !important; }
  @keyframes screen-out-fade { from { opacity: 1; } to { opacity: 0; } }
}

.home-block { margin-bottom: 26px; }

/* --------------------------------------------------------
   Bottom navigation
   -------------------------------------------------------- */
#bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: calc(var(--nav-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  padding-left: var(--safe-l); padding-right: var(--safe-r);
  background: rgba(12,11,10,0.86);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 50;
}
/* Two equal-width button groups flank the fixed-width FAB, keeping it dead-centre
   even with an odd split (3 left / 2 right). */
.nav-group { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-around; }

.nav-btn {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; flex: 1; height: var(--nav-h);
  background: none; border: none;
  color: var(--muted);
  font-size: 10px; font-weight: 500; letter-spacing: 0.04em;
  transition: color var(--dur-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
  position: relative; /* for the per-icon active glow */
}
.nav-btn.active { color: var(--gold); }
.nav-btn.active span { font-weight: 600; } /* subtle label weight bump */
.nav-btn svg { flex-shrink: 0; position: relative; z-index: 1; }
/* Unread-messages count, pinned to the corner of the Settings tab icon so new
   messages are noticed from any screen (not just inside Settings). */
.nav-unread-badge {
  position: absolute; top: 6px; left: 50%; margin-left: 4px;
  min-width: 16px; height: 16px; padding: 0 4px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px; background: var(--loss, #e05252); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: 0;
  border: 1.5px solid var(--bg); z-index: 2; pointer-events: none;
}
.nav-unread-badge[hidden] { display: none; }

/* Faint gold glow pooled under the active tab's icon. Sits behind the glyph,
   never inside any .cp-scene, so no SVG pre-rasterization risk. */
.nav-btn::before {
  content: "";
  position: absolute;
  top: 8px; left: 50%;
  width: 30px; height: 30px;
  transform: translateX(-50%) scale(0.6);
  border-radius: 50%;
  background: radial-gradient(circle, var(--btn-gold-glow) 0%, transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
  pointer-events: none;
}
.nav-btn.active::before { opacity: 1; transform: translateX(-50%) scale(1); }
.nav-fab::before { content: none; } /* FAB owns its own gold circle */

/* Icon pop on becoming active: scale 1 → 1.18 → 1 (added/removed in JS). */
.nav-btn.nav-pop svg { animation: nav-icon-pop var(--dur-slow) var(--ease); }
@keyframes nav-icon-pop {
  0% { transform: scale(1); }
  45% { transform: scale(1.18); }
  100% { transform: scale(1); }
}

/* Living indicator — a gold pill that slides between tabs. Centre-x + width come
   from --nav-ind-* (set by navigate()); only transform/opacity animate. */
.nav-indicator {
  position: absolute;
  top: 8px; left: 0;
  width: var(--nav-ind-w, 36px); height: 3px;
  margin-left: calc(var(--nav-ind-w, 36px) / -2);
  border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold) 18%, var(--gold-light) 50%, var(--gold) 82%, transparent);
  box-shadow: 0 0 10px var(--btn-gold-glow);
  opacity: var(--nav-ind-o, 0);
  transform: translateX(var(--nav-ind-x, 0));
  transition: transform var(--dur-slow) var(--ease),
              width var(--dur-slow) var(--ease),
              opacity var(--dur-base) var(--ease);
  pointer-events: none;
  z-index: 2;
}
/* During a viewport resize, snap the pill to the new layout (no chase). */
#bottom-nav.nav-resizing .nav-indicator { transition: none; }

.nav-fab { position: relative; flex: 0 0 72px; }
.fab-circle {
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 55%, #A8842F 100%);
  box-shadow: 0 6px 18px rgba(201,168,76,0.4), 0 0 0 1px rgba(201,168,76,0.35), inset 0 1px 0 rgba(255,255,255,0.4);
  color: #1A1407;
  transition: transform 0.14s, box-shadow 0.14s;
}
.nav-fab:active .fab-circle { transform: scale(0.92); box-shadow: 0 3px 10px rgba(201,168,76,0.35); }

/* --------------------------------------------------------
   Typography helpers
   -------------------------------------------------------- */
.section-title {
  font-family: var(--display);
  font-size: 14px; font-weight: 400;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 12px;
}
.label-xs {
  font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted);
}
.muted  { color: var(--muted); }
.mono   { font-family: var(--mono); }
.font-display { font-family: var(--display); }
.font-body    { font-family: var(--body); }
.font-mono    { font-family: var(--mono); }
.val-est-tag { font-size: 0.7em; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0.03em; text-transform: uppercase; vertical-align: 1px; }
.gain   { color: var(--gain); }
.loss   { color: var(--loss); }

/* Trove wordmark */
.trove-wordmark {
  text-align: center;
  padding: 8px 0 20px;
  letter-spacing: 0.22em;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
}
.trove-logo-t    { color: var(--gold); font-size: 15px; }
.trove-logo-rest { }

/* --------------------------------------------------------
   Home: greeting + total
   -------------------------------------------------------- */
.home-greeting { padding: 4px 0 20px; }
.greeting-text { font-size: 14px; color: var(--muted); margin-bottom: 4px; letter-spacing: 0.04em; }
.total-value {
  font-family: var(--display);
  font-size: clamp(42px, 13vw, 56px);
  font-weight: 300; letter-spacing: -0.01em; line-height: 1;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; /* steady width during count-up */
  color: var(--gold);
  margin-bottom: 6px;
  text-shadow: 0 0 28px rgba(201,168,76,0.18);
}
.items-count { font-size: 13px; color: var(--muted); }

/* Sparkline card */
.sparkline-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  padding: 16px; margin-bottom: 26px;
  box-shadow: var(--glass-shadow);
  position: relative;
}
.sparkline-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 10px;
}
.sparkline-svg { width: 100%; height: 56px; overflow: visible; display: block; }
.sparkline-fill { stroke: none; opacity: 0.9; }
.sparkline-line {
  fill: none; stroke: var(--gold); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  /* Layered gold glow: a tight core + a soft outer bloom for a lit, premium read. */
  filter: drop-shadow(0 1px 4px rgba(201,168,76,0.45)) drop-shadow(0 0 9px rgba(201,168,76,0.26));
}
.sparkline-dot { fill: var(--gold-light); }
/* Net-direction tint for the per-item value line (opts.gainColored). */
.sparkline-line.line-gain { stroke: var(--gain); filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--gain) 32%, transparent)); }
.sparkline-line.line-loss { stroke: var(--loss); filter: drop-shadow(0 2px 5px color-mix(in srgb, var(--loss) 32%, transparent)); }
.sparkline-empty {
  display: flex; align-items: center; justify-content: center;
  height: 56px; color: var(--muted); font-size: 12px;
}
/* Screen-reader-only utility (a11y live regions etc.). */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Interactive sparkline: scrub cursor + value tooltip + time-range toggle. */
.spark-plot { position: relative; touch-action: pan-y; }
/* pan-y (NOT none): vertical swipes must still scroll the page — the chart is a
   full-width strip mid-viewport. Horizontal drags scrub; a vertical pan fires
   pointercancel, which the scrubber's onUp already uses to hide the tip. */
#home-sparkline { touch-action: pan-y; cursor: crosshair; outline: none; }
#home-sparkline:focus-visible { box-shadow: 0 0 0 2px var(--gold-border); border-radius: 6px; }
.spark-cursor {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: linear-gradient(var(--gold-border), transparent);
  pointer-events: none; z-index: 2;
}
.spark-cursor-dot {
  position: absolute; top: 50%; left: 50%; width: 7px; height: 7px;
  transform: translate(-50%, -50%); border-radius: 50%;
  background: var(--gold-light); box-shadow: 0 0 8px rgba(201,168,76,0.6);
}
.spark-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%);
  background: rgba(30,27,23,0.97); border: 1px solid var(--gold-border);
  border-radius: 8px; padding: 5px 9px; font-size: 11.5px; font-weight: 600;
  color: var(--text); white-space: nowrap; pointer-events: none; z-index: 3;
  box-shadow: 0 6px 18px rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.spark-range { display: flex; gap: 6px; margin-top: 12px; }
.spark-range-chip {
  position: relative; flex: 0 0 auto; padding: 4px 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 999px; color: var(--muted); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.spark-range-chip::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); height: 44px; }
.spark-range-chip:active { transform: scale(0.97); }
.spark-range-chip.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }

/* Section title row with "See all" link */
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-title-row .section-title { margin-bottom: 0; }
.section-link {
  background: none; border: none; color: var(--gold);
  font-size: 12px; font-weight: 500; letter-spacing: 0.02em;
  padding: 2px 4px;
}
.section-link:active { opacity: 0.7; }

/* ── By-category full-width rows ───────────────────────────── */
.cat-bars { display: flex; flex-direction: column; }
.cat-row {
  display: block; width: 100%; text-align: left;
  background: none; border: none; padding: 12px 2px 13px;
  border-bottom: 1px solid var(--border);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s;
}
.cat-row:last-child { border-bottom: none; }
.cat-row:active { opacity: 0.85; transform: scale(0.99); }
.cat-row-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.cat-row-icon { flex: 0 0 auto; display: inline-flex; color: var(--gold); }
.cat-row-icon svg { width: 18px; height: 18px; display: block; }
.cat-row-label { font-size: 14px; color: var(--text); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-row-count {
  font-size: 11px; color: var(--muted); flex: 0 0 auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-3); border-radius: var(--r-pill);
}
.cat-row-val { font-family: var(--mono); font-size: 13px; color: var(--muted-strong); flex: 0 0 auto; margin-left: 8px; }
/* Signposts that this row opens the Cards binder, not a filtered item list. */
.cat-row-go { font-size: 12.5px; font-weight: 600; color: var(--gold); flex: 0 0 auto; margin-left: 8px; white-space: nowrap; }
.cat-row-track { display: block; width: 100%; height: 4px; background: rgba(255,255,255,0.05); border-radius: var(--r-pill); overflow: hidden; }
.cat-row-fill {
  display: block; height: 100%; width: 0; border-radius: var(--r-pill);
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 0 12px rgba(201,168,76,0.6), 0 0 3px rgba(232,201,106,0.8), 0 1px 0 rgba(255,255,255,0.25) inset;
  transition: width 0.7s cubic-bezier(0.22,1,0.36,1);
}
/* slow light sweep along the gold fill — compositor-only (transform) */
.cat-row-fill::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: translateX(-160%);
  animation: cat-fill-sheen 4s ease-in-out var(--sheen-d, 0ms) infinite;
}
@keyframes cat-fill-sheen { 0% { transform: translateX(-160%); } 55%, 100% { transform: translateX(420%); } }
@media (prefers-reduced-motion: reduce) { .cat-row-fill::after, .estate-heir-bar span::after { animation: none; } }

/* ── "This week" movers digest — dismissible glass strip ───── */
.movers-strip {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card); padding: 16px 16px 15px;
  box-shadow: var(--glass-shadow);
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
}
.movers-strip.movers-leaving { opacity: 0; transform: translateY(-6px); }
.movers-head { display: flex; align-items: flex-start; gap: 12px; }
.movers-head-text { flex: 1; min-width: 0; }
.movers-eyebrow {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold); font-weight: 600;
}
.movers-delta {
  font-family: var(--mono); font-size: 24px; font-weight: 600;
  line-height: 1.1; letter-spacing: -0.01em; margin-top: 6px;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
}
.movers-delta.gain { color: var(--gain); }
.movers-delta.loss { color: var(--loss); }
.movers-delta .mover-arrow { display: inline-flex; }
.movers-delta-pct { font-size: 13px; opacity: 0.85; margin-left: 2px; }
.movers-sub { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.movers-dismiss {
  flex: 0 0 auto; width: 30px; height: 30px; margin: -4px -4px 0 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); border: 1px solid transparent;
  background: none; color: var(--muted);
  transition: color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
@media (hover: hover) { .movers-dismiss:hover { color: var(--text); background: var(--surface-2); } }
.movers-dismiss:active { transform: scale(0.92); }
.movers-lists {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px;
  margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--glass-border);
}
.movers-col { min-width: 0; }
.movers-col-cap {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted); margin-bottom: 6px;
}
.mover-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; }
.mover-row-name { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted-strong); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mover-row-pct { flex: 0 0 auto; font-family: var(--mono); font-size: 12px; }
.mover-row-pct.gain { color: var(--gain); }
.mover-row-pct.loss { color: var(--loss); }

/* ── Portfolio insights — two large cards ──────────────────── */
.insights-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.insight-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card); padding: 16px 16px 15px;
  box-shadow: var(--glass-shadow);
}
.insight-card-value {
  font-family: var(--mono); font-size: 22px; font-weight: 600;
  line-height: 1.1; letter-spacing: -0.01em; color: var(--text);
  display: flex; align-items: center; gap: 5px;
}
.insight-card-value.gain { color: var(--gain); }
.insight-card-value.loss { color: var(--loss); }
.insight-arrow { display: inline-flex; }
.insight-card-label { font-size: 13px; color: var(--text); margin-top: 8px; }
.insight-card-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Donut allocation card with legend ─────────────────────── */
.donut-card {
  display: flex; align-items: center; gap: 18px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-card); padding: 18px 16px;
  box-shadow: var(--glass-shadow);
}
.donut-figure { position: relative; flex: 0 0 116px; width: 116px; height: 116px; }
.donut-svg { width: 116px; height: 116px; transform: rotate(-90deg); }
.donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.donut-center-num { font-family: var(--display); font-size: 28px; font-weight: 400; color: var(--text); line-height: 1; }
.donut-center-cap { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-top: 2px; }
.donut-legend { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.donut-legend-item { display: flex; align-items: center; gap: 8px; }
.donut-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.donut-legend-name { font-size: 12.5px; color: var(--muted-strong); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.donut-legend-pct { font-family: var(--mono); font-size: 12px; color: var(--text); flex: 0 0 auto; }

/* ── Price-check pills ─────────────────────────────────────── */
.price-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.price-pill {
  display: inline-flex; align-items: center; font-size: 12.5px;
  padding: 7px 14px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--muted-strong); text-decoration: none;
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
@media (hover: hover) {
  .price-pill:hover { border-color: var(--gold-border); color: var(--gold); transform: translateY(-1px); box-shadow: var(--elev-2); }
}
.price-pill:active { transform: scale(0.98); box-shadow: var(--elev-1); }

/* ── Mini-card condition badge ─────────────────────────────── */
.mini-card-badges { margin-top: 6px; }

/* ── Not-being-used list rows ──────────────────────────────── */
.notused-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px; margin-bottom: 8px;
  background: var(--glass-bg-2);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border); border-radius: var(--r-card);
}
.notused-thumb { flex: 0 0 46px; width: 46px; height: 46px; border-radius: var(--r-input); overflow: hidden; background: var(--surface-2); }
.notused-thumb img { width: 100%; height: 100%; object-fit: cover; }
.notused-body { flex: 1; min-width: 0; cursor: pointer; }
.notused-name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notused-val { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.notused-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.notused-btn {
  font-size: 11.5px; padding: 5px 11px; border-radius: var(--r-pill);
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  transition: border-color 0.14s, color 0.14s;
}
.notused-btn:hover { border-color: var(--gold-border); color: var(--gold); }
.notused-dismiss { color: var(--muted); }
.notused-dismiss:hover { border-color: var(--border-strong); color: var(--muted-strong); }

/* --------------------------------------------------------
   Wishlist
   -------------------------------------------------------- */
/* Home header bookmark button (top-right) */
#screen-home { position: relative; }
.home-wishlist-btn {
  position: absolute; top: calc(12px + var(--safe-t)); right: 12px;
  height: 34px; padding: 0 13px; display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--r-pill);
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); color: var(--gold);
  transition: border-color 0.16s, transform 0.12s, color 0.16s; z-index: 3;
}
.home-icon-label { font-size: 12.5px; font-weight: 600; letter-spacing: 0.01em; }
.home-wishlist-btn:hover { border-color: var(--gold-border); color: var(--gold-light); }
.home-wishlist-btn:active { transform: scale(0.93); }

/* Tappable settings row (chevron) — extends .settings-row */
.settings-row-tappable {
  width: 100%; text-align: left; background: none; cursor: pointer;
  font: inherit; color: inherit;
}
.settings-row-tappable:active { background: rgba(255,255,255,0.05); }
.settings-row-chevron { color: var(--muted); flex-shrink: 0; }

/* Screen header: back · title · add */
.wishlist-screen-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 18px;
}
.wishlist-back-btn {
  width: 38px; height: 38px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text);
  transition: border-color 0.16s, color 0.16s, transform 0.12s;
}
.wishlist-back-btn:hover { border-color: var(--gold-border); color: var(--gold); }
.wishlist-back-btn:active { transform: scale(0.93); }
.wishlist-title {
  flex: 1; margin: 0; font-family: var(--display);
  font-size: 28px; font-weight: 400; letter-spacing: -0.01em; color: var(--text);
}
.wishlist-add-pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; font-size: 14px; border-radius: var(--r-pill);
}

/* Wishlist card */
/* ---- Wishlist target-price firing ---- */
/* Count badge on the Home pill + Settings row (how many wishes are at/below target). */
.wl-hit-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  border-radius: 9px; background: var(--gold); color: #1a1710;
  font-size: 11px; font-weight: 800; vertical-align: middle;
}
.home-wishlist-btn .wl-hit-count { margin-left: 2px; }

/* Tracking line (which catalogue card a wish follows) + the per-row price status. */
.wl-linked-ref {
  display: flex; align-items: center; gap: 5px;
  margin-top: 7px; font-size: 11.5px; color: var(--muted);
  overflow-wrap: anywhere;
}
.wl-linked-ref-ico { color: var(--gold); font-size: 11px; }
.wl-pricestat {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px;
  margin-top: 8px; font-size: 12px;
}
.wl-hit-detail { color: var(--muted); }
.wl-watch-badge {
  display: inline-flex; align-items: center;
  font-family: var(--mono); font-weight: 600; color: var(--muted-strong);
}
.wl-hit-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.02em;
  color: #1a1710; background: linear-gradient(180deg, var(--gold-light), var(--gold));
  box-shadow: 0 2px 8px color-mix(in srgb, var(--gold) 36%, transparent);
}
.wl-hit-spark { font-size: 10px; }
.wl-pricestat.is-hit .wl-hit-detail { color: var(--gold-light); }
@media (hover: hover) {
  .wishlist-card.wl-card-hit { border-color: var(--gold-border); }
}
.wishlist-card.wl-card-hit { box-shadow: var(--glass-shadow), inset 0 0 0 1px color-mix(in srgb, var(--gold) 22%, transparent); }

/* Catalogue-link control inside the Add/Edit wishlist form. */
.wl-link-hint { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-left: 4px; }
.wl-link-search {
  width: 100%; box-sizing: border-box;
}
.wl-link-results { margin-top: 8px; max-height: 240px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.wl-link-results .coll-result { width: 100%; }
.wl-link-empty { padding: 10px 4px; font-size: 12.5px; color: var(--muted); }
.wl-link-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 11px; border-radius: var(--r-input);
  background: color-mix(in srgb, var(--gold) 9%, var(--surface-2));
  border: 1px solid var(--gold-border);
}
.wl-link-chip-ico { color: var(--gold); flex: 0 0 auto; }
.wl-link-chip-name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-link-unlink {
  flex: 0 0 auto; padding: 4px 9px; border-radius: var(--r-pill);
  font: inherit; font-size: 11.5px; font-weight: 600;
  background: none; border: 1px solid var(--border); color: var(--muted);
  cursor: pointer; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.wl-link-unlink:hover { color: var(--text); border-color: var(--border-strong); }
.wl-link-note { margin-top: 6px; font-size: 11.5px; color: var(--muted); }

.wishlist-card {
  display: flex; align-items: flex-start; gap: 13px;
  padding: 13px; margin-bottom: 11px;
  background: var(--glass-bg-2);
  backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border); border-radius: var(--r-card);
  /* Skip layout/paint for off-screen wishes — the list is unvirtualized and EACH card
     runs an expensive blur(20px) backdrop-filter, so a long wishlist otherwise composites
     every card up front. 'auto' remembers the real height once seen; fallback ≈ thumb +
     name/meta/actions. The card's own box-shadow isn't clipped (paint containment only
     clips descendants), and no child is absolutely positioned outside the box. */
  content-visibility: auto;
  contain-intrinsic-size: auto 150px;
  box-shadow: var(--glass-shadow);
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
}
@media (hover: hover) {
  .wishlist-card:hover { transform: translateY(-2px); border-color: var(--gold-border); box-shadow: var(--elev-3); }
}
.wishlist-thumb {
  flex: 0 0 60px; width: 60px; height: 60px;
  border-radius: var(--r-input); overflow: hidden; background: var(--surface-2);
}
.wishlist-body { flex: 1; min-width: 0; }
.wishlist-card-top { display: flex; align-items: flex-start; gap: 8px; }
.wishlist-name {
  flex: 1; min-width: 0; font-size: 16px; font-weight: 500; color: var(--text);
  line-height: 1.25; overflow-wrap: anywhere;
}
.wishlist-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 5px;
  font-size: 12.5px; color: var(--muted);
}
.wishlist-target { font-family: var(--mono); color: var(--gold); }
.wishlist-target-label {
  font-family: var(--body); font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-right: 2px;
}
.wishlist-cat { color: var(--muted); }
.wishlist-notes {
  font-size: 12.5px; color: var(--muted-strong); line-height: 1.45; margin-top: 7px;
  overflow-wrap: anywhere;
}
.wishlist-link {
  display: inline-block; margin-top: 8px; font-size: 12.5px; font-weight: 500;
  color: var(--gold); text-decoration: none;
}
.wishlist-link:hover { color: var(--gold-light); text-decoration: underline; }
.wishlist-delete {
  flex: 0 0 auto; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: none; border: 1px solid transparent;
  color: var(--muted); transition: color 0.16s, border-color 0.16s, background 0.16s;
}
.wishlist-delete:hover { color: var(--loss); border-color: color-mix(in srgb, var(--loss) 38%, transparent); background: color-mix(in srgb, var(--loss) 10%, transparent); }
.wishlist-delete:active { transform: scale(0.92); }
.wishlist-actions { display: flex; gap: 8px; margin-top: 10px; }
.wl-act {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: var(--r-pill);
  font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted-strong);
  cursor: pointer; transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.wl-act:hover { color: var(--text); border-color: var(--border-strong); }
.wl-act:active { transform: scale(0.96); }
.wl-act-got { color: var(--gain); border-color: color-mix(in srgb, var(--gain) 36%, transparent); background: color-mix(in srgb, var(--gain) 10%, transparent); }
.wl-act-got:hover { color: var(--gain); border-color: color-mix(in srgb, var(--gain) 55%, transparent); background: color-mix(in srgb, var(--gain) 16%, transparent); }

/* Priority pill */
.wl-priority {
  flex: 0 0 auto; font-size: 9.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.07em;
  padding: 3px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--border); color: var(--muted); white-space: nowrap;
}
.wl-priority.high {
  color: var(--gold-light); border-color: var(--gold-border); background: var(--gold-dim);
}
.wl-priority.medium { color: var(--muted-strong); border-color: var(--border); background: rgba(255,255,255,0.04); }
.wl-priority.low { color: var(--muted); border-color: var(--border); background: none; }

/* Wishlist empty state */
.wishlist-empty { text-align: center; padding: 34px 24px; }
.wishlist-empty-icon {
  width: 52px; height: 52px; margin: 0 auto 14px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill); background: var(--gold-dim);
  border: 1px solid var(--gold-border); color: var(--gold);
}
.wishlist-empty-title { font-size: 16px; color: var(--text); margin-bottom: 4px; }
.wishlist-empty-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }

/* ── Home empty state ──────────────────────────────────────── */
/* Empty-state "what's it worth?" price-check demo */
.epc { width: 100%; margin: 0 0 18px; }
.epc-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 8px 11px 14px; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  transition: border-color var(--dur-base) var(--ease);
}
.epc-bar:focus-within { border-color: color-mix(in srgb, var(--gold-light) 50%, var(--glass-border)); }
.epc-bar-icon { flex: 0 0 auto; color: var(--muted); }
.epc-bar input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 15px; color: var(--text); text-align: left;
}
.epc-bar input::placeholder { color: var(--muted); }
.epc-bar input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.epc-scan {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--gold-light);
  transition: transform var(--dur-fast) var(--ease);
}
.epc-scan:active { transform: scale(0.92); }
.epc-results { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; text-align: left; }
.epc-results[hidden] { display: none; }
.epc-empty { font-size: 13px; color: var(--muted); padding: 10px 2px; text-align: center; }

.home-empty {
  border-radius: var(--r-card); padding: 32px 22px;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.home-empty-icon {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); border: 1px solid var(--border);
  background: var(--surface-2); margin-bottom: 16px;
}
.home-empty-title { font-family: var(--display); font-size: 22px; color: var(--text); }
.home-empty-sub { font-size: 13px; color: var(--muted); margin: 4px 0 20px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: var(--r-input); font-weight: 500; font-size: 15px; padding: 13px 20px; }
.home-empty-add { width: 100%; }
.home-empty-sample {
  background: none; border: none; color: var(--gold);
  font-size: 13px; margin-top: 14px; padding: 6px;
}
.home-empty-sample:active { opacity: 0.7; }

/* ── Onboarding ────────────────────────────────────────────── */
#onboarding {
  position: fixed; inset: 0; z-index: 200;
  background:
    radial-gradient(ellipse 120% 30% at 50% 0%, color-mix(in srgb, var(--gold) 16%, var(--bg)) 0%, var(--bg) 70%);
  display: flex; flex-direction: column;
  padding: calc(20px + var(--safe-t)) 24px calc(28px + var(--safe-b));
  /* Clip the directional slide transition (translateX) so it can never spill past
     the overlay edge and create a horizontal scroll. The overlay is full-viewport;
     nothing should ever scroll out of it on either axis. */
  overflow: hidden; overscroll-behavior: contain;
  animation: page-in 0.3s ease both;
}
#onboarding[hidden] { display: none !important; }
/* Lock the page behind the overlay so the home screen can't scroll under it. */
html.onb-locked, html.onb-locked body { overflow: hidden !important; overscroll-behavior: none; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
.onb-skip {
  position: absolute; top: calc(16px + var(--safe-t)); right: 22px;
  background: none; border: none; color: var(--muted); font-size: 14px; padding: 8px;
}
.onb-slides {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  /* Single-axis safety valve: if a slide is taller than the area on a very short
     device, this region scrolls vertically (never the page, never horizontally).
     Normal phones fit with no scroll at all. */
  overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
}
.onb-slides::-webkit-scrollbar { display: none; }
/* margin:auto vertically centers the active slide AND stays scroll-safe when it
   overflows (auto margins collapse to 0, so the top never gets clipped). */
.onb-slide { margin: auto 0; max-width: 360px; text-align: center; display: flex; flex-direction: column; align-items: center; animation: page-in 0.35s ease both; }
.onb-slide[hidden] { display: none !important; }
/* Directional slide + cross-fade between onboarding slides (wireOnboarding adds
   .onb-in / .onb-out, plus .onb-back to reverse direction). The outgoing slide
   is overlaid absolutely so both can animate in the same space. Transform/opacity
   only. */
.onb-slide.onb-out {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  animation: onb-slide-out var(--dur-slow) var(--ease) both;
}
.onb-slide.onb-in { animation: onb-slide-in var(--dur-slow) var(--ease) both; }
@keyframes onb-slide-in  { from { opacity: 0; transform: translateX(34px); } to { opacity: 1; transform: none; } }
@keyframes onb-slide-out { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(calc(-50% - 34px), -50%); } }
/* Back navigation mirrors the horizontal direction. */
.onb-slide.onb-in.onb-back  { animation-name: onb-slide-in-back; }
.onb-slide.onb-out.onb-back { animation-name: onb-slide-out-back; }
@keyframes onb-slide-in-back  { from { opacity: 0; transform: translateX(-34px); } to { opacity: 1; transform: none; } }
@keyframes onb-slide-out-back { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(calc(-50% + 34px), -50%); } }
.onb-icon {
  width: 76px; height: 76px; border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow); margin-bottom: 30px;
}
.onb-title { font-size: 40px; font-weight: 400; line-height: 1.05; color: var(--text); letter-spacing: 0.01em; }
.onb-text { font-size: 15px; line-height: 1.55; color: var(--muted-strong); margin: 18px 0 18px; }
.onb-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; color: var(--gold); }

/* ---- Onboarding spotlight slides — real category scenes + a set binder ---- */
.onb-slide-spot { max-width: 384px; }
.onb-spot { width: 100%; margin-bottom: 26px; display: flex; align-items: center; justify-content: center; }
.onb-spot .onb-title { margin-top: 0; }
/* Category scene grid */
.onb-cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; width: 100%; }
.onb-cat-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; animation: onb-rise 0.5s var(--ease) both; animation-delay: calc(var(--i) * 45ms); }
.onb-cat-scene { width: 100%; aspect-ratio: 1 / 1; border-radius: var(--r-card); overflow: hidden; box-shadow: var(--elev-1); }
.onb-cat-scene .cat-placeholder-wrap, .onb-cat-scene .cat-placeholder { width: 100%; height: 100%; border-radius: var(--r-card); }
.onb-cat-label { font-size: 9.5px; font-weight: 600; letter-spacing: 0.05em; color: var(--muted); text-transform: uppercase; }
/* Mini set-completion binder */
.onb-binder { position: relative; width: 236px; }
.onb-binder-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.onb-slot { aspect-ratio: 5 / 7; border-radius: 7px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; animation: onb-rise 0.5s var(--ease) both; animation-delay: calc(var(--i) * 38ms); }
.onb-slot.locked { background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.onb-slot.owned { background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 32%, var(--surface-3)), var(--surface-2)); border: 1px solid var(--gold-border); box-shadow: var(--elev-1), inset 0 0 0 1px color-mix(in srgb, var(--gold) 18%, transparent); }
.onb-slot-foil { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 32%, color-mix(in srgb, var(--gold-light) 55%, transparent) 48%, transparent 60%); mix-blend-mode: screen; opacity: 0.6; }
.onb-slot-spark { position: absolute; top: 5px; right: 5px; width: 5px; height: 5px; border-radius: 50%; background: var(--gold-light); box-shadow: 0 0 6px var(--gold); }
.onb-binder-ring { position: absolute; top: -16px; right: -16px; background: var(--surface); border-radius: 50%; padding: 4px; box-shadow: var(--elev-2); }
@keyframes onb-rise { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }
/* real card art inside a binder slot (foil overlays the art) */
.onb-slot-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.onb-slot.has-card { background: var(--surface-2); }
.onb-slot.has-card .onb-slot-foil { opacity: 0.4; z-index: 1; }
/* Scanner viewfinder spotlight */
.onb-scan { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.onb-scan-frame { position: relative; width: 152px; aspect-ratio: 5 / 7; border-radius: 12px; overflow: hidden; background: linear-gradient(160deg, var(--surface-3), var(--surface)); box-shadow: var(--elev-2); }
.onb-scan-card { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.onb-scan-frame.no-card::after { content: ''; position: absolute; inset: 16px; border-radius: 8px; background: linear-gradient(150deg, color-mix(in srgb, var(--gold) 30%, var(--surface-3)), var(--surface-2)); }
.onb-scan-reticle { position: absolute; inset: 9px; pointer-events: none; z-index: 2; }
.onb-scan-reticle span { position: absolute; width: 20px; height: 20px; border: 2px solid var(--gold); }
.onb-scan-reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 5px 0 0 0; }
.onb-scan-reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 5px 0 0; }
.onb-scan-reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 5px; }
.onb-scan-reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 5px 0; }
.onb-scan-beam { position: absolute; left: 6px; right: 6px; height: 34%; top: -34%; z-index: 1; background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--gold-light) 32%, transparent), transparent); box-shadow: 0 0 14px color-mix(in srgb, var(--gold) 50%, transparent); animation: onb-scan-sweep 2.4s var(--ease-in-out) infinite; }
@keyframes onb-scan-sweep { 0% { top: -34%; } 55%, 100% { top: 100%; } }
.onb-scan-result { display: inline-flex; align-items: center; gap: 9px; padding: 8px 13px; border-radius: var(--r-pill); background: var(--glass-bg); border: 1px solid var(--glass-border); box-shadow: var(--elev-1); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); animation: onb-rise 0.5s var(--ease) both; animation-delay: 0.4s; }
.onb-scan-check { display: flex; color: var(--gain); }
.onb-scan-name { display: flex; flex-direction: column; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.18; text-align: left; }
.onb-scan-set { font-size: 9px; font-weight: 500; color: var(--muted); letter-spacing: 0.03em; text-transform: uppercase; }
.onb-scan-val { font-size: 13px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; margin-left: 2px; }
@media (prefers-reduced-motion: reduce) { .onb-cat-tile, .onb-slot { animation: none; } .onb-scan-beam { animation: none; opacity: 0; } }

.onb-footer { display: flex; flex-direction: column; align-items: center; gap: 18px; flex-shrink: 0; padding-top: 8px; }
.onb-dots { display: flex; gap: 7px; }
.onb-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: width var(--dur-slow) var(--ease), background var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease); }
.onb-dot.active {
  width: 22px; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: 0 0 10px -2px var(--btn-gold-glow);
}
.onb-continue { width: 100%; max-width: 420px; padding: 15px; font-size: 16px; }
.onb-wordmark { letter-spacing: 0.22em; font-size: 12px; font-weight: 500; text-transform: uppercase; color: var(--muted); }
.onb-wordmark .trove-logo-t { color: var(--gold); font-size: 14px; }

/* Short viewports (iPhone SE, small Androids, landscape): compact every block so
   the whole guide — spotlight + copy + CTA — fits on one screen with no scrolling.
   Without this the 3×3 category grid alone pushed the Continue button below the fold. */
@media (max-height: 745px) {
  .onb-icon { width: 60px; height: 60px; margin-bottom: 16px; border-radius: 16px; }
  .onb-title { font-size: 30px; }
  .onb-text { margin: 11px 0; font-size: 14px; line-height: 1.45; }
  .onb-tag { font-size: 10.5px; }
  .onb-spot { margin-bottom: 14px; }
  .onb-cat-grid { max-width: 264px; gap: 7px; }
  .onb-cat-label { font-size: 9px; }
  .onb-binder { width: 200px; }
  .onb-binder-ring { top: -13px; right: -13px; }
  .onb-scan-frame { width: 128px; }
  .onb-footer { gap: 11px; padding-top: 4px; }
  .onb-continue { padding: 13px; }
}
@media (max-height: 660px) {
  .onb-title { font-size: 26px; }
  .onb-text { margin: 9px 0; }
  .onb-cat-grid { max-width: 232px; }
  .onb-binder { width: 178px; }
}

/* ============================================================
   AUTH GATE (login / register)
   ============================================================ */
#auth-screen {
  position: fixed; inset: 0; z-index: 190;
  background:
    radial-gradient(ellipse 120% 30% at 50% 0%, color-mix(in srgb, var(--gold) 16%, var(--bg)) 0%, var(--bg) 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(28px + var(--safe-t)) 24px calc(28px + var(--safe-b));
  overflow-y: auto;
  animation: page-in 0.3s ease both;
}
/* Ambient gold mesh — two soft radial blooms that drift VERY slowly behind the
   card, lifting the void into something alive. Pure transform/opacity on a
   single layer, so it's cheap; pausable via .anim-paused. */
#auth-screen::before {
  content: ''; position: absolute; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 34% at 30% 28%, color-mix(in srgb, var(--gold) 22%, transparent) 0%, transparent 64%),
    radial-gradient(34% 30% at 72% 66%, color-mix(in srgb, var(--gold-light) 16%, transparent) 0%, transparent 60%);
  opacity: 0.85;
  animation: auth-drift 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes auth-drift {
  0%   { transform: translate3d(-3%, -2%, 0) scale(1.02); }
  50%  { transform: translate3d(2%, 3%, 0) scale(1.06); }
  100% { transform: translate3d(4%, -3%, 0) scale(1.03); }
}
#auth-screen.anim-paused::before { animation-play-state: paused; }
#auth-screen[hidden] { display: none !important; }
/* The HTML hidden attribute must win over the explicit display rules on the
   shell and nav so the auth gate can hide them. */
#app-shell[hidden], #bottom-nav[hidden] { display: none !important; }
.auth-wordmark {
  padding: 0 0 26px;
  font-size: 18px; letter-spacing: 0.26em;
  /* Settle in from above as the gate appears — restrained, expo-out. */
  animation: auth-wordmark-in var(--dur-slow) var(--ease) both;
}
@keyframes auth-wordmark-in {
  from { opacity: 0; transform: translateY(-10px); letter-spacing: 0.4em; }
  to   { opacity: 1; transform: none; letter-spacing: 0.26em; }
}
.auth-wordmark .trove-logo-t { font-size: 21px; }
.auth-card {
  position: relative;
  width: 100%; max-width: 380px;
  padding: 26px 24px 22px;
  border-radius: var(--r-card);
  transition: box-shadow var(--dur-slow) var(--ease), border-color var(--dur-slow) var(--ease);
}
/* Gold edge-glow when the user is typing into the card. */
.auth-card:focus-within {
  border-color: var(--gold-border);
  box-shadow: var(--glass-shadow), 0 0 0 1px var(--gold-border), 0 0 34px -6px var(--btn-gold-glow);
}
.auth-heading {
  font-family: var(--display);
  font-size: 28px; font-weight: 500; line-height: 1.1;
  color: var(--text); letter-spacing: 0.01em;
  margin: 0 0 22px; text-align: center;
}
.auth-field { margin-bottom: 16px; }
.auth-field[hidden] { display: none !important; }
.auth-error {
  color: var(--loss); font-size: 13px; line-height: 1.45;
  margin: -4px 0 14px;
}
.auth-error[hidden] { display: none !important; }
.auth-submit { width: 100%; padding: 14px; font-size: 16px; margin-top: 4px; }
.auth-submit:disabled { opacity: 0.6; cursor: default; }
.auth-toggle {
  display: block; width: 100%; margin-top: 16px;
  background: none; border: none; cursor: pointer;
  font-size: 14px; color: var(--muted);
}
.auth-toggle span { color: var(--gold); font-weight: 500; }
.auth-toggle:hover span { color: var(--gold-light); }
/* Muted "Forgot password?" entry under the sign-in form (login mode only —
   setAuthMode hides it elsewhere). Swaps the form into recovery-code mode. */
.auth-forgot {
  display: block; width: 100%; margin-top: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 13px; color: var(--muted);
  text-decoration: underline; text-underline-offset: 3px;
}
.auth-forgot:hover { color: var(--muted-strong); }
.auth-forgot[hidden] { display: none !important; }
/* "or" divider + local-mode entry on the auth card */
.auth-or {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 4px; color: var(--muted);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
}
.auth-or::before, .auth-or::after {
  content: ''; flex: 1 1 auto; height: 1px;
  background: var(--border);
}
.auth-local-btn {
  display: block; width: 100%; margin-top: 12px; padding: 13px;
  background: transparent; cursor: pointer;
  border: 1px solid var(--gold-border); border-radius: var(--r-pill);
  color: var(--gold); font-size: 14.5px; font-weight: 500;
  letter-spacing: 0.01em;
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease),
    background var(--dur-base) var(--ease), transform var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
}
@media (hover: hover) {
  .auth-local-btn:hover {
    border-color: var(--gold); color: var(--gold-light);
    background: var(--gold-dim);
    transform: translateY(-1px); box-shadow: var(--elev-2);
  }
}
.auth-local-btn:active { transform: scale(0.98); box-shadow: var(--elev-1); }
.auth-local-btn span { margin-left: 4px; }
.auth-local-sub {
  margin: 10px 0 0; text-align: center;
  font-size: 12px; line-height: 1.5; color: var(--muted);
}
.auth-reassure {
  max-width: 380px; margin: 20px auto 0; text-align: center;
  font-size: 12.5px; line-height: 1.6; color: var(--muted);
}
.auth-legal { display: block; margin-top: 4px; }
.auth-legal a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.auth-legal a:hover { color: var(--gold); }
.auth-legal span[aria-hidden] { margin: 0 7px; color: var(--muted); }

/* Account section (Settings) */
.account-row { display: flex; align-items: center; gap: 12px; }
.account-avatar {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 19px; font-weight: 600;
  color: color-mix(in srgb, var(--gold) 86%, #000);
  /* Subtle top-lit gold gradient monogram + a gold ring (matches the estate
     heir avatar) — reads as a struck token in both themes. */
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold-light) 40%, transparent), color-mix(in srgb, var(--gold) 26%, transparent));
  border: 1px solid color-mix(in srgb, var(--gold) 48%, var(--border));
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 0 0 3px var(--gold-dim);
}

/* Horizontal carousels */
.horizontal-scroll {
  display: flex; gap: 12px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 4px; scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.horizontal-scroll::-webkit-scrollbar { display: none; }

.mini-card {
  flex: 0 0 138px; scroll-snap-align: start;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); overflow: hidden;
  box-shadow: var(--elev-1);
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .mini-card:hover { transform: translateY(-2px); border-color: var(--gold-border); box-shadow: var(--elev-2); }
}
.mini-card:active { transform: scale(0.97); border-color: var(--gold-border); }
.mini-card-thumb { aspect-ratio: 1; overflow: hidden; position: relative; background: #1a1714; }
.mini-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Same photo scrim as the grid card — real photos only. */
/* removed: dead bottom photo scrim (parity with item-card) */
.mini-card-body { padding: 9px 11px 11px; }
.mini-card-name {
  font-size: 12.5px; font-weight: 500; color: var(--text); line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mini-card-val { font-family: var(--mono); font-size: 11.5px; color: var(--gold); margin-top: 2px; }

/* "Needs revaluation" alert rows */
.alert-card {
  display: flex; align-items: center; gap: 12px;
  padding: 13px; margin-bottom: 8px;
  background: rgba(224,168,90,0.07);
  border: 1px solid rgba(224,168,90,0.22);
  border-radius: var(--r-card);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.14s;
}
.alert-card:active { transform: scale(0.99); }
.alert-card-thumb { width: 44px; height: 44px; border-radius: 9px; overflow: hidden; flex-shrink: 0; background: #1a1714; }
.alert-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.alert-card-text { flex: 1; min-width: 0; }
.alert-card-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-card-sub { font-size: 12px; color: var(--muted); }
.alert-card-arrow { color: var(--muted); flex-shrink: 0; }

/* "Needs attention" care/reminder rows (warranty / service / insurance).
   Tappable — opens the item via the global [data-item] handler. Tinted amber
   for "due soon", red for "overdue". Tokens carry it into light mode. */
.attention-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 13px; margin-bottom: 8px;
  border-radius: var(--r-card);
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: transform 0.14s, border-color 0.14s;
}
.attention-row:active { transform: scale(0.99); }
.attention-soon {
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
}
.attention-overdue {
  background: color-mix(in srgb, var(--loss) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--loss) 30%, transparent);
}
.attention-thumb {
  flex: 0 0 44px; width: 44px; height: 44px;
  border-radius: var(--r-input); overflow: hidden;
  background: var(--surface-2);
}
.attention-thumb img { width: 100%; height: 100%; object-fit: cover; }
.attention-body { flex: 1; min-width: 0; }
.attention-name {
  font-size: 14px; font-weight: 500; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.attention-reason {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; margin-top: 2px; color: var(--muted-strong);
}
.attention-dot {
  flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn);
}
.attention-overdue .attention-reason { color: var(--loss); }
.attention-overdue .attention-dot { background: var(--loss); }
.attention-soon .attention-reason { color: var(--warn); }
.attention-soon .attention-dot { background: var(--warn); }
.attention-arrow { color: var(--muted); flex-shrink: 0; }

/* --------------------------------------------------------
   Browse
   -------------------------------------------------------- */
/* "You are here" heading for Items — matches the Cards screen title (cohesion). */
.browse-title {
  font-family: var(--display); font-weight: 500; font-size: 22px; letter-spacing: 0.01em;
  color: var(--text); margin: 0; padding: calc(12px + var(--safe-t)) 16px 6px;
}
/* Empty-state primary action — centred under the empty message. A soft pulsing gold
   ring (via ::after, so the button's own shadow stays) signals "there's something to
   do here". Reduced-motion-safe. */
.empty-add-btn { display: block; margin: 4px auto 0; }
.empty-add-btn, .home-empty-add { position: relative; }
.empty-add-btn::after, .home-empty-add::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  animation: cta-pulse 2.4s var(--ease, ease) infinite;
}
@keyframes cta-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201,168,76,0); }
  60% { box-shadow: 0 0 0 5px rgba(201,168,76,0.16); }
}
@media (prefers-reduced-motion: reduce) {
  .empty-add-btn::after, .home-empty-add::after { animation: none; }
}

.browse-sticky {
  position: sticky;
  top: calc(-1px + var(--safe-t));
  z-index: 10;
  background: linear-gradient(180deg, var(--bg) 70%, rgba(12,11,10,0));
  padding-top: 4px;
  margin: 0 -2px 12px;
  padding-left: 2px; padding-right: 2px;
}

.search-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 11px 12px; margin-bottom: 12px;
  min-height: 46px; /* comfortable 44px+ tap target (visual-audit follow-up) */
  transition: border-color 0.2s;
}
.search-bar:focus-within { border-color: var(--gold-border); }
.search-bar > svg { flex-shrink: 0; color: var(--muted); }
.search-bar input {
  flex: 1; min-width: 0; background: none; border: none; outline: none;
  color: var(--text); font-size: 15px; padding: 0;
}
.search-bar input::placeholder { color: var(--muted); }
.search-clear {
  background: none; border: none; color: var(--muted);
  font-size: 20px; line-height: 1; min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
}
.filter-btn {
  position: relative; flex-shrink: 0;
  background: none; border: none; color: var(--text);
  display: flex; align-items: center; padding: 2px;
}
.filter-count {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--gold); color: #1A1407;
  border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}
.scan-btn {
  flex-shrink: 0;
  background: none; border: none; color: var(--muted);
  display: flex; align-items: center; padding: 2px;
  transition: color 0.16s;
}
.scan-btn:hover, .scan-btn:active { color: var(--gold); }

.filter-chips {
  display: flex; gap: 8px; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-bottom: 2px; margin-bottom: 12px;
}
.filter-chips::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0; padding: 7px 15px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted);
  box-shadow: var(--elev-1);
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease),
    border-color var(--dur-base) var(--ease), transform var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .filter-chip:hover { border-color: var(--gold-border); color: var(--gold-light); transform: translateY(-1px); box-shadow: var(--elev-2); }
}
.filter-chip:active { transform: scale(0.98); box-shadow: var(--elev-1); transition-duration: 0.08s; }
.filter-chip.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }

.browse-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.browse-count { font-size: 12px; color: var(--muted); }
.browse-toolbar-right { display: flex; align-items: center; gap: 8px; }
.browse-toolbar select {
  width: auto; padding: 7px 30px 7px 11px; font-size: 12.5px; border-radius: var(--r-input);
}
.layout-toggle {
  flex-shrink: 0; width: 36px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-input); color: var(--muted);
}
.layout-toggle.list-active { color: var(--gold); border-color: var(--gold-border); }
/* The Select/Done toggle carries the same class but holds TEXT, not an icon — size it
   to content so the label doesn't overflow the 36px icon square. */
#browse-select-toggle { width: auto; min-width: 44px; padding: 0 12px; font-size: 12.5px; font-weight: 600; }

/* Item grid / list */
.item-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.item-grid > .empty-state { grid-column: 1 / -1; } /* span both cols so the centered box truly centers */
.item-grid.list-mode { grid-template-columns: 1fr; }

/* First-run auth: value tagline + a promoted no-account path so a stranger doesn't hit a login wall. */
.auth-tagline { color: var(--muted); font-size: 13.5px; line-height: 1.45; margin: -2px 0 16px; text-align: center; }
.auth-card.is-firsttime .auth-local-btn { border-color: var(--gold-border); color: var(--text); font-weight: 600; }
.auth-card.is-firsttime .auth-local-sub { color: var(--muted); }

/* Inline validation error tied to a field (a11y form errors). */
.field-error { color: var(--danger, #e0645c); font-size: 12px; line-height: 1.35; margin-top: 5px; font-weight: 500; }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--danger, #e0645c) !important; }

.item-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); overflow: hidden;
  /* Skip layout/paint for off-screen tiles (the Vault grid is unvirtualized, so a big
     collection otherwise paints every tile up front). 'auto' remembers the real size
     once seen; fallback ≈ square thumb + meta row. */
  content-visibility: auto;
  contain-intrinsic-size: auto 248px;
  box-shadow: var(--elev-2);
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
  text-align: left; width: 100%; padding: 0; display: block;
}
@media (hover: hover) {
  .item-card:hover {
    transform: translateY(-3px); border-color: var(--gold-border);
    box-shadow: var(--elev-3);
  }
}
.item-card:active { transform: scale(0.975); border-color: var(--gold-border); transition-duration: 0.08s; }

.item-card-thumb { aspect-ratio: 1; overflow: hidden; position: relative; background: #1a1714; }
/* recessed niche so the photo / scene reads as inset with depth */
.item-card-thumb::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    inset 0 -16px 26px -16px rgba(0,0,0,0.6);
}
.item-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
/* Bottom scrim — only over a REAL photo (.has-img), never monogram/cp-scene
   tiles. Keeps the fav star / status dot and any overlaid pills legible against
   bright photography. Sits under the recessed-niche ::after (z 2). */
/* removed: dead bottom photo scrim — no pills overlay the thumbnail any longer */
.item-card-body { padding: 10px 12px 12px; }
.item-card-name {
  font-size: 13.5px; font-weight: 500; color: var(--text); line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-card-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; row-gap: 5px; }
.item-card-val-wrap { display: inline-flex; align-items: baseline; gap: 6px; min-width: 0; flex: 1 1 auto; }
.item-card-value { font-family: var(--mono); font-size: 12.5px; color: var(--gold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* At-a-glance appreciation: ▲ green / ▼ red vs. acquired price. */
.gain-loss-badge { font-family: var(--mono); font-size: 10.5px; font-weight: 600; white-space: nowrap; letter-spacing: -0.01em; }
.gain-loss-badge.gl-up { color: var(--gain); }
.gain-loss-badge.gl-down { color: var(--loss); }
.item-card-fav {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  color: var(--gold-light); font-size: 14px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.7));
}
.item-card-statusdot {
  position: absolute; top: 9px; left: 9px; z-index: 2;
  width: 8px; height: 8px; border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(0,0,0,0.35);
}

/* List-mode card layout */
.item-grid.list-mode .item-card { display: flex; align-items: stretch; }
.item-grid.list-mode .item-card-thumb { width: 92px; aspect-ratio: 1; flex-shrink: 0; }
.item-grid.list-mode .item-card-body {
  flex: 1; display: flex; flex-direction: column; justify-content: center; min-width: 0;
}
.item-grid.list-mode .item-card-name { -webkit-line-clamp: 2; line-clamp: 2; margin-bottom: 8px; }

/* --------------------------------------------------------
   Pills / badges / chips
   -------------------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-dim); color: var(--gold-light);
  border: 1px solid var(--gold-border);
  border-radius: var(--r-pill); padding: 4px 11px;
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.chip.gain { background: rgba(76,175,130,0.12); color: var(--gain); border-color: rgba(76,175,130,0.3); }
.chip.loss { background: rgba(224,82,82,0.12); color: var(--loss); border-color: rgba(224,82,82,0.3); }
.chip.flat { background: rgba(255,255,255,0.05); color: var(--muted); border-color: var(--border); }

.tag-pill {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.06); color: var(--text);
  border: 1px solid var(--border); border-radius: var(--r-pill);
  padding: 4px 11px; font-size: 12px; white-space: nowrap;
}

.cond-pill {
  display: inline-flex; align-items: center;
  border-radius: var(--r-pill); padding: 3px 10px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--muted);
}
/* Non-owned status pill on item tiles (Sold / Gifted / Lost) — stands apart from the
   neutral condition pill so a disposed item never reads as still owned. */
.item-card-status { color: var(--gold, #c9a84c); border-color: var(--gold-border, rgba(201,168,76,0.4)); background: rgba(201,168,76,0.10); font-weight: 600; }
.cond-mint      { background: rgba(201,168,76,0.14); color: var(--gold-light); border-color: var(--gold-border); }
.cond-excellent { background: rgba(76,175,130,0.12); color: var(--gain); border-color: rgba(76,175,130,0.28); }
.cond-good      { background: rgba(111,168,220,0.12); color: var(--info); border-color: rgba(111,168,220,0.28); }
.cond-fair      { background: rgba(224,168,90,0.12);  color: var(--warn); border-color: rgba(224,168,90,0.28); }
.cond-poor      { background: rgba(224,82,82,0.12);   color: var(--loss); border-color: rgba(224,82,82,0.28); }

.status-badge {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--r-pill); padding: 3px 10px;
  font-size: 11px; font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); background: rgba(255,255,255,0.05); color: var(--muted);
}
.status-owned    { background: rgba(76,175,130,0.12); color: var(--gain); border-color: rgba(76,175,130,0.28); }
.status-for_sale { background: rgba(201,168,76,0.14); color: var(--gold-light); border-color: var(--gold-border); }
.status-loaned   { background: rgba(111,168,220,0.12); color: var(--info); border-color: rgba(111,168,220,0.28); }
.status-in_repair{ background: rgba(224,168,90,0.12);  color: var(--warn); border-color: rgba(224,168,90,0.28); }
.status-sold     { background: rgba(255,255,255,0.05); color: var(--muted); border-color: var(--border); }

.dot-owned    { background: var(--gain); }
.dot-for_sale { background: var(--gold); }
.dot-loaned   { background: var(--info); }
.dot-in_repair{ background: var(--warn); }
.dot-sold     { background: var(--muted); }

/* --------------------------------------------------------
   Forms
   -------------------------------------------------------- */

/* Animated category hero banner at top of add/edit form */
.form-cat-preview {
  width: 100%; height: 180px;
  border-radius: var(--r-card); overflow: hidden;
  margin-bottom: 20px;
  background: var(--surface);
  animation: fadeInDown 0.32s cubic-bezier(0.22,1,0.36,1);
}
.form-cat-preview .cat-placeholder-wrap,
.form-cat-preview .cat-placeholder { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.form-title { font-size: 22px; font-weight: 400; color: var(--text); }
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-group label,
.form-label {
  display: block; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted-strong); margin-bottom: 8px; line-height: 1.3;
}
.form-section-title {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted);
  margin: 24px 0 12px; padding-top: 16px;
  border-top: 1px solid var(--border);
}

input, textarea, select {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  color: var(--text); padding: 12px 14px;
  width: 100%; font-size: 15px; line-height: 1.4;
  appearance: none; -webkit-appearance: none; outline: none;
  caret-color: var(--gold);
  color-scheme: dark; /* native date/select popovers render dark */
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
html.light input, html.light textarea, html.light select { color-scheme: light; }
/* Hover lift — text-like controls only; checkbox/radio/range/file keep their own skins */
@media (hover: hover) {
  :where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]):not(:focus):not(:disabled),
         textarea:not(:focus):not(:disabled),
         select:not(:focus):not(:disabled)):hover {
    border-color: var(--border-strong);
  }
}
/* Date/time fields — hold the text-input height even when empty (WebKit collapses
   the value box); color-scheme above keeps the native pickers dark. */
input[type="date"], input[type="time"], input[type="month"], input[type="datetime-local"] {
  min-height: calc(1.4em + 26px); /* line + 12px×2 padding + 1px×2 border */
}
input[type="date"]::-webkit-date-and-time-value,
input[type="time"]::-webkit-date-and-time-value,
input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; line-height: 1.4; }
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator { opacity: 0.6; }
/* Number fields — drop desktop spinners so they skin exactly like text */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }
textarea { resize: vertical; min-height: 88px; line-height: 1.5; }
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%23C9A84C' stroke-opacity='0.8' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center; background-size: 12px 8px;
  padding-right: 40px;
}
html.light select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%238A6B22' stroke-width='1.6' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
input:focus, textarea:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
/* The gold ring above IS the focus indicator for text-like controls — drop the
   generic outline so keyboard focus shows one clean ring, not a double halo.
   (:where keeps this at the same zero-ish specificity as the global rule, so
   component focus styles like .cf-picker-input:focus-visible still win.) */
:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), textarea, select):focus-visible { outline: none; }
input:disabled, textarea:disabled, select:disabled {
  opacity: 0.55; cursor: not-allowed; background-color: var(--surface-1);
}
input::placeholder, textarea::placeholder { color: var(--muted); }
select option { background: #1a1814; color: var(--text); }
html.light select option { background: #FFFFFD; }
@media (prefers-reduced-motion: reduce) {
  input, textarea, select, .tags-input-wrap, .add-field-btn { transition: none; }
}
.input-prefixed { position: relative; }
.input-prefixed .input-prefix {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-family: var(--mono); font-size: 14px; pointer-events: none;
}
.input-prefixed input { padding-left: 30px; }

/* Hierarchical category picker */
.cat-picker { margin-bottom: 16px; }
.cat-picker-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cat-picker-selects .cat-pick-sub[disabled] { opacity: 0.5; }

/* Tags input */
.tags-input-wrap {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 8px 12px; min-height: 48px;
  transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
@media (hover: hover) {
  .tags-input-wrap:hover:not(:focus-within) { border-color: var(--border-strong); }
}
.tags-input-wrap:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim); }
.tags-input-wrap input {
  flex: 1; min-width: 90px; width: auto;
  background: none; border: none; border-radius: 0; padding: 4px 2px; box-shadow: none;
}
.tags-input-wrap input:focus { box-shadow: none; }
.tag-chip-removable {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--gold-dim); color: var(--gold-light);
  border: 1px solid var(--gold-border); border-radius: var(--r-pill);
  padding: 3px 4px 3px 10px; font-size: 12px;
}
.tag-chip-removable button {
  background: none; border: none; color: inherit;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; line-height: 1; opacity: 0.7;
}
.tag-chip-removable button:active { opacity: 1; }

/* Custom fields */
.custom-fields-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.custom-field-row { display: flex; gap: 8px; align-items: center; }
.custom-field-row input { flex: 1; }
.custom-field-remove {
  flex-shrink: 0; background: none; border: none; color: var(--loss);
  font-size: 20px; line-height: 1; padding: 4px 6px;
}
.add-field-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px dashed var(--border-strong);
  color: var(--muted-strong); border-radius: var(--r-card);
  padding: 12px; min-height: 44px; font-size: 13px; font-weight: 500;
  width: 100%; justify-content: center;
  transition: border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
@media (hover: hover) { .add-field-btn:hover { border-color: var(--gold-border); color: var(--gold); } }
.add-field-btn:active { border-color: var(--gold-border); color: var(--gold); }

/* Toggle */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 6px 0;
}
.toggle-row > span { font-size: 15px; color: var(--text); }
.toggle { position: relative; width: 46px; height: 28px; flex-shrink: 0; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 2; }
.toggle-track {
  position: absolute; inset: 0; background: rgba(255,255,255,0.14);
  border-radius: var(--r-pill); transition: background 0.2s;
}
.toggle input:checked ~ .toggle-track { background: var(--gold); }
.toggle-thumb {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  background: #fff; border-radius: 50%;
  transition: transform 0.2s; pointer-events: none;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.toggle input:checked ~ .toggle-thumb { transform: translateX(18px); }
/* Keyboard focus ring. The checkbox itself is opacity:0 (its outline can't show),
   so paint the global focus ring on the visible track instead (WCAG 2.4.7). */
.toggle input:focus-visible ~ .toggle-track { outline: 2px solid var(--gold-bright); outline-offset: 2px; }

/* --------------------------------------------------------
   Buttons
   -------------------------------------------------------- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--r-card); padding: 14px 22px;
  font-size: 15px; font-weight: 600; border: none; width: 100%;
  letter-spacing: 0.01em;
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); transition-duration: 0.08s; }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 55%, #A8842F 100%);
  color: #1A1407;
  box-shadow: 0 4px 16px rgba(201,168,76,0.28), inset 0 1px 0 rgba(255,255,255,0.35);
}
.btn-gold:active { opacity: 0.92; }
.btn-ghost {
  background: transparent; border: 1px solid var(--border-strong);
  color: var(--text); font-weight: 500;
}
.btn-ghost:active { background: rgba(255,255,255,0.06); }
.btn-danger {
  background: rgba(224,82,82,0.12); border: 1px solid rgba(224,82,82,0.32);
  color: var(--loss); font-weight: 500;
}
.btn-danger:active { background: rgba(224,82,82,0.2); }
/* Hover affordance on desktop (mobile has no hover, so gate it) */
@media (hover: hover) {
  .btn-gold:hover { box-shadow: 0 6px 22px rgba(201,168,76,0.40), inset 0 1px 0 rgba(255,255,255,0.42); transform: translateY(-1px); }
  .btn-ghost:hover { border-color: var(--gold-border); background: color-mix(in srgb, var(--text) 4%, transparent); }
  .btn-danger:hover { background: rgba(224,82,82,0.18); border-color: rgba(224,82,82,0.45); }
}
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* --------------------------------------------------------
   Public Showcase — share controls (item detail)
   -------------------------------------------------------- */
.share-hint {
  font-size: 13px; color: var(--muted); line-height: 1.5;
  margin-bottom: 12px;
}
/* Public-profile editable fields (display name + bio) in the share control */
.prof-fields { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.prof-field { display: flex; flex-direction: column; gap: 5px; }
.prof-field > span { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.prof-field input, .prof-field textarea { width: 100%; padding: 10px 12px; border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--border); font: inherit; font-size: 14px; color: var(--text); outline: none; transition: border-color var(--dur-fast) var(--ease); }
.prof-field textarea { resize: vertical; min-height: 44px; line-height: 1.45; }
.prof-field input:focus, .prof-field textarea:focus { border-color: var(--gold-border); }
.share-link-row {
  display: flex; gap: 8px; align-items: stretch;
}
.share-link-input {
  flex: 1 1 auto; min-width: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-input);
  color: var(--text);
  font-family: var(--mono); font-size: 12.5px;
  padding: 0 12px; height: 44px;
  text-overflow: ellipsis;
}
.share-link-input:focus {
  outline: none; border-color: var(--gold-border);
}
.share-copy-btn {
  flex: 0 0 auto; width: auto;
  padding: 0 18px; height: 44px; font-size: 14px;
  white-space: nowrap;
}
.share-actions {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 12px;
}
.share-open-link {
  color: var(--gold); text-decoration: none;
  font-size: 13.5px; font-weight: 500;
}
.share-open-link:active { opacity: 0.7; }
.share-stop-btn {
  background: none; border: none;
  color: var(--muted); font-size: 13.5px; font-weight: 500;
  cursor: pointer; padding: 4px 2px;
  font-family: var(--body);
}
.share-stop-btn:hover { color: var(--loss); }
.share-stop-btn:disabled { opacity: 0.5; cursor: default; }
#item-share-section .btn-ghost { width: 100%; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; flex-shrink: 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-input); color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:active { background: var(--surface-3); }
@media (hover: hover) { .icon-btn:hover { border-color: var(--gold-border); color: var(--gold-light); background: color-mix(in srgb, var(--surface-3) 70%, transparent); } }
.icon-btn.active { color: var(--gold); border-color: var(--gold-border); background: var(--gold-dim); }

/* --------------------------------------------------------
   Photo upload + grid
   -------------------------------------------------------- */
.photo-upload-zone {
  position: relative;
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-card);
  padding: 26px 18px; text-align: center;
  color: var(--muted);
  transition: border-color 0.2s, background 0.2s, box-shadow var(--dur-base) var(--ease);
}
/* Gold gradient ring on hover/drag — box-shadow/mask halo, no layout shift
   (shares the language of .csv-drop::before). */
.photo-upload-zone::before {
  content: ''; position: absolute; inset: -2px; border-radius: inherit;
  padding: 2px; pointer-events: none;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--dur-base) var(--ease);
}
@media (hover: hover) {
  .photo-upload-zone:hover { border-color: var(--gold-border); box-shadow: 0 0 0 1px var(--gold-border), 0 10px 30px -16px var(--btn-gold-glow); }
  .photo-upload-zone:hover::before { opacity: 0.6; }
}
.photo-upload-zone:active { border-color: var(--gold-border); background: var(--gold-dim); }
.photo-upload-zone.drag { border-color: var(--gold); background: var(--gold-dim); box-shadow: 0 0 0 1px var(--gold), 0 0 28px -6px var(--btn-gold-glow); }
.photo-upload-zone.drag::before { opacity: 1; }
.photo-upload-zone svg { color: var(--muted); margin: 0 auto 8px; }
.photo-upload-zone input[type="file"] { display: none; }
.photo-upload-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* "Find a photo online" — guided CC image search inside the photo step. */
.photo-find-btn {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 10px;
  cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 14px; border-radius: var(--r-pill);
  color: var(--gold-light); background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-base) var(--ease);
}
.photo-find-btn:active { transform: scale(0.97); }
.photo-find-btn svg { flex: 0 0 auto; }
.photo-find-btn.open { background: color-mix(in srgb, var(--gold-dim) 70%, var(--gold) 12%); }
.photo-find { margin-top: 12px; }
.photo-find:not([hidden]) { animation: cf-panel-in var(--dur-base) cubic-bezier(0.22,1,0.36,1) both; }
@keyframes cf-panel-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .photo-find:not([hidden]) { animation: none; } }
.photo-find-row { display: flex; gap: 8px; }
.photo-find-input {
  flex: 1 1 0; min-width: 0; font: inherit; font-size: 14px; padding: 10px 12px;
  border-radius: var(--r-input); background: var(--glass-bg); color: var(--text);
  border: 1px solid var(--border-strong); transition: border-color var(--dur-base) var(--ease);
}
.photo-find-input:focus { outline: none; border-color: var(--gold-border); }
.photo-find-go {
  flex: 0 0 auto; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: var(--r-input); white-space: nowrap;
  color: #1a1408; background: var(--gold); border: 1px solid var(--gold-border);
  transition: transform var(--dur-fast) var(--ease);
}
.photo-find-go:active { transform: scale(0.97); }
.photo-find-status { margin-top: 9px; font-size: 12px; color: var(--muted); min-height: 1px; }
.photo-find-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 10px; }
.photo-find-cell {
  position: relative; aspect-ratio: 1; padding: 0; cursor: pointer; overflow: hidden;
  border-radius: var(--r-input); border: 1px solid var(--border-strong); background: var(--glass-bg);
  transition: border-color var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease);
}
.photo-find-cell:hover, .photo-find-cell:focus-visible { border-color: var(--gold-border); outline: none; }
.photo-find-cell:active { transform: scale(0.96); }
.photo-find-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-find-cell.loading { opacity: 0.5; pointer-events: none; }
.photo-find-cell.loading::after {
  content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.photo-find-credit { margin-top: 9px; font-size: 11px; color: var(--muted); line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .photo-find-btn:active, .photo-find-go:active, .photo-find-cell:active { transform: none; } }

.photo-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.photo-thumb {
  position: relative; width: 84px; height: 84px;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
  background: #1a1714;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb.is-primary { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.photo-thumb-badge {
  position: absolute; bottom: 4px; left: 4px;
  background: rgba(201,168,76,0.92); color: #1A1407;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 5px; border-radius: 4px;
}
.photo-thumb-actions { position: absolute; top: 4px; right: 4px; display: flex; gap: 4px; }
.photo-thumb-btn {
  background: rgba(0,0,0,0.7); border: none; color: #fff;
  border-radius: 50%; width: 22px; height: 22px; font-size: 12px;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.photo-thumb-spinner {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.5);
}

/* Drag-to-reorder affordance + state */
.photo-thumb[draggable] { cursor: grab; }
.photo-thumb[draggable]:active { cursor: grabbing; }
.photo-thumb.dragging { opacity: 0.4; cursor: grabbing; }
.photo-thumb-handle {
  position: absolute; bottom: 4px; right: 4px;
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(0,0,0,0.6); color: rgba(245,240,232,0.7);
  pointer-events: none; opacity: 0; transition: opacity 0.15s;
}
.photo-thumb[draggable]:hover .photo-thumb-handle { opacity: 1; }

/* --------------------------------------------------------
   Attachments (receipts / documents)
   -------------------------------------------------------- */
.attachment-list { display: flex; flex-direction: column; gap: 8px; }
.attachment-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--glass-bg-2);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-border); border-radius: var(--r-card);
}
.attachment-icon {
  flex: 0 0 38px; width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-input);
  background: var(--gold-dim); color: var(--gold);
}
.attachment-body { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.attachment-name { font-size: 13.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.attachment-meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.attachment-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.attachment-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: var(--r-pill);
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
@media (hover: hover) {
  .attachment-btn:hover { border-color: var(--gold-border); color: var(--gold); transform: translateY(-1px); box-shadow: var(--elev-2); }
  .attachment-del:hover { border-color: var(--loss); color: var(--loss); }
}
.attachment-btn:active { transform: scale(0.98); box-shadow: var(--elev-1); }
.attachment-add {
  width: 100%; margin-top: 10px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 16px; border-radius: var(--r-input);
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  color: var(--text); font-size: 14px; font-weight: 500;
  transition: border-color 0.16s, background 0.16s, color 0.16s;
}
.attachment-add svg { color: var(--gold); flex-shrink: 0; }
.attachment-add:hover { border-color: var(--gold-border); background: var(--gold-dim); color: var(--gold-light); }
.attachment-add:active { transform: scale(0.99); }
.attachment-add:disabled { opacity: 0.6; }
.attachment-hint, .attachment-empty {
  font-size: 12.5px; color: var(--muted);
  padding: 10px 2px;
}

/* --------------------------------------------------------
   Slide-up panels
   -------------------------------------------------------- */
.panel { position: fixed; inset: 0; z-index: 100; }
.panel-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.62);
  opacity: 0; transition: opacity 0.22s ease-out;
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
}
.panel.open .panel-backdrop { opacity: 1; transition: opacity 0.4s ease-out; }
@media (prefers-reduced-motion: reduce) { .panel-sheet { transition-duration: 0.2s !important; } }

.panel-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 640px; margin: 0 auto;
  background: var(--surface-raised);
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  border-top: 1px solid var(--border);
  box-shadow: 0 -12px 40px rgba(0,0,0,0.5);
  max-height: calc(100dvh - 28px);
  display: flex; flex-direction: column;
  transform: translateY(100%);
  /* base = EXIT: commits and accelerates away */
  transition: transform 0.28s cubic-bezier(0.4, 0, 1, 1);
}
.panel.open .panel-sheet { transform: translateY(0);
  /* ENTER: the iOS drawer curve — brisk launch, long weighty settle */
  transition: transform 0.5s cubic-bezier(0.32, 0.72, 0, 1); }
.panel-sheet-full { height: calc(100dvh - 28px); }

.panel-grabber {
  width: 38px; height: 4px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.18);
  margin: 10px auto 4px; flex-shrink: 0; cursor: grab;
}
.panel-titlebar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 16px 10px; flex-shrink: 0;
}
.panel-title { font-size: 16px; font-weight: 500; }
.panel-close {
  position: absolute; top: 12px; right: 12px; z-index: 5;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(0,0,0,0.35); border: 1px solid var(--border);
  color: var(--text); display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.panel-close::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; } /* 44px tap target */
.panel-titlebar .panel-close { position: static; backdrop-filter: none; background: var(--surface); }
.panel-scroll {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 18px calc(28px + var(--safe-b));
}

/* --------------------------------------------------------
   Item detail
   -------------------------------------------------------- */
.detail-hero {
  position: relative; margin: 0 -18px;
  aspect-ratio: 4/3; background: #1a1714; overflow: hidden;
}
/* Melt the artwork's bottom edge into the sheet — no hard photo cut above the title. */
.detail-hero::before {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--surface-raised) 92%, transparent));
}
.detail-hero .cat-placeholder-wrap,
.detail-hero .cat-placeholder, .detail-hero img { position: absolute; inset: 0; }
.detail-hero img { width: 100%; height: 100%; object-fit: cover; }
.detail-photo-track {
  display: flex; height: 100%; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.detail-photo-track::-webkit-scrollbar { display: none; }
.detail-photo-track img { min-width: 100%; scroll-snap-align: center; object-fit: cover; }
.detail-photo-dots {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 5px; z-index: 3;
}
.detail-photo-dot { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,0.45); transition: background 0.2s; }
.detail-photo-dot.active { background: #fff; }
/* Scroll-linked parallax on the photo hero — JS writes --mx/--my (glint position)
   and --rx/--ry (drift) as the page scrolls. Compositor-only: a foreground
   specular glint drifts and the artwork floats a hair, so the hero reads with
   depth on first scroll (no permission, every device). */
.detail-hero { transition: transform var(--dur-base) var(--ease); }
.detail-hero.cp-parallax .cat-placeholder-wrap,
.detail-hero.cp-parallax img {
  transform: translate3d(var(--rx, 0px), var(--ry, 0px), 0) scale(1.04);
  transition: transform var(--dur-base) var(--ease);
  will-change: transform;
}
.detail-hero.cp-parallax::after {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 40%),
    rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.04) 38%, transparent 64%);
  mix-blend-mode: screen;
  opacity: 0.6; transition: opacity var(--dur-slow) var(--ease);
}
@media (prefers-reduced-motion: reduce) {
  .detail-hero.cp-parallax .cat-placeholder-wrap,
  .detail-hero.cp-parallax img { transform: none; }
  .detail-hero.cp-parallax::after { display: none; }
}

.detail-head { padding: 18px 0 0; }
.detail-name { font-family: var(--display); font-size: 24px; font-weight: 500; line-height: 1.2; margin-bottom: 5px; }
.detail-breadcrumb { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

.detail-value-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 10px; margin: 18px 0; }
.value-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px 10px; text-align: center; box-shadow: var(--elev-1); min-width: 0; overflow: hidden; }
/* Premium accent on the primary (gold) value box — the most-looked-at figure. */
.value-box:has(.value-box-val.gold) { border-color: var(--gold-border); background: color-mix(in srgb, var(--gold-dim) 55%, var(--surface)); }
.value-box:has(.value-box-val.gold) .value-box-val { font-size: clamp(13px, 5vw, 17.5px); }
.value-box-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 5px; }
.value-box-val { font-family: var(--mono); font-size: clamp(12px, 4.2vw, 15px); font-weight: 600; color: var(--text); letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.value-box-val.gold { color: var(--gold); }
.value-box-val.gain { color: var(--gain); }
.value-box-val.loss { color: var(--loss); }
/* Where the current value came from — honest provenance for the headline figure. */
.val-source { margin: -8px 0 14px; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .01em; }

/* Per-item valuation block (detail view): value line + "since acquisition". */
.valuation-section .valuation-chart {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 12px 10px 6px;
  margin-bottom: 8px;
}
.valuation-section .valuation-chart .sparkline-svg { height: 60px; }
.valuation-since {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap;
}
.valuation-since.gain { color: var(--gain); }
.valuation-since.loss { color: var(--loss); }
.valuation-since-label {
  font-family: var(--sans, inherit); font-weight: 400; font-size: 10px;
  text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted);
}
.valuation-meta { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
.valuation-stale-cta {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  color: var(--gold); font-weight: 700;
}
.valuation-stale-cta:active { opacity: 0.7; }

.detail-section { margin-bottom: 22px; }
/* Provenance & Authenticity — the trust block reads as premium: a gold hairline
   accent + faint tint set it apart from the plain Category Details grid. */
.provenance-section { position: relative; padding: 14px 14px 14px 16px; border: 1px solid var(--border);
  border-radius: var(--r-card); background: linear-gradient(180deg, rgba(201,168,76,.06), rgba(201,168,76,.02)); }
.provenance-section::before { content: ''; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px;
  border-radius: 3px; background: linear-gradient(180deg, var(--gold), #E8C96A); }
.provenance-section .section-title { color: var(--gold); }
.provenance-section .detail-field-val a { color: var(--gold); text-decoration: none; white-space: nowrap; }
/* Live valuation (crypto) — a cool blue accent vs the gold provenance block. */
.crypto-live-section { border: 1px solid var(--border); border-radius: var(--r-card); padding: 14px; background: linear-gradient(180deg, rgba(111,168,220,.07), rgba(111,168,220,.02)); }
.crypto-live-section .section-title { color: var(--info); }
.crypto-live-note { font-size: 11px; opacity: .5; margin-top: 8px; }
.caliber-section .section-title { color: var(--gold); }
.caliber-photo { text-align: center; margin: 4px 0 12px; }
.caliber-photo img { max-width: 170px; max-height: 170px; border-radius: 10px; background: var(--surface-2); }
/* Fragrance Profile detail block (B9) — note pyramid, accords, fill, rating.
   Mirrors share.php's public fragrance block, themed with the app tokens. */
.frag-detail-section .section-title { color: var(--gold); }
.frag-detail-section { display: flex; flex-direction: column; gap: 13px; }
.frag-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; font-size: 13px; color: var(--muted); }
.frag-conc { color: var(--text); font-weight: 600; }
.frag-accords { display: flex; flex-wrap: wrap; gap: 6px; }
.frag-accord {
  font-size: 12px; padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
}
.frag-pyramid {
  display: grid; gap: 1px; background: var(--border);
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.frag-note-row { display: grid; grid-template-columns: 64px 1fr; gap: 10px; padding: 11px 14px; background: var(--surface); }
.frag-note-tier { text-transform: uppercase; letter-spacing: 0.12em; font-size: 10.5px; color: var(--muted); padding-top: 1px; }
.frag-note-val { font-size: 14px; color: var(--text); }
.frag-fill, .frag-rating { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.frag-fill-label { text-transform: uppercase; letter-spacing: 0.1em; font-size: 10.5px; color: var(--muted); min-width: 86px; }
.frag-fill-bar {
  flex: 1; height: 8px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.frag-fill-bar > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--gold), var(--gold-light)); }
.frag-fill-pct, .frag-rating-num { color: var(--text); font-variant-numeric: tabular-nums; }
.frag-rating-dots { display: inline-flex; gap: 3px; }
.frag-rating-dots > span { width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.frag-rating-dots > span.on { background: var(--gold-light); }
.home-live-tag { color: var(--gold); opacity: .85; font-size: .92em; }

/* ── Ammo stash (Militaria → Ammunition) ──────────────────────────
   The item-page gauge + steppers, and the Add picker's caliber/box-size chips.
   Brass-on-dark: reuses the gold tokens so it sits with the rest of the app. */
.ammo-stash-section .section-title { color: var(--gold); }
.ammo-gauge { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.ammo-gauge-bar {
  height: 14px; border-radius: 999px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--border);
}
.ammo-gauge-bar > span {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  transition: width 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-reduced-motion: reduce) { .ammo-gauge-bar > span { transition: none; } }
.ammo-gauge-count { font-size: 13.5px; color: var(--muted-strong); font-variant-numeric: tabular-nums; }
.ammo-gauge-count b { color: var(--text); font-size: 16px; }
.ammo-steppers { display: flex; flex-wrap: wrap; gap: 7px; }
.ammo-step {
  min-width: 52px; padding: 9px 13px; border-radius: 11px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font: inherit; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.ammo-step:active { transform: scale(0.95); }
.ammo-step-fill { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }
.ammo-stash-note { min-height: 16px; margin-top: 7px; font-size: 12px; color: var(--muted); }
.ammo-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ammo-chip {
  padding: 8px 12px; border-radius: 999px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--muted-strong);
  font: inherit; font-size: 13px; font-weight: 600;
}
.ammo-chip:active { transform: scale(0.96); }
.ammo-chip.on { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }
.ammo-chip-size { min-width: 56px; text-align: center; font-variant-numeric: tabular-nums; }
/* Firearm type tiles: catalogue hero photos are wide side-profiles, not square logos */
.firearm-type-grid .cars-brand-logo img { object-fit: contain; }

/* ── Market-value panel (Add/Edit form) ─────────────────────────────
   "Our average" figures shown beside the user's own value field once a picker
   or scan links the item to a catalogue card. Tappable gold figures; the user's
   input always sits directly below — the two co-exist by design. */
.value-hint {
  margin: 0 0 14px; padding: 13px 14px;
  background: linear-gradient(160deg, var(--gold-dim), var(--surface));
  border: 1px solid var(--gold-border); border-radius: var(--r-card);
}
.value-hint-head {
  display: flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold-light); margin-bottom: 10px;
}
.value-hint-spark { font-size: 12px; line-height: 1; }
.value-hint-figs { display: flex; flex-wrap: wrap; gap: 8px; }
.value-hint-fig {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 128px; padding: 10px 13px; cursor: pointer; position: relative;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  font: inherit; text-align: left;
  transition: border-color 140ms var(--ease, ease), transform 140ms var(--ease, ease);
}
.value-hint-fig:active { transform: scale(0.97); }
.value-hint-fig.on { border-color: var(--gold-border); background: var(--gold-dim); }
.value-hint-fig .vh-amt {
  font-size: 19px; font-weight: 800; color: var(--gold-light);
  font-variant-numeric: tabular-nums; letter-spacing: 0.01em;
  padding-right: 40px; /* reserves the absolute USE tag's footprint — five-figure amounts must not slide under it */
}
.value-hint-fig .vh-src { font-size: 11px; color: var(--muted-strong); }
.value-hint-fig .vh-use {
  position: absolute; top: 9px; right: 11px;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--gold); opacity: 0.85;
}
.value-hint-fig.on .vh-use { display: none; } /* applied — the gold fill says it */
.value-hint-note { margin-top: 9px; font-size: 11.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .value-hint-fig { transition: none; } }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.detail-cell { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: 12px; }
.detail-cell-label { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.detail-cell-val { font-size: 14px; color: var(--text); word-break: break-word; }
.detail-desc { color: var(--text); font-size: 14.5px; line-height: 1.6; }

.detail-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.custom-field-display { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.custom-field-display:last-child { border-bottom: none; }
.custom-field-display .cf-key { color: var(--muted); font-size: 13px; }
.custom-field-display .cf-val { color: var(--text); font-size: 14px; text-align: right; word-break: break-word; }

/* QR */
.qr-section {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); padding: 16px;
}
.qr-canvas-wrap {
  background: #F5F0E8; padding: 8px; border-radius: 10px; flex-shrink: 0;
  width: 96px; height: 96px; display: flex; align-items: center; justify-content: center;
}
.qr-canvas-wrap canvas, .qr-canvas-wrap img { width: 80px !important; height: 80px !important; display: block; }
.qr-meta { flex: 1; min-width: 0; }
.qr-meta-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 4px; }
.qr-meta-id { font-family: var(--mono); font-size: 12.5px; color: var(--text); word-break: break-all; }

/* Activity inside detail */
.detail-activity { display: flex; flex-direction: column; }

/* Per-item provenance timeline — a connected life-story of the piece. */
.prov-timeline { position: relative; }
.prov-item { position: relative; display: flex; gap: 13px; padding-bottom: 16px; }
.prov-item:last-child { padding-bottom: 0; }
.prov-item::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: -2px; width: 2px; background: var(--border); }
.prov-item:last-child::before { display: none; }
.prov-dot {
  position: relative; z-index: 1; flex: 0 0 auto;
  width: 28px; height: 28px; border-radius: 50%; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border-strong);
}
.prov-item.up .prov-dot { border-color: color-mix(in srgb, var(--gain) 55%, var(--border)); }
.prov-item.down .prov-dot { border-color: color-mix(in srgb, var(--loss) 55%, var(--border)); }
.prov-item.acquired .prov-dot { border-color: var(--gold-border); background: var(--gold-dim); }
.prov-dot svg { color: var(--muted-strong); }
.prov-item.up .prov-dot svg { color: var(--gain); }
.prov-item.down .prov-dot svg { color: var(--loss); }
.prov-item.acquired .prov-dot svg { color: var(--gold); }
.prov-body { flex: 1; min-width: 0; padding-top: 3px; }
.prov-head { display: flex; align-items: baseline; gap: 8px; }
.prov-title { font-size: 14px; font-weight: 600; color: var(--text); }
.prov-delta { font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prov-delta.gain { color: var(--gain); }
.prov-delta.loss { color: var(--loss); }
.prov-sub { font-size: 13px; color: var(--muted-strong); margin-top: 2px; font-variant-numeric: tabular-nums; }
.prov-sub strong { color: var(--text); font-weight: 600; }
.prov-note { font-size: 12px; color: var(--muted); margin-top: 3px; font-style: italic; }
.prov-date { font-size: 11px; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------
   Activity timeline
   -------------------------------------------------------- */
.timeline-list { display: flex; flex-direction: column; }
.timeline-group { display: flex; flex-direction: column; }

/* Sticky day header — a date-chip pill that pins under the screen header as you
   scroll a long ledger. Sits on the sticky band so it never collides with the
   nav/panels above it. */
.timeline-day {
  position: -webkit-sticky; position: sticky; top: 4px;
  z-index: var(--z-sticky);
  padding: 10px 0 8px;
}
.timeline-day-chip {
  display: inline-flex; align-items: center;
  padding: 5px 12px; border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted-strong);
  background: color-mix(in srgb, var(--surface-1) 86%, transparent);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur-2)); backdrop-filter: blur(var(--blur-2));
  box-shadow: var(--elev-1);
}

/* The connector spine: a vertical gradient rail anchored to the centre of the
   icon column (34px icon → 17px). Drawn on the rail so it spans variable row
   heights and fades out top/bottom. */
.timeline-rail { position: relative; }
.timeline-rail::before {
  content: ''; position: absolute; top: 26px; bottom: 22px; left: 16.5px; width: 2px;
  background: linear-gradient(180deg, transparent, var(--border-strong) 12%, var(--border-strong) 88%, transparent);
  border-radius: 2px; pointer-events: none;
}
.timeline-item {
  position: relative;
  display: flex; gap: 12px; padding: 13px 0;
  border-bottom: 1px solid var(--border); align-items: flex-start;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-icon {
  position: relative; z-index: 1;
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 15px;
  background: var(--gold-dim);
  /* a hairline ring so the node reads as a bead on the spine, not floating */
  box-shadow: 0 0 0 3px var(--bg);
}
.timeline-icon.created { background: rgba(76,175,130,0.16); }
.timeline-icon.value_updated { background: var(--gold-dim); }
.timeline-icon.value_down { background: rgba(224,82,82,0.16); }
.timeline-icon.edited { background: rgba(111,168,220,0.16); }
.timeline-icon.photo_added { background: rgba(111,168,220,0.16); }
.timeline-icon svg { color: var(--muted-strong); }
.timeline-icon.created svg { color: var(--gain); }
.timeline-icon.value_updated svg { color: var(--gold-light); }
.timeline-icon.value_down svg { color: var(--loss); }
.timeline-icon.edited svg, .timeline-icon.photo_added svg { color: var(--info); }
/* Revaluation rows tint the node ring gain/loss so the direction reads at a
   glance down the spine. */
.timeline-up .timeline-icon { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px color-mix(in srgb, var(--gain) 45%, transparent); }
.timeline-down .timeline-icon { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px color-mix(in srgb, var(--loss) 45%, transparent); }
.timeline-content { flex: 1; min-width: 0; }
.timeline-title {
  font-size: 14px; font-weight: 500; color: var(--text); margin-bottom: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.timeline-sub { font-size: 12.5px; color: var(--muted); }
.timeline-sub .gain { color: var(--gain); }
.timeline-sub .loss { color: var(--loss); }
/* Lift the delta in a revaluation sub to a tinted pill so it carries weight. */
.timeline-reval .timeline-sub .gain,
.timeline-reval .timeline-sub .loss {
  display: inline-block; padding: 1px 7px; margin-left: 2px;
  border-radius: var(--r-pill); font-weight: 600; font-variant-numeric: tabular-nums;
}
.timeline-reval .timeline-sub .gain { background: color-mix(in srgb, var(--gain) 16%, transparent); border: 1px solid color-mix(in srgb, var(--gain) 32%, transparent); }
.timeline-reval .timeline-sub .loss { background: color-mix(in srgb, var(--loss) 16%, transparent); border: 1px solid color-mix(in srgb, var(--loss) 32%, transparent); }
.timeline-time { font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0; margin-left: 8px; }

/* --------------------------------------------------------
   Settings
   -------------------------------------------------------- */
.settings-section {
  /* Glass card — tokenized look + a deliberately LIGHT blur. Stacking the heavy
     28px glass blur across ~11 sections on a long scroll is expensive, so this
     uses --blur-1 (8px); the glass-bg/shadow carry the depth. */
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(var(--blur-1)); backdrop-filter: blur(var(--blur-1));
  box-shadow: var(--glass-shadow);
  border-radius: var(--r-card); overflow: hidden; margin-bottom: 16px;
}
/* Settings quick-jump filter: hide non-matching title+section pairs. */
.settings-search-bar { margin-bottom: 14px; }
.settings-hide { display: none !important; }
/* While filtering, kill the section entrance animation so re-shown sections don't
   re-play enter-rise on every keystroke. The initial load still animates. */
.settings-filtering .settings-section { animation: none; }
.settings-noresults { color: var(--muted); text-align: center; padding: 22px 8px; font-size: 14px; }
.settings-section-title { padding: 0 2px 8px; }
/* Title now leads with a small section icon (sTitle() in app.js). */
.settings-section-title.section-title { display: flex; align-items: center; gap: 8px; }
.settings-sec-ico { flex: 0 0 auto; color: var(--gold); opacity: 0.92; }
.settings-section-title.danger-zone-title .settings-sec-ico { color: var(--loss); }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-main { min-width: 0; }
.settings-row-label { font-size: 15px; color: var(--text); }
.settings-row-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.settings-row-val { font-size: 14px; color: var(--muted); }
.settings-row select { width: auto; min-width: 120px; padding: 8px 30px 8px 11px; font-size: 14px; }
.settings-action { width: 100%; text-align: left; background: none; border: none; padding: 14px 16px; color: var(--text); font-size: 15px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.settings-action:last-child { border-bottom: none; }
.settings-action:active { background: rgba(255,255,255,0.05); }
.settings-action svg { color: var(--gold); flex-shrink: 0; }
.settings-action.danger { color: var(--loss); }
.settings-action.danger svg { color: var(--loss); }
/* Show an open/expanded inline form as the active row */
.settings-action[aria-expanded="true"] { background: rgba(255,255,255,0.04); }

/* Inline expanding forms inside a settings-section (change password / delete) */
.inline-form {
  padding: 4px 16px 18px;
  border-bottom: 1px solid var(--border);
  animation: inline-form-in 0.24s cubic-bezier(0.22,1,0.36,1);
}
.inline-form:last-child { border-bottom: none; }
.inline-form[hidden] { display: none !important; }
.inline-form .form-group { margin-bottom: 12px; }
.inline-form .btn-row { margin-top: 4px; }
.inline-form .btn { padding: 11px 16px; font-size: 14px; }
@keyframes inline-form-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.inline-form-error {
  color: var(--loss); font-size: 13px; line-height: 1.45; margin: -2px 0 12px;
}
.inline-form-error[hidden] { display: none !important; }
.inline-form-warn {
  font-size: 12.5px; line-height: 1.55; color: var(--muted-strong);
  margin-bottom: 14px;
}
.inline-form-warn strong { color: var(--loss); font-weight: 600; }

/* Danger zone — visually set apart from the rest of settings */
.danger-zone-title { color: var(--loss); }
.danger-zone {
  border-color: color-mix(in srgb, var(--loss) 32%, var(--border));
  background: color-mix(in srgb, var(--loss) 5%, var(--surface));
}
.danger-zone .btn-danger:not(:disabled):active { background: rgba(224,82,82,0.2); }
.danger-zone .btn-danger:disabled { opacity: 0.5; cursor: default; }

/* "Get the app" install affordance (PWA) — matches the settings-row look,
   driven by tokens so it works in both dark and light themes. */
.install-row { align-items: center; }
.install-btn {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: var(--r-pill, 999px);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.install-ios-hint {
  margin-top: 6px;
  line-height: 1.5;
  /* let the hint breathe to the full row width */
  max-width: none;
}
.install-ios-hint strong { color: var(--text); font-weight: 600; }
.install-share-ico {
  display: inline-block; vertical-align: -3px;
  margin: 0 1px; color: var(--gold);
}

.about-block { padding: 18px 16px; text-align: center; }
.about-logo { font-size: 28px; font-weight: 200; color: var(--gold); letter-spacing: 0.04em; margin-bottom: 4px; }
.about-tagline { font-size: 13px; color: var(--muted); }
.about-version { font-size: 11px; color: var(--muted); margin-top: 8px; }
.about-credits { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }
.about-credits summary { font-size: 12.5px; color: var(--muted-strong); cursor: pointer; list-style: revert; }
.about-credits-intro { font-size: 11.5px; color: var(--muted); margin: 8px 0; line-height: 1.5; }
.about-credit { font-size: 11px; color: var(--muted); line-height: 1.6; }
.about-credit a { color: var(--gold); }
.storage-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: var(--r-pill); overflow: hidden; margin-top: 8px; }
.storage-bar-fill { height: 100%; background: linear-gradient(90deg, var(--gold-light), var(--gold)); border-radius: var(--r-pill); box-shadow: 0 0 12px rgba(201,168,76,0.6), 0 0 3px rgba(232,201,106,0.8), 0 1px 0 rgba(255,255,255,0.25) inset; }

/* Plan row (settings entry into the upgrade modal) */
.plan-row .plan-cta {
  display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0;
  padding: 6px 8px 6px 13px; border-radius: var(--r-pill);
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  color: #1A1407;
  background: linear-gradient(175deg, var(--gold-bright) 0%, var(--gold) 60%, color-mix(in srgb, var(--gold) 72%, black) 100%);
  border: 1px solid color-mix(in srgb, var(--gold) 42%, black);
  box-shadow: 0 1px 0 0 color-mix(in srgb, white 40%, transparent) inset, 0 3px 12px -2px var(--btn-gold-glow);
}
.plan-row .plan-cta svg { margin-right: -2px; }

/* --------------------------------------------------------
   Upgrade / plan modal
   -------------------------------------------------------- */
.upgrade-modal { position: fixed; inset: 0; z-index: 350; display: flex; align-items: flex-end; justify-content: center; }
.upgrade-modal[hidden] { display: none !important; }
.upgrade-backdrop {
  position: absolute; inset: 0;
  background: color-mix(in srgb, black 62%, transparent);
  backdrop-filter: blur(8px) saturate(120%); -webkit-backdrop-filter: blur(8px) saturate(120%);
  animation: upgrade-fade 0.2s ease both;
}
.upgrade-sheet {
  position: relative; z-index: 1;
  width: 100%; max-width: 560px; max-height: calc(100dvh - 24px - var(--safe-t));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(26px + var(--safe-t)) 20px calc(24px + var(--safe-b));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-bottom: none;
  box-shadow: var(--glass-shadow);
  animation: upgrade-rise 0.32s cubic-bezier(0.22,1,0.36,1) both;
}
@media (min-width: 600px) {
  .upgrade-modal { align-items: center; }
  .upgrade-sheet { border-radius: var(--r-sheet); border-bottom: 1px solid var(--glass-border); margin: 0 16px; }
}
@keyframes upgrade-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes upgrade-rise { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: translateY(0); } }
.upgrade-close {
  position: absolute; top: calc(14px + var(--safe-t)); right: 16px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%;
  background: color-mix(in srgb, var(--surface-3) 70%, transparent); border: 1px solid var(--glass-border); color: var(--text);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.upgrade-close:active { transform: scale(0.94); }
.upgrade-head { text-align: center; margin-bottom: 14px; padding: 0 28px; }
.upgrade-eyebrow { font-size: 11px; letter-spacing: 0.28em; color: var(--gold); font-weight: 600; margin-bottom: 4px; }
.upgrade-title { font-size: 27px; font-weight: 500; color: var(--text); line-height: 1.1; }
.upgrade-reason {
  display: flex; align-items: center; gap: 8px; margin: 0 auto 16px; max-width: 420px;
  padding: 10px 14px; border-radius: var(--r-pill);
  font-size: 13px; color: var(--gold-light); text-align: center; justify-content: center;
  background: var(--gold-dim); border: 1px solid var(--gold-border);
}
.upgrade-tiers { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 600px) { .upgrade-tiers { flex-direction: row; align-items: stretch; } }

.tier-card {
  position: relative; flex: 1; min-width: 0;
  padding: 16px; border-radius: var(--r-card);
  background: color-mix(in srgb, var(--surface-2) 60%, transparent);
  border: 1px solid var(--glass-border);
  display: flex; flex-direction: column;
}
.tier-card.is-recommended {
  border-color: var(--gold-border);
  box-shadow: 0 0 0 1px var(--gold-border), 0 8px 30px -8px var(--btn-gold-glow);
}
.tier-card.is-current { border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.tier-flag {
  position: absolute; top: -9px; left: 16px;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 3px 9px; border-radius: var(--r-pill); color: #1A1407;
  background: linear-gradient(175deg, var(--gold-bright), var(--gold));
  box-shadow: 0 2px 8px -2px var(--btn-gold-glow);
}
.tier-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.tier-label { font-size: 17px; font-weight: 600; color: var(--text); font-family: var(--display); }
.tier-price { font-size: 14px; font-weight: 600; color: var(--gold-light); white-space: nowrap; }
.tier-features { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.tier-features li { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted-strong); line-height: 1.35; }
.tier-check { color: var(--gold); flex-shrink: 0; margin-top: 1px; }
.tier-choose { width: 100%; padding: 11px 14px; border-radius: var(--r-pill); font-size: 14px; font-weight: 600; }
.tier-choose:disabled { opacity: 0.6; cursor: default; }
.upgrade-foot { margin-top: 18px; text-align: center; font-size: 11.5px; line-height: 1.5; color: var(--muted); padding: 0 6px; }

/* --------------------------------------------------------
   Empty states + skeletons
   -------------------------------------------------------- */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 56px 24px; text-align: center;
}
.empty-state-icon {
  width: 56px; height: 56px; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--gold); opacity: 0.8;
}
.empty-state-title { font-size: 16px; color: var(--text); }
.empty-state-text { color: var(--muted); font-size: 13.5px; max-width: 260px; }
.horizontal-scroll > .empty-state { flex: 1 0 100%; min-width: 100%; }
.error-state .error-state-retry { margin-top: 14px; }

@keyframes skeleton-shimmer {
  from { background-position: -180% 0; }
  to   { background-position:  180% 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, color-mix(in srgb, var(--gold-light) 10%, transparent) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; background: rgba(255,255,255,0.055); } }
.skel-card { border-radius: var(--r-card); overflow: hidden; }
.skel-line { height: 11px; border-radius: 6px; margin-top: 8px; }

/* --------------------------------------------------------
   Lightbox — shared-element FLIP zoom from the tapped thumbnail.
   --lb-bd drives backdrop opacity (drag-to-dismiss fades it); the image
   itself is transformed inline from JS (thumb rect → full-screen).
   -------------------------------------------------------- */
#lightbox { position: fixed; inset: 0; z-index: var(--z-sheet); display: flex; align-items: center; justify-content: center; --lb-bd: 1; }
.lightbox-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.92);
  opacity: var(--lb-bd);
}
#lightbox-img {
  max-width: 92vw; max-height: 88vh; border-radius: 12px;
  position: relative; z-index: var(--z-base); object-fit: contain;
  transform-origin: 0 0; will-change: transform;
  box-shadow: var(--elev-4); /* the floating tier minted for exactly this surface */
}
/* FLIP transition — only while the open/close tween is armed, never during a
   1:1 finger drag (.lb-dragging clears it so tracking stays instant). */
#lightbox.lb-anim #lightbox-img { transition: transform var(--dur-slow) var(--ease); }
#lightbox.lb-anim .lightbox-backdrop { transition: opacity var(--dur-slow) var(--ease); }
#lightbox.lb-dragging #lightbox-img,
#lightbox.lb-dragging .lightbox-backdrop { transition: none; }
#lightbox-close {
  position: absolute; top: calc(16px + var(--safe-t)); right: 16px; z-index: var(--z-toast);
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: var(--lb-bd); transition: opacity var(--dur-base) var(--ease);
}
/* Reduced motion: skip the zoom entirely — plain crossfade, no transform tween. */
@media (prefers-reduced-motion: reduce) {
  #lightbox.lb-anim #lightbox-img { transition: none; }
  #lightbox-img { will-change: auto; }
}

/* --------------------------------------------------------
   QR Scanner (camera) — dark, theme-agnostic full-screen overlay
   -------------------------------------------------------- */
#scanner {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
  display: flex; flex-direction: column;
  padding: calc(8px + var(--safe-t)) 0 calc(16px + var(--safe-b));
  animation: page-in 0.2s ease both;
}
#scanner[hidden] { display: none !important; }
.scanner-head {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px 12px;
}
.scanner-close {
  width: 40px; height: 40px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.scanner-title {
  color: #fff; font-size: 17px; font-weight: 500;
  font-family: var(--display);
}
.scanner-stage {
  flex: 1; position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
#scanner-video, #card-scanner-video {
  width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--r-card);
  background: #000;
}
.scanner-reticle {
  position: absolute; top: 50%; left: 50%;
  width: min(64vw, 260px); aspect-ratio: 1 / 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
  border-radius: 18px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.42);
}
/* gold corner brackets (two pseudo-elements, mirrored via border sides) */
.scanner-reticle::before,
.scanner-reticle::after {
  content: ''; position: absolute;
  width: 38px; height: 38px;
  border: 3px solid var(--gold-light);
}
.scanner-reticle::before {
  top: -2px; left: -2px;
  border-right: none; border-bottom: none;
  border-top-left-radius: 14px;
  box-shadow: 0 -2px 8px rgba(232,201,106,0.35);
}
.scanner-reticle::after {
  bottom: -2px; right: -2px;
  border-left: none; border-top: none;
  border-bottom-right-radius: 14px;
  box-shadow: 0 2px 8px rgba(232,201,106,0.35);
}
/* subtle moving scan line */
.scanner-reticle > i,
.scanner-stage::after {
  content: ''; position: absolute;
  left: 50%; top: 50%;
  transform: translateX(-50%) translateY(calc(-1 * min(32vw, 130px)));
  width: min(60vw, 240px); height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  box-shadow: 0 0 10px rgba(232,201,106,0.6);
  border-radius: var(--r-pill);
  pointer-events: none;
  will-change: transform, opacity;
  animation: scan-line 2.4s var(--ease-in-out) infinite;
}
/* Compositor-only: travels via translateY (was animating `top`, the one layout
   thrash in a hot loop). translateX(-50%) is preserved for horizontal centering. */
@keyframes scan-line {
  0%   { transform: translateX(-50%) translateY(calc(-1 * min(32vw, 130px))); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(-50%) translateY(min(32vw, 130px)); opacity: 0; }
}
.scanner-hint {
  color: rgba(255,255,255,0.62);
  font-size: 13.5px; text-align: center; line-height: 1.45;
  padding: 16px 24px 0;
  max-width: 420px; margin: 0 auto;
}
@media (prefers-reduced-motion: reduce) {
  .scanner-stage::after { animation: none; opacity: 0.85; top: 50%; transform: translateX(-50%); }
}

/* --------------------------------------------------------
   Toast
   -------------------------------------------------------- */
#toast {
  position: fixed;
  /* Centre with left/right + margin auto (not left:50%) so the shrink-to-fit
     width spans the full viewport — left:50% caps it at half, which wrapped a
     toast that carries an action button. */
  left: 16px; right: 16px; margin-inline: auto; width: fit-content;
  bottom: calc(var(--nav-h) + 18px + var(--safe-b));
  transform: translateY(16px) scale(0.95);
  z-index: 9999;
  background: rgba(30,27,23,0.97);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-card);
  padding: 13px 18px; color: var(--text); font-size: 14px;
  display: flex; align-items: center; gap: 9px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.55);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  max-width: calc(100vw - 32px);
  opacity: 0; pointer-events: none;
  /* base = EXIT: faster, ease-in, drops away */
  transition: opacity 0.18s cubic-bezier(0.4,0,1,1), transform 0.18s cubic-bezier(0.4,0,1,1);
}
#toast.show { opacity: 1; transform: translateY(0) scale(1);
  /* ENTER: house expo-out with a slight scale settle */
  transition: opacity 0.3s cubic-bezier(0.22,1,0.36,1), transform 0.3s cubic-bezier(0.22,1,0.36,1); }
@keyframes toast-swap { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(0) scale(0.96); } }
#toast.swap { animation: toast-swap 0.22s var(--ease); }
#toast .toast-ico { flex-shrink: 0; display: flex; }
#toast.success { border-color: rgba(76,175,130,0.45); }
#toast.success .toast-ico { color: var(--gain); }
#toast.error   { border-color: rgba(224,82,82,0.45); }
#toast.error .toast-ico { color: var(--loss); }
#toast.info    { border-color: rgba(111,168,220,0.4); }
#toast.info .toast-ico { color: var(--info); }
/* An optional inline action (e.g. "Add another"). The toast itself is
   pointer-events:none so it never blocks taps — re-enable just the button. */
#toast.has-action.show { pointer-events: auto; }
#toast .toast-action {
  flex-shrink: 0; margin-left: 6px; padding: 6px 12px;
  border: 1px solid var(--gold-border);
  border-radius: 999px; background: var(--gold-dim);
  color: var(--gold-light); font-size: 13px; font-weight: 650;
  cursor: pointer; pointer-events: auto; white-space: nowrap;
  transition: background 0.16s ease, transform 0.12s ease;
}
#toast .toast-action:hover { background: var(--gold-border); }
#toast .toast-action:active { transform: scale(0.96); }

/* ==================================================================
   Milestone celebrations — a cinematic burst on meaningful moments.
================================================================== */
.celebrate-overlay {
  position: fixed; inset: 0; z-index: 10000; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 38%, rgba(8,7,6,0.62), rgba(8,7,6,0.32) 60%, transparent);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
/* Gold shockwave — the second beat after the card pops. transform/opacity only. */
.celebrate-ring { position: absolute; left: 50%; top: 50%; width: 130px; height: 130px; margin: -65px 0 0 -65px; border-radius: 50%; border: 1.5px solid hsl(var(--cel-hue, 44) 70% 60% / 0.75); pointer-events: none; animation: cel-ring 0.9s cubic-bezier(0.22,1,0.36,1) 0.12s both; }
@keyframes cel-ring { from { opacity: 1; transform: scale(0.45); } to { opacity: 0; transform: scale(2.1); } }

/* Mini 'vaulted' card for ordinary adds — exits DOWN toward the Vault tab. */
.celebrate-mini { background: radial-gradient(120% 90% at 50% 38%, rgba(8,7,6,0.4), transparent 65%); }
.celebrate-mini .celebrate-art { width: 72px; height: 72px; margin: 0 auto 10px; border-radius: var(--r-input); overflow: hidden; }
.celebrate-mini .celebrate-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.celebrate-mini.bye .celebrate-card { opacity: 0; transform: scale(0.55) translateY(40vh); transition: transform 0.38s var(--ease), opacity 0.3s ease; }
.celebrate-overlay.show { opacity: 1; pointer-events: auto; }
/* The mini variant must NEVER block — the toast's 'Add another' stays tappable.
   Source order is load-bearing: this ties .celebrate-overlay.show at (0,2,0). */
.celebrate-mini.show { pointer-events: none; }
.celebrate-mini .celebrate-card { pointer-events: auto; cursor: pointer; }
.celebrate-card {
  position: relative; z-index: 2; text-align: center; padding: 30px 34px;
  border-radius: 22px; background: linear-gradient(165deg, var(--surface-2), var(--surface-1));
  border: 1px solid hsl(var(--cel-hue, 44) 55% 55% / 0.42);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(255,255,255,0.04), 0 0 60px hsl(var(--cel-hue, 44) 60% 50% / 0.18);
  max-width: min(86vw, 360px);
  opacity: 0; transform: scale(0.82) translateY(12px);
  transition: transform 0.5s cubic-bezier(0.18,1.5,0.4,1), opacity 0.4s ease;
}
.celebrate-overlay.show .celebrate-card { opacity: 1; transform: scale(1) translateY(0); }
.celebrate-icon {
  font-size: 52px; line-height: 1; margin-bottom: 12px;
  filter: drop-shadow(0 4px 14px hsl(var(--cel-hue, 44) 60% 45% / 0.5));
  animation: celebrate-pop 0.6s cubic-bezier(0.18,1.6,0.4,1) 0.08s both;
}
@keyframes celebrate-pop { 0% { transform: scale(0) rotate(-18deg); } 100% { transform: scale(1) rotate(0); } }
.celebrate-title { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--text); letter-spacing: 0.01em; }
.celebrate-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.celebrate-confetti { position: absolute; inset: 0; overflow: hidden; z-index: 1; pointer-events: none; }
.celebrate-confetti i {
  position: absolute; top: -8%; width: var(--w); height: calc(var(--w) * 1.35);
  background: var(--cf); border-radius: 1.5px; opacity: 0;
  animation: celebrate-fall var(--t) linear var(--d) forwards;
}
@keyframes celebrate-fall {
  0% { opacity: 0; transform: translate(0, -10vh) rotate(var(--r)); }
  10% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), 110vh) rotate(calc(var(--r) + 540deg)); }
}
@media (prefers-reduced-motion: reduce) {
  .celebrate-card, .celebrate-overlay.show .celebrate-card { transition: opacity 0.3s ease; transform: none; }
  .celebrate-icon { animation: none; }
  .celebrate-ring { animation: none; opacity: 0; }
}

/* Account nudge — a calm bottom sheet inviting guests to create an account.
   Non-blocking (z-index below celebrate's 10000); dismiss on backdrop tap. */
.account-nudge-overlay {
  position: fixed; inset: 0; z-index: 9000; display: flex;
  align-items: flex-end; justify-content: center; pointer-events: none;
  background: radial-gradient(120% 90% at 50% 100%, rgba(8,7,6,0.5), transparent 70%);
  opacity: 0; transition: opacity 0.3s ease;
}
.account-nudge-overlay.show { opacity: 1; pointer-events: auto; }
.account-nudge-sheet {
  position: relative; width: min(92vw, 420px); margin: 0 12px max(16px, var(--safe-b));
  text-align: center; padding: 26px 22px 22px; border-radius: 22px;
  background: linear-gradient(165deg, var(--surface-2), var(--surface));
  border: 1px solid var(--gold-border);
  box-shadow: 0 24px 70px rgba(0,0,0,0.6), 0 0 60px var(--gold-dim);
  transform: translateY(18px); opacity: 0;
  transition: transform 0.42s cubic-bezier(0.18,1.2,0.4,1), opacity 0.3s ease;
}
.account-nudge-overlay.show .account-nudge-sheet { transform: translateY(0); opacity: 1; }
.account-nudge-ico { width: 46px; height: 46px; margin: 0 auto 12px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center; color: var(--gold);
  background: var(--gold-dim); border: 1px solid var(--gold-border); }
.account-nudge-title { font-size: 21px; font-weight: 600; color: var(--text); }
.account-nudge-text { font-size: 13.5px; line-height: 1.5; color: var(--muted-strong); margin: 8px 0 18px; }
.account-nudge-cta { width: 100%; }
.account-nudge-later { display: block; width: 100%; margin-top: 10px; background: none; border: none;
  color: var(--muted); font-size: 13px; padding: 8px; cursor: pointer; }
.account-nudge-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center; background: none; border: none;
  color: var(--muted); border-radius: var(--r-pill); cursor: pointer; }
@media (prefers-reduced-motion: reduce) {
  .account-nudge-sheet, .account-nudge-overlay.show .account-nudge-sheet { transition: opacity 0.3s ease; transform: none; }
}

/* Styled confirm dialog (replaces native confirm() for destructive actions) */
.confirm-overlay {
  /* Dialogs must clear EVERY sheet/overlay tier (sheets 300, scanner 1000,
     lightbox var(--z-sheet)=1100) — promptAction can be spawned from inside
     the Add-to-Binders sheet. */
  position: fixed; inset: 0; z-index: calc(var(--z-sheet, 1100) + 100);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; padding-bottom: calc(24px + var(--safe-b));
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity var(--dur-base) var(--ease);
}
.confirm-overlay.show { opacity: 1; }
.confirm-card {
  width: 100%; max-width: 360px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-card); box-shadow: var(--elev-3);
  padding: 22px 22px 18px;
  transform: translateY(8px) scale(0.98); opacity: 0;
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
}
.confirm-overlay.show .confirm-card { transform: none; opacity: 1; }
.confirm-title { font-family: var(--display); font-size: 21px; color: var(--text); margin-bottom: 8px; text-wrap: balance; }
.confirm-msg { font-size: 14px; line-height: 1.5; color: var(--muted-strong); margin-bottom: 18px; text-wrap: pretty; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

/* Generic modal sheet (Collection edit, etc.) — same chrome as the confirm dialog. */
.sheet-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; padding-bottom: calc(24px + var(--safe-b));
  background: rgba(0,0,0,0.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity var(--dur-base) var(--ease);
}
.sheet-overlay.show { opacity: 1; }
.sheet-card {
  width: 100%; max-width: 420px; max-height: calc(100vh - 48px - var(--safe-b)); overflow-y: auto;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  border-radius: var(--r-card); box-shadow: var(--elev-3);
  padding: 22px;
  transform: translateY(8px) scale(0.98); opacity: 0;
  transition: transform var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease);
}
.sheet-overlay.show .sheet-card { transform: none; opacity: 1; }
.sheet-title { font-family: var(--display); font-size: 21px; color: var(--text); margin-bottom: 16px; }
/* Collection edit fields */
.edit-coll-field { display: block; margin-bottom: 14px; }
.edit-coll-field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted-strong); letter-spacing: 0.02em; margin-bottom: 6px; }
.edit-coll-field > span small { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.edit-coll-field input, .edit-coll-field textarea {
  width: 100%; box-sizing: border-box; padding: 11px 13px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-input);
  color: var(--text); font-size: 15px; font-family: inherit; resize: vertical;
}
.edit-coll-field input:focus, .edit-coll-field textarea:focus { outline: none; border-color: var(--gold-border); }
.edit-coll-label { font-size: 12px; font-weight: 600; color: var(--muted-strong); letter-spacing: 0.02em; margin-bottom: 8px; }
.edit-coll-covers { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; -webkit-overflow-scrolling: touch; }
.edit-cover-opt {
  flex: 0 0 auto; width: 56px; height: 56px; padding: 0; overflow: hidden;
  border-radius: 10px; border: 2px solid var(--border); background: var(--surface);
  cursor: pointer; transition: border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.edit-cover-opt img { width: 100%; height: 100%; object-fit: cover; display: block; }
.edit-cover-opt.on { border-color: var(--gold); }
.edit-cover-opt:active { transform: scale(0.94); }
.edit-cover-auto { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 11px; font-weight: 600; color: var(--muted-strong); }
.edit-coll-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.edit-coll-actions-spacer { flex: 1; }
.btn-ghost-danger {
  background: none; border: 1px solid transparent; color: var(--loss);
  padding: 9px 14px; border-radius: var(--r-input); font-weight: 600; cursor: pointer;
}
.btn-ghost-danger:hover { background: rgba(224,82,82,0.12); }
/* Pinned Collection cover (owner-chosen) fills the binder tile face. */
.binder-cover-pinned { position: absolute; inset: 0; overflow: hidden; }
.binder-cover-pinned-img { width: 100%; height: 100%; object-fit: cover; }
/* Collection description under the showcase stats. */
.coll-showcase-desc { margin-top: 7px; font-size: 13px; line-height: 1.5; color: var(--muted-strong); text-wrap: pretty; }

/* Recovery-codes sheet — the one-time reveal of freshly-generated codes.
   No backdrop/Esc dismissal (see showRecoveryCodesSheet); "I saved them" is
   the only way out, so the chrome stays calm but the warning reads loud. */
.rc-card { max-width: 400px; }
.rc-intro { font-size: 13.5px; line-height: 1.55; color: var(--muted-strong); margin: -6px 0 14px; text-wrap: pretty; }
.rc-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.rc-code {
  font-family: var(--mono); font-size: 14px; letter-spacing: 0.04em;
  color: var(--gold); text-align: center;
  padding: 9px 4px;
  user-select: all; -webkit-user-select: all;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-input);
}
.rc-warn { font-size: 12.5px; font-weight: 600; line-height: 1.5; color: var(--loss); margin: 0 0 14px; text-wrap: pretty; }
.rc-actions { display: flex; gap: 10px; margin-bottom: 10px; }
.rc-actions .btn { flex: 1; }
.rc-done { width: 100%; }

/* Right-aligned metadata on a settings-action row (e.g. "6 left"). */
.settings-action-meta { margin-left: auto; font-family: var(--mono); font-size: 12.5px; color: var(--muted); flex: 0 0 auto; }

/* Price-check sheet */
.pc-card { max-width: 400px; }
.pc-title { font-family: var(--display); font-size: 22px; color: var(--text); margin-bottom: 4px; }
.pc-sub { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin-bottom: 16px; }
.pc-list { display: flex; flex-direction: column; gap: 12px; max-height: 52vh; overflow-y: auto; margin-bottom: 18px; }
.pc-item { padding: 12px; border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--border); }
.pc-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
.pc-item-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.pc-item-val { font-family: var(--mono); font-size: 13px; color: var(--gold); flex: 0 0 auto; }
.pc-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pc-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 12px; border-radius: var(--r-pill);
  background: var(--gold-dim); border: 1px solid var(--gold-border); color: var(--gold);
  font-size: 13px; font-weight: 600;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.pc-link:active { transform: scale(0.96); background: color-mix(in srgb, var(--gold) 24%, transparent); }
.bulk-btn-gold { background: var(--gold-dim); border: 1px solid var(--gold-border); color: var(--gold); }
.bulk-btn-gold:disabled { opacity: 0.4; }

/* Active category filter chip in Browse (set from home "By Category") */
.browse-cat-chip {
  grid-column: 1 / -1; justify-self: start; width: fit-content; margin-bottom: 2px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 9px 7px 14px; border-radius: var(--r-pill);
  background: var(--gold-dim); border: 1px solid var(--gold-border); color: var(--gold);
  font-size: 13px; font-weight: 600;
  transition: background var(--dur-fast) var(--ease);
}
.browse-cat-chip .browse-cat-x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold-border); font-size: 14px; line-height: 1;
}
.browse-cat-chip:active { background: color-mix(in srgb, var(--gold) 22%, transparent); }
@media (prefers-reduced-motion: reduce) {
  .confirm-overlay, .confirm-card { transition: none; }
}

/* ============================================================
   CATEGORY PLACEHOLDER SCENES (animated SVG)
   ============================================================ */

/* Outer perspective wrapper — must NOT clip so cast shadow is visible */
.cat-placeholder-wrap {
  width: 100%; height: 100%;
  perspective: 600px;
  perspective-origin: 50% 30%;
}
.cat-placeholder-wrap.cp-sm {
  perspective: 400px;
  perspective-origin: 50% 30%;
}

/* Inner tilted surface */
.cat-placeholder {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  /* warm top-left form light over the category gradient → reads as lit, not flat */
  background:
    radial-gradient(135% 90% at 26% 14%, rgba(var(--cp-1),0.13) 0%, transparent 58%),
    linear-gradient(155deg, rgba(var(--cat-a),0.24) 0%, rgba(var(--cat-b),0.58) 100%);
  transform: rotateX(7deg) rotateY(-3.5deg);
  transform-style: preserve-3d;
  box-shadow:
    0 0 38px 7px rgba(0,0,0,0.5) inset,        /* dramatic vignette — dark edges, spotlit centre */
    0 0 50px rgba(var(--cat-a),0.2) inset,
    0 1px 0 rgba(255,255,255,0.16) inset,
    0 -1px 0 rgba(0,0,0,0.35) inset,
    0 24px 48px -8px rgba(0,0,0,0.62),
    0 4px 18px rgba(var(--cat-a),0.24);
}
.cat-placeholder-wrap.cp-sm .cat-placeholder {
  transform: rotateX(6deg) rotateY(-3deg);
  box-shadow:
    0 0 48px rgba(var(--cat-a),0.18) inset,
    0 1px 0 rgba(255,255,255,0.10) inset,
    0 -1px 0 rgba(0,0,0,0.25) inset,
    0 8px 20px -4px rgba(0,0,0,0.45),
    0 2px 8px rgba(var(--cat-a),0.15);
}

/* Radial glow bloom behind scene — pushed back in Z so it parallaxes apart
   from the lifted scene on tilt (the depth cue that sells "dimensional"). */
.cat-placeholder::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(var(--cp-1),0.30) 0%, rgba(var(--cat-a),0.24) 24%, transparent 56%);
  pointer-events: none; z-index: 0;
  transform: translateZ(-12px);
}
/* Top-edge specular shimmer */
.cat-placeholder::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent 5%, rgba(var(--cat-a),0.55) 50%, transparent 95%);
  z-index: 3;
}
/* Scene positioned inside, lifted with translateZ */
.cat-placeholder .cp-scene-wrap {
  position: absolute;
  inset: 13%; /* ~74% of tile, centred */
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
  --cp-lift: 20px;               /* modest lift: enough parallax, far less magnification blur */
  transform: translateZ(var(--cp-lift));
}
.cat-placeholder-wrap.cp-sm .cp-scene-wrap { inset: 19%; --cp-lift: 12px; transform: translateZ(var(--cp-lift)); } /* ~62%, gentler lift for small */
/* Idle float — the picker's subject gently breathes so the category chooser feels
   ALIVE, not a static icon grid. Focal scenes only (picker tiles, kind cards,
   detail hero); item-card thumbnails stay calm. Compositor-only (transform),
   paused off-screen, and off under reduced motion. Staggered so a grid drifts. */
@keyframes cp-bob {
  0%, 100% { transform: translateZ(var(--cp-lift, 20px)) translateY(0); }
  50%      { transform: translateZ(var(--cp-lift, 20px)) translateY(-5px); }
}
@media (prefers-reduced-motion: no-preference) {
  .cat-tile .cp-scene-wrap,
  .kind-card .cp-scene-wrap,
  .detail-hero .cp-scene-wrap {
    animation: cp-bob 4.6s var(--ease-in-out, ease-in-out) infinite;
    /* Small stagger (0–1.4s) so the grid drifts organically yet every tile is
       visibly floating within a beat — not the holo's long 0–7s sweep delay. */
    animation-delay: calc(var(--cp-holo-delay, 0s) * 0.2);
  }
}
.cat-placeholder.cp-paused .cp-scene-wrap { animation-play-state: paused !important; }

/* Real category photo with the SAME premium treatment as the scenes: it fills
   the niche, takes a depth grade (vignette + bottom scrim so it reads dark &
   cohesive and the holo pops), and a slow ken-burns drift so it's a "real photo
   WITH animation to match". Focal contexts animate; item-card thumbs stay still. */
.cat-placeholder.has-photo .cp-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  z-index: 0; transform-origin: 50% 45%;
}
.cat-placeholder.has-photo .cp-photo-grade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(125% 95% at 50% 32%, transparent 42%, rgba(0,0,0,0.44) 100%),
    linear-gradient(180deg, rgba(0,0,0,0.12) 0%, transparent 32%, transparent 56%, rgba(0,0,0,0.52) 100%);
}
@keyframes cp-kenburns { from { transform: scale(1.03); } to { transform: scale(1.12) translateY(-1.5%); } }
@media (prefers-reduced-motion: no-preference) {
  .cat-tile .cat-placeholder.has-photo .cp-photo,
  .featured-art .cat-placeholder.has-photo .cp-photo,
  .detail-hero .cat-placeholder.has-photo .cp-photo {
    animation: cp-kenburns 9s var(--ease-in-out, ease-in-out) infinite alternate;
    animation-delay: calc(var(--cp-holo-delay, 0s) * 0.2);
  }
}

/* Featured (popular) categories — a horizontal rail of premium photo tiles at
   the top of the Add picker; one tap drops straight into that flow. */
.featured-wrap { margin-bottom: 18px; }
.featured-eyebrow { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px 2px; }
.featured-row { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; scroll-snap-type: x proximity; }
.featured-row::-webkit-scrollbar { display: none; }
.featured-tile { flex: 0 0 auto; width: 92px; padding: 0; cursor: pointer; background: none; border: none; display: flex; flex-direction: column; gap: 7px; scroll-snap-align: start; transition: transform var(--dur-fast) var(--ease); }
.featured-tile:active { transform: scale(0.95); }
.featured-art { display: block; width: 92px; height: 92px; border-radius: 14px; overflow: hidden; }
.featured-art .cat-placeholder-wrap { width: 100%; height: 100%; }
.featured-name { font-size: 12px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.2; }
@media (prefers-reduced-motion: reduce) { .featured-tile:active { transform: none; } }
.cat-placeholder.cp-paused .cp-photo { animation-play-state: paused !important; }

/* ===== "Videogame loot-card" treatment — dramatic, alive scenes =====
   A soft SPOTLIGHT that sweeps the subject + drifting ENERGY PARTICLES, layered
   over the existing depth/holo/float/parallax. Focal contexts only (Add picker
   tiles, featured rail, kind cards, detail hero) — item-card thumbs stay calm.
   Compositor-only (transform/opacity), paused off-screen, off under reduced motion. */
.cat-placeholder .cp-spotlight {
  position: absolute; inset: -22%; z-index: 2; pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(var(--cp-1, 255,255,255), 0.24), transparent 72%);
  mix-blend-mode: screen;
}
@keyframes cp-spot {
  0%, 100% { transform: translate(-24%, -12%) scale(1);    opacity: 0; }
  28%      { opacity: 0.7; }
  50%      { transform: translate(22%, 10%) scale(1.18);   opacity: 0.85; }
  74%      { opacity: 0.55; }
}
.cat-placeholder .cp-particles { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; opacity: 0; }
.cat-placeholder .cp-particles i {
  position: absolute; bottom: -6%; width: 3px; height: 3px; border-radius: 50%;
  background: rgba(var(--cp-1, 255,255,255), 0.95);
  box-shadow: 0 0 7px 1px rgba(var(--cp-1, 255,255,255), 0.55);
}
.cp-particles i:nth-child(1) { left: 14%; --d: 7.5s; --dl: 0s;   --sx: 7px; }
.cp-particles i:nth-child(2) { left: 31%; --d: 9.2s; --dl: 1.4s; --sx: -9px; width: 2px; height: 2px; }
.cp-particles i:nth-child(3) { left: 47%; --d: 6.4s; --dl: 2.7s; --sx: 11px; }
.cp-particles i:nth-child(4) { left: 63%; --d: 8.6s; --dl: 0.8s; --sx: -7px; width: 2px; height: 2px; }
.cp-particles i:nth-child(5) { left: 77%; --d: 7s;   --dl: 3.3s; --sx: 8px; }
.cp-particles i:nth-child(6) { left: 89%; --d: 9.8s; --dl: 1.9s; --sx: -10px; width: 2px; height: 2px; }
@keyframes cp-mote {
  0%   { transform: translate(0, 0) scale(0.5);                        opacity: 0; }
  12%  { opacity: 0.9; }
  50%  { transform: translate(var(--sx, 0), -185%) scale(1);           opacity: 0.8; }
  88%  { opacity: 0; }
  100% { transform: translate(calc(var(--sx, 0) * 1.6), -365%) scale(0.6); opacity: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .cat-tile .cat-placeholder .cp-spotlight,
  .featured-art .cat-placeholder .cp-spotlight,
  .kind-card .cat-placeholder .cp-spotlight,
  .detail-hero .cat-placeholder .cp-spotlight {
    animation: cp-spot 11s var(--ease-in-out, ease-in-out) infinite;
    animation-delay: calc(var(--cp-holo-delay, 0s) * 0.3);
  }
  .cat-tile .cp-particles, .featured-art .cp-particles, .kind-card .cp-particles, .detail-hero .cp-particles { opacity: 1; }
  .cat-tile .cp-particles i, .featured-art .cp-particles i, .kind-card .cp-particles i, .detail-hero .cp-particles i {
    animation: cp-mote var(--d, 8s) linear infinite; animation-delay: var(--dl, 0s);
  }
}
.cat-placeholder.cp-paused .cp-spotlight,
.cat-placeholder.cp-paused .cp-particles i { animation-play-state: paused !important; }

/* Rotating GOD-RAYS + a pulsing RARITY AURA behind the scene object — the part
   that makes a flat icon read like an epic loot drop. Scenes only; behind the
   subject (z0). Focal contexts animate; off-screen + reduced-motion paused. */
.cat-placeholder .cp-rays {
  position: absolute; inset: -30%; z-index: 0; pointer-events: none; opacity: 0;
  background: conic-gradient(from 0deg,
    transparent 0deg, rgba(var(--cp-1, 255,255,255), 0.18) 11deg, transparent 26deg,
    transparent 58deg, rgba(var(--cp-1, 255,255,255), 0.12) 72deg, transparent 90deg,
    transparent 176deg, rgba(var(--cp-1, 255,255,255), 0.16) 196deg, transparent 214deg,
    transparent 298deg, rgba(var(--cp-1, 255,255,255), 0.11) 316deg, transparent 336deg);
  -webkit-mask: radial-gradient(closest-side, #000 24%, transparent 78%);
          mask: radial-gradient(closest-side, #000 24%, transparent 78%);
  mix-blend-mode: screen;
}
.cat-placeholder .cp-aura {
  position: absolute; inset: 0; z-index: 0; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at 50% 46%, rgba(var(--cp-1, 255,255,255), 0.42) 0%, rgba(var(--cat-a), 0.32) 22%, transparent 56%);
  mix-blend-mode: screen;
}
@keyframes cp-rays-spin { to { transform: rotate(360deg); } }
@keyframes cp-aura-pulse { 0%, 100% { opacity: 0.45; transform: scale(0.95); } 50% { opacity: 0.95; transform: scale(1.07); } }
@media (prefers-reduced-motion: no-preference) {
  .cat-tile .cp-rays, .featured-art .cp-rays, .kind-card .cp-rays, .detail-hero .cp-rays {
    opacity: 1; animation: cp-rays-spin 19s linear infinite;
  }
  .cat-tile .cp-aura, .featured-art .cp-aura, .kind-card .cp-aura, .detail-hero .cp-aura {
    opacity: 1; animation: cp-aura-pulse 4.6s var(--ease-in-out, ease-in-out) infinite;
    animation-delay: calc(var(--cp-holo-delay, 0s) * 0.25);
  }
}
.cat-placeholder.cp-paused .cp-rays,
.cat-placeholder.cp-paused .cp-aura { animation-play-state: paused !important; }
/* HD: kill the per-scene drop-shadow filter — it pre-rasterised the SVG, and
   under the 3D transform that bitmap got scaled → soft. Render crisp vector
   instead; depth comes from the niche box-shadow + the contact shadow. */
.cat-placeholder .cp-scene { width: 100%; height: 100%; display: block; filter: none !important; }
/* Soft elliptical contact shadow — sits near the floor so the lifted scene
   reads as floating above the surface rather than painted onto it. */
.cat-placeholder .cp-bottom-shadow {
  position: absolute; bottom: 7%; left: 16%; right: 16%; height: 13%; z-index: 0;
  background: radial-gradient(ellipse 50% 50% at 50% 50%, rgba(0,0,0,0.55) 0%, transparent 72%);
  filter: blur(5px);
  pointer-events: none;
}
.cat-placeholder-wrap.cp-sm .cp-bottom-shadow { filter: blur(3px); bottom: 8%; }
/* Foreground specular glint — the front-most layer; tracks the pointer on tilt
   so the scene catches light as it moves. Inherits --mx/--my from the tile. */
.cat-placeholder .cp-glint {
  content: ''; position: absolute; inset: 0; z-index: 5; pointer-events: none;
  transform: translateZ(52px);
  background: radial-gradient(140px circle at var(--mx,50%) var(--my,40%),
    rgba(255,255,255,0.18) 0%, rgba(255,255,255,0.05) 34%, transparent 60%);
  mix-blend-mode: screen;
  opacity: 0; transition: opacity var(--dur-base) var(--ease);
}
.cat-tile.tilting .cp-glint,
.kind-card.tilting .cp-glint { opacity: 1; }

/* Holographic foil sheen — a slow diagonal light band that periodically sweeps
   the tile, the signature "premium card" catch-the-light feel. Compositor-only
   (opacity + transform), staggered per tile (--cp-holo-delay), paused off-screen
   and under reduced-motion. Sits above the scene, below the pointer glint. */
.cat-placeholder .cp-holo {
  position: absolute; inset: -10% -30%; z-index: 4; pointer-events: none;
  background: linear-gradient(115deg,
    transparent 36%,
    rgba(var(--cp-1,255,255,255), 0.10) 45%,
    rgba(255,255,255, 0.18) 50%,
    rgba(var(--cp-1,255,255,255), 0.10) 55%,
    transparent 64%);
  mix-blend-mode: screen; opacity: 0; transform: translateX(-32%);
}
@keyframes cp-holo-sweep {
  0%, 20%   { opacity: 0; transform: translateX(-34%); }
  34%       { opacity: 0.85; }
  48%       { opacity: 0.85; }
  62%, 100% { opacity: 0; transform: translateX(34%); }
}
@media (prefers-reduced-motion: no-preference) {
  .cat-placeholder .cp-holo {
    animation: cp-holo-sweep 8.5s var(--ease-in-out, ease-in-out) infinite;
    animation-delay: var(--cp-holo-delay, 0s);
  }
}
.cat-placeholder.cp-paused .cp-holo { animation-play-state: paused !important; }

/* Ambient life — every scene's glow breathes slowly so nothing feels static,
   even with no hover (the default state on touch). Compositor-only (opacity),
   paused off-screen, and only when motion is allowed. */
@keyframes cp-breathe { 0%, 100% { opacity: 0.82; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: no-preference) {
  .cat-placeholder::before { animation: cp-breathe 6s var(--ease-in-out, ease-in-out) infinite; }
}
.cat-placeholder.cp-paused::before { animation-play-state: paused !important; }

/* Device-orientation parallax (mobile). Rotates the inner surface around its
   resting tilt by the gyro delta — never lifts the tile, so a grid stays calm. */
.cat-placeholder.cp-gyro {
  transform: rotateX(calc(12deg + var(--rx, 0deg))) rotateY(calc(-6deg + var(--ry, 0deg)));
  transition: transform 0.12s linear;
}
.cat-placeholder-wrap.cp-sm .cat-placeholder.cp-gyro {
  transform: rotateX(calc(6deg + var(--rx, 0deg))) rotateY(calc(-3deg + var(--ry, 0deg)));
}
.cat-placeholder.cp-gyro .cp-glint { opacity: 0.55; }

/* Palettes per slug (rgb triplets for fill/stroke usage) */
.cat-placeholder[data-slug="watches"]      { --cat-a: 88,128,196;  --cat-b: 16,38,78;   --cp-1: 198,220,255; --cp-2: 110,150,222; }
.cat-placeholder[data-slug="jewelry"]      { --cat-a: 150,108,196; --cat-b: 52,30,92;   --cp-1: 224,212,250; --cp-2: 168,138,224; }
.cat-placeholder[data-slug="vehicles"]     { --cat-a: 66,118,180;  --cat-b: 18,44,82;   --cp-1: 202,224,250; --cp-2: 108,158,216; }
.cat-placeholder[data-slug="electronics"] { --cat-a: 36,150,172;  --cat-b: 10,66,84;   --cp-1: 196,238,248; --cp-2: 96,196,214; }
.cat-placeholder[data-slug="art"]          { --cat-a: 198,128,52;  --cat-b: 92,46,12;   --cp-1: 250,214,168; --cp-2: 228,158,92; }
.cat-placeholder[data-slug="wine-spirits"]{ --cat-a: 158,38,52;   --cat-b: 62,12,20;   --cp-1: 244,176,176; --cp-2: 212,92,92; }
.cat-placeholder[data-slug="music"]        { --cat-a: 200,158,66;  --cat-b: 96,72,20;   --cp-1: 250,232,178; --cp-2: 226,190,114; }
.cat-placeholder[data-slug="fashion"]      { --cat-a: 168,92,92;   --cat-b: 76,34,38;   --cp-1: 240,202,196; --cp-2: 212,138,130; }
.cat-placeholder[data-slug="real-estate"] { --cat-a: 48,142,98;   --cat-b: 16,68,44;   --cp-1: 198,240,214; --cp-2: 104,200,148; }
.cat-placeholder[data-slug="crypto"]       { --cat-a: 222,150,40;  --cat-b: 122,74,12;  --cp-1: 252,222,164; --cp-2: 240,178,82; }
.cat-placeholder[data-slug="default"]      { --cat-a: 198,162,74;  --cat-b: 92,72,22;   --cp-1: 244,226,176; --cp-2: 216,184,114; }

/* Category placeholder animations — ported from CategoryPlaceholder.tsx KEYFRAMES_CSS */
/* Every keyframe name is prefixed cp- to avoid global collisions.                    */

/* ---- Watch ---- */
@keyframes cp-hourHand   { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes cp-minuteHand { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes cp-secondHand { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes cp-pulse      { 0%,100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.3); } }

/* ---- Vehicles: car ---- */
@keyframes cp-wheelSpin  { to { transform: rotate(360deg); } }
@keyframes cp-speedLine  { from { transform: translateX(0); opacity: 0.85; } to { transform: translateX(-60px); opacity: 0; } }

/* ---- Vehicles: boat ---- */
@keyframes cp-boatRock   { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes cp-wave1      { from { transform: translateX(-20px); } to { transform: translateX(20px); } }
@keyframes cp-wave2      { from { transform: translateX(20px); } to { transform: translateX(-20px); } }

/* ---- Vehicles: plane ---- */
@keyframes cp-planeBob   { 0%,100% { transform: translateY(-4px); } 50% { transform: translateY(4px); } }
@keyframes cp-contrail   { from { opacity: 0.8; transform: translateX(0); } to { opacity: 0; transform: translateX(-30px); } }
@keyframes cp-twinkle    { 0%,100% { opacity: 0.2; transform: scale(0.7); } 50% { opacity: 1; transform: scale(1.15); } }

/* ---- Vehicles: motorcycle ---- */
@keyframes cp-chainDash  { to { stroke-dashoffset: -16; } }
@keyframes cp-exhaust    { from { opacity: 0.6; transform: translate(0,0) scale(0.6); } to { opacity: 0; transform: translate(14px,-12px) scale(1.4); } }

/* ---- Vehicles: jet ski ---- */
@keyframes cp-spray      { from { transform: translate(0,0); opacity: 0.9; } to { transform: translate(-22px,-18px); opacity: 0; } }
@keyframes cp-wake       { 0%,100% { transform: translateX(0); opacity: 0.5; } 50% { transform: translateX(-6px); opacity: 0.8; } }

/* ---- Jewelry ---- */
@keyframes cp-diamondRotate { to { transform: rotate(360deg); } }
@keyframes cp-sparkle    { 0%,100% { transform: scale(0); opacity: 0; } 50% { transform: scale(1); opacity: 1; } }
@keyframes cp-facetShimmer { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

/* ---- Electronics: camera ---- */
@keyframes cp-iris       { 0% { transform: rotate(0deg); } 100% { transform: rotate(30deg); } }
@keyframes cp-focusRing  { to { transform: rotate(360deg); } }
@keyframes cp-lensFlare  { 0%,100% { opacity: 0.3; } 50% { opacity: 0.7; } }

/* ---- Music: guitar ---- */
@keyframes cp-stringVib1 { 0%,100% { transform: scaleX(1);    filter: blur(0); } 50% { transform: scaleX(1.004); filter: blur(0.5px); } }
@keyframes cp-stringVib2 { 0%,100% { transform: scaleX(1);    filter: blur(0); } 50% { transform: scaleX(1.004); filter: blur(0.5px); } }
@keyframes cp-stringVib3 { 0%,100% { transform: scaleX(1);    filter: blur(0); } 50% { transform: scaleX(1.004); filter: blur(0.5px); } }
@keyframes cp-stringVib4 { 0%,100% { transform: scaleX(1);    filter: blur(0); } 50% { transform: scaleX(1.004); filter: blur(0.5px); } }
@keyframes cp-stringVib5 { 0%,100% { transform: scaleX(1);    filter: blur(0); } 50% { transform: scaleX(1.004); filter: blur(0.5px); } }
@keyframes cp-stringVib6 { 0%,100% { transform: scaleX(1);    filter: blur(0); } 50% { transform: scaleX(1.004); filter: blur(0.5px); } }
@keyframes cp-noteFloat  { from { transform: translateY(0) rotate(0deg); opacity: 0.9; } to { transform: translateY(-44px) rotate(12deg); opacity: 0; } }
@keyframes cp-soundHole  { 0%,100% { opacity: 0.25; transform: scale(0.9); } 50% { opacity: 0.6; transform: scale(1.08); } }

/* ---- Wine ---- */
@keyframes cp-liquidWave { from { transform: translateX(0); } to { transform: translateX(-40px); } }
@keyframes cp-bubble     { from { transform: translateY(0); opacity: 0; } 15% { opacity: 0.85; } 85% { opacity: 0.85; } to { transform: translateY(-35px); opacity: 0; } }
@keyframes cp-wineShine  { 0%,100% { opacity: 0; } 30%,70% { opacity: 0.5; } }

/* ---- Fashion: bag ---- */
@keyframes cp-bagSheen   { from { transform: translateX(-120%) skewX(-18deg); } to { transform: translateX(260%) skewX(-18deg); } }
@keyframes cp-chainSway  { 0%,100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes cp-claspShine { 0%,100% { opacity: 0.4; } 50% { opacity: 1; } }

/* ---- Art ---- */
@keyframes cp-brushStroke1 { from { stroke-dashoffset: 200; } to { stroke-dashoffset: 0; } }
@keyframes cp-brushStroke2 { from { stroke-dashoffset: 170; } to { stroke-dashoffset: 0; } }
@keyframes cp-paletteGlow  { 0%,100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.06); } }

/* ---- Default crystal ---- */
@keyframes cp-crystalRotate { to { transform: rotate(360deg); } }
@keyframes cp-rayPulse   { 0%,100% { opacity: 0.2; transform: scaleY(1); } 50% { opacity: 0.8; transform: scaleY(1.3); } }
@keyframes cp-orbit      { from { transform: rotate(0deg) translateX(25px); } to { transform: rotate(360deg) translateX(25px); } }
@keyframes cp-coreGlow   { 0%,100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.15); } }

/* Reduced motion — kill scene animation only */
@media (prefers-reduced-motion: reduce) {
  .cp-scene *, .cp-scene { animation: none !important; }
  .screen { animation: none !important; }
  .cat-row-fill { transition: none !important; }
  .cat-row-fill::after { animation: none !important; opacity: 0; }
}

/* --------------------------------------------------------
   Market Research Links
   -------------------------------------------------------- */
.market-links { margin: 4px 0 0; }
.market-links-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 8px; }
.market-links-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.market-link-btn {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 6px 13px;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--r-pill); color: var(--text);
  text-decoration: none;
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
@media (hover: hover) {
  .market-link-btn:hover { border-color: var(--gold-border); color: var(--gold); transform: translateY(-1px); box-shadow: var(--elev-2); }
}
.market-link-btn:active { transform: scale(0.98); box-shadow: var(--elev-1); }
.market-link-btn::after { content: '↗'; font-size: 10px; opacity: 0.5; }

/* --------------------------------------------------------
   Item Actions
   -------------------------------------------------------- */
.action-btns-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-action {
  display: inline-flex; align-items: center;
  font-size: 12px; padding: 6px 14px;
  background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: var(--r-pill); color: var(--text);
  cursor: pointer;
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease),
    background var(--dur-base) var(--ease), transform var(--dur-base) var(--ease),
    box-shadow var(--dur-base) var(--ease);
  font-family: inherit;
}
@media (hover: hover) {
  .btn-action:hover { border-color: var(--gold-border); color: var(--gold); transform: translateY(-1px); box-shadow: var(--elev-2); }
  .btn-action.danger:hover { border-color: var(--loss); }
  .btn-action.positive:hover { border-color: var(--gold-border); }
}
.btn-action:active { transform: scale(0.98); box-shadow: var(--elev-1); }
.btn-action.active { border-color: var(--gold-border); background: var(--gold-dim); color: var(--gold); }
.btn-action.danger { color: var(--loss); }
.btn-action.positive { color: var(--gold); }
.action-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 14px;
  margin-top: 10px;
  animation: fadeInDown 0.2s ease;
  display: flex; flex-direction: column; gap: 10px;
}
.action-input {
  width: 100%; background: var(--surface-raised); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); padding: 8px 12px; font-size: 13px;
  font-family: inherit; box-sizing: border-box; outline: none;
  transition: border-color 0.14s;
}
.action-input:focus { border-color: var(--gold-border); }
.action-textarea { resize: vertical; min-height: 52px; }
.action-form-footer { display: flex; gap: 8px; }

/* --------------------------------------------------------
   Category custom fields (form + detail display)
   -------------------------------------------------------- */
.cat-custom-fields { margin-top: 4px; }

.detail-field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin: 12px 0;
}
.detail-field { }
.detail-field-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2px;
}
.detail-field-val {
  font-size: 14px;
  color: var(--text);
}
/* Care-date tinting in the item detail grid. */
.detail-field.care-soon .detail-field-val { color: var(--warn); }
.detail-field.care-overdue .detail-field-val { color: var(--loss); }

/* --------------------------------------------------------
   Misc utility
   -------------------------------------------------------- */
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.stack-12 > * + * { margin-top: 12px; }
.center { text-align: center; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2); border-top-color: var(--gold);
  animation: spin 0.7s linear infinite;
}

/* --------------------------------------------------------
   Saved-search presets (filters panel)
   -------------------------------------------------------- */
.preset-block { margin-bottom: 18px; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.preset-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--gold-dim); color: var(--gold-light);
  border: 1px solid var(--gold-border); border-radius: var(--r-pill);
  padding: 2px 5px 2px 11px; font-size: 12.5px; font-weight: 500;
  white-space: nowrap;
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
/* The chip name is now a real <button> (sibling of the delete X) so neither nests
   inside the other — valid HTML + real keyboard semantics for both controls. */
.preset-chip-apply {
  background: none; border: none; color: inherit; font: inherit; cursor: pointer;
  padding: 6px 0; white-space: nowrap;
}
@media (hover: hover) {
  .preset-chip:hover { border-color: var(--gold); transform: translateY(-1px); box-shadow: var(--elev-2); }
}
.preset-chip:active { transform: scale(0.98); box-shadow: var(--elev-1); }
.preset-chip-x {
  background: none; border: none; color: inherit;
  width: 17px; height: 17px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; line-height: 1; opacity: 0.65; cursor: pointer;
}
.preset-chip-x:hover { opacity: 1; background: rgba(255,255,255,0.12); }
.preset-save {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px dashed var(--border-strong);
  color: var(--muted); border-radius: var(--r-pill);
  padding: 6px 13px; font-size: 12.5px; cursor: pointer;
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease),
    transform var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
  -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) {
  .preset-save:hover { border-color: var(--gold-border); color: var(--gold); transform: translateY(-1px); box-shadow: var(--elev-1); }
}
.preset-save:active { transform: scale(0.98); box-shadow: none; }

/* --------------------------------------------------------
   Bulk multi-select
   -------------------------------------------------------- */
/* Selectable cards: gold border + check badge. */
.item-card.selectable { cursor: pointer; }
.item-card.selectable .item-card-check {
  position: absolute; top: 8px; left: 8px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(12,11,10,0.6); border: 1.5px solid rgba(255,255,255,0.5);
  color: transparent;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.item-card.selected { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.item-card.selected .item-card-check {
  background: var(--gold); border-color: var(--gold); color: #1A1407;
}
/* Keep the check legible over the status dot in select mode. */
.item-card.selectable .item-card-statusdot { left: auto; right: 9px; }

/* Bulk action bar — fixed above the bottom nav, glass look. */
.bulk-bar {
  position: fixed; left: 0; right: 0;
  bottom: calc(var(--nav-h) + var(--safe-b));
  z-index: 60;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 12px 16px calc(12px);
  max-width: 640px; margin: 0 auto;
  background: var(--glass-bg-2);
  backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  box-shadow: 0 -8px 28px -6px color-mix(in srgb, black 55%, transparent);
  animation: bulkBarUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes bulkBarUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bulk-bar-count { font-size: 13px; font-weight: 500; color: var(--text); white-space: nowrap; }
.bulk-bar-count #bulk-count { color: var(--gold); font-family: var(--mono); }
.bulk-bar-actions { display: flex; align-items: center; gap: 8px; }
.bulk-bar-actions select {
  width: auto; padding: 8px 30px 8px 12px; font-size: 12.5px; border-radius: var(--r-input);
}
.bulk-btn {
  display: inline-flex; align-items: center; flex-shrink: 0;
  font-size: 12.5px; font-weight: 500; padding: 8px 14px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-input); color: var(--text); cursor: pointer;
  transition: border-color 0.14s, color 0.14s, opacity 0.14s;
  -webkit-tap-highlight-color: transparent;
}
.bulk-btn:active { transform: scale(0.97); }
.bulk-btn-danger { color: var(--loss); }
.bulk-btn-danger:hover { border-color: var(--loss); }
.bulk-btn:disabled,
.bulk-bar-actions select:disabled { opacity: 0.45; cursor: default; }

/* When the bulk bar is up, lift the grid so the last row clears it. */
body.bulk-active #screen-browse { padding-bottom: calc(var(--nav-h) + 84px + var(--safe-b)); }

@media (prefers-reduced-motion: reduce) {
  .bulk-bar { animation: none !important; }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Printable label ───────────────────────────────────────── */
#print-label {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  animation: page-in 0.2s ease both;
}
#print-label[hidden] { display: none !important; }
.pl-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pl-close {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.pl-print { padding: 12px 18px; }
.pl-sheet { flex: 1; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
.pl-card {
  width: 100%; max-width: 360px; background: #fff; color: #1a1a1a;
  border: 1px solid #e3e0d8; border-radius: 12px; padding: 22px;
}
.pl-head { display: flex; gap: 14px; align-items: center; }
.pl-qr { width: 84px; height: 84px; flex: 0 0 84px; }
.pl-qr canvas, .pl-qr svg { width: 100% !important; height: 100% !important; }
.pl-brand { font-size: 10px; letter-spacing: 0.22em; color: #9a9487; text-transform: uppercase; }
.pl-name { font-weight: 700; font-size: 18px; line-height: 1.2; color: #1a1a1a; margin-top: 2px; }
.pl-cat { font-size: 13px; color: #6b665c; margin-top: 2px; }
.pl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 18px; }
.pl-cell { font-size: 13px; }
.pl-cell-label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #9a9487; }
.pl-cell-val { display: block; font-weight: 600; color: #1a1a1a; margin-top: 1px; }
.pl-id { font-family: var(--mono); font-size: 9px; color: #c4bfb4; word-break: break-all; margin-top: 16px; }

@media print {
  body * { visibility: hidden !important; }
  #print-label, #print-label * { visibility: visible !important; }
  #print-label {
    position: absolute; inset: 0; background: #fff;
    backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0;
    display: block;
  }
  .print-hidden { display: none !important; }
  .pl-sheet { display: block; overflow: visible; }
  .pl-card { max-width: 380px; margin: 24px auto; border: 1px solid #ccc; }
}

/* ── "Pro" badge pill (settings rows) ──────────────────────── */
.pro-pill {
  display: inline-block; vertical-align: middle; margin-left: 6px;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 5px;
  color: #5a4a18; background: var(--gold-light);
  border: 1px solid color-mix(in srgb, var(--gold) 50%, black);
}

/* ══════════════════════════════════════════════════════════════
   VALUATION & INSURANCE REPORT  (print-ready document)
   On screen: dark overlay + centered white A4-ish sheet.
   The document itself is ALWAYS light (dark text on white) so it is
   consistent and print-correct regardless of app theme.
═════════════════════════════════════════════════════════════════ */
#report-view {
  position: fixed; inset: 0; z-index: 350;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  animation: page-in 0.2s ease both;
}
#report-view[hidden] { display: none !important; }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.report-close {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto;
  background: rgba(255,255,255,0.12); border: none; color: #fff;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.report-print { padding: 12px 18px; }
.report-sheet { flex: 1; display: flex; align-items: flex-start; justify-content: center; overflow: auto; }
#report-body {
  width: 100%; max-width: 800px; min-height: 100%;
  background: #fff; color: #1a1a1a;
  border: 1px solid #e3e0d8; border-radius: 12px;
  padding: 48px 52px;
  font-family: var(--sans, system-ui, sans-serif);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}
.report-loading { color: #6b665c; text-align: center; padding: 80px 0; font-size: 15px; }

/* Cover / header */
.rpt-cover { border-bottom: 2px solid #1a1a1a; padding-bottom: 26px; margin-bottom: 30px; }
.rpt-wordmark {
  font-family: var(--display); font-size: 30px; font-weight: 600;
  letter-spacing: 0.34em; color: #1a1a1a; text-indent: 0.34em;
}
.rpt-title {
  font-family: var(--display); font-size: 30px; font-weight: 600;
  color: #1a1a1a; margin: 10px 0 22px; line-height: 1.15;
}
.rpt-meta { display: grid; gap: 5px; max-width: 460px; }
.rpt-meta-row { display: flex; gap: 14px; font-size: 13px; }
.rpt-meta-label { flex: 0 0 110px; text-transform: uppercase; letter-spacing: 0.07em; font-size: 10px; color: #9a9487; align-self: center; }
.rpt-meta-val { font-weight: 600; color: #1a1a1a; }
.rpt-ref { font-family: var(--mono); font-weight: 500; font-size: 12px; }

/* Sections */
.rpt-section { margin-bottom: 34px; }
.rpt-h2 {
  font-family: var(--display); font-size: 19px; font-weight: 600;
  color: #1a1a1a; margin: 0 0 14px;
  padding-bottom: 7px; border-bottom: 1px solid #d9d4c8;
  text-transform: uppercase; letter-spacing: 0.05em;
}

/* Summary band */
.rpt-sum-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.rpt-sum-card { border: 1px solid #e3e0d8; border-radius: 9px; padding: 16px 16px 18px; background: #faf9f5; }
.rpt-sum-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: #6b665c; margin-bottom: 8px; }
.rpt-sum-value { font-family: var(--display); font-size: 25px; font-weight: 600; color: #1a1a1a; line-height: 1.05; }
.rpt-sum-accent { background: #fbf6e6; border-color: color-mix(in srgb, #C9A84C 45%, #e3e0d8); }
.rpt-sum-accent .rpt-sum-value { color: #8a6d1f; }
.rpt-sum-gain .rpt-sum-value { color: #1f7a45; }
.rpt-sum-loss .rpt-sum-value { color: #b23b3b; }

/* Tables */
.rpt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.rpt-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #6b665c; font-weight: 700; padding: 8px 10px; border-bottom: 1.5px solid #1a1a1a;
}
.rpt-table td { padding: 9px 10px; border-bottom: 1px solid #ebe8df; color: #2a2a2a; vertical-align: middle; }
.rpt-table tbody tr:nth-child(even) td { background: #faf9f5; }
.rpt-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rpt-money { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-family: var(--mono); font-size: 12px; }
.rpt-empty { color: #9a9487; text-align: center !important; padding: 22px 10px !important; background: transparent !important; }

/* Itemized schedule */
.rpt-item-cell { display: flex; align-items: center; gap: 10px; }
.rpt-item-name { font-weight: 600; color: #1a1a1a; }
.rpt-thumb {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 6px;
  background-size: cover; background-position: center; background-color: #efece3;
  border: 1px solid #e0dccf; display: inline-block;
}
.rpt-thumb-mono {
  display: inline-flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, #C9A84C 26%, #fff);
  color: #6b5418; font-weight: 700; font-size: 13px;
  font-family: var(--display); border-color: color-mix(in srgb, #C9A84C 40%, #e0dccf);
}
.rpt-total-row td { border-top: 1.5px solid #1a1a1a; border-bottom: none; padding-top: 12px; font-size: 13px; }
.rpt-total-label { text-align: right; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 11px; color: #1a1a1a; }
.rpt-total-row .rpt-money { font-weight: 700; font-size: 14px; color: #1a1a1a; }

/* Footer / disclaimer */
.rpt-footer {
  margin-top: 30px; padding-top: 16px; border-top: 1px solid #d9d4c8;
  font-size: 10.5px; line-height: 1.5; color: #9a9487;
}

@media (max-width: 640px) {
  #report-body { padding: 30px 22px; }
  .rpt-sum-grid { grid-template-columns: repeat(2, 1fr); }
  .rpt-table { font-size: 11.5px; }
  .rpt-table th, .rpt-table td { padding: 7px 6px; }
}

/* ── Report print handling (coexists with #print-label) ─────────
   Both overlays are display:none when closed, so revealing one via
   visibility never resurrects the other (a display:none ancestor
   renders nothing). Each open overlay prints only itself. */
@media print {
  #report-view, #report-view * { visibility: visible !important; }
  #report-view {
    position: absolute; inset: 0; background: #fff;
    backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0;
    display: block; z-index: auto;
  }
  .report-sheet { display: block; overflow: visible; }
  #report-body {
    max-width: 100%; margin: 0; border: none; border-radius: 0;
    box-shadow: none; padding: 24px 28px;
    color: #000;
  }
  /* Keep blocks intact across page breaks */
  .rpt-cover, .rpt-summary, .rpt-sum-card, .rpt-h2 { page-break-inside: avoid; break-inside: avoid; }
  .rpt-section { page-break-inside: auto; }
  .rpt-table thead { display: table-header-group; }   /* repeat header on each page */
  .rpt-table tfoot { display: table-footer-group; }
  .rpt-table tr { page-break-inside: avoid; break-inside: avoid; }
  .rpt-table tbody tr:nth-child(even) td { background: #f5f4ef !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt-sum-card, .rpt-sum-accent, .rpt-thumb, .rpt-thumb-mono { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ========================================================
   ESTATE & SUCCESSION  (Pro/Collector)
   In-app overview (#estate-view) reuses the report overlay chrome but keeps
   the dark, glassy in-app aesthetic. The heir dossier (#dossier-view) reuses
   the white print sheet + .rpt-* document styles, with .dsr-* additions.
   ======================================================== */
#estate-view {
  position: fixed; inset: 0; z-index: 350;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  animation: page-in 0.2s ease both;
}
#estate-view[hidden] { display: none !important; }
.report-toolbar-title {
  font-family: var(--display); font-size: 17px; font-weight: 600;
  letter-spacing: 0.06em; color: #fff; text-transform: uppercase;
}
.estate-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; }
#estate-body { width: 100%; max-width: 640px; margin: 0 auto; padding-bottom: 24px; }

.estate-intro { padding: 8px 2px 22px; }
.estate-title {
  font-size: 30px; font-weight: 600; line-height: 1.1; margin: 0 0 10px;
  color: var(--text);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold-light) 92%, #fff) 0%, var(--gold) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.estate-lede { font-size: 14.5px; line-height: 1.6; color: var(--muted); margin: 0; max-width: 52ch; }

.estate-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.estate-sum-card {
  border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 15px 16px; background: var(--surface-1);
}
.estate-sum-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 8px; }
.estate-sum-val { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--text); line-height: 1.05; }
.estate-sum-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }

.estate-note-block {
  border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 16px; background: var(--surface-1); margin-bottom: 24px;
}
.estate-note-label { display: block; font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.estate-note-hint { font-size: 12.5px; line-height: 1.5; color: var(--muted); margin: 0 0 12px; }
.estate-note-input {
  width: 100%; resize: vertical; min-height: 76px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); font: inherit; font-size: 14px; line-height: 1.55; padding: 11px 13px;
}
.estate-note-input:focus { outline: none; border-color: var(--gold); }
.estate-note-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 12px; }
.estate-note-saved { font-size: 13px; color: var(--gold); }

.estate-section-label {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin: 4px 2px 12px; font-weight: 700;
}
.estate-heirs { display: grid; gap: 14px; margin-bottom: 24px; }
.estate-heir {
  border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 16px; background: var(--surface-1);
}
.estate-heir-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.estate-heir-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.estate-heir-avatar {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 17px;
  color: color-mix(in srgb, var(--gold) 80%, #000);
  background: linear-gradient(180deg, color-mix(in srgb, var(--gold-light) 38%, transparent), color-mix(in srgb, var(--gold) 24%, transparent));
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--border));
}
.estate-heir-txt { min-width: 0; }
.estate-heir-name { font-size: 16px; font-weight: 600; color: var(--text); line-height: 1.2; word-break: break-word; }
.estate-heir-meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.estate-heir-total { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--gold); white-space: nowrap; }
.estate-heir-bar { position: relative; height: 4px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; margin: 12px 0 12px; }
/* Aligned with the Home category bars: gold gradient, glow + light sweep, and a
   post-paint rAF width animation (driven from buildEstate). */
.estate-heir-bar span {
  display: block; height: 100%; width: 0; border-radius: var(--r-pill);
  position: relative; overflow: hidden;
  background: linear-gradient(90deg, var(--gold-light) 0%, var(--gold) 100%);
  box-shadow: 0 0 12px rgba(201,168,76,0.6), 0 0 3px rgba(232,201,106,0.8), 0 1px 0 rgba(255,255,255,0.25) inset;
  transition: width 0.7s cubic-bezier(0.22,1,0.36,1);
}
.estate-heir-bar span::after {
  content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 38%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  transform: translateX(-160%);
  animation: cat-fill-sheen 4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .estate-heir-bar span { transition: none !important; }
  .estate-heir-bar span::after { animation: none !important; opacity: 0; }
}
.estate-heir-items { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 1px; }
.estate-heir-items li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  font-size: 13.5px;
}
.estate-heir-items li:last-child { border-bottom: none; }
.estate-li-name { color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.estate-li-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.estate-li-more { color: var(--muted); font-style: italic; justify-content: flex-start !important; }
.estate-heir-dossier { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.estate-unassigned {
  border: 1px dashed var(--border); border-radius: var(--r-card);
  padding: 6px 16px; background: transparent; margin-bottom: 24px;
}
.estate-all-dossier { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 8px; }
.estate-empty {
  border: 1px dashed var(--border); border-radius: var(--r-card);
  padding: 22px 18px; color: var(--muted); font-size: 14px; line-height: 1.6; margin-bottom: 22px;
}
.estate-empty p { margin: 0; }

/* The field note used under the optional beneficiary input in the add wizard +
   edit form. Calm, secondary. */
.fld-note { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 7px 0 0; }
.today-chip { float: right; font: inherit; font-size: 11px; font-weight: 600; line-height: 1.6; letter-spacing: 0.04em; color: var(--gold-light); background: transparent; border: 1px solid color-mix(in srgb, var(--gold-light) 35%, transparent); border-radius: 999px; padding: 0 9px; cursor: pointer; }
.today-chip:active { transform: scale(0.96); }

@media (max-width: 480px) {
  .estate-summary { grid-template-columns: 1fr; }
  .estate-title { font-size: 26px; }
}

/* ── Heir dossier overlay (print-ready, white sheet) ───────────── */
#dossier-view {
  position: fixed; inset: 0; z-index: 360;
  background: rgba(0,0,0,0.9);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  display: flex; flex-direction: column;
  padding: calc(16px + var(--safe-t)) 16px calc(16px + var(--safe-b));
  animation: page-in 0.2s ease both;
}
#dossier-view[hidden] { display: none !important; }
#dossier-body {
  width: 100%; max-width: 800px; min-height: 100%;
  background: #fff; color: #1a1a1a;
  border: 1px solid #e3e0d8; border-radius: 12px;
  padding: 48px 52px;
  font-family: var(--sans, system-ui, sans-serif);
  box-shadow: 0 24px 60px rgba(0,0,0,0.4);
}

/* Owner cover note — a quiet, framed personal message atop the dossier. */
.dsr-note {
  border-left: 3px solid color-mix(in srgb, #C9A84C 70%, #1a1a1a);
  background: #fbf6e6; border-radius: 0 8px 8px 0;
  padding: 16px 20px; margin: 0 0 30px;
}
.dsr-note-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #8a6d1f; font-weight: 700; margin-bottom: 7px; }
.dsr-note-body { font-size: 14px; line-height: 1.65; color: #2a2a2a; white-space: pre-wrap; font-style: italic; }

.dsr-sum-grid { grid-template-columns: repeat(2, 1fr) !important; }

.dsr-heir-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  border-bottom: 1px solid #d9d4c8; padding-bottom: 9px; margin-bottom: 16px;
}
.dsr-heir-name { font-family: var(--display); font-size: 21px; font-weight: 600; color: #1a1a1a; margin: 0; }
.dsr-heir-sub { font-size: 12.5px; color: #6b665c; font-variant-numeric: tabular-nums; white-space: nowrap; }

.dsr-pieces { display: grid; gap: 16px; }
.dsr-piece {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid #e3e0d8; border-radius: 10px; padding: 14px 16px; background: #faf9f5;
}
.dsr-piece-media { flex: 0 0 96px; }
.dsr-thumb {
  width: 96px; height: 96px; border-radius: 8px; display: block;
  background-size: cover; background-position: center; background-color: #efece3;
  border: 1px solid #e0dccf;
}
.dsr-thumb-mono {
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, #C9A84C 26%, #fff);
  color: #6b5418; font-weight: 700; font-size: 34px;
  font-family: var(--display); border-color: color-mix(in srgb, #C9A84C 40%, #e0dccf);
}
.dsr-piece-body { flex: 1; min-width: 0; }
.dsr-piece-name { font-family: var(--display); font-size: 17px; font-weight: 600; color: #1a1a1a; line-height: 1.2; }
.dsr-piece-desc { font-size: 12.5px; line-height: 1.5; color: #4a463e; margin: 5px 0 10px; }
.dsr-piece-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 18px; margin-top: 8px; }
.dsr-cell { font-size: 12.5px; min-width: 0; }
.dsr-cell-label { display: block; font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #9a9487; }
.dsr-cell-val { display: block; font-weight: 600; color: #1a1a1a; margin-top: 1px; word-break: break-word; }
.dsr-empty { color: #6b665c; font-size: 14px; }

@media (max-width: 640px) {
  #dossier-body { padding: 30px 22px; }
  .dsr-piece { gap: 12px; }
  .dsr-piece-media { flex: 0 0 72px; }
  .dsr-thumb { width: 72px; height: 72px; }
  .dsr-piece-grid { grid-template-columns: 1fr; gap: 7px; }
}

/* ── Dossier print handling (mirrors the report; each open overlay prints
   only itself because closed overlays are display:none) ───────── */
@media print {
  #dossier-view, #dossier-view * { visibility: visible !important; }
  #dossier-view {
    position: absolute; inset: 0; background: #fff;
    backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0;
    display: block; z-index: auto;
  }
  #dossier-body {
    max-width: 100%; margin: 0; border: none; border-radius: 0;
    box-shadow: none; padding: 24px 28px; color: #000;
  }
  .rpt-cover, .dsr-note, .dsr-piece, .dsr-heir-head { page-break-inside: avoid; break-inside: avoid; }
  .dsr-section { page-break-inside: auto; }
  .dsr-piece, .dsr-note, .rpt-sum-card, .rpt-sum-accent, .dsr-thumb, .dsr-thumb-mono {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
}

/* ========================================================
   LOCAL-MODE UPSELL — banner + settings "create account"
   Shown only when running without an account. Subtle gold-tinted glass
   that nudges toward syncing, with a dismiss. Works in light mode via
   the shared --gold / --glass tokens.
   ======================================================== */
.local-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; margin-bottom: 18px;
  border-radius: var(--r-card);
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--gold) 14%, transparent) 0%,
      color-mix(in srgb, var(--gold) 7%, transparent) 100%),
    var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--gold-border);
  box-shadow:
    0 1px 0 0 var(--glass-highlight) inset,
    0 4px 18px color-mix(in srgb, black 28%, transparent);
}
.local-banner[hidden] { display: none; }
.local-banner-ico {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold); background: var(--gold-dim);
  border: 1px solid var(--gold-border);
}
.local-banner-text {
  flex: 1 1 auto; min-width: 0;
  font-size: 12.5px; line-height: 1.45; color: var(--muted-strong);
}
.local-banner-text strong { display: block; color: var(--text); font-weight: 600; margin-bottom: 1px; }
.local-banner-cta {
  flex: 0 0 auto; white-space: nowrap;
  border-radius: var(--r-input);
  font-size: 13px; font-weight: 600; padding: 9px 14px;
}
.local-banner-dismiss {
  flex: 0 0 auto; align-self: flex-start;
  width: 26px; height: 26px; margin: -2px -4px 0 0;
  display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--muted);
  border-radius: var(--r-pill);
}
.local-banner-dismiss { position: relative; }
.local-banner-dismiss::after { content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 44px; height: 44px; }
.local-banner-dismiss:hover { color: var(--muted-strong); }

/* On narrow screens stack the CTA below the copy so nothing truncates. */
@media (max-width: 460px) {
  .local-banner { flex-wrap: wrap; }
  .local-banner-text { flex: 1 1 100%; order: 2; }
  .local-banner-ico { order: 1; }
  .local-banner-dismiss { order: 1; margin-left: auto; }
  .local-banner-cta { order: 3; flex: 1 1 100%; }
}

/* Settings account section — local-mode variant */
.account-avatar-local { color: color-mix(in srgb, var(--gold) 86%, #000); }
.settings-upsell-note {
  padding: 2px 16px 12px;
  font-size: 12.5px; line-height: 1.5; color: var(--muted);
}
/* A gold-accented action row for "Create account to sync". */
.settings-action-gold { color: var(--gold); font-weight: 600; }
.settings-action-gold svg { color: var(--gold); }
.settings-action-gold:active { background: var(--gold-dim); }

/* ---- Backup safety: status line + gentle nudge ---- */
.backup-status {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px 4px;
  font-size: 13px; color: var(--muted-strong);
}
.backup-status-dot {
  flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn);
}
.backup-status-warn .backup-status-label { color: var(--warn); }
.backup-nudge {
  margin: 6px 12px 12px;
  padding: 12px 14px;
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--warn) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 28%, transparent);
}
.backup-nudge-text {
  margin: 0 0 10px;
  font-size: 12.5px; line-height: 1.5; color: var(--muted-strong);
}
.backup-nudge-actions { display: flex; align-items: center; gap: 10px; }
.backup-nudge-go {
  border-radius: var(--r-input);
  font-size: 13px; font-weight: 600; padding: 9px 16px;
}
.backup-nudge-dismiss {
  background: none; border: none; color: var(--muted);
  font-size: 13px; font-weight: 500; padding: 9px 4px;
  -webkit-tap-highlight-color: transparent;
}
.backup-nudge-dismiss:active { color: var(--muted-strong); }

/* Gold-tinted variant of the Home banner, reused for the backup nudge.
   (Inherits the .local-banner layout; just shifts the accent to warn.) */
.backup-banner {
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--warn) 13%, transparent) 0%,
      color-mix(in srgb, var(--warn) 6%, transparent) 100%),
    var(--glass-bg);
  border-color: color-mix(in srgb, var(--warn) 32%, transparent);
}
.backup-banner .local-banner-ico {
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 15%, transparent);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
}

/* ---- Needs Attention digest count badge ---- */
.attention-count {
  display: inline-flex; align-items: center;
  margin-left: 8px; padding: 1px 9px;
  border-radius: var(--r-pill);
  font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  vertical-align: middle;
  color: var(--warn);
  background: color-mix(in srgb, var(--warn) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.attention-count.attention-count-overdue {
  color: var(--loss);
  background: color-mix(in srgb, var(--loss) 14%, transparent);
  border-color: color-mix(in srgb, var(--loss) 32%, transparent);
}
.attention-count[hidden] { display: none; }

/* ============================================================
   GUIDED ADD WIZARD + premium pickers
   A manicured, step-by-step add flow — no more one big form.
============================================================ */

/* Header: eyebrow + progress dots + conversational title */
.wiz-head { margin-bottom: 18px; }
/* Continuous progress rail — one thin gold thread that fills as steps advance.
   --wiz-prog (0..1) is set inline per step; the fill scales on the compositor
   (transform-origin:left) and eases between steps so the thread grows weightily. */
.wiz-rail {
  height: 3px; border-radius: var(--r-pill); overflow: hidden;
  background: var(--border); margin-bottom: 14px;
}
.wiz-rail-fill {
  display: block; height: 100%; width: 100%; border-radius: inherit;
  transform: scaleX(var(--wiz-prog, 0)); transform-origin: left center;
  background: linear-gradient(90deg, var(--gold) 0%, var(--gold-light) 100%);
  box-shadow: 0 0 10px rgba(201,168,76,0.5), 0 0 2px rgba(232,201,106,0.7);
  transition: transform var(--dur-slow) var(--ease);
}
.wiz-dots { display: flex; align-items: center; gap: 5px; margin-bottom: 14px; }
.wiz-dot {
  height: 4px; width: 6px; border-radius: var(--r-pill);
  background: var(--border-strong);
  transform-origin: left center;
  transition: width var(--dur-slow) var(--ease),
    background var(--dur-base) var(--ease), transform var(--dur-base) var(--ease-spring);
}
.wiz-dot.done { background: var(--gold); }
/* The active dot lifts in with a restrained spring scale + gold fill instead of
   a hard recolor — reads as the step "landing". */
.wiz-dot.now { width: 18px; background: var(--gold); transform: scaleX(1.04); }
.wiz-count { margin-left: 6px; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wiz-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 2px;
}
.wiz-title {
  font-family: var(--display); font-size: 30px; font-weight: 500;
  line-height: 1.12; color: var(--text); margin: 0 0 5px;
}
.wiz-sub { font-size: 13px; color: var(--muted); line-height: 1.45; }

/* Step container + directional slide */
.wiz-step { animation: wiz-in 0.28s cubic-bezier(0.22,1,0.36,1) both; }
.wiz-step[hidden] { display: none; }
.wiz-step.is-back { animation-name: wiz-in-back; }
@keyframes wiz-in     { from { opacity: 0; transform: translateX(28px);  } to { opacity: 1; transform: none; } }
@keyframes wiz-in-back{ from { opacity: 0; transform: translateX(-28px); } to { opacity: 1; transform: none; } }

/* Glass card to group fields within a step */
.wiz-card {
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-card); padding: 16px; margin-bottom: 14px;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
}
.wiz-card .form-group:last-child,
.wiz-card .form-row:last-child { margin-bottom: 0; }
.wiz-card > .form-section-title:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* Labelled hairline divider */
.fld-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0 14px; }
.fld-divider::before, .fld-divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.fld-divider span { font-size: 9px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
/* Expert guidance note atop a category's detail fields */
.cat-guide {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 14px; padding: 10px 12px;
  background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--r-input);
  font-size: 12.5px; line-height: 1.45; color: var(--muted-strong); text-wrap: pretty;
}
.cat-guide svg { flex: 0 0 auto; margin-top: 1px; color: var(--gold); }

/* ---- Hybrid Add picker: an optional quick-fill that PRE-FILLS the fields
   below (cars VIN + marque, vinyl/books search). Additive — the rich manual
   fields always render beneath it; this only saves typing. */
.cf-picker {
  margin: 0 0 16px; padding: 13px 13px 12px;
  background: var(--gold-dim); border: 1px solid var(--gold-border); border-radius: var(--r-input);
}
.cf-picker-head {
  display: flex; align-items: center; gap: 7px; margin-bottom: 11px; flex-wrap: wrap;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em; color: var(--gold-light);
}
.cf-picker-head svg { flex: 0 0 auto; color: var(--gold); }
/* "N,NNN in the library" / "Powered by …" depth label, flaunting catalogue depth. */
.cf-depth {
  margin-left: auto; padding: 2px 9px; border-radius: var(--r-pill); white-space: nowrap;
  font-size: 11px; font-weight: 700; letter-spacing: .01em;
  color: var(--gold, #d8b25a); background: rgba(216,178,90,.12); border: 1px solid rgba(216,178,90,.30);
}
.cf-picker-row { display: flex; gap: 8px; }
.cf-picker-row + .cf-picker-row { margin-top: 8px; }
.cf-picker-input {
  flex: 1 1 0; min-width: 0; font: inherit; font-size: 14px; padding: 10px 12px;
  border-radius: var(--r-input); background: var(--glass-bg); color: var(--text);
  border: 1px solid var(--border-strong);
  transition: border-color var(--dur-base) var(--ease);
}
.cf-picker-input:focus { outline: none; border-color: var(--gold-border); }
.cf-picker-input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
@media (hover: hover) { .cf-picker-input:hover { border-color: var(--gold-border); } }
.cf-picker-btn {
  flex: 0 0 auto; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  padding: 10px 15px; border-radius: var(--r-input); white-space: nowrap;
  color: #1a1408; background: var(--gold); border: 1px solid var(--gold-border);
  transition: transform var(--dur-fast) var(--ease);
}
.cf-picker-btn:active { transform: scale(0.97); }
.cf-picker-btn:disabled { opacity: 0.6; cursor: default; }
.cf-picker-or {
  display: flex; align-items: center; gap: 10px; margin: 11px 0;
  color: var(--muted); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
}
.cf-picker-or::before, .cf-picker-or::after { content: ''; flex: 1; height: 1px; background: var(--border-strong); }
.cf-picker-status { margin-top: 9px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.cf-picker-status.is-ok { color: hsl(145 52% 62%); }
.cf-picker-status.is-warn { color: var(--gold-light); }
/* On-demand search results (vinyl artists / book authors). */
.cf-picker-results { margin-top: 9px; display: flex; flex-direction: column; gap: 4px; max-height: 230px; overflow-y: auto; }
.cf-result {
  display: flex; flex-direction: column; gap: 1px; text-align: left; width: 100%;
  padding: 9px 11px; border-radius: var(--r-input); cursor: pointer;
  background: var(--glass-bg); border: 1px solid var(--border-strong); color: var(--text);
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.cf-result:hover, .cf-result:focus-visible { border-color: var(--gold-border); background: var(--gold-dim); outline: none; }
.cf-result-name { font-size: 14px; font-weight: 600; }
.cf-result-meta { font-size: 11.5px; color: var(--muted); }

/* Visual marque picker (cars) — the "modern cars collection" surfaced in Add:
   a scrollable grid of brand LOGOS (popular-first) → that brand's models. */
.cars-marque { margin-top: 2px; }
.cars-marque-bar { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.cars-marque-back {
  flex: 0 0 auto; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-input); cursor: pointer; color: var(--gold);
  background: var(--glass-bg); border: 1px solid var(--border-strong);
  transition: border-color var(--dur-base) var(--ease);
}
.cars-marque-back:hover { border-color: var(--gold-border); }
.cars-marque-search { flex: 1 1 0; min-width: 0; }
.cars-brand-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  max-height: 340px; overflow-y: auto; padding: 2px; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.cars-brand-grid.is-models { display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; }
/* Premium brand tile — depth + sheen to match the Cards game tiles. */
.cars-brand-tile {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 9px;
  padding: 14px 8px 11px; border-radius: var(--r-card); cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border); box-shadow: var(--elev-1);
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.cars-brand-tile::after {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 42%; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.06), transparent);
}
@media (hover: hover) { .cars-brand-tile:hover, .cars-brand-tile:focus-visible {
  transform: translateY(-2px); border-color: var(--gold-border); outline: none;
  box-shadow: var(--elev-2), 0 0 0 1px var(--gold-border);
} }
.cars-brand-tile:active { transform: scale(0.97); }
.cars-brand-logo {
  width: 58px; height: 58px; flex: 0 0 auto; border-radius: 14px; padding: 9px; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: #fff;
  box-shadow: 0 2px 9px rgba(0,0,0,0.28), inset 0 0 0 1px rgba(0,0,0,0.05);
}
.cars-brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.cars-brand-mono { font-family: var(--display); font-size: 24px; font-weight: 600; color: #1a1a1a; }
.cars-brand-name {
  font-size: 12px; font-weight: 600; color: var(--text); text-align: center; line-height: 1.2;
  letter-spacing: 0.01em; max-height: 2.4em; overflow: hidden; max-width: 100%;
}
.cars-model-chip {
  cursor: pointer; font: inherit; font-size: 13px; padding: 8px 12px; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--border-strong); color: var(--muted-strong);
  transition: border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.cars-model-chip:hover { border-color: var(--gold-border); color: var(--text); }
.just-filled { animation: field-filled 0.9s var(--ease) both; }
@keyframes field-filled { 0% { border-color: var(--gold); background: var(--gold-dim); box-shadow: 0 0 0 3px var(--gold-dim); } 100% { box-shadow: 0 0 0 0 transparent; } }
.cars-brand-tile.sel { border-color: var(--gold-border); box-shadow: var(--elev-2), 0 0 0 1px var(--gold-border); }
.cars-brand-tile.sel::before { content: '✓'; position: absolute; top: 6px; right: 6px; z-index: 2; width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--r-pill); background: var(--gold); color: #1a1408; font-size: 12px; font-weight: 700; animation: selpop 0.22s var(--ease-spring) both; }
@keyframes selpop { from { transform: scale(0.4); opacity: 0; } }
.btn-check { animation: selpop 0.22s var(--ease-spring) both; }

.cars-model-chip.sel { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }
.cars-marque-loading, .cars-marque-empty { width: 100%; flex-basis: 100%; grid-column: 1 / -1; padding: 18px; text-align: center; font-size: 13px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .cars-brand-tile:active { transform: none; } }
@media (prefers-reduced-motion: reduce) { .cf-picker-btn:active { transform: none; } }

/* ---- Step 3: category specifics (guided, never a wall of inputs) ---- */
.cat-specifics { margin-top: 2px; }
/* Identity header: the chosen category's scene + name, so the step feels
   bespoke to what you're adding rather than a generic form. */
.cat-specifics-head {
  display: flex; align-items: center; gap: 13px;
  margin-bottom: 16px;
}
.cat-specifics-art {
  width: 56px; height: 56px; flex: 0 0 auto;
  border-radius: var(--r-input); overflow: hidden;
  box-shadow: 0 1px 0 rgba(255,255,255,0.07) inset, 0 6px 16px -10px rgba(0,0,0,0.6);
}
.cat-specifics-art .cat-placeholder-wrap,
.cat-specifics-art .cat-placeholder { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
.cat-specifics-txt { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cat-specifics-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--gold);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cat-specifics-name {
  font-family: var(--display); font-size: 22px; font-weight: 500;
  line-height: 1.1; color: var(--text); text-wrap: balance;
}
.cat-specifics-empty {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 2px 0 0; padding: 14px 15px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  font-size: 13px; line-height: 1.5; color: var(--muted); text-wrap: pretty;
}
.cat-specifics-empty svg { flex: 0 0 auto; margin-top: 2px; color: var(--muted); }

.cf-primary { display: block; }

/* "More details" reveal — keeps long expert schemas (TCG, cars) tucked away */
.cf-disclosure { margin-top: 2px; }
.cf-more-toggle {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  width: 100%; padding: 10px 12px;
  background: none; border: 1px dashed var(--border-strong);
  border-radius: var(--r-input); color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.cf-more-toggle:active { border-color: var(--gold-border); color: var(--gold); }
.cf-more-toggle.open { color: var(--gold-light); border-color: var(--gold-border); }
.cf-more-chev { transition: transform 0.18s var(--ease, ease-out); }
.cf-more-toggle.open .cf-more-chev { transform: rotate(180deg); }
.cf-more { margin-top: 12px; }
.cf-more:not([hidden]) > .form-group { animation: cf-reveal 0.18s ease-out both; }
@keyframes cf-reveal { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .cf-more-chev { transition: none; }
  .cf-more:not([hidden]) > .form-group { animation: none; }
}

/* Save-early escape hatch — a quiet secondary text affordance under the
   Back/Continue row. Deliberately NOT button-shaped: it must read as a shortcut,
   never compete with the gold primary. Disabled until the name is non-empty. */
.wiz-savenow { display: flex; justify-content: center; margin-top: 12px; margin-bottom: 2px; }
.wiz-save-now {
  appearance: none; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  color: var(--gold); padding: 6px 10px; border-radius: var(--r-pill);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, opacity 0.15s, background 0.15s;
}
.wiz-save-now:hover { background: color-mix(in srgb, var(--gold) 10%, transparent); }
.wiz-save-now:active { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.wiz-save-now:disabled { color: var(--muted); opacity: 0.55; cursor: default; background: none; }
.wiz-save-now .spinner { vertical-align: -2px; }

/* Footer navigation */
.wiz-foot { display: flex; gap: 12px; margin-top: 22px; margin-bottom: 8px; }
.wiz-foot .btn { width: auto; flex: 1; }
.wiz-foot .wiz-back {
  flex: 0 0 auto; min-width: 56px; padding-left: 14px; padding-right: 14px;
  background: transparent; border: 1px solid var(--border-strong); color: var(--text);
}
.wiz-foot .wiz-back:active { background: rgba(255,255,255,0.06); }

/* ---- Condition rows (full-width, colour-coded, with description) ---- */
.opt-rows { display: flex; flex-direction: column; gap: 8px; }
.opt-row {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07);
  border-radius: var(--r-card); padding: 13px 15px; cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.opt-row .opt-dot {
  height: 10px; width: 10px; border-radius: var(--r-pill);
  background: var(--muted); flex: 0 0 auto; transition: box-shadow 0.15s;
}
.opt-row .opt-text { flex: 1; min-width: 0; }
.opt-row .opt-label { display: block; font-size: 15px; font-weight: 500; color: var(--text); transition: color 0.15s; }
.opt-row .opt-desc { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.opt-row .opt-check { opacity: 0; color: var(--gold); flex: 0 0 auto; transition: opacity 0.15s; }
.opt-row.on { transform: scale(1.01); }
.opt-row.on .opt-check { opacity: 1; }
/* per-condition accent — dot is always coloured, row lights up when selected */
.opt-row.cond-mint      .opt-dot { background: var(--gold-light); }
.opt-row.cond-excellent .opt-dot { background: var(--gain); }
.opt-row.cond-good      .opt-dot { background: var(--info); }
.opt-row.cond-fair      .opt-dot { background: var(--warn); }
.opt-row.cond-poor      .opt-dot { background: var(--loss); }
.opt-row.on .opt-dot { box-shadow: 0 0 8px currentColor; }
.opt-row.cond-mint.on      { background: rgba(201,168,76,0.13); border-color: var(--gold-border); }
.opt-row.cond-mint.on      .opt-label, .opt-row.cond-mint.on .opt-check { color: var(--gold-light); }
.opt-row.cond-mint.on      .opt-dot { box-shadow: 0 0 8px var(--gold); }
.opt-row.cond-excellent.on { background: rgba(86,186,120,0.12); border-color: rgba(86,186,120,0.38); }
.opt-row.cond-excellent.on .opt-label, .opt-row.cond-excellent.on .opt-check { color: var(--gain); }
.opt-row.cond-excellent.on .opt-dot { box-shadow: 0 0 8px var(--gain); }
.opt-row.cond-good.on      { background: rgba(111,168,220,0.12); border-color: rgba(111,168,220,0.38); }
.opt-row.cond-good.on      .opt-label, .opt-row.cond-good.on .opt-check { color: var(--info); }
.opt-row.cond-good.on      .opt-dot { box-shadow: 0 0 8px var(--info); }
.opt-row.cond-fair.on      { background: rgba(220,168,60,0.12); border-color: rgba(220,168,60,0.38); }
.opt-row.cond-fair.on      .opt-label, .opt-row.cond-fair.on .opt-check { color: var(--warn); }
.opt-row.cond-fair.on      .opt-dot { box-shadow: 0 0 8px var(--warn); }
.opt-row.cond-poor.on      { background: rgba(220,60,60,0.12); border-color: rgba(220,60,60,0.38); }
.opt-row.cond-poor.on      .opt-label, .opt-row.cond-poor.on .opt-check { color: var(--loss); }
.opt-row.cond-poor.on      .opt-dot { box-shadow: 0 0 8px var(--loss); }

/* ---- Chip pickers (status / frequency) ---- */
.chip-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-pick.cells { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.chip-pick .chip {
  padding: 10px 16px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--muted); cursor: pointer; transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.chip-pick.cells .chip { border-radius: var(--r-card); padding: 12px; text-align: center; }
.chip-pick .chip.on {
  background: var(--gold-dim); border-color: var(--gold-border);
  color: var(--gold-light); transform: scale(1.05);
}
.chip-pick.cells .chip.on { transform: scale(1.03); }

/* Review step summary */
.wiz-review-card {
  display: flex; gap: 0; overflow: hidden;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-card); margin-bottom: 14px;
}
.wiz-review-art { width: 96px; flex: 0 0 auto; aspect-ratio: 1; background: var(--surface-2); }
.wiz-review-art > * { width: 100%; height: 100%; }
.wiz-review-body { flex: 1; min-width: 0; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; }
.wiz-review-crumb { font-size: 10px; color: var(--muted); margin-bottom: 3px; }
.wiz-review-name { font-family: var(--display); font-size: 21px; line-height: 1.1; color: var(--text); }
.wiz-review-value { font-family: var(--display); font-size: 18px; color: var(--gold-light); margin-top: 2px; }
.wiz-review-warn { color: var(--warn); margin-top: 10px; }
.wiz-rows { background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-card); overflow: hidden; margin-bottom: 14px; }
.wiz-rows .wiz-r { display: flex; justify-content: space-between; gap: 16px; padding: 11px 16px; border-top: 1px solid var(--border); }
.wiz-rows .wiz-r:first-child { border-top: none; }
.wiz-rows .wiz-r .k { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.wiz-rows .wiz-r .v { font-size: 14px; color: var(--text); text-align: right; }

/* ============================================================
   GUIDED CATEGORY PICKER — kind cards → animated tiles
============================================================ */
.catpick { animation: wiz-in 0.26s cubic-bezier(0.22,1,0.36,1) both; }

/* --- Stage 1: Physical / Digital glass cards --- */
.catpick-kinds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kind-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 26px 16px 20px; cursor: pointer; text-align: center;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-shadow);
  transition: transform 0.2s cubic-bezier(0.22,1,0.36,1), border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.kind-card:hover, .kind-card:focus-visible { transform: translateY(-3px); border-color: var(--gold-border); outline: none; }
.kind-card:active { transform: translateY(0) scale(0.99); }
.kind-art { width: 64px; height: 64px; display: grid; place-items: center; }
.kind-svg { width: 64px; height: 64px; animation: kind-float 4s ease-in-out infinite; transform-origin: center; }
.kind-card:nth-child(2) .kind-svg { animation-delay: -2s; }
@keyframes kind-float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-5px) rotate(1deg); } }
.kind-label { font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--text); line-height: 1; }
.kind-sub { font-size: 11px; color: var(--muted); }

/* --- Stage bar: back + breadcrumb --- */
.catpick-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.catpick-back {
  flex: 0 0 auto; width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: var(--r-pill); cursor: pointer; color: var(--text);
  background: var(--glass-bg-2); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.catpick-back:hover { border-color: var(--gold-border); transform: translateX(-2px); }
.catpick-back:active { transform: scale(0.94); }
.catpick-crumb { font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--text); }

/* --- Stage 2/3: animated category / subcategory tiles --- */
.catpick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(144px, 1fr)); gap: 10px; }
.cat-tile {
  display: flex; flex-direction: column; gap: 0; cursor: pointer; overflow: hidden;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-card);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.07) inset,
    0 10px 22px -12px rgba(0,0,0,0.6),
    0 2px 5px rgba(0,0,0,0.28);
  transition: transform 0.18s cubic-bezier(0.22,1,0.36,1), border-color 0.2s, box-shadow 0.2s;
  -webkit-tap-highlight-color: transparent;
  animation: tile-in 0.34s cubic-bezier(0.22,1,0.36,1) both;
}
.cat-tile:hover, .cat-tile:focus-visible {
  transform: translateY(-5px); border-color: var(--gold-border); outline: none;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.12) inset,
    0 0 0 1px var(--gold-border) inset,
    0 22px 42px -12px rgba(0,0,0,0.72),
    0 6px 14px rgba(0,0,0,0.4);
}
/* pointer-reactive 3D tilt — JS sets --rx/--ry (fine-pointer devices only) */
.cat-tile.tilting {
  transform: perspective(720px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-5px) scale(1.02);
  transition: transform 0.08s linear, box-shadow 0.2s;
}
.cat-tile:active { transform: translateY(-1px) scale(0.985); }
.cat-tile-art { position: relative; aspect-ratio: 1; width: 100%; overflow: hidden; }
.cat-tile-art .cat-placeholder-wrap,
.cat-tile-art .cat-placeholder { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
/* recessed, lit niche so the animated scene reads as inset with depth */
.cat-tile-art::after {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -18px 28px -16px rgba(0,0,0,0.7);
}
.cat-tile-name {
  padding: 10px 10px 12px; font-size: 13px; font-weight: 500; color: var(--text);
  text-align: center; line-height: 1.25;
}
/* staggered entrance for the first dozen tiles */
.cat-tile:nth-child(1){animation-delay:.02s}.cat-tile:nth-child(2){animation-delay:.05s}
.cat-tile:nth-child(3){animation-delay:.08s}.cat-tile:nth-child(4){animation-delay:.11s}
.cat-tile:nth-child(5){animation-delay:.14s}.cat-tile:nth-child(6){animation-delay:.17s}
.cat-tile:nth-child(7){animation-delay:.20s}.cat-tile:nth-child(8){animation-delay:.23s}
.cat-tile:nth-child(9){animation-delay:.26s}.cat-tile:nth-child(10){animation-delay:.29s}
.cat-tile:nth-child(11){animation-delay:.32s}.cat-tile:nth-child(12){animation-delay:.35s}
@keyframes tile-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }

/* "Just [Root]" skip tile */
.cat-tile-skip .cat-tile-art { display: grid; place-items: center; background: rgba(255,255,255,0.02); }
.cat-tile-skip-glyph {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--r-pill);
  font-size: 20px; color: var(--gold-light);
  background: var(--gold-dim); border: 1px solid var(--gold-border);
}

/* --- Selected summary --- */
.catpick-selected {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  background: var(--glass-bg); border: 1px solid var(--gold-border);
  border-radius: var(--r-card);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  animation: wiz-in 0.26s cubic-bezier(0.22,1,0.36,1) both;
}
.catpick-selected-art { width: 64px; height: 64px; flex: 0 0 auto; border-radius: var(--r-input); overflow: hidden; }
.catpick-selected-art .cat-placeholder-wrap,
.catpick-selected-art .cat-placeholder { width: 100% !important; height: 100% !important; border-radius: 0 !important; }
.catpick-selected-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.catpick-selected-name { font-family: var(--display); font-size: 19px; color: var(--text); line-height: 1.1; }
.catpick-selected-crumb { font-size: 11px; color: var(--muted); }
.catpick-change {
  flex: 0 0 auto; padding: 8px 14px; border-radius: var(--r-pill); cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--gold-light);
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  transition: opacity 0.15s, transform 0.1s;
}
.catpick-change:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
  .kind-svg, .cat-tile, .catpick, .catpick-selected { animation: none !important; }
}

/* ---- New per-category scene keyframes (composite-only) ---- */
@keyframes cp-float        { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes cp-winGlow      { 0%,100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes cp-coinFlip     { to { transform: rotateY(360deg); } }
@keyframes cp-pageTurn     { 0%,16% { transform: rotateY(0); } 50%,66% { transform: rotateY(-155deg); } 100% { transform: rotateY(0); } }
@keyframes cp-chronoSpin   { to { transform: rotate(360deg); } }
@keyframes cp-earSwing     { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes cp-braceletSpin { to { transform: rotate(360deg); } }
@keyframes cp-scan         { 0% { transform: translateY(0); opacity: 0.2; } 50% { opacity: 0.7; } 100% { transform: translateY(25px); opacity: 0.2; } }
@keyframes cp-smoke        { 0% { opacity: 0; transform: translateY(4px) scaleX(0.8); } 35% { opacity: 0.6; } 100% { opacity: 0; transform: translateY(-10px) scaleX(1.2); } }
/* polished-surface light sweep: a bright bar crosses, then holds before repeating */
@keyframes cp-sheenX       { 0% { transform: translateX(-135%); } 55%,100% { transform: translateX(135%); } }
@keyframes cp-orbit2       { from { transform: rotate(360deg) translateX(34px); } to { transform: rotate(0deg) translateX(34px); } }
@keyframes cp-shimmer      { 0%,100% { opacity: 0.25; } 50% { opacity: 0.85; } }
/* richer primary-motion helpers (reused across scenes) */
@keyframes cp-rockY        { 0%,100% { transform: rotateY(-15deg); } 50% { transform: rotateY(15deg); } }
@keyframes cp-bob2         { 0%,100% { transform: translateY(0) rotate(-1.6deg); } 50% { transform: translateY(-4px) rotate(1.6deg); } }
@keyframes cp-emberGlow    { 0%,100% { opacity: 0.55; transform: scale(0.85); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes cp-keyPress     { 0%,100% { transform: translateY(0); } 50% { transform: translateY(2px); } }

/* Palettes so Sports / Books read distinct, not the default colour */
.cat-placeholder[data-slug="sports"] { --cat-a: 64,150,104; --cat-b: 18,74,48;  --cp-1: 196,240,214; --cp-2: 104,198,148; }
.cat-placeholder[data-slug="books"]  { --cat-a: 178,126,72; --cat-b: 80,48,20;  --cp-1: 244,214,172; --cp-2: 214,158,98; }
.cat-placeholder[data-slug="sneakers"] { --cat-a: 44,156,136;  --cat-b: 12,74,64;   --cp-1: 192,242,228; --cp-2: 92,202,176; }
.cat-placeholder[data-slug="coins"]    { --cat-a: 198,158,58;  --cat-b: 98,70,20;   --cp-1: 250,228,162; --cp-2: 224,186,102; }
.cat-placeholder[data-slug="cards"]    { --cat-a: 74,112,206;  --cat-b: 26,44,116;  --cp-1: 200,218,255; --cp-2: 124,156,232; }
.cat-placeholder[data-slug="comics"]   { --cat-a: 206,76,56;   --cat-b: 100,28,18;  --cp-1: 250,196,182; --cp-2: 234,126,96; }
.cat-placeholder[data-slug="vinyl"]    { --cat-a: 116,92,200;  --cat-b: 44,30,102;  --cp-1: 212,202,250; --cp-2: 146,126,222; }
.cat-placeholder[data-slug="toys"]     { --cat-a: 100,172,64;  --cat-b: 42,82,22;   --cp-1: 204,242,178; --cp-2: 140,206,104; }
.cat-placeholder[data-slug="pops"]     { --cat-a: 234,116,46;  --cat-b: 96,40,10;   --cp-1: 252,208,158; --cp-2: 240,152,86; }
.cat-placeholder[data-slug="antiques"]   { --cat-a: 168,110,60;  --cat-b: 82,46,18;   --cp-1: 244,212,172; --cp-2: 212,156,96; }
.cat-placeholder[data-slug="memorabilia"]{ --cat-a: 92,104,190;  --cat-b: 36,42,104;  --cp-1: 210,216,250; --cp-2: 138,150,226; }
.cat-placeholder[data-slug="minerals"]   { --cat-a: 48,168,144;  --cat-b: 14,80,68;   --cp-1: 194,246,230; --cp-2: 96,208,182; }
.cat-placeholder[data-slug="militaria"]  { --cat-a: 138,126,58;  --cat-b: 66,58,20;   --cp-1: 234,224,168; --cp-2: 198,180,102; }
.cat-placeholder[data-slug="tools"]      { --cat-a: 116,138,166; --cat-b: 44,58,80;   --cp-1: 216,230,246; --cp-2: 146,170,202; }

/* Motion-perf: freeze scenes on tiles scrolled off-screen + drop their layers */
.cat-placeholder.cp-paused .cp-scene,
.cat-placeholder.cp-paused .cp-scene * { animation-play-state: paused !important; will-change: auto !important; }

/* Keyboard focus: clear, consistent ring on every picker control */
.kind-card:focus-visible,
.cat-tile:focus-visible,
.cat-tile-skip:focus-visible,
.catpick-back:focus-visible,
.catpick-change:focus-visible,
.opt-row:focus-visible,
.chip-pick .chip:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

/* ---- Depth pass: dimensional cards, lit niches, pointer tilt ---- */
.kind-card.tilting {
  transform: perspective(720px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-3px) scale(1.02);
  transition: transform 0.08s linear, box-shadow 0.2s;
}
/* lift the floating icon forward while tilting for parallax */
.kind-card.tilting .kind-art { transform: translateZ(26px); }
.kind-card { transform-style: preserve-3d; }

/* give the wizard cards + selected summary real elevation, not flat fills */
.wiz-card,
.catpick-selected {
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 10px 24px -16px rgba(0,0,0,0.55),
    0 2px 6px rgba(0,0,0,0.25);
}
.catpick-selected { box-shadow:
    0 1px 0 rgba(255,255,255,0.08) inset,
    0 0 0 1px var(--gold-border) inset,
    0 14px 30px -14px rgba(0,0,0,0.6); }

/* ---- Depth v2: pointer specular glare, deeper niche, stronger tilt ---- */
.cat-tile, .kind-card { position: relative; }
.cat-tile::before, .kind-card::before {
  content: ''; position: absolute; inset: 0; z-index: 4; pointer-events: none;
  border-radius: inherit; opacity: 0; transition: opacity 0.2s;
  background: radial-gradient(220px circle at var(--mx,50%) var(--my,50%), rgba(255,255,255,0.18), rgba(255,255,255,0.05) 38%, transparent 62%);
  mix-blend-mode: screen;
}
.cat-tile.tilting::before, .kind-card.tilting::before { opacity: 1; }
.cat-tile.tilting {
  transform: perspective(720px) rotateX(var(--rx,0deg)) rotateY(var(--ry,0deg)) translateY(-6px) scale(1.03);
}
/* deepen the niche so the scene sits in a darker, lit well */
.cat-tile-art::after {
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -22px 34px -16px rgba(0,0,0,0.8),
    inset 0 0 26px -4px rgba(0,0,0,0.45);
}
@media (prefers-reduced-motion: reduce) {
  .cat-tile.tilting, .kind-card.tilting { transform: none; }
  .cat-tile.tilting::before, .kind-card.tilting::before { opacity: 0; }
  .cat-tile.tilting .cp-glint, .kind-card.tilting .cp-glint { opacity: 0; }
}

/* Backup-state badge on photo thumbs (account mode) */
.photo-thumb-state {
  position: absolute; bottom: 5px; left: 5px; z-index: 3;
  display: inline-flex; align-items: center; justify-content: center;
  width: 21px; height: 21px; border-radius: var(--r-pill);
  background: rgba(0,0,0,0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
}
.photo-thumb-state.is-backed { color: var(--gold-light); }
.photo-thumb-state.is-local  { color: var(--muted-strong); }

/* ============================================================
   ICON LIVELINESS — tap feedback, entrance choreography, idle motion.
   Tasteful + compositor-only; full reduced-motion opt-out at the end.
   ============================================================ */

/* 1 ── Tap feedback: icons inside a pressed control nudge + spring back.
   Touch-friendly (no hover needed), and purely on :active so it's never busy. */
.settings-action svg, .btn-action svg, .nav-btn svg,
.cat-row-icon, .settings-row-chevron, .market-link-btn svg {
  transition: transform var(--dur-fast) var(--ease);
}
.settings-action:active svg, .btn-action:active svg, .nav-btn:active svg,
.cat-row:active .cat-row-icon, .settings-row-tappable:active .settings-row-chevron,
.market-link-btn:active svg { transform: scale(1.18); }

/* 2 ── Entrance choreography: key lists fade/rise in (staggered) on each screen
   open, then sit still. `backwards` fill so interactive :hover/:active
   transforms still work once the entrance finishes. */
@keyframes enter-rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
/* NOTE: the Browse grid (.item-grid .item-card) now reveals via
   applyStaggerReveal() (.reveal) on full remount, so it's intentionally not in
   this nth-child set — that would double-animate the entrance. */
.cat-row, .settings-section {
  animation: enter-rise 0.4s var(--ease) backwards;
}
.cat-row:nth-child(1),.settings-section:nth-child(1){animation-delay:.02s}
.cat-row:nth-child(2),.settings-section:nth-child(2){animation-delay:.05s}
.cat-row:nth-child(3),.settings-section:nth-child(3){animation-delay:.08s}
.cat-row:nth-child(4),.settings-section:nth-child(4){animation-delay:.11s}
.cat-row:nth-child(5),.settings-section:nth-child(5){animation-delay:.14s}
.cat-row:nth-child(6),.settings-section:nth-child(6){animation-delay:.17s}
.cat-row:nth-child(7),.settings-section:nth-child(7){animation-delay:.20s}
.cat-row:nth-child(n+8),.settings-section:nth-child(n+8){animation-delay:.22s}

/* 3 ── Idle motion on a couple of hero spots only. */
@keyframes fab-breathe { 0%,100% { box-shadow: 0 6px 18px rgba(201,168,76,0.4), 0 0 0 0 rgba(201,168,76,0.0); } 50% { box-shadow: 0 6px 22px rgba(201,168,76,0.55), 0 0 22px 2px rgba(201,168,76,0.3); } }
.fab-circle { animation: fab-breathe 3.6s ease-in-out infinite; }
.nav-fab:active .fab-circle { animation: none; }
@keyframes icon-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.home-empty-icon { animation: icon-float 4s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  .settings-action:active svg, .btn-action:active svg, .nav-btn:active svg,
  .cat-row:active .cat-row-icon, .market-link-btn:active svg { transform: none; }
  .cat-row, .settings-section { animation: none; }
  /* Unified hover/press lift — neutralize the translate/scale so nothing moves;
     border/color hover states still read. */
  .item-card:hover, .mini-card:hover, .card-interactive:hover, .wishlist-card:hover,
  .price-pill:hover, .filter-chip:hover, .attachment-btn:hover, .market-link-btn:hover,
  .btn-action:hover, .preset-chip:hover, .preset-save:hover, .auth-local-btn:hover,
  .item-card:active, .mini-card:active, .card-interactive:active, .wishlist-card:active,
  .price-pill:active, .filter-chip:active, .attachment-btn:active, .market-link-btn:active,
  .btn-action:active, .preset-chip:active, .preset-save:active, .auth-local-btn:active {
    transform: none;
  }
  .fab-circle, .home-empty-icon { animation: none; }
  /* Living nav: snap the indicator (no slide), drop the icon pop. */
  .nav-indicator { transition: opacity var(--dur-base) var(--ease); }
  .nav-btn.nav-pop svg { animation: none; }
}

/* ==================================================================
   BULK IMPORT FROM SPREADSHEET (CSV) — guided stepper
================================================================== */
/* The stepper body is replaced whole on each step, so the head carries the
   directional slide (the add wizard gets this from .wiz-step). Forward by
   default; .wiz-in-back (set in renderCsvStep) reverses the entry. */
#csv-import-body .wiz-head { animation: wiz-in var(--dur-slow) var(--ease) both; }
#csv-import-body .wiz-head.wiz-in-back { animation-name: wiz-in-back; }

/* Step 1: the file drop / pick zone (reuses the photo-zone language). */
.csv-drop {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; text-align: center;
  padding: 34px 20px; margin-bottom: 14px;
  background: var(--glass-bg); border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-card); color: var(--muted);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: border-color 0.18s, background 0.18s, color 0.18s, transform 0.15s, box-shadow var(--dur-base) var(--ease);
}
/* Gold gradient ring drawn as a soft glow halo — box-shadow only, so no layout
   shift while it ramps in on hover/drag. */
.csv-drop::before {
  content: ''; position: absolute; inset: -1.5px; border-radius: inherit;
  padding: 1.5px; pointer-events: none;
  background: linear-gradient(135deg, var(--gold-light), var(--gold) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  opacity: 0; transition: opacity var(--dur-base) var(--ease);
}
.csv-drop:hover, .csv-drop:focus-visible { border-color: var(--gold-border); color: var(--muted-strong); outline: none; }
.csv-drop:hover { box-shadow: 0 0 0 1px var(--gold-border), 0 10px 30px -16px var(--btn-gold-glow); }
.csv-drop:hover::before { opacity: 0.65; }
.csv-drop:focus-visible { box-shadow: 0 0 0 3px var(--gold-dim); }
.csv-drop:active { transform: scale(0.992); }
.csv-drop.drag { border-color: var(--gold); background: var(--gold-dim); color: var(--gold-light); box-shadow: 0 0 0 1px var(--gold), 0 0 28px -6px var(--btn-gold-glow); }
.csv-drop.drag::before { opacity: 1; }
.csv-drop svg { color: var(--gold); }
.csv-drop-title { font-size: 15px; font-weight: 600; color: var(--text); }
.csv-drop-hint { font-size: 12px; color: var(--muted); }

/* Inline guidance / warnings (mirrors .cat-guide). */
.csv-tip {
  display: flex; align-items: flex-start; gap: 9px;
  margin: 0 0 4px; padding: 11px 13px;
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  border-radius: var(--r-input);
  font-size: 12.5px; line-height: 1.5; color: var(--muted-strong); text-wrap: pretty;
}
.csv-tip svg { flex: 0 0 auto; margin-top: 1px; color: var(--gold); }
.csv-tip.csv-warn { background: var(--gold-dim); border-color: var(--gold-border); color: var(--muted-strong); margin-top: 12px; }
.csv-tip.csv-warn svg { color: var(--gold-light); }

/* Step 2: file chip + the column→field mapping list. */
.csv-file-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; margin-bottom: 14px;
  background: var(--glass-bg-2); border: 1px solid var(--glass-border);
  border-radius: var(--r-input); font-size: 12.5px; color: var(--muted-strong);
}
.csv-file-chip svg { flex: 0 0 auto; color: var(--gold); }
.csv-file-name { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csv-file-count { margin-left: auto; flex: 0 0 auto; color: var(--muted); font-variant-numeric: tabular-nums; }

.csv-map-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 6px; }
.csv-map-row {
  display: grid; grid-template-columns: 1fr auto 1.15fr; align-items: center; gap: 10px;
  padding: 11px 12px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-input);
}
.csv-map-col { min-width: 0; }
.csv-map-head {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.csv-map-sample { font-size: 11px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csv-map-arrow { flex: 0 0 auto; color: var(--muted); }
.csv-map-field { min-width: 0; }
.csv-map-select { padding: 9px 30px 9px 11px; font-size: 13px; }

/* Step 3: the preview list. */
.csv-prev-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 4px; }
.csv-prev-row {
  padding: 12px 14px;
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-input);
}
.csv-prev-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.25; text-wrap: balance; }
.csv-prev-bits { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.csv-prev-tag {
  display: inline-flex; align-items: center;
  font-size: 11px; padding: 2px 9px; border-radius: var(--r-pill);
  background: var(--gold-dim); color: var(--gold-light); border: 1px solid var(--gold-border);
}
.csv-prev-tag-muted { background: rgba(255,255,255,0.05); color: var(--muted); border-color: var(--border-strong); }
.csv-prev-val {
  font-size: 11px; padding: 2px 9px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--border-strong);
  font-variant-numeric: tabular-nums;
}
.csv-prev-meta {
  font-size: 11px; padding: 2px 9px; border-radius: var(--r-pill);
  background: rgba(255,255,255,0.04); color: var(--muted); border: 1px solid var(--border);
}
.csv-prev-more { padding: 6px 2px 2px; font-size: 12.5px; color: var(--muted); text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .csv-drop:active { transform: none; }
  /* Progress snaps to the step; the active dot widens without a spring scale;
     the stepper head appears in place. */
  .wiz-rail-fill { transition: none !important; }
  .wiz-dot { transition: background var(--dur-base) ease, width var(--dur-base) ease; }
  .wiz-dot.now { transform: none; }
  #csv-import-body .wiz-head,
  #csv-import-body .wiz-head.wiz-in-back { animation: none !important; }
}

/* ============================================================
   Motion utilities — CSS companions to the JS motion primitives
   (countUp / spring / applyStaggerReveal / removeWithExit in app.js).
   ============================================================ */

/* Staggered list entrance: applyStaggerReveal() sets --i + .reveal per child. */
@keyframes reveal-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.reveal {
  animation: reveal-rise var(--dur-slow) var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 24ms);
}
.reveal-done { opacity: 1; }

/* Tabular numerals for any figure that counts up, so the row never reflows
   mid-tween. */
.tabular-nums { font-variant-numeric: tabular-nums; }

/* Exit/collapse for removeWithExit() — the symmetric counterpart to entrances. */
.exit-collapse {
  /* exits ACCELERATE away (ease-in) — the entrance curve made deletions linger */
  transition:
    max-height var(--dur-base) cubic-bezier(0.4, 0, 1, 1),
    opacity    var(--dur-base) cubic-bezier(0.4, 0, 1, 1),
    transform  var(--dur-base) cubic-bezier(0.4, 0, 1, 1);
  pointer-events: none;
}

/* Reduced-motion gap closure: entrance keyframes that previously kept playing
   under reduce. Each selector rests in its final visible state (verified: no
   base opacity:0 / offscreen transform), so animation:none = appears in place. */
@media (prefers-reduced-motion: reduce) {
  .reveal { animation: none !important; }
  #onboarding, .onb-slide, #auth-screen, #scanner,
  .form-cat-preview, .action-form, .inline-form,
  .upgrade-backdrop, .upgrade-sheet,
  .wiz-step, .wiz-step.is-back, .catpick, .catpick-selected { animation: none !important; }
  /* Auth ambient holds a single static frame; wordmark appears in place. */
  #auth-screen::before { animation: none !important; transform: none; }
  .auth-wordmark { animation: none !important; }
  /* Onboarding slides cross-fade is disabled; slides snap (toggle hidden). */
  .onb-slide.onb-out, .onb-slide.onb-in { animation: none !important; }
}

/* ==================================================================
   HERO FIGURES + DATA-VIZ — count-up gold-foil + self-drawing charts
================================================================== */

/* Gold-foil text treatment for the single most-looked-at figures (Home total,
   item-detail value). Brushed-metal gradient clipped to the glyphs with a faint
   warm bloom — keeps the existing gold color as the fallback fill where
   background-clip:text isn't honored. Same recipe as .estate-title. */
.gold-foil {
  background: linear-gradient(176deg,
    color-mix(in srgb, var(--gold-light) 94%, #fff) 0%,
    var(--gold-light) 34%,
    var(--gold) 72%,
    #A8842F 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  /* the foil's own drop-shadow is the single glow source — drop any host
     text-shadow that would otherwise paint behind transparent glyphs */
  text-shadow: none;
  /* warm bloom under the foil; outside any .cp-scene so it stays crisp */
  filter: drop-shadow(0 1px 10px rgba(201,168,76,0.28));
}
/* One-shot light sweep when a gold figure lands (added by JS, self-removing). */
.gold-foil.foil-glint {
  background-image:
    linear-gradient(110deg, transparent 38%, rgba(255,248,224,0.95) 50%, transparent 62%),
    linear-gradient(176deg, color-mix(in srgb, var(--gold-light) 94%, #fff) 0%, var(--gold-light) 34%, var(--gold) 72%, #A8842F 100%);
  background-size: 220% 100%, 100% 100%;
  background-repeat: no-repeat;
  animation: foil-glint 850ms var(--ease) 1 both;
}
@keyframes foil-glint {
  from { background-position: -120% 0, 0 0; }
  to   { background-position: 220% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) { .gold-foil.foil-glint { animation: none !important; } }
html.light .gold-foil.foil-glint {
  /* base-layer stops mirror html.light .gold-foil so the class self-removal causes no color jump */
  background-image:
    linear-gradient(110deg, transparent 38%, rgba(255,250,235,0.9) 50%, transparent 62%),
    linear-gradient(176deg, color-mix(in srgb, var(--gold) 72%, #fff) 0%, var(--gold) 46%, #8A6A24 100%);
  background-size: 220% 100%, 100% 100%;
  background-repeat: no-repeat;
}

html.light .gold-foil {
  background: linear-gradient(176deg,
    color-mix(in srgb, var(--gold) 72%, #fff) 0%,
    var(--gold) 46%,
    #8A6A24 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 8px rgba(169,132,47,0.22));
}
/* Insight hero figures: keep the sign glued to the magnitude, no reflow. */
.insight-sign { display: inline-block; }

/* ── Sparkline self-draw + glow ───────────────────────────── */
/* The stroke-on transition: one-shot stroke-dashoffset (allowed for chart
   draw-on). Lifted area-fill alpha + glow live in the inline SVG defs. */
.sparkline-line.spark-draw-in {
  transition: stroke-dashoffset var(--dur-slower) var(--ease);
}
/* Area fill fades + rises in under the drawing line. */
@keyframes spark-fill-rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 0.95; transform: none; }
}
.sparkline-fill.spark-fill-in {
  transform-box: fill-box; transform-origin: bottom;
  animation: spark-fill-rise var(--dur-slower) var(--ease) backwards;
}
/* End-of-line marker: a soft, slow gold pulse to draw the eye to "now". */
@keyframes spark-dot-pulse {
  0%, 100% { transform: scale(1);   opacity: 0.9; }
  50%      { transform: scale(1.45); opacity: 1; }
}
.sparkline-dot.spark-dot-live {
  transform-box: fill-box; transform-origin: center;
  filter: drop-shadow(0 0 4px rgba(232,201,106,0.85));
  animation: spark-dot-pulse 2.6s var(--ease-in-out) infinite;
}

/* ── Donut staggered sweep-in ─────────────────────────────── */
.donut-seg.donut-seg-in,
.comp-ring-fill.donut-seg-in {
  transition: stroke-dashoffset var(--dur-slower) var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  /* Charts render their FINAL state instantly: no draw-on, no pulse. The inline
     SVG already paints the completed line/ring; we just neutralize the tweens. */
  .sparkline-line.spark-draw-in,
  .donut-seg.donut-seg-in,
  .comp-ring-fill.donut-seg-in { transition: none !important; }
  .sparkline-fill.spark-fill-in { animation: none !important; opacity: 0.95; transform: none; }
  .sparkline-dot.spark-dot-live { animation: none !important; }
}

/* ============================================================
   TCG set-collection — sets browser, binder, card sheet
   ============================================================ */
.home-sets-btn {
  position: absolute; top: calc(12px + var(--safe-t)); right: 58px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-pill);
  background: var(--glass-bg); backdrop-filter: var(--glass-blur); -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); color: var(--gold); z-index: 3;
  transition: border-color var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease), color var(--dur-base) var(--ease);
}
.home-sets-btn:hover { border-color: var(--gold-border); color: var(--gold-light); }
.home-sets-btn:active { transform: scale(0.93); }

.sets-header {
  display: flex; align-items: center; gap: 8px;
  padding: calc(12px + var(--safe-t)) 14px 10px;
  position: sticky; top: 0; z-index: var(--z-sticky);
  background: linear-gradient(to bottom, var(--bg) 64%, transparent);
}
.sets-back-btn, .sets-header-spacer { width: 40px; height: 40px; flex: 0 0 auto; }
.sets-back-btn {
  display: flex; align-items: center; justify-content: center; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease);
}
.sets-back-btn:active { transform: scale(0.92); }
.sets-title {
  flex: 1; text-align: center; font-family: var(--display); font-weight: 500;
  font-size: 22px; letter-spacing: 0.01em; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#sets-body { padding: 4px 14px calc(28px + var(--nav-h) + var(--safe-b)); }

.sets-series { margin-bottom: 26px; }
.sets-series-head { display: flex; align-items: baseline; gap: 10px; margin: 4px 2px 12px; }
.sets-series-name { font-family: var(--display); font-size: 19px; color: var(--text); }
.sets-series-year { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.sets-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 13px; }
@media (min-width: 560px) { .sets-grid { grid-template-columns: repeat(3, 1fr); } }

/* ── Set-complete: permanent foil COMPLETE ribbon (tile + binder header) ─────
   A tasteful gold corner flag on a finished set, plus a full-width foil banner
   on the open binder with an inline "Share certificate" action. Game-tinted via
   --game-hue (set on #screen-sets); transform/opacity-only entrance. */
.set-tile-ribbon {
  position: absolute; top: 11px; left: -34px; z-index: 3;
  transform: rotate(-45deg); transform-origin: center;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 36px; font-size: 10px; font-weight: 800; letter-spacing: 1.4px;
  color: #25180a; text-shadow: 0 1px 0 hsl(44 70% 78% / 0.6);
  background: linear-gradient(135deg, #f4e3a3 0%, #c9a84c 45%, #a8842f 60%, #e8c96a 100%);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.5);
  pointer-events: none;
}
.set-tile-ribbon-star { font-size: 9px; line-height: 1; }
.set-tile.is-complete .set-tile-logo { box-shadow: inset 0 0 0 2px hsl(44 60% 55% / 0.45); }

.set-complete-ribbon {
  flex: 1 1 100%; order: 3; margin-top: 12px;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: var(--r-input);
  background: linear-gradient(100deg, hsl(var(--game-hue, 44) 40% 16%), hsl(var(--game-hue, 44) 36% 11%));
  border: 1px solid hsl(var(--game-hue, 44) 55% 55% / 0.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05), 0 0 26px hsl(var(--game-hue, 44) 60% 50% / 0.14);
  overflow: hidden; position: relative;
}
/* foil sheen sweep — runs once on entrance, respects reduced-motion below */
.set-complete-ribbon::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.22) 50%, transparent 65%);
  transform: translateX(-120%);
}
.set-complete-ribbon.ribbon-in { animation: ribbon-pop 0.5s cubic-bezier(0.18,1.4,0.4,1) both; }
.set-complete-ribbon.ribbon-in::after { animation: ribbon-sheen 1.1s ease 0.25s 1; }
@keyframes ribbon-pop { from { opacity: 0; transform: translateY(8px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes ribbon-sheen { to { transform: translateX(120%); } }
.set-complete-flag {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; font-size: 13px; color: #25180a;
  background: linear-gradient(135deg, #f4e3a3, #c9a84c 55%, #a8842f);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.6);
}
.set-complete-label {
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 2px;
  color: hsl(var(--game-hue, 44) 60% 78%); text-transform: uppercase; flex: 1 1 auto;
}
.set-complete-share {
  flex: 0 0 auto; appearance: none; cursor: pointer;
  padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: #1b140a; background: linear-gradient(135deg, #efd98f, #c9a84c);
  border: 1px solid hsl(44 55% 45% / 0.6); white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
  transition: transform var(--dur-fast) var(--ease), filter var(--dur-fast) var(--ease);
}
.set-complete-share:hover { filter: brightness(1.06); }
.set-complete-share:active { transform: scale(0.96); }
.binder-head.is-complete { flex-wrap: wrap; }

/* The celebration overlay's inline action button (e.g. "Share this set"). */
.celebrate-action {
  margin-top: 16px; padding: 9px 20px; font-size: 14px;
  pointer-events: auto; position: relative; z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .set-complete-ribbon.ribbon-in { animation: none; }
  .set-complete-ribbon.ribbon-in::after { animation: none; }
}

.set-tile {
  position: relative;
  display: flex; flex-direction: column; text-align: left; color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border); border-radius: var(--r-card);
  box-shadow: var(--elev-1); overflow: hidden;
}
.set-tile-logo {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(120% 100% at 50% 0%, hsl(var(--game-hue, 44) 60% 55% / 0.14), transparent 70%), var(--surface-2);
}
/* Real card art fills the tile (every game gets the Pokémon treatment); a Pokémon
   set logo floats on top over a soft scrim, other games show the art alone. */
.set-tile-logo img.set-tile-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 15%; z-index: 0; filter: none; }
.set-tile.has-art .set-tile-logo { padding: 0; }
.set-tile.has-art .set-tile-logo::after { content: ''; position: absolute; inset: 0; z-index: 1; background: radial-gradient(95% 80% at 50% 42%, rgba(8,7,6,0.5), rgba(8,7,6,0.12) 72%, transparent); }
.set-tile-logo img.set-tile-logo-img { position: relative; z-index: 2; max-width: 86%; max-height: 66%; object-fit: contain; filter: drop-shadow(0 3px 11px rgba(0,0,0,0.9)); }
.set-tile-fallback { position: relative; z-index: 2; font-family: var(--display); font-size: 18px; color: hsl(var(--game-hue, 44) 62% 72%); text-align: center; }
.set-tile-foot { display: flex; align-items: center; gap: 8px; padding: 11px 12px 12px; }
.set-tile-text { flex: 1; min-width: 0; }
.set-tile-name { font-size: 13.5px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.5em; }
.set-tile-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }

.comp-ring { flex: 0 0 auto; }
.comp-ring-fill { transition: stroke-dashoffset var(--dur-slow) var(--ease); }
.comp-ring-text { fill: hsl(var(--game-hue, 44) 62% 72%); font-weight: 700; font-family: var(--mono); }

.binder-head { display: flex; align-items: center; gap: 14px; padding: 6px 4px 12px; }
.binder-head-logo { flex: 1; min-width: 0; height: 64px; display: flex; align-items: center; }
.binder-head-logo img { max-height: 64px; max-width: 100%; object-fit: contain; filter: drop-shadow(0 2px 10px rgba(0,0,0,0.55)); }
.binder-head-logo span { font-family: var(--display); font-size: 22px; color: hsl(var(--game-hue, 44) 62% 72%); }
.binder-head-ring { flex: 0 0 auto; }
.binder-counts {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 0 4px 14px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.binder-count-main { font-size: 15px; }
.binder-count-main b { font-size: 24px; font-family: var(--display); color: hsl(var(--game-hue, 44) 62% 72%); font-variant-numeric: tabular-nums; }
.binder-count-den { color: var(--muted); font-size: 13px; }
.binder-count-master { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.binder-count-master b { color: var(--muted-strong); }
/* Catalogue value of the cards owned in this set — a gold money figure, pushed
   to the right edge of the counts row. */
.binder-count-value { margin-left: auto; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.binder-count-value b { color: var(--gold-light); font-size: 15px; font-family: var(--display); }

/* Find-a-card search — sticks just under the screen header so it stays reachable
   while scrolling a big binder. Matches collector number or name (see filterBinder). */
.binder-search {
  position: sticky; top: calc(62px + var(--safe-t)); z-index: calc(var(--z-sticky) - 1);
  display: flex; align-items: center; gap: 8px; margin: 0 0 14px;
  padding: 10px 13px; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.binder-search-ico { flex: 0 0 auto; color: var(--muted); }
.binder-search input {
  flex: 1; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 15px; color: var(--text);
}
.binder-search input::placeholder { color: var(--muted); }
.binder-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.binder-search:focus-within { border-color: color-mix(in srgb, var(--gold-light) 50%, var(--glass-border)); }
/* Live match-count chip shared by the per-game set search and the binder card search. */
.sets-search-count {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: var(--muted-strong);
  padding: 2px 9px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border);
  white-space: nowrap;
}
.binder-missing-toggle {
  flex: 0 0 auto; font: inherit; font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
  padding: 5px 11px; border-radius: var(--r-pill); cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--glass-border);
  transition: color var(--dur-base) var(--ease), background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.binder-missing-toggle.on {
  color: #1a1408; background: hsl(var(--game-hue, 44) 55% 66%);
  border-color: hsl(var(--game-hue, 44) 55% 66%);
}
.binder-noresults { text-align: center; color: var(--muted); font-size: 14px; padding: 28px 0; }

.binder-page { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.tcg-slot {
  position: relative; aspect-ratio: 2.5 / 3.5; border-radius: 9px; overflow: hidden;
  /* A modern set's binder is 300+ image slots rendered in one pass — skip the off-screen
     ones. 'auto' learns the real card height after first paint. */
  content-visibility: auto;
  contain-intrinsic-size: auto 150px;
  border: 1px solid var(--border); display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 80% at 50% 8%, rgba(255,246,226,0.05), transparent 60%),
    linear-gradient(180deg, var(--surface-2), var(--surface-1));
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.tcg-slot.owned { border-color: hsl(var(--game-hue, 44) 55% 55% / 0.4); box-shadow: var(--elev-1), inset 0 0 0 1px hsl(var(--game-hue, 44) 60% 55% / 0.2); }
/* A just-owned card visibly LANDS in the grid as the sheet slides away. */
.tcg-slot.sleeve-in { animation: sleeve-pop 0.5s var(--ease-spring); z-index: 2; }
@keyframes sleeve-pop { 0% { transform: scale(0.94); } 60% { transform: scale(1.045); } 100% { transform: scale(1); } }
.tcg-slot.sleeve-in::before { opacity: 1; backdrop-filter: none; -webkit-backdrop-filter: none;
  background: linear-gradient(115deg, transparent 36%, hsla(var(--game-hue, 44), 90%, 84%, 0.30) 48%, transparent 62%);
  animation: foil-sweep 0.55s var(--ease) 0.1s both; }
.tcg-slot:active { transform: scale(0.96); transition-duration: 0.06s, var(--dur-base), var(--dur-base); }
.tcg-slot-img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: filter var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease);
}
/* Locked = the real card, blurred + desaturated behind frosted glass, so you can
   see exactly what you're missing; collecting clears the filter (the unlock reveal). */
/* Locked = softly veiled but still readable — you can tell which card it is. */
.tcg-slot.locked .tcg-slot-img { filter: grayscale(0.5) brightness(0.82); transform: none; }
/* Light frosted glass over the (still readable) card — no heavy image blur. */
.tcg-slot::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 1;
  background: linear-gradient(180deg, rgba(9,8,7,0.10), rgba(9,8,7,0.34));
  opacity: 0; transition: opacity var(--dur-slow) var(--ease);
}
.tcg-slot.locked::before {
  opacity: 1;
  /* blur stays gated on .locked so owned slots never pay backdrop cost across a 100+ grid;
     its instant drop hides under the 340ms gradient fade */
  backdrop-filter: blur(1.6px) saturate(0.92);
  -webkit-backdrop-filter: blur(1.6px) saturate(0.92);
}
/* Small "Not Collected" tag instead of an opaque veil. */
.tcg-slot.locked::after {
  content: 'Not Collected'; position: absolute; z-index: 3;
  left: 50%; bottom: 6px; transform: translateX(-50%);
  font-size: 8px; font-weight: 600; letter-spacing: 0.04em; white-space: nowrap;
  color: rgba(255,255,255,0.84);
  background: rgba(20,18,16,0.52); border: 1px solid rgba(255,255,255,0.15);
  padding: 2.5px 8px; border-radius: var(--r-pill);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
}
/* When a card has multiple printings, lift the tag so the variant badge stays clear. */
.tcg-slot.locked:has(.tcg-slot-vbadge)::after { bottom: 20px; }
.tcg-slot.owned .tcg-slot-img { filter: none; transform: none; }
.tcg-slot-mono { font-family: var(--display); font-size: 26px; color: color-mix(in srgb, var(--gold) 50%, transparent); }
.tcg-slot-num {
  position: absolute; top: 4px; left: 5px; z-index: 2; font-size: 9.5px; font-variant-numeric: tabular-nums;
  color: var(--muted-strong); background: rgba(0,0,0,0.45); padding: 1px 5px; border-radius: var(--r-pill);
  /* Long alphanumeric serials (e.g. "LOB-EN001") truncate instead of overrunning
     the slot; the full number is always shown on the card sheet. */
  max-width: calc(100% - 36px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tcg-slot.owned .tcg-slot-num { color: #fff; }
.tcg-slot-vbadge {
  position: absolute; bottom: 4px; right: 5px; z-index: 2; font-size: 9px; font-variant-numeric: tabular-nums;
  color: hsl(var(--game-hue, 44) 62% 72%); background: rgba(0,0,0,0.55); padding: 1px 5px; border-radius: var(--r-pill);
}
.tcg-slot-vbadge.full { background: hsl(var(--game-hue, 44) 55% 66%); color: #1a1408; font-weight: 700; } /* every printing owned */

.tcg-sheet { padding: 4px 4px 8px; }
.tcg-sheet-art {
  position: relative;
  max-height: 46vh; margin: 0 auto 18px; border-radius: 14px; overflow: hidden; width: fit-content;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 10%, rgba(255,246,226,0.06), transparent 60%), linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border); box-shadow: var(--elev-3);
}
.tcg-sheet-art img { height: 46vh; max-width: 100%; object-fit: contain; display: block; transition: filter var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
/* Locked = blurred until you collect a printing; collecting unblurs it. */
.tcg-sheet-art.locked img { filter: grayscale(0.28) brightness(0.74) blur(2.6px); transform: scale(1.02); }
.tcg-sheet-art.owned img { filter: none; transform: none; }
.tcg-sheet-art.owned { border-color: var(--gold-border); }
/* Holographic foil — rainbow interference that tracks pointer/tilt (--hx/--hy ∈ [-0.5,0.5]).
   color-dodge over the art reads exactly like holo stock catching the light. */
.tcg-sheet-holo { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; mix-blend-mode: color-dodge;
  background:
    radial-gradient(140% 110% at calc(50% + var(--hx, 0) * 60%) calc(45% + var(--hy, 0) * 50%), rgba(255,255,255,0.30), transparent 42%),
    conic-gradient(from calc(var(--hx, 0) * 140deg) at calc(50% + var(--hx, 0) * 30%) calc(50% + var(--hy, 0) * 30%),
      hsla(0, 90%, 70%, 0.15), hsla(60, 90%, 70%, 0.13), hsla(120, 90%, 70%, 0.13),
      hsla(180, 90%, 70%, 0.15), hsla(240, 90%, 70%, 0.13), hsla(300, 90%, 70%, 0.13), hsla(0, 90%, 70%, 0.15));
  transition: opacity var(--dur-slow) var(--ease); }
.tcg-sheet-art.owned .tcg-sheet-holo { opacity: 1; }
.tcg-price-trend { display: flex; align-items: center; gap: 8px; margin: 4px 0 2px; font-size: 11.5px; color: var(--muted); }
.tcg-trend-delta.gain { color: var(--gain); }
.tcg-trend-delta.loss { color: var(--loss); }

/* Snapshot share sheet */
.snapshot-sheet { max-width: 420px; }
.snapshot-body { padding: 14px; }
.snapshot-preview img { width: 100%; border-radius: var(--r-card); border: 1px solid var(--border-strong); display: block; box-shadow: var(--elev-2); }
.snapshot-toggle { display: flex; align-items: center; gap: 9px; margin: 12px 2px; font-size: 13.5px; color: var(--muted-strong); }
.snapshot-sheet .btn-row { display: flex; gap: 10px; }
.snapshot-sheet .btn-row .btn { flex: 1; }

/* PokéDex */
.dex-open-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 14px; margin-bottom: 14px; border-radius: var(--r-card); background: linear-gradient(135deg, rgba(201,168,76,0.10), rgba(255,255,255,0.03)); border: 1px solid var(--gold-border); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.dex-open-btn:active { transform: scale(0.99); transition-duration: 0.08s; }
.dex-open-ico { color: var(--gold-light); display: flex; }
.dex-open-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dex-open-text b { font-size: 15px; }
.dex-open-text small { font-size: 11.5px; color: var(--muted); }
.dex-open-go { font-size: 18px; opacity: 0.5; }
.dex-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.dex-head-title { font-family: var(--display); font-size: 22px; color: var(--gold-light); }
.dex-head-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; max-width: 250px; }
.dex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.dex-cell { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.07); color: var(--muted); font: inherit; text-align: left; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 50px; }
.dex-cell:active { transform: scale(0.97); transition-duration: 0.08s; }
.dex-cell .dex-num { font-size: 10px; letter-spacing: 0.05em; opacity: 0.6; font-variant-numeric: tabular-nums; }
.dex-cell .dex-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dex-cell.caught { background: color-mix(in srgb, var(--gold-dim) 60%, var(--surface)); border-color: var(--gold-border); color: var(--text); }
.dex-cell.caught .dex-name { color: var(--gold-light); }
.dex-cell.no-cards { opacity: 0.38; cursor: default; }
.dex-check { position: absolute; top: 7px; right: 8px; font-size: 11px; color: var(--gold-light); }
.dex-results .coll-result-sub { font-size: 10.5px; }

/* Card-morph transitions: the page must stay still while the art flies — only
   the named element animates. (navigate()'s root slide is for screen changes.) */
.vt-morph::view-transition-old(root),
.vt-morph::view-transition-new(root) { animation: none; }

/* [11] the cost-to-complete line under the binder counts */
.binder-complete-cost { margin: 6px 0 2px; font-size: 12.5px; color: var(--muted-strong); }
.binder-complete-cost b { color: var(--gold-light); }
@media (prefers-reduced-motion: reduce) { .tcg-sheet-holo { opacity: 0 !important; } }
/* One-shot holo sweep when a printing is owned — sharpen first, then the foil catches the light. */
.tcg-sheet-art::after { content: ''; position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 36%, hsla(var(--game-hue, 44), 90%, 84%, 0.26) 47%, rgba(255,255,255,0.20) 50%, transparent 62%);
  transform: translateX(-130%); }
.tcg-sheet-art.just-owned::after { animation: foil-sweep 0.6s var(--ease) 0.12s; }
@keyframes foil-sweep { 0% { transform: translateX(-130%); opacity: 1; } 100% { transform: translateX(130%); opacity: 1; } }
.tcg-sheet-locktag {
  position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text); background: rgba(0,0,0,0.55); border: 1px solid var(--glass-border);
  padding: 4px 12px; border-radius: var(--r-pill); backdrop-filter: blur(var(--blur-1));
}
.tcg-sheet-art.owned .tcg-sheet-locktag { display: none; }
/* Credit when a card's art comes from the community pool (not the user's own). */
.tcg-sheet-community {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 11px; letter-spacing: 0.03em;
  color: var(--text); background: rgba(0,0,0,0.55); border: 1px solid var(--glass-border);
  padding: 4px 10px; border-radius: var(--r-pill); backdrop-filter: blur(var(--blur-1));
}
.tcg-sheet-mono { font-family: var(--display); font-size: 60px; color: color-mix(in srgb, var(--gold) 55%, transparent); padding: 44px 64px; }
.tcg-sheet-num { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: hsl(var(--game-hue, 44) 60% 72%); margin-bottom: 4px; }
.tcg-sheet-name { font-family: var(--display); font-weight: 500; font-size: 27px; color: var(--text); margin-bottom: 16px; }
.tcg-sheet-label { font-size: 12px; color: var(--muted); margin-bottom: 10px; }
/* Printing chips as a tappable checklist — a clear box that fills gold with a
   spring-in check when you own that printing. */
.tcg-variant-chips { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.tcg-chip {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border-radius: var(--r-input);
  background: var(--glass-bg); border: 1px solid var(--border-strong); color: var(--muted-strong); font-size: 15px; text-align: left;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
}
.tcg-chip:active { transform: scale(0.985); transition-duration: 0.06s, var(--dur-base), var(--dur-base), var(--dur-base); }
.tcg-chip-box {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 7px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border-strong); color: transparent;
  transition: background var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.tcg-chip-box svg { width: 15px; height: 15px; transform: scale(0.3); transition: transform var(--dur-base) var(--ease-spring); }
.tcg-chip-label { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tcg-chip-name { display: block; }
.tcg-chip-sub { font-size: 11px; font-weight: 600; color: hsl(var(--game-hue, 44) 45% 64%); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.tcg-chip.owned { background: hsl(var(--game-hue, 44) 58% 50% / 0.16); border-color: hsl(var(--game-hue, 44) 55% 55% / 0.4); color: hsl(var(--game-hue, 44) 62% 75%); }
.tcg-chip.owned .tcg-chip-box { background: hsl(var(--game-hue, 44) 55% 66%); border-color: hsl(var(--game-hue, 44) 55% 66%); color: #1a1408; }
/* Owned chip + its Details button share a row. */
.tcg-chip-row { display: flex; gap: 8px; width: 100%; align-items: stretch; }
.tcg-chip-row .tcg-chip { width: auto; flex: 1; }
.tcg-chip-detail {
  flex: 0 0 auto; width: 46px; border-radius: var(--r-input);
  background: var(--glass-bg); border: 1px solid var(--border-strong);
  color: hsl(var(--game-hue, 44) 55% 70%); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease);
}
.tcg-chip-detail:active { transform: scale(0.96); }
.tcg-chip-detail { transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease), color var(--dur-base) var(--ease), opacity var(--dur-base) var(--ease); }
.tcg-promote-wrap > * { transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease); }
@media (prefers-reduced-motion: no-preference) {
  @starting-style { .tcg-chip-detail { opacity: 0; transform: scale(0.9); } }
  @starting-style { .tcg-promote-wrap > * { opacity: 0; transform: translateY(6px); } }
}
.tcg-chip-detail:hover { border-color: hsl(var(--game-hue, 44) 55% 55% / 0.5); color: hsl(var(--game-hue, 44) 60% 78%); }
/* Owned-card detail sheet fields (reuses .sheet-overlay / .edit-coll-* chrome). */
.sheet-title-sub { font-family: var(--body); font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }
.owned-detail-field { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.owned-detail-field > span { font-size: 13px; font-weight: 600; color: var(--muted-strong); }
.owned-detail-col { flex-direction: column; align-items: flex-start; }
.owned-detail-col > span { margin-bottom: 8px; }
.owned-qty { display: flex; align-items: center; gap: 4px; }
.owned-qty button { width: 34px; height: 34px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-size: 18px; line-height: 1; cursor: pointer; }
.owned-qty button:active { transform: scale(0.94); }
.owned-qty b { min-width: 34px; text-align: center; font-variant-numeric: tabular-nums; font-size: 17px; }
.owned-conds { display: flex; flex-wrap: wrap; gap: 6px; }
.owned-cond { padding: 7px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted-strong); font-size: 13px; font-weight: 600; cursor: pointer; }
.owned-cond:active { transform: scale(0.96); }
.owned-cond.on { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }
/* Slabbed-card fields: grade + cert side by side once a grading company is picked */
.owned-slab-row { display: flex; gap: 10px; }
.owned-slab-row .edit-coll-field { flex: 1 1 0; min-width: 0; }
/* "PSA 10" slab tag on an owned chip's subtitle — gold pill so a graded copy reads
   at a glance in the printings list */
.tcg-chip-slab.is-slab {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  background: var(--gold-dim); border: 1px solid var(--gold-border); color: var(--gold-light);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; vertical-align: 1px;
}

/* Subscriber card-photo control + the user's-own-photo treatment */
.tcg-card-photo { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-top: 13px; }
.tcg-photo-note { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.tcg-photo-share { flex-basis: 100%; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-strong); cursor: pointer; }
.tcg-photo-share input { width: 16px; height: 16px; accent-color: hsl(var(--game-hue, 44) 58% 55%); cursor: pointer; }
.tcg-photo-btn {
  flex: 0 0 auto; cursor: pointer; font: inherit; font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: var(--r-pill);
  color: hsl(var(--game-hue, 44) 62% 76%); background: hsl(var(--game-hue, 44) 55% 50% / 0.14);
  border: 1px solid hsl(var(--game-hue, 44) 55% 55% / 0.35);
  transition: transform var(--dur-fast) var(--ease);
}
.tcg-photo-btn:active { transform: scale(0.97); }
.tcg-photo-rm { cursor: pointer; font: inherit; font-size: 12px; color: var(--muted); background: none; border: none; padding: 4px; }
.tcg-photo-rm:hover { color: var(--loss); }
/* The user's own photo is their real card — never blur or dim it. */
.tcg-slot.user-photo .tcg-slot-img, .tcg-sheet-art.user-photo img { filter: none; transform: none; }
.tcg-slot.user-photo::after { display: none; }
@media (prefers-reduced-motion: reduce) { .tcg-photo-btn:active { transform: none; } }
.tcg-chip.owned .tcg-chip-box svg { transform: scale(1); }
.tcg-promote-btn { width: 100%; padding: 13px; font-size: 14.5px; }
/* Done-state after a card is promoted — non-actionable, clearly "already tracked". */
.tcg-promote-btn.is-done {
  width: 100%; padding: 13px; font-size: 14px; font-weight: 600; cursor: default;
  border-radius: var(--r-input); color: hsl(145 45% 64%);
  background: hsl(145 40% 45% / 0.14); border: 1px solid hsl(145 40% 50% / 0.4);
}

.sets-empty { text-align: center; padding: 60px 24px; color: var(--muted); }
.sets-empty h2 { font-family: var(--display); font-size: 24px; color: var(--text); margin-bottom: 8px; }
/* A picker's no-match state lands INSIDE the .watch-results grid — span all columns
   (so it isn't squished into one), tighten the padding, and lead with a soft glyph. */
.watch-results > .sets-empty { grid-column: 1 / -1; padding: 34px 16px; }
.watch-results > .sets-empty::before {
  content: '🔍'; display: block; font-size: 26px; opacity: .4; margin-bottom: 8px;
}
.watch-results > .sets-empty p { font-size: 13.5px; line-height: 1.5; margin: 0; }

/* Game/domain picker tiles (Pokémon, Magic, Books, …) */
.game-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .game-grid { grid-template-columns: 1fr 1fr; } }
/* Collect-tab section headers (Trading Cards / Figures) */
.coll-section-label {
  font-family: var(--display); font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted-strong, var(--muted)); margin: 18px 2px 10px;
}
.coll-games > .coll-section-label:first-child { margin-top: 6px; }
/* "Your <collectible>" rail header: title on the left, an owned-count chip on the right. */
.coll-rail-label { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.coll-rail-count { flex: 0 0 auto; font-size: 11px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--muted); }

/* Custom Collection (binder) tiles on the Collections tab. */
.coll-list-new { flex: 0 0 auto; font: inherit; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; cursor: pointer; color: var(--gold); background: none; border: 0; padding: 0; }
.coll-list-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-bottom: 6px; }
@media (min-width: 480px) { .coll-list-grid { grid-template-columns: repeat(3, 1fr); } }

/* ---- Binders tab ---- */
.binders-header { display: flex; align-items: center; justify-content: space-between; }
.binders-new-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 13px; border-radius: var(--r-pill); font: inherit; font-size: 13px; font-weight: 600; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); cursor: pointer; transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.binders-new-btn:hover { background: color-mix(in srgb, var(--gold) 22%, transparent); }
.binders-new-btn:active { transform: scale(0.96); }
.binders-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; margin-top: 4px; }
@media (min-width: 480px) { .binders-grid { grid-template-columns: repeat(3, 1fr); } }
/* Binder cover — fanned art + comic halftone + gold spine */
.binder-cover { --cc: var(--gold); position: relative; aspect-ratio: 4 / 5; border-radius: var(--r-card); overflow: hidden; border: 1px solid var(--border-strong); background: var(--surface-2); box-shadow: var(--elev-2); padding: 0; cursor: pointer; text-align: left; transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease); }
.binder-cover:hover { box-shadow: var(--elev-3); }
.binder-cover:active { transform: scale(0.97); }
.binder-cover-bg { position: absolute; inset: 0; background: radial-gradient(130% 80% at 22% 0%, color-mix(in srgb, var(--cc) 46%, transparent), transparent 60%), linear-gradient(160deg, color-mix(in srgb, var(--cc) 30%, var(--surface-3)), var(--surface)); }
.binder-cover-halftone { position: absolute; inset: 0; background-image: radial-gradient(color-mix(in srgb, var(--cc) 65%, transparent) 1px, transparent 1.6px); background-size: 7px 7px; opacity: 0.16; mix-blend-mode: screen; }
.binder-cover-spine { position: absolute; left: 0; top: 0; bottom: 0; width: 5px; z-index: 5; background: linear-gradient(var(--gold-light), var(--gold), var(--gold-bright)); box-shadow: 1px 0 7px color-mix(in srgb, var(--gold) 55%, transparent); }
.binder-cover-fan { position: absolute; inset: 0 0 16% 0; display: flex; align-items: center; justify-content: center; }
.binder-cover-card { position: absolute; width: 54%; aspect-ratio: 5 / 7; object-fit: cover; border-radius: 6px; border: 1.5px solid rgba(255,255,255,0.14); box-shadow: 0 7px 18px rgba(0,0,0,0.55); transform-origin: bottom center; transform: rotate(calc((var(--k) - (var(--kn) - 1) / 2) * 13deg)) translateY(calc((var(--k) - (var(--kn) - 1) / 2) * (var(--k) - (var(--kn) - 1) / 2) * -3px)); }
.binder-cover-card:nth-child(2) { z-index: 3; }
.binder-cover-card:nth-child(1), .binder-cover-card:nth-child(3) { z-index: 2; }
.binder-cover-mono { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 60px; font-weight: 600; color: color-mix(in srgb, var(--cc) 55%, #fff); opacity: 0.45; }
/* Smart placeholder: the binder's dominant-category scene (photo or crafted vector,
   with the premium frame) fills the cover behind the chrome; the monogram becomes a
   soft watermark so the scene reads as the thumbnail, not the letter. */
.binder-cover-scene { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.binder-cover-scene .cat-placeholder-wrap,
.binder-cover-scene .cat-placeholder { width: 100%; height: 100%; border-radius: 0; }
.binder-cover.has-scene .binder-cover-bg { opacity: 0.35; }
.binder-cover.has-scene .binder-cover-halftone { opacity: 0.08; }
.binder-cover.has-scene .binder-cover-mono { z-index: 2; font-size: 44px; opacity: 0.22; color: #fff; mix-blend-mode: soft-light; }
.binder-cover-scrim { position: absolute; inset: 0; z-index: 4; background: linear-gradient(to top, rgba(8,7,6,0.94) 8%, rgba(8,7,6,0.45) 32%, transparent 54%); }
.binder-cover-meta { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; padding: 11px 12px 11px 14px; display: flex; flex-direction: column; gap: 1px; }
.binder-cover-name { font-family: var(--display); font-size: 18px; font-weight: 600; color: #fff; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.binder-cover-count { font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em; color: color-mix(in srgb, var(--gold-light) 88%, #fff); text-transform: uppercase; }
/* Kind glyph in the cover's top corner */
.binder-cover-kind { position: absolute; top: 8px; right: 8px; z-index: 6; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: color-mix(in srgb, var(--gold-light) 90%, #fff); background: rgba(10,8,6,0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1); }
.binder-cover-kind svg { width: 15px; height: 15px; }

/* Pin/favorite star on a binder cover (top-LEFT; the kind icon owns top-right) */
.binder-fav { position: absolute; top: 8px; left: 8px; z-index: 7; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); cursor: pointer; color: rgba(255,255,255,0.82); background: rgba(10,8,6,0.40); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10); opacity: 0; transform: scale(0.9); transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.binder-fav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.binder-cover:hover .binder-fav, .binder-fav:focus-visible { opacity: 1; transform: none; }
.binder-fav.is-fav { opacity: 1; transform: none; color: var(--gold-light); }
.binder-fav.is-fav svg { fill: var(--gold-light); stroke: var(--gold-light); }
.binder-fav:active { transform: scale(0.88); }
/* Touch devices have no hover — keep the star faintly visible so it's discoverable */
@media (hover: none) { .binder-fav { opacity: 0.5; transform: none; } .binder-fav.is-fav { opacity: 1; } }

/* Binder grouping sections (a pinned Favorites rail + by-category sections) */
.binder-section { margin-bottom: 6px; }
.binder-grid-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 16px 2px 9px; }
.binder-section:first-child .binder-grid-head { margin-top: 4px; }

/* Binder kind subtitle (in the detail head) */
.binder-detail-kind { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin-top: 4px; padding: 2px 8px 2px 6px; border-radius: var(--r-pill); font-family: var(--body); font-size: 11px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); }
.binder-detail-kind svg { width: 13px; height: 13px; }

/* Card-binder page — a real 9-pocket sheet */
.binder-pages { display: flex; flex-direction: column; gap: 18px; }
.binder-page { position: relative; padding: 14px; border-radius: 16px; background: linear-gradient(160deg, var(--surface-3), var(--surface-2)); border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 10px 30px rgba(0,0,0,0.25); }
.binder-page-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.binder-pocket { position: relative; aspect-ratio: 5 / 7; border-radius: 9px; border: 0; padding: 0; background: rgba(255,255,255,0.025); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06), inset 0 2px 8px rgba(0,0,0,0.35); overflow: hidden; }
.binder-pocket.filled, .binder-pocket.back { cursor: pointer; transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease); }
.binder-pocket.filled:hover, .binder-pocket.back:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.08), 0 10px 22px rgba(0,0,0,0.4); }
.binder-pocket.filled:active, .binder-pocket.back:active { transform: scale(0.97); }
.binder-pocket img { width: 100%; height: 100%; object-fit: cover; display: block; }
.binder-pocket-gloss { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(125deg, rgba(255,255,255,0.16) 0%, transparent 32%, transparent 70%, rgba(255,255,255,0.06) 100%); }
.binder-pocket.back { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; background: linear-gradient(150deg, var(--gold-dim), rgba(0,0,0,0.25)); }
.binder-pocket-mono { font-family: var(--display); font-size: 26px; font-weight: 600; color: color-mix(in srgb, var(--gold-light) 70%, #fff); opacity: 0.85; }
.binder-pocket-bname { font-size: 9.5px; line-height: 1.2; font-weight: 600; color: var(--muted-strong); text-align: center; max-width: 100%; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.binder-pocket.empty { background: rgba(255,255,255,0.012); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.035); }
.binder-page-no { margin-top: 12px; text-align: center; font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

/* New-binder sheet — name + kind picker */
.binder-new-body { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.binder-new-field { display: flex; flex-direction: column; gap: 6px; }
.binder-new-flabel { font-size: 12px; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--muted); }
.binder-new-field input { width: 100%; padding: 12px 14px; border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--border); font: inherit; font-size: 16px; color: var(--text); outline: none; transition: border-color var(--dur-fast) var(--ease); }
.binder-new-field input:focus { border-color: var(--gold-border); }
.binder-new-field input.shake { animation: binder-shake 0.4s; border-color: var(--loss); }
.binder-new-kinds { display: flex; flex-direction: column; gap: 8px; }
.binder-kind-opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 12px; border-radius: var(--r-card); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease); }
.binder-kind-opt:hover { background: var(--surface-3); }
.binder-kind-opt.sel { border-color: var(--gold-border); background: var(--gold-dim); }
.binder-kind-ic { flex: 0 0 auto; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: var(--r-sm); color: var(--gold); background: rgba(0,0,0,0.2); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.binder-kind-ic svg { width: 21px; height: 21px; }
.binder-kind-opt.sel .binder-kind-ic { color: var(--gold-light); background: color-mix(in srgb, var(--gold) 16%, transparent); }
.binder-kind-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.binder-kind-name { font-family: var(--display); font-size: 16px; font-weight: 500; color: var(--text); }
.binder-kind-blurb { font-size: 12px; color: var(--muted); line-height: 1.3; }
.binder-kind-tick { flex: 0 0 auto; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; background: var(--gold); opacity: 0; transform: scale(0.6); transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.binder-kind-tick svg { width: 13px; height: 13px; }
.binder-kind-opt.sel .binder-kind-tick { opacity: 1; transform: scale(1); }
@keyframes binder-shake { 10%,90%{transform:translateX(-1px);} 20%,80%{transform:translateX(2px);} 30%,50%,70%{transform:translateX(-4px);} 40%,60%{transform:translateX(4px);} }
.wiz-shake { animation: binder-shake 0.4s; }
@media (prefers-reduced-motion: reduce) { .wiz-shake, .just-filled, .tcg-sheet-art.just-owned::after, .tcg-slot.sleeve-in, .tcg-slot.sleeve-in::before, #toast.swap, .cars-brand-tile.sel::before, .btn-check { animation: none !important; } .tcg-slot::before { transition: none; } }

/* Binder drag-reorder (long-press) */
.binder-ghost { position: fixed; z-index: 1500; left: 0; top: 0; margin: 0; pointer-events: none; box-shadow: 0 24px 60px rgba(0,0,0,0.55); transition: none; will-change: transform; }
.binder-cover.reorder-src { opacity: 0.3; }
body.binder-reordering { -webkit-user-select: none; user-select: none; }
body.binder-reordering .binders-grid { touch-action: none; }
.binder-cover { touch-action: manipulation; }

/* Binder share button + sheet */
.binder-detail-share { width: 36px; height: 36px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.binder-detail-share:hover { background: var(--surface-3); }
.binder-detail-share:active { transform: scale(0.94); }
.binder-share-body { display: flex; flex-direction: column; gap: 14px; padding-top: 4px; }
.binder-share-hint { font-size: 13.5px; line-height: 1.55; color: var(--muted-strong); margin: 0; }
.binder-share-linkrow { display: flex; gap: 8px; }
.binder-share-linkrow input { flex: 1; min-width: 0; padding: 11px 13px; border-radius: var(--r-input); background: var(--surface-2); border: 1px solid var(--border); font: inherit; font-size: 13px; color: var(--muted-strong); outline: none; }
.binder-share-linkrow .btn { flex: 0 0 auto; width: auto; padding: 12px 18px; }
.binder-share-qr { display: flex; justify-content: center; padding: 4px 0; }
.binder-share-qr canvas { border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,0.35); }
.binder-share-actions { display: flex; gap: 8px; }
.binder-share-actions .btn { flex: 1; }
.binder-share-off { color: var(--loss) !important; }

/* ===== Achievements · XP · rank (Trophies) ===== */
.ach-banner { display: flex; align-items: center; gap: 18px; padding: 20px; border-radius: 20px; margin-bottom: 20px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 17%, var(--surface-2)), var(--surface-1));
  border: 1px solid var(--gold-border); box-shadow: var(--elev-1), inset 0 1px 0 rgba(255,255,255,0.05); }
.ach-rank-ring { position: relative; flex: 0 0 auto; width: 76px; height: 76px; display: flex; align-items: center; justify-content: center; }
.ach-rank-ring .comp-ring-text { display: none; }   /* the ring shows the LEVEL overlay, not its % */
.ach-level { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; pointer-events: none; }
.ach-level b { font-family: var(--display); font-size: 25px; font-weight: 600; color: var(--gold-light); }
.ach-level span { font-size: 8.5px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted); margin-top: 1px; }
.ach-rank-meta { flex: 1; min-width: 0; }
.ach-rank-name { font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--text); line-height: 1.05; }
.ach-rank-tag { font-size: 12.5px; color: var(--muted); margin-bottom: 10px; }
.ach-xp-bar { height: 7px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.ach-xp-bar span { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--gold), var(--gold-light)); box-shadow: 0 0 10px color-mix(in srgb, var(--gold) 60%, transparent); transition: width 0.6s var(--ease); }
.ach-xp-text { font-size: 11px; color: var(--muted-strong); margin-top: 6px; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 12px; }
.ach-badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 5px; padding: 15px 8px 13px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--border); --medal: #9aa3ad; }
.ach-badge.locked { opacity: 0.6; }
.ach-common { --medal: #9aa3ad; } .ach-rare { --medal: #5b9bd5; } .ach-epic { --medal: #a874e0; } .ach-legend { --medal: var(--gold); }
.ach-medal { position: relative; width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 2px; background: var(--surface-2); }
.ach-ic { font-size: 27px; line-height: 1; }
.ach-badge.locked .ach-ic { filter: grayscale(1) opacity(0.5); }
.ach-badge.earned .ach-medal { background: radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--medal) 28%, var(--surface-2)), var(--surface-1)); box-shadow: 0 0 0 2px var(--medal), 0 0 16px color-mix(in srgb, var(--medal) 50%, transparent), inset 0 0 14px color-mix(in srgb, var(--medal) 20%, transparent); }
.ach-badge.earned.ach-legend .ach-medal { animation: ach-foil 3.2s ease-in-out infinite; }
@keyframes ach-foil { 0%,100% { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(229,184,90,0.5); } 50% { box-shadow: 0 0 0 2px var(--gold-light), 0 0 28px rgba(229,184,90,0.85); } }
.ach-prog { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); }
.ach-prog-bg { stroke: var(--surface-3); stroke-width: 2.5; }
.ach-prog-fg { stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; transition: stroke-dasharray 0.5s var(--ease); }
.ach-name { font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2; }
.ach-desc { font-size: 10.5px; color: var(--muted); line-height: 1.3; }
@media (prefers-reduced-motion: reduce) { .ach-badge.earned.ach-legend .ach-medal { animation: none; } .ach-xp-bar span, .ach-prog-fg { transition: none; } }

/* celebration pop — fires when a badge is earned since last view */
.ach-pop { position: fixed; inset: 0; z-index: 2200; display: flex; align-items: center; justify-content: center; background: rgba(6,5,4,0.62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity 0.25s var(--ease); pointer-events: none; --medal: var(--gold); }
.ach-pop.show { opacity: 1; pointer-events: auto; }
.ach-pop.ach-common { --medal: #9aa3ad; } .ach-pop.ach-rare { --medal: #5b9bd5; } .ach-pop.ach-epic { --medal: #a874e0; } .ach-pop.ach-legend { --medal: var(--gold); }
.ach-pop.ach-levelup { --medal: var(--gold); }
.ach-pop-level span { font-family: var(--display); font-size: 44px; font-weight: 600; color: var(--gold-light); line-height: 1; }
.ach-pop-card { position: relative; text-align: center; padding: 30px 36px; border-radius: 24px; transform: scale(0.7); opacity: 0;
  background: linear-gradient(150deg, color-mix(in srgb, var(--medal) 22%, var(--surface-2)), var(--surface-1));
  border: 1px solid color-mix(in srgb, var(--medal) 50%, transparent);
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 40px color-mix(in srgb, var(--medal) 30%, transparent); }
.ach-pop.show .ach-pop-card { animation: ach-pop-in 0.5s var(--ease-spring) forwards; }
@keyframes ach-pop-in { to { transform: scale(1); opacity: 1; } }
.ach-pop-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: color-mix(in srgb, var(--medal) 75%, #fff); margin-bottom: 14px; }
.ach-pop-medal { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 46px;
  background: radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--medal) 32%, var(--surface-2)), var(--surface-1));
  box-shadow: 0 0 0 3px var(--medal), 0 0 30px color-mix(in srgb, var(--medal) 60%, transparent); }
.ach-pop-name { font-family: var(--display); font-size: 24px; font-weight: 600; color: var(--text); }
.ach-pop-xp { font-size: 14px; font-weight: 700; color: color-mix(in srgb, var(--medal) 80%, var(--gold-light)); margin-top: 4px; }
.ach-pop-burst { position: absolute; inset: -45%; pointer-events: none; opacity: 0;
  background: conic-gradient(from 0deg, transparent, color-mix(in srgb, var(--medal) 38%, transparent) 8%, transparent 16%, transparent 50%, color-mix(in srgb, var(--medal) 38%, transparent) 58%, transparent 66%); }
.ach-pop.show .ach-pop-burst { animation: ach-burst 2.6s ease-out; }
@keyframes ach-burst { 0% { transform: rotate(0); opacity: 0; } 12% { opacity: 0.5; } 100% { transform: rotate(150deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ach-pop.show .ach-pop-card { animation: none; transform: none; opacity: 1; } .ach-pop-burst { display: none; } }

/* Home rank chip — tappable level/rank → Trophies */
.home-rank-chip { display: inline-flex; align-items: center; gap: 11px; margin: 16px auto 0; padding: 7px 14px 7px 8px; border-radius: var(--r-pill); cursor: pointer; vertical-align: middle;
  background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 16%, var(--surface-2)), var(--surface-1));
  border: 1px solid var(--gold-border); box-shadow: var(--elev-1);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease); }
.home-rank-chip:active { transform: scale(0.97); }
@media (hover: hover) { .home-rank-chip:hover { border-color: var(--gold); } }
.home-rank-lvl { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  background: radial-gradient(circle at 50% 34%, color-mix(in srgb, var(--gold) 30%, var(--surface-2)), var(--surface-1));
  box-shadow: 0 0 0 1.5px var(--gold-border), inset 0 0 10px color-mix(in srgb, var(--gold) 16%, transparent); }
.home-rank-lvl b { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--gold-light); }
.home-rank-lvl span { font-size: 7px; font-weight: 700; letter-spacing: 0.1em; color: var(--muted); }
.home-rank-mid { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 100px; }
.home-rank-name { font-size: 13px; font-weight: 600; color: var(--text); }
.home-rank-bar { width: 100%; height: 5px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.home-rank-bar span { display: block; height: 100%; border-radius: var(--r-pill); background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 0.6s var(--ease); }
.home-rank-badges { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: var(--gold-light); padding-left: 2px; }
.home-rank-goal { font-size: 11px; font-weight: 600; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .home-rank-bar span { transition: none; } }

/* Treasure Hunt showcase (Hot Wheels TH = green flame / Super TH = spectraflame) */
.th-section { margin-bottom: 22px; padding: 16px; border-radius: 18px; background: linear-gradient(150deg, color-mix(in srgb, #1fae4f 13%, var(--surface-2)), var(--surface-1)); border: 1px solid color-mix(in srgb, #1fae4f 30%, transparent); }
.th-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.th-head-flame { font-size: 27px; filter: drop-shadow(0 0 8px rgba(31,174,79,0.6)); }
.th-title { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--text); }
.th-sub { font-size: 12px; color: var(--muted-strong); margin-top: 1px; }
.th-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 11px; }
.th-card { display: flex; flex-direction: column; gap: 4px; padding: 7px 7px 9px; border-radius: 13px; cursor: pointer; text-align: center; background: var(--surface-1); border: 1px solid color-mix(in srgb, #1fae4f 35%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, #1fae4f 16%, transparent); transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease); }
.th-card:active { transform: scale(0.97); }
@media (hover: hover) { .th-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(0,0,0,0.4), 0 0 16px color-mix(in srgb, #1fae4f 40%, transparent); } }
.th-thumb { position: relative; aspect-ratio: 4 / 3; border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, #1fae4f 16%, var(--surface-3)), var(--surface-1)); }
.th-thumb img { width: 100%; height: 100%; object-fit: cover; }
.th-mono { font-family: var(--display); font-size: 24px; color: color-mix(in srgb, #1fae4f 70%, #fff); opacity: 0.7; }
.th-flame { position: absolute; top: 4px; right: 4px; font-size: 14px; filter: drop-shadow(0 0 4px rgba(0,0,0,0.55)); }
.th-name { font-size: 11px; font-weight: 600; color: var(--text); line-height: 1.2; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.th-tag { font-size: 9px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #3fce6f; }
.th-card.th-super { border-color: transparent;
  background: linear-gradient(var(--surface-1), var(--surface-1)) padding-box, linear-gradient(125deg, #d4af37, #e0457b, #5b9bd5, #a874e0, #d4af37) border-box;
  box-shadow: 0 0 18px rgba(224,69,123,0.22); }
.th-card.th-super .th-thumb { background: radial-gradient(circle at 50% 30%, rgba(224,69,123,0.18), var(--surface-1)); }
.th-card.th-super .th-tag { background: linear-gradient(90deg, #e8c879, #e0457b, #5b9bd5); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
@media (hover: hover) { .th-card.th-super:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 22px rgba(224,69,123,0.4); } }

/* Community directory */
.comm-sub { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); margin: 0 2px 12px; }
.comm-grid { display: flex; flex-direction: column; gap: 10px; }
.comm-card { display: flex; align-items: center; gap: 13px; padding: 12px 14px; border-radius: 16px; text-decoration: none; color: inherit; background: var(--surface-1); border: 1px solid var(--border); transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease); }
/* "Recent finds" feed — display rows under the directory grid */
.comm-feed-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.comm-feed-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border-radius: 14px; text-decoration: none; color: inherit;
  background: var(--surface-1); border: 1px solid var(--border);
  /* The community activity feed grows unbounded — skip off-screen rows.
     Fallback ≈ 44px art + 20px padding + 2px border. */
  content-visibility: auto;
  contain-intrinsic-size: auto 66px;
}
.comm-feed-row:active { transform: scale(0.99); }
.comm-feed-art {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; overflow: hidden;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
}
.comm-feed-art img { width: 100%; height: 100%; object-fit: cover; }
.comm-feed-mono { font-size: 17px; font-weight: 700; color: var(--muted-strong); }
.comm-feed-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.comm-feed-line { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-feed-line b { font-weight: 700; }
.comm-feed-meta { font-size: 11.5px; color: var(--muted); }
.comm-card:active { transform: scale(0.99); }
@media (hover: hover) { .comm-card:hover { transform: translateY(-2px); border-color: var(--gold-border); box-shadow: var(--elev-2); } }
.comm-avatar { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 21px; font-weight: 600; color: var(--gold-light); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--gold) 26%, var(--surface-2)), var(--surface-1)); border: 1px solid var(--gold-border); }
.comm-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.comm-name { font-family: var(--display); font-size: 17px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comm-badges { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 3px; font-size: 14px; font-weight: 700; color: var(--gold-light); }
.comm-empty { text-align: center; padding: 40px 22px; display: flex; flex-direction: column; align-items: center; gap: 8px; }

/* ---------- Inbox · conversations · offers (Phase 3 messaging) ---------- */
.inbox-nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 9px; background: var(--gold); color: #1a1710; font-size: 11px; font-weight: 800; vertical-align: middle; }
.inbox-list { display: flex; flex-direction: column; gap: 8px; }
.inbox-thread { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border-radius: 15px; background: var(--surface-1); border: 1px solid var(--border); color: inherit; cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 68px; transition: transform 0.16s var(--ease), border-color 0.16s var(--ease), box-shadow 0.16s var(--ease); }
.inbox-thread:active { transform: scale(0.99); }
@media (hover: hover) { .inbox-thread:hover { transform: translateY(-2px); border-color: var(--gold-border); box-shadow: var(--elev-2); } }
.inbox-thread.is-unread { border-color: var(--gold-border); background: color-mix(in srgb, var(--gold) 6%, var(--surface-1)); }
.inbox-avatar { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 20px; font-weight: 600; color: var(--gold-light); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--gold) 26%, var(--surface-2)), var(--surface-1)); border: 1px solid var(--gold-border); }
.inbox-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inbox-row1 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.inbox-name { font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-time { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.inbox-row2 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.inbox-snippet { flex: 1; min-width: 0; font-size: 13px; color: var(--muted-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-thread.is-unread .inbox-snippet { color: var(--text); font-weight: 600; }
.inbox-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--gold); color: #1a1710; font-size: 11px; font-weight: 800; }
.inbox-ctx { display: inline-block; max-width: 100%; margin-top: 2px; font-size: 11px; color: var(--gold-light); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Inbox section labels + comment moderation */
.inbox-section-label { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); margin: 20px 2px 9px; }
.inbox-section-label:first-child { margin-top: 2px; }
.inbox-comments { display: flex; flex-direction: column; gap: 8px; }
.inbox-comment { padding: 12px 14px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); content-visibility: auto; contain-intrinsic-size: auto 96px; }
.inbox-comment.is-hidden { opacity: 0.62; }
.inbox-comment-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.inbox-comment-name { font-weight: 600; color: var(--text); font-size: 14px; }
.inbox-comment-flag { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--loss); border: 1px solid color-mix(in srgb, var(--loss) 40%, transparent); border-radius: 6px; padding: 1px 5px; }
.inbox-comment-time { flex: 0 0 auto; font-size: 11px; color: var(--muted); }
.inbox-comment-ctx { font-size: 12px; color: var(--gold-light); margin-top: 2px; }
.inbox-comment-body { font-size: 14px; color: var(--muted-strong); margin-top: 6px; white-space: pre-wrap; word-break: break-word; }
.inbox-comment-actions { display: flex; gap: 16px; margin-top: 9px; }
.inbox-comment-actions .link-btn { font-size: 12px; }

/* Conversation view */
.thread-view { display: flex; flex-direction: column; min-height: 60vh; }
.thread-head { display: flex; align-items: center; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.thread-back { flex: 0 0 auto; background: none; border: none; color: var(--gold-light); font-size: 14px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.thread-head-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thread-peer-link, .thread-peer-name { font-family: var(--display); font-size: 16px; font-weight: 600; color: var(--text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-peer-link:hover { color: var(--gold-light); }
.thread-ctx { font-size: 12px; color: var(--gold-light); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-block { flex: 0 0 auto; }
.link-btn { background: none; border: none; color: var(--muted-strong); font-size: 13px; font-weight: 600; cursor: pointer; padding: 4px 2px; }
.link-btn:hover { color: var(--loss); }
.thread-scroll { flex: 1; display: flex; flex-direction: column; gap: 10px; overflow-y: auto; max-height: 56vh; padding: 4px 2px 12px; }
.thread-msg { display: flex; flex-direction: column; gap: 3px; max-width: 82%; }
.thread-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.thread-msg.is-theirs { align-self: flex-start; align-items: flex-start; }
.msg-bubble { padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; color: var(--text); white-space: pre-wrap; word-break: break-word; background: var(--surface-2); border: 1px solid var(--border); }
.thread-msg.is-mine .msg-bubble { background: color-mix(in srgb, var(--gold) 18%, var(--surface-2)); border-color: var(--gold-border); }
.msg-time { font-size: 10px; color: var(--muted); }
.msg-report { background: none; border: none; color: var(--muted); font-size: 10px; cursor: pointer; padding: 0; text-decoration: underline; }
.msg-report:hover { color: var(--loss); }
.offer-bubble { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.offer-amt { font-family: var(--display); font-size: 19px; font-weight: 700; color: var(--gold-light); }
.offer-pill { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); font-size: 11px; font-weight: 700; background: var(--surface-3); color: var(--muted-strong); }
.offer-pill.is-accepted { background: color-mix(in srgb, var(--gain, #58B368) 24%, var(--surface-2)); color: var(--gain, #58B368); }
.offer-pill.is-declined { background: color-mix(in srgb, var(--loss) 20%, var(--surface-2)); color: var(--loss); }
.offer-note { font-size: 13px; color: var(--muted-strong); }
.offer-actions { display: flex; gap: 8px; margin-top: 4px; }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.thread-composer { display: flex; align-items: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--border); }
.thread-composer textarea { flex: 1 1 auto; min-width: 0; resize: none; min-height: 40px; max-height: 160px; padding: 10px 13px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 14px; line-height: 1.4; }
.thread-composer .btn { flex: 0 0 auto; width: auto; align-self: flex-end; }
.offer-actions .btn { width: auto; }
.thread-composer textarea:focus { outline: none; border-color: var(--gold-border); }
.thread-blocked { padding: 14px; text-align: center; font-size: 13px; color: var(--muted-strong); border-top: 1px solid var(--border); }

/* Compose (deep-linked from a public share page) */
.compose-form { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.compose-label { font-size: 12px; font-weight: 700; color: var(--muted-strong); letter-spacing: 0.02em; text-transform: uppercase; }
.compose-form textarea { resize: vertical; min-height: 96px; padding: 11px 13px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: 14px; line-height: 1.45; }
.compose-form textarea:focus, .compose-amount-row:focus-within { outline: none; border-color: var(--gold-border); }
.compose-amount-row { display: flex; align-items: center; gap: 6px; padding: 0 13px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); }
.compose-cur { font-size: 18px; font-weight: 700; color: var(--gold-light); }
.compose-amount-row input { flex: 1; padding: 12px 0; background: none; border: none; color: var(--text); font: inherit; font-size: 18px; }
.compose-amount-row input:focus { outline: none; }
.compose-form .btn { margin-top: 6px; width: auto; align-self: flex-start; }

/* Shared binder tile value chip */
.binder-tile-val { font-size: 12px; font-weight: 700; color: var(--gold-light); letter-spacing: 0.01em; }
.binder-tile-val.est { color: var(--muted-strong); font-weight: 600; }

/* Collectible binder — a lit shelf of standing pieces */
.binder-shelf { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.binder-shelf-tile { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface-2); overflow: hidden; cursor: pointer; text-align: left; transition: transform 0.16s var(--ease), border-color 0.16s var(--ease); }
.binder-shelf-tile:hover { transform: translateY(-3px); border-color: var(--gold-border); }
.binder-shelf-tile:active { transform: scale(0.98); }
.binder-shelf-stage { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: flex-end; justify-content: center; padding: 14px 14px 0; background: radial-gradient(120% 80% at 50% 18%, color-mix(in srgb, var(--gold) 10%, transparent), transparent 70%), linear-gradient(180deg, var(--surface-3), var(--surface-1)); overflow: hidden; }
.binder-shelf-stage::after { content: ''; position: absolute; left: 8%; right: 8%; bottom: 0; height: 1px; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--gold) 45%, transparent), transparent); }
.binder-shelf-stage img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 12px 14px rgba(0,0,0,0.5)); }
.binder-shelf-mono { font-family: var(--display); font-size: 44px; font-weight: 600; color: color-mix(in srgb, var(--gold-light) 60%, #fff); opacity: 0.5; margin-bottom: 18px; }
.binder-shelf-meta { display: flex; flex-direction: column; gap: 2px; padding: 9px 12px 11px; }
.binder-shelf-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Real-estate binder — wide property cards */
.binder-estate { display: flex; flex-direction: column; gap: 12px; }
.binder-estate-row { display: flex; flex-direction: column; padding: 0; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface-2); overflow: hidden; cursor: pointer; text-align: left; transition: transform 0.16s var(--ease), border-color 0.16s var(--ease); }
.binder-estate-row:hover { transform: translateY(-2px); border-color: var(--gold-border); }
.binder-estate-row:active { transform: scale(0.99); }
.binder-estate-banner { position: relative; aspect-ratio: 16 / 9; background: var(--surface-3); overflow: hidden; }
.binder-estate-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.binder-estate-noimg { position: absolute; inset: 0; background: linear-gradient(135deg, var(--surface-3), var(--surface-1)); }
.binder-estate-info { display: flex; flex-direction: column; gap: 2px; padding: 11px 14px 13px; }
.binder-estate-name { font-family: var(--display); font-size: 16px; font-weight: 500; color: var(--text); }
.binder-estate-addr { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.binder-estate-info .binder-tile-val { margin-top: 3px; font-size: 14px; }

/* Hybrid binder — section labels between the pocket page and the shelf */
.binder-section-label { display: flex; align-items: center; gap: 8px; margin: 18px 2px 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.binder-section-label:first-child { margin-top: 2px; }
.binder-section-label span { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font-size: 10.5px; color: var(--gold); background: var(--gold-dim); }

/* Card item's detail hero -> 3D viewer affordance */
.detail-photo-track.is-card, .detail-photo-track.is-card img { cursor: pointer; }
.detail-cv-hint { position: absolute; right: 12px; bottom: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: #fff; background: rgba(12,10,8,0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); pointer-events: none; }
.detail-cv-hint svg { width: 13px; height: 13px; }

/* Premium 3D card viewer */
.card-viewer { position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(6,5,4,0.93); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); opacity: 0; transition: opacity 0.22s var(--ease); padding: calc(24px + var(--safe-t)) 20px calc(20px + var(--safe-b)); }
.card-viewer.show { opacity: 1; }
.card-viewer-stage { flex: 1; width: 100%; display: flex; align-items: center; justify-content: center; perspective: 1100px; touch-action: none; overflow: hidden; }
.card-viewer-card { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --zoom: 1; --panx: 0px; --pany: 0px; position: relative; max-height: 76vh; max-width: 88vw; aspect-ratio: 5 / 7; border-radius: 16px; transform-style: preserve-3d; transform: translate(var(--panx), var(--pany)) scale(var(--zoom)) rotateX(var(--rx)) rotateY(var(--ry)); transition: transform 0.12s ease-out; box-shadow: 0 34px 90px rgba(0,0,0,0.72), 0 0 0 1px rgba(255,255,255,0.07); will-change: transform; cursor: grab; }
.card-viewer.show .card-viewer-card { animation: cv-in 0.42s var(--ease-spring) both; }
@keyframes cv-in { from { opacity: 0; transform: scale(0.82); } }
.card-viewer-card img { width: 100%; height: 100%; object-fit: contain; border-radius: 16px; display: block; -webkit-user-drag: none; user-select: none; }
.card-viewer-foil { position: absolute; inset: 0; border-radius: 16px; pointer-events: none; mix-blend-mode: color-dodge; opacity: 0.5; background: linear-gradient(115deg, transparent 30%, hsla(190,90%,70%,0.55) 42%, hsla(50,95%,65%,0.55) 50%, hsla(320,90%,68%,0.55) 58%, transparent 70%); background-size: 220% 220%; background-position: var(--mx) var(--my); }
.card-viewer-glare { position: absolute; inset: 0; border-radius: 16px; pointer-events: none; mix-blend-mode: overlay; background: radial-gradient(60% 55% at var(--mx) var(--my), rgba(255,255,255,0.5), transparent 60%); }
.card-viewer-close { position: absolute; top: calc(14px + var(--safe-t)); right: 16px; z-index: 2; width: 42px; height: 42px; border-radius: 50%; background: rgba(255,255,255,0.13); border: none; color: #fff; display: flex; align-items: center; justify-content: center; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer; }
.card-viewer-close:active { transform: scale(0.92); }
.card-viewer-name { font-family: var(--display); font-size: 21px; font-weight: 500; color: #fff; text-align: center; margin-top: 16px; padding: 0 20px; }
.card-viewer-hint { font-size: 11px; color: rgba(255,255,255,0.5); letter-spacing: 0.04em; margin-top: 6px; }
@media (prefers-reduced-motion: reduce) { .card-viewer-card { transition: none; } .card-viewer.show .card-viewer-card { animation: none; } }
.binders-empty { text-align: center; padding: 40px 26px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.binders-empty-icon { width: 64px; height: 64px; border-radius: 18px; display: flex; align-items: center; justify-content: center; color: var(--gold); background: var(--gold-dim); border: 1px solid var(--gold-border); }
.binders-empty-title { font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--text); }
.binders-empty-text { font-size: 14px; line-height: 1.55; color: var(--muted-strong); max-width: 320px; }
.binders-empty .btn { margin-top: 6px; }
/* Binder detail (in the Binders tab) */
.binder-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.binder-back, .binder-detail-menu { width: 36px; height: 36px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.binder-back:hover, .binder-detail-menu:hover { background: var(--surface-3); }
.binder-back:active, .binder-detail-menu:active { transform: scale(0.94); }
.binder-detail-title { flex: 1; min-width: 0; display: flex; flex-direction: column; font-family: var(--display); font-size: 22px; font-weight: 500; color: var(--text); line-height: 1.1; }
.binder-detail-count { font-family: var(--body); font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0.02em; margin-top: 2px; }
.binder-add-btn { display: inline-flex; align-items: center; gap: 6px; width: 100%; justify-content: center; padding: 11px; border-radius: var(--r-card); margin-bottom: 14px; font: inherit; font-size: 14px; font-weight: 600; color: var(--gold); background: var(--gold-dim); border: 1px dashed var(--gold-border); cursor: pointer; transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.binder-add-btn:hover { background: color-mix(in srgb, var(--gold) 18%, transparent); }
.binder-add-btn:active { transform: scale(0.99); }
.binder-detail-empty { text-align: center; padding: 36px 20px; color: var(--muted-strong); font-size: 14px; line-height: 1.6; }
/* Cross-vault item picker */
.binder-pick { max-height: 82vh; display: flex; flex-direction: column; }
.binder-pick-search { display: flex; align-items: center; gap: 8px; margin: 4px 0 10px; padding: 9px 13px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); }
.binder-pick-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 15px; color: var(--text); }
.binder-pick-body { flex: 1; overflow-y: auto; min-height: 120px; display: flex; flex-direction: column; gap: 4px; }
.binder-pick-row { display: flex; align-items: center; gap: 11px; padding: 7px 8px; border-radius: var(--r-input); cursor: pointer; content-visibility: auto; contain-intrinsic-size: auto 58px; transition: background var(--dur-fast) var(--ease); }
.binder-pick-row:hover { background: var(--surface-2); }
.binder-pick-row > input { position: absolute; opacity: 0; pointer-events: none; }
.binder-pick-thumb { width: 44px; height: 44px; flex: 0 0 auto; border-radius: var(--r-input); overflow: hidden; position: relative; }
.binder-pick-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.binder-pick-name { font-size: 14px; font-weight: 500; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.binder-pick-cat { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.binder-pick-check { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 50%; display: flex; align-items: center; justify-content: center; border: 1.5px solid var(--border-strong); color: transparent; transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease); }
.binder-pick-row > input:checked ~ .binder-pick-check { background: var(--gold); border-color: var(--gold); color: #1a1206; }
.binder-pick-count { flex: 1; font-size: 12.5px; color: var(--muted); }

/* "Your collection" unified owned browser (Collections tab) */
.owned-head { margin-top: 8px; }
.owned-chips { display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; padding-bottom: 2px; margin-bottom: 12px; }
.owned-chips::-webkit-scrollbar { display: none; }
.filter-chip, .owned-chip { position: relative; }
.filter-chip::after, .owned-chip::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); height: 44px; }
.owned-chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-pill); font: inherit; font-size: 12.5px; font-weight: 500; color: var(--muted-strong); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease); }
.owned-chip span { font-size: 11px; font-weight: 600; color: var(--muted); }
.owned-chip:hover { color: var(--text); }
.owned-chip:active { transform: scale(0.96); }
.owned-chip.active { color: #1a1206; background: var(--gold); border-color: var(--gold); }
.owned-chip.active span { color: color-mix(in srgb, #1a1206 65%, transparent); }
.owned-grid { margin-bottom: 6px; }
.owned-empty { text-align: center; padding: 30px 20px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.owned-empty-inline { grid-column: 1 / -1; padding: 22px 20px; }
.coll-list-tile {
  display: flex; align-items: center; gap: 11px; text-align: left; cursor: pointer; width: 100%;
  padding: 11px 12px; border-radius: var(--r-card);
  background: linear-gradient(160deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border); box-shadow: var(--elev-1);
  transition: transform var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.coll-list-tile:active { transform: scale(0.98); }
.coll-list-tile:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (hover: hover) { .coll-list-tile:hover { transform: translateY(-2px); border-color: var(--gold-border); box-shadow: var(--elev-2); } }
.coll-list-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 11px; font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--cc, var(--gold)) 20%, var(--surface-2));
  border: 1px solid var(--border);
}
.coll-list-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.coll-list-name { font-size: 13.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coll-list-count { font-size: 11.5px; color: var(--muted); }
.game-tile {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px; text-align: left; color: var(--text);
  padding: 18px; min-height: 94px; border-radius: var(--r-card);
  /* Per-game accent: a deterministic hue (set inline as --game-hue) tints the wash. */
  background: radial-gradient(140% 120% at 0% 0%, hsla(var(--game-hue, 44), 60%, 55%, 0.13), transparent 60%), var(--glass-bg);
  border: 1px solid var(--glass-border); box-shadow: var(--elev-1);
}
/* Real card art (the game's newest chase card) as a cinematic tile background,
   a legibility scrim, and a slow holographic sheen sweeping across like a holo card. */
.game-tile-hero { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 82% 16%; opacity: 0.62; z-index: 0; }
.game-tile.has-hero::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(96deg, var(--surface-1) 15%, hsla(var(--game-hue, 44), 35%, 9%, 0.55) 52%, transparent 100%); }
.game-tile-shine { position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(118deg, transparent 38%, hsla(var(--game-hue, 44), 85%, 82%, 0.16) 47%, rgba(255,255,255,0.12) 50%, transparent 60%);
  background-size: 260% 100%; animation: game-shine 5.5s linear infinite; }
@keyframes game-shine { 0% { background-position: 150% 0; } 100% { background-position: -50% 0; } }
.game-tile-badge, .game-tile-text, .game-tile > .comp-ring, .game-tile-add { position: relative; z-index: 2; }
.game-tile-badge {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 24px; font-weight: 600;
  color: hsl(var(--game-hue, 44), 55%, 82%);
  background: linear-gradient(150deg, hsla(var(--game-hue, 44), 55%, 50%, 0.30), hsla(var(--game-hue, 44), 55%, 40%, 0.12));
  border: 1px solid hsla(var(--game-hue, 44), 55%, 65%, 0.34);
  box-shadow: inset 0 1px 0 hsla(var(--game-hue, 44), 60%, 80%, 0.18);
}
.game-tile-text { flex: 1; min-width: 0; }
.game-tile-name { font-family: var(--display); font-size: 21px; font-weight: 500; color: var(--text); }
.game-tile-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

/* ---- Collections overview + cross-collection card search ---- */
.coll-overview {
  display: flex; align-items: center; gap: 16px; padding: 4px 4px 16px; margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.coll-overview-text { min-width: 0; }
.coll-overview-main { color: var(--muted); }
.coll-overview-main b { font-family: var(--display); font-size: 27px; color: var(--gold-light); font-variant-numeric: tabular-nums; margin-right: 5px; }
.coll-overview-main span { font-size: 13px; }
.coll-overview-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-variant-numeric: tabular-nums; }

.coll-search {
  display: flex; align-items: center; gap: 8px; margin: 0 0 16px;
  padding: 11px 14px; border-radius: var(--r-pill);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
}
.coll-search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 15px; color: var(--text); }
.coll-search input::placeholder { color: var(--muted); }
.coll-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.coll-search:focus-within { border-color: color-mix(in srgb, var(--gold-light) 50%, var(--glass-border)); }
.coll-scan-btn {
  flex: 0 0 auto; width: 32px; height: 32px; margin: -4px -4px -4px 0; border-radius: var(--r-pill);
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--gold-light); background: var(--gold-dim); border: 1px solid var(--gold-border);
  transition: transform var(--dur-fast) var(--ease);
}
.coll-scan-btn:active { transform: scale(0.92); }
/* Per-game scanner CTA (in a game's sets view) — tinted with the game's hue. */
.game-scan-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; margin: 0 0 14px; padding: 13px 16px;
  border-radius: var(--r-card); cursor: pointer;
  background: linear-gradient(135deg, color-mix(in srgb, hsl(var(--game-hue, 44) 70% 52%) 22%, var(--surface-2)), var(--surface-2));
  border: 1px solid color-mix(in srgb, hsl(var(--game-hue, 44) 70% 55%) 45%, var(--border));
  color: var(--text); font-size: 14.5px; font-weight: 600; box-shadow: var(--elev-1);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.game-scan-btn svg { color: hsl(var(--game-hue, 44) 75% 62%); }
@media (hover: hover) { .game-scan-btn:hover { box-shadow: var(--elev-2); border-color: color-mix(in srgb, hsl(var(--game-hue, 44) 75% 58%) 70%, var(--border)); } }
.game-scan-btn:active { transform: scale(0.98); }
/* Back control for secondary screens (Activity / Trophies / Community / Messages)
   reached from Settings — consistent one-tap return. */
.page-header-back { display: flex; align-items: center; gap: 4px; }
.page-back-btn { background: none; border: none; color: var(--muted); display: inline-flex; align-items: center; padding: 8px 8px 8px 6px; margin-left: -6px; cursor: pointer; min-width: 40px; min-height: 40px; }
@media (hover: hover) { .page-back-btn:hover { color: var(--text); } }
.page-back-btn:active { transform: scale(0.92); }
/* Game-scope pill shown at the top of the scanner. */
.scanner-game-tag {
  position: absolute; top: calc(16px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 3;
  padding: 5px 14px; border-radius: var(--r-pill); color: #fff;
  background: color-mix(in srgb, hsl(var(--game-hue, 44) 70% 50%) 32%, rgba(10,9,8,0.72));
  border: 1px solid color-mix(in srgb, hsl(var(--game-hue, 44) 75% 60%) 55%, transparent);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}

/* ---- Camera card scanner (full-screen) ---- */
.scanner-overlay {
  position: fixed; inset: 0; z-index: 10001; display: flex; flex-direction: column;
  background: #05040a; color: var(--text);
  padding-top: var(--safe-t); padding-bottom: var(--safe-b);
}
.scanner-stage { position: relative; flex: 1; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #000; }
.scanner-stage[hidden] { display: none; }
#scanner-video, #card-scanner-video { width: 100%; height: 100%; object-fit: cover; }
.scanner-stage.no-cam #scanner-video, .scanner-stage.no-cam #card-scanner-video { display: none; }
.scanner-stage.no-cam { background: radial-gradient(120% 90% at 50% 30%, rgba(201,168,76,0.10), transparent 60%), #0b0a09; }
.scanner-frame {
  position: absolute; left: 8%; right: 8%; top: 18%; bottom: 18%; border-radius: 16px;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.5); pointer-events: none;
}
.scanner-frame span { position: absolute; width: 26px; height: 26px; border: 3px solid var(--gold-light); }
.scanner-frame span:nth-child(1) { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 14px; }
.scanner-frame span:nth-child(2) { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 14px; }
.scanner-frame span:nth-child(3) { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 14px; }
.scanner-frame span:nth-child(4) { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 14px; }
.scanner-hint {
  position: absolute; left: 0; right: 0; bottom: 22px; text-align: center;
  font-size: 13px; color: rgba(255,255,255,0.86); padding: 0 24px; text-shadow: 0 1px 6px rgba(0,0,0,0.8);
}
.scanner-stage.reading::after {
  content: ''; position: absolute; left: 8%; right: 8%; height: 2px; top: 18%;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  animation: scanner-sweep 1.1s ease-in-out infinite;
}
@keyframes scanner-sweep { 0% { top: 18%; } 100% { top: 82%; } }
.scanner-bar { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px 20px; gap: 16px; }
.scanner-btn {
  font: inherit; font-size: 14px; color: var(--text); background: var(--glass-bg);
  border: 1px solid var(--glass-border); border-radius: var(--r-pill); padding: 9px 16px; cursor: pointer;
}
.scanner-shutter {
  width: 64px; height: 64px; border-radius: 50%; flex: 0 0 auto; cursor: pointer;
  background: var(--gold-light); border: 4px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 0 2px var(--gold), 0 6px 20px rgba(0,0,0,0.5);
  transition: transform var(--dur-fast) var(--ease);
}
.scanner-shutter:active { transform: scale(0.92); }
.scanner-results { flex: 1; overflow-y: auto; padding: 18px 16px calc(20px + var(--safe-b)); }
.scanner-results[hidden] { display: none; }
.scanner-read-label { font-size: 12px; color: var(--muted); margin: 0 4px 8px; }
/* Graded-slab callout under the read label — the scan spotted a PSA/BGS/… label */
.scanner-slab-note {
  margin: 0 4px 8px; padding: 7px 11px; border-radius: 10px;
  background: var(--gold-dim); border: 1px solid var(--gold-border);
  color: var(--gold-light); font-size: 12px; line-height: 1.45;
}
.scanner-slab-note b { font-weight: 700; }
/* "Matched X instead" line above relaxed/fallback scan results. */
.scanner-relaxed-note { font-size: 12px; color: var(--gold-light); margin: 2px 4px 10px; }
.scanner-read-search { position: static; margin-bottom: 16px; }
.scanner-matches { display: flex; flex-direction: column; gap: 8px; }
.scanner-actions { display: flex; justify-content: center; padding-top: 18px; }
@media (prefers-reduced-motion: reduce) {
  .scanner-stage.reading::after { animation: none; }
  .coll-scan-btn:active, .scanner-shutter:active { transform: none; }
}

/* "Not in your trove yet" — catalogue discovery below a thin Vault result set.
   Visually fenced off from owned items by a top divider + eyebrow header. */
.browse-suggest { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--glass-border); }
.browse-suggest[hidden] { display: none; }
.browse-suggest-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 0 4px 12px; }
.browse-suggest-title { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gold-light); }
.browse-suggest-sub { font-size: 12px; color: var(--muted); }
.coll-results { display: flex; flex-direction: column; gap: 8px; }
.coll-results-count { font-size: 12px; color: var(--muted); padding: 0 4px 2px; }
/* Surplus / duplicates summary card + the duplicates panel. */
.dup-card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px; margin-bottom: 14px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease);
}
.dup-card:active { transform: scale(0.99); }
.dup-card-ico {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 11px; color: var(--gold-light);
  background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.22);
}
.dup-card-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dup-card-meta b { font-size: 14.5px; }
.dup-card-meta span { font-size: 11.5px; color: var(--muted); }
.dup-card-val { flex: 0 0 auto; font-size: 15px; font-weight: 700; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.dup-card-go { flex: 0 0 auto; font-size: 18px; line-height: 1; opacity: 0.5; }
.dup-head { margin: 4px 2px 14px; }
.dup-title { font-size: 20px; font-weight: 700; margin: 0; }
.dup-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.dup-list { display: flex; flex-direction: column; gap: 8px; }
.dup-qty-badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--gold-light); background: rgba(201,168,76,0.14); border: 1px solid rgba(201,168,76,0.24);
}

.coll-result {
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  padding: 8px 10px; border-radius: var(--r-card); color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  /* Catalogue search / dex / duplicates can return hundreds of rows in one
     unvirtualized list — skip layout/paint for the off-screen ones. Fallback
     ≈ 53px thumb + 16px padding + 2px border. */
  content-visibility: auto;
  contain-intrinsic-size: auto 71px;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease);
}
.coll-result:active { transform: scale(0.985); }
.coll-result-thumb {
  flex: 0 0 auto; width: 38px; height: 53px; border-radius: 6px; overflow: hidden;
  background: rgba(0,0,0,0.3); border: 1px solid var(--border);
}
.coll-result-thumb img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.4) brightness(0.66); }
.coll-result-thumb.owned img { filter: none; }
.coll-result-meta { flex: 1; min-width: 0; }
.coll-result-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coll-result-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coll-result-end { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; gap: 5px; }
.coll-result-val { font-size: 13px; font-weight: 600; color: var(--gold-light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.coll-result-check { flex: 0 0 auto; width: 22px; height: 22px; color: var(--gold-light); }
.coll-result-check svg { width: 100%; height: 100%; }
.tcg-sheet-value { font-size: 13px; color: var(--muted); margin: 5px 0 2px; }
.tcg-sheet-value b { color: var(--gold-light); font-size: 15px; font-variant-numeric: tabular-nums; }
/* Community value (our own market data) — what fellow collectors paid / sold for. */
.tcg-sheet-comp { font-size: 12.5px; color: var(--muted-strong); margin: 2px 0 4px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.tcg-sheet-comp b { color: var(--text); font-variant-numeric: tabular-nums; }

/* "You own 12/131 of <set>" chip on catalogue-linked item details */
.item-set-chip { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.item-set-chip-ring { flex: 0 0 auto; display: flex; }
.item-set-chip-text { flex: 1; font-size: 13px; color: var(--muted-strong); }
.item-set-chip-text b { color: var(--text); font-variant-numeric: tabular-nums; }
.item-set-chip-go { font-size: 18px; line-height: 1; opacity: 0.5; }
.item-set-chip:active { transform: scale(0.985); }

/* Home "Almost Complete" binder strip */
/* Binder value line — portfolio roll-up of the raw owned binder slots. */
#home-binder-value { margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); }
.binder-val-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.binder-val-label { font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.binder-val-amount { font-size: 22px; font-weight: 700; color: var(--text); }
.binder-val-meta { margin-top: 4px; font-size: 11.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.binder-val-sub { white-space: nowrap; }
.binder-val-chip { font-weight: 600; font-variant-numeric: tabular-nums; }
.binder-val-chip.gain { color: var(--gain); }
.binder-val-chip.loss { color: var(--loss); }
.binder-strip-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; margin-bottom: 8px; border-radius: 12px; background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.binder-strip-ring { flex: 0 0 auto; display: flex; }
.binder-strip-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.binder-strip-meta b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.binder-strip-meta span { font-size: 11.5px; color: var(--muted); }
.binder-strip-go { font-size: 18px; line-height: 1; opacity: 0.5; }
.binder-strip-row:active { transform: scale(0.99); }

/* Tappable insight cards (Top Gainer / Biggest Faller) */
.insight-tappable { font: inherit; color: inherit; text-align: inherit; cursor: pointer; position: relative; }
.insight-tappable:active { transform: scale(0.985); }
.insight-thumb { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 8px; overflow: hidden; opacity: 0.9; }
.insight-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Relative countdown beside care dates */
.care-rel { font-size: 11px; color: var(--muted); margin-left: 4px; }
.care-overdue .care-rel { color: var(--danger, #c0564f); }

/* Trophies banner near-miss + badge tier lines */
.ach-next { font-size: 11px; color: var(--gold-light); margin-top: 4px; opacity: 0.85; }
.ach-tierline { font-size: 10px; color: var(--muted); margin-top: 4px; text-transform: capitalize; letter-spacing: 0.04em; }

/* Directory podium */
.comm-avatar { position: relative; }
.comm-medal { position: absolute; top: -7px; right: -7px; font-size: 13px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.5)); }

/* Pull-to-refresh pill */
.ptr-pill { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 14px); left: 50%; transform: translate(-50%, -16px); background: rgba(20,18,12,0.92); color: var(--gold-light); border: 1px solid rgba(232,201,106,0.3); border-radius: 999px; padding: 6px 14px; font-size: 12px; z-index: 1300; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; }
.ptr-pill.show { opacity: 1; transform: translate(-50%, 0); }

/* promptAction text input inside the confirm card */
.confirm-input { width: 100%; margin: 12px 0 2px; padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.14); background: rgba(255,255,255,0.05); color: var(--text); font: inherit; font-size: 15px; }
.confirm-input:focus { outline: none; border-color: var(--gold-light); }
.tcg-comp-n { font-size: 10.5px; color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); padding: 0 6px; }
.tcg-comp-ico { opacity: .85; }

/* ---- Add-flow spotlight: trading cards' top spot + curated path ---- */
.tcg-add-spotlight {
  display: flex; align-items: center; gap: 15px; width: 100%; text-align: left;
  padding: 15px 16px; margin: 0 0 14px; border-radius: var(--r-card); color: var(--text);
  background:
    radial-gradient(120% 150% at 0% 0%, hsla(251, 60%, 55%, 0.20), transparent 55%),
    radial-gradient(120% 150% at 100% 100%, hsla(136, 55%, 48%, 0.15), transparent 55%),
    var(--glass-bg);
  border: 1px solid var(--glass-border); box-shadow: var(--elev-2);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease);
}
.tcg-add-spotlight:active { transform: scale(0.99); }
.tcg-add-spotlight-chips { flex: 0 0 auto; display: flex; padding-left: 12px; }
.tcg-add-chip {
  width: 32px; height: 44px; margin-left: -12px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-size: 16px; font-weight: 600;
  color: hsl(var(--game-hue) 55% 86%);
  background: linear-gradient(155deg, hsl(var(--game-hue) 55% 50%), hsl(var(--game-hue) 58% 34%));
  border: 1.5px solid hsl(var(--game-hue) 45% 28%);
  box-shadow: 0 4px 11px rgba(0,0,0,0.45);
}
.tcg-add-spotlight-text { flex: 1; min-width: 0; }
.tcg-add-spotlight-title { font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--text); }
.tcg-add-spotlight-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; line-height: 1.35; }
.tcg-add-spotlight-go { flex: 0 0 auto; color: var(--muted); }
.catpick-or { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--muted); font-size: 12px; letter-spacing: 0.02em; }
.catpick-or::before, .catpick-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
/* "Resume your draft?" banner atop Add step 1. */
.add-draft-resume { margin: 0 0 14px; }
.draft-resume-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  padding: 11px 14px; border-radius: var(--r-input);
  background: var(--gold-dim); border: 1px solid var(--gold-border);
}
.draft-resume-txt { font-size: 13px; color: var(--muted-strong); }
.draft-resume-txt b { color: var(--gold-light); font-weight: 600; }
.draft-resume-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.draft-resume-discard { background: none; border: none; color: var(--muted); font-size: 13px; padding: 6px 8px; cursor: pointer; }
.draft-resume-go { background: var(--gold); color: #1a1408; border: none; border-radius: var(--r-pill); font-size: 13px; font-weight: 700; padding: 6px 14px; cursor: pointer; }
.draft-resume-go:active { transform: scale(0.97); }

/* ---- On-demand collection tiles + artist/author search-to-collect ---- */
.game-tile-add {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 300; line-height: 1;
  color: hsl(var(--game-hue, 44) 60% 72%);
  border: 1px dashed hsl(var(--game-hue, 44) 50% 55% / 0.55);
}
.coll-source-prompt { color: var(--muted); font-size: 14px; margin: 2px 4px 12px; }
.coll-source-results { display: flex; flex-direction: column; gap: 8px; }
.coll-source-results:not(:empty) { margin-bottom: 20px; }
.coll-source-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px 13px; border-radius: var(--r-card); color: var(--text);
  background: var(--glass-bg); border: 1px solid var(--glass-border);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease);
}
.coll-source-row:active { transform: scale(0.99); }
.coll-source-row:focus-within, .coll-source-row:hover { border-color: hsl(var(--game-hue, 44) 50% 55% / 0.5); }
.coll-source-ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: hsl(var(--game-hue, 44) 60% 72%); background: hsl(var(--game-hue, 44) 55% 50% / 0.14);
}
.coll-source-ico svg { width: 22px; height: 22px; }
.coll-source-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.coll-source-name { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coll-source-sub { font-size: 12px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coll-source-add { flex: 0 0 auto; font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: hsl(var(--game-hue, 44) 62% 74%); }

@media (prefers-reduced-motion: reduce) {
  .comp-ring-fill { transition: none; }
  .game-tile-shine { animation: none; }
  .tcg-slot:active, .tcg-chip:active, .sets-back-btn:active, .home-sets-btn:active, .coll-result:active, .tcg-add-spotlight:active, .coll-source-row:active { transform: none; }
  /* Keep the locked/owned end-states (blur vs clear) but drop the tweens. */
  .tcg-slot-img, .tcg-sheet-art img, .tcg-chip-box, .tcg-chip-box svg { transition: none; }
  /* New modal sheet (Collection edit / owned-card details): fade only, no slide. */
  .sheet-card, .sheet-overlay.show .sheet-card { transition: opacity var(--dur-base) var(--ease); transform: none; }
  /* New micro press-transforms introduced with the depth pass. */
  .tcg-chip-detail:active, .edit-cover-opt:active, .owned-qty button:active, .owned-cond:active,
  .spark-range-chip:active, .draft-resume-go:active, .toast-action:active { transform: none; }
}

/* --------------------------------------------------------
   Barcode scanner (UPC/EAN) — reusable dark full-screen overlay
   -------------------------------------------------------- */
.bc-overlay {
  position: fixed; inset: 0; z-index: 1001;
  background: #07070a;
  display: flex; flex-direction: column;
  padding: calc(8px + var(--safe-t)) 0 calc(14px + var(--safe-b));
  animation: page-in 0.2s ease both;
}
.bc-overlay .scanner-stage {
  flex: 1; position: relative; min-height: 0;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#bc-video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.bc-overlay .scanner-stage.no-cam #bc-video { display: none; }
.bc-overlay .scanner-stage.no-cam { background: radial-gradient(120% 80% at 50% 30%, #16161d, #07070a); }
/* wide landscape viewfinder for a 1-D barcode */
.bc-frame {
  position: absolute; top: 50%; left: 50%;
  width: min(82vw, 440px); height: min(42vw, 190px);
  transform: translate(-50%, -50%);
  border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.52);
  overflow: hidden;
  transition: box-shadow 0.25s ease;
}
.bc-frame::before, .bc-frame::after {
  content: ''; position: absolute; width: 36px; height: 36px;
  border: 3px solid var(--gold-light);
}
.bc-frame::before { top: -1px; left: -1px; border-right: none; border-bottom: none; border-top-left-radius: 13px; }
.bc-frame::after  { bottom: -1px; right: -1px; border-left: none; border-top: none; border-bottom-right-radius: 13px; }
.bc-frame.hit { box-shadow: 0 0 0 100vmax rgba(7,7,10,0.72), inset 0 0 0 2px var(--gain); }
.bc-line {
  position: absolute; left: 6%; right: 6%; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
  box-shadow: 0 0 12px rgba(232,201,106,0.7);
  border-radius: 2px; will-change: transform;
  animation: bc-scan 2s var(--ease-in-out) infinite;
}
@keyframes bc-scan {
  0%   { transform: translateY(8px); opacity: 0; }
  12%  { opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateY(min(42vw, 188px)); opacity: 0; }
}
.bc-torch {
  position: absolute; top: 14px; right: 14px; z-index: 2;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255,255,255,0.14); color: #fff; font-size: 20px; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bc-torch.on { background: var(--gold); color: #1a1206; }
.bc-overlay .scanner-hint {
  position: absolute; left: 0; right: 0; bottom: 9%;
  color: rgba(255,255,255,0.82); font-size: 14px; text-align: center;
  padding: 0 24px; line-height: 1.4; text-shadow: 0 1px 6px rgba(0,0,0,0.75);
}
.bc-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px 0; justify-content: space-between;
}
.bc-overlay .scanner-btn {
  background: rgba(255,255,255,0.14); border: none; color: #fff;
  border-radius: var(--r-pill); padding: 11px 15px; font-size: 14px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); flex: 0 0 auto;
}
.bc-manual { flex: 1; display: flex; gap: 6px; align-items: center; min-width: 0; }
.bc-manual input {
  flex: 1; min-width: 0; color: #fff; font-size: 14px;
  background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--r-pill); padding: 11px 14px;
}
.bc-manual input::placeholder { color: rgba(255,255,255,0.42); }
/* Keyboard focus must read over a live camera feed — the global gold-dim ring is
   15% alpha and the input's own border rule outranks input:focus's gold. */
.bc-manual input:focus { border-color: var(--gold-bright); box-shadow: 0 0 0 3px rgba(220, 190, 100, 0.35); }
@media (prefers-reduced-motion: reduce) { .bc-line { animation: none; top: 50%; opacity: 0.85; } }

/* + Add: prominent "Scan a barcode" call-to-action */
.bc-cta {
  display: flex; align-items: center; gap: 13px; width: 100%;
  background: linear-gradient(135deg, rgba(232,201,106,0.17), rgba(232,201,106,0.04));
  border: 1px solid rgba(232,201,106,0.32); border-radius: var(--r-card);
  padding: 13px 15px; margin: 0 0 14px; cursor: pointer; text-align: left;
  transition: transform 0.15s ease, border-color 0.2s ease;
}
.bc-cta:active { transform: scale(0.985); }
.bc-cta:hover { border-color: rgba(232,201,106,0.5); }
.bc-cta-ico {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(232,201,106,0.18); color: var(--gold-light);
}
.bc-cta-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.bc-cta-txt strong { font-size: 15px; color: var(--text); font-weight: 600; }
.bc-cta-txt small { font-size: 12.5px; color: var(--text-dim); }

/* ============================================================
   RESPONSIVE — tablet + desktop (so users can log in from the web
   on any monitor). Mobile-first base above is untouched; these
   blocks only enhance wider viewports. Fixed overlays (#scanner,
   .bc-overlay, #toast, modals) are viewport-anchored, so the
   desktop rail offset on #app-shell never shifts them.
   ============================================================ */

/* ---- Tablet: roomier grids + a touch more width ---- */
@media (min-width: 700px) {
  .screen { max-width: 780px; }
  .item-grid { grid-template-columns: repeat(3, 1fr); }
  .binder-page { grid-template-columns: repeat(4, 1fr); }
  .photo-find-grid { grid-template-columns: repeat(4, 1fr); }
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Desktop: left nav rail + wide centred content ---- */
@media (min-width: 1024px) {
  :root { --rail-w: 234px; }

  /* clear the fixed rail (fixed children are unaffected by this padding) */
  #app-shell { padding-left: var(--rail-w); }

  /* bottom bar -> vertical left rail */
  #bottom-nav {
    top: 0; bottom: 0; left: 0; right: auto;
    width: var(--rail-w); height: 100dvh;
    flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 4px; padding: 24px 16px calc(20px + var(--safe-b));
    border-top: none; border-right: 1px solid var(--glass-border);
  }
  .nav-group { flex: 0 0 auto; flex-direction: column; align-items: stretch; gap: 4px; }
  #bottom-nav .nav-group:last-of-type { margin-top: auto; }
  .nav-btn {
    flex-direction: row; justify-content: flex-start; gap: 14px;
    height: 46px; width: 100%; padding: 0 14px;
    font-size: 14px; letter-spacing: 0.01em; border-radius: 12px;
    transition: color var(--dur-base) var(--ease), background var(--dur-base) var(--ease);
  }
  .nav-btn svg { width: 22px; height: 22px; }
  .nav-btn span { font-size: 14px; }
  .nav-btn:not(.active):hover { background: var(--surface-2); }
  .nav-btn.active { background: var(--gold-dim); }
  .nav-btn::before { content: none; }   /* drop the mobile under-glow */
  .nav-indicator { display: none; }      /* the sliding pill is horizontal-only */

  /* FAB -> prominent "Add" at the top of the rail */
  .nav-fab { order: -1; width: 100%; flex: 0 0 auto; display: flex; justify-content: center; margin-bottom: 14px; }
  .fab-circle { width: 56px; height: 56px; animation: none; }

  /* content: wide, centred in the space beside the rail */
  .screen { max-width: 1120px; padding: 34px 30px 56px; }

  /* grids breathe on a big monitor */
  .item-grid { grid-template-columns: repeat(4, 1fr); }
  .sets-grid { grid-template-columns: repeat(4, 1fr); }
  .game-grid { grid-template-columns: repeat(3, 1fr); }
  .binders-grid, .coll-list-grid { grid-template-columns: repeat(4, 1fr); } /* were stuck at 2-3 -> oversized tiles */
  .binder-page-grid { grid-template-columns: repeat(6, 1fr); } /* the real pocket grid (was targeting the wrong .binder-page wrapper) */
  .photo-find-grid { grid-template-columns: repeat(6, 1fr); }
  .insights-cards { grid-template-columns: repeat(4, 1fr); }
  .pl-grid { grid-template-columns: repeat(4, 1fr); }

  /* Item detail → a wide 2-column sheet on desktop: the hero pins on the left,
     the metadata/sections scroll on the right (a premium product-page layout
     instead of a tall mobile stack squeezed into a narrow modal). */
  #panel-item-detail .panel-sheet-full { max-width: 960px; }
  #item-detail-body { display: grid; grid-template-columns: 360px minmax(0, 1fr); column-gap: 36px; align-items: start; }
  #item-detail-body > * { grid-column: 2; min-width: 0; }
  #item-detail-body > .detail-hero {
    grid-column: 1; grid-row: 1 / span 200; align-self: start;
    position: sticky; top: 0; margin: 0; border-radius: 16px;
  }

  /* Form / wizard / settings screens read better as a centered readable column than
     stretched to the full 1120 (long inputs + long line-lengths look broken on desktop).
     The gallery pickers inside Add still show a comfortable 5-6 columns at this width. */
  #screen-add, #screen-settings, #screen-activity { max-width: 760px; }
  #screen-home { max-width: 960px; } /* don't stretch the single-column home across the full 1120 */
}

/* ---- Ultrawide: keep content from sprawling ---- */
@media (min-width: 1480px) {
  .screen { max-width: 1280px; }
}

/* --------------------------------------------------------
   Items = category home (the Items tab opens to category tiles)
   -------------------------------------------------------- */
.browse-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.browse-cat-head { grid-column: 1 / -1; font-size: 13px; color: var(--text-dim); margin: 2px 2px 4px; letter-spacing: 0.02em; }
.browse-cat-tile {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  padding: 11px; border-radius: var(--r-card); cursor: pointer; text-align: left;
  background: linear-gradient(180deg, var(--surface-2), var(--surface-1));
  border: 1px solid var(--border);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.browse-cat-tile:active { transform: scale(0.97); }
.browse-cat-tile.has-items { border-color: var(--gold-border); }
@media (hover: hover) { .browse-cat-tile:hover { border-color: var(--gold-border); box-shadow: var(--elev-1); } }
.browse-cat-art { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; }
.browse-cat-art .cat-placeholder-wrap { width: 100%; height: 100%; }
.browse-cat-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.browse-cat-name { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.browse-cat-count { font-size: 12px; color: var(--text-dim); }
.browse-cat-n {
  position: absolute; top: 9px; right: 9px; z-index: 3;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  background: var(--gold); color: #1a1206; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
/* In category-home mode the status chips + toolbar are noise — hide them. */
body.browse-cathome #screen-browse .filter-chips,
body.browse-cathome #screen-browse .browse-toolbar { display: none; }

/* --------------------------------------------------------
   In-category filter bar (Items > a category): back, sub-chips, attribute selects
   -------------------------------------------------------- */
.cat-filterbar { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.cat-filter-back {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-pill); padding: 7px 13px 7px 11px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease);
}
.cat-filter-back:active { transform: scale(0.96); }
@media (hover: hover) { .cat-filter-back:hover { border-color: var(--gold-border); } }
.cat-subchips, .cat-attrs { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-subchip {
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: var(--r-pill); padding: 6px 12px; font-size: 12.5px; cursor: pointer;
  transition: background var(--dur-base) var(--ease), color var(--dur-base) var(--ease), border-color var(--dur-base) var(--ease);
}
.cat-subchip:active { transform: scale(0.96); }
.cat-subchip.active { background: var(--gold-dim); border-color: var(--gold-border); color: var(--gold-light); }
.cat-attr-select {
  background: var(--surface-1); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--r-pill); padding: 6px 10px; font-size: 12.5px; cursor: pointer; max-width: 46vw;
}
.cat-attr-select.on { border-color: var(--gold-border); color: var(--gold-light); background: var(--gold-dim); }

.browse-cat-art .browse-cat-realimg { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 2x2 mosaic preview for categories with 4+ imaged pieces */
.browse-cat-mosaic { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 1.5px; background: var(--surface-2); }
.browse-cat-mosaic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* --------------------------------------------------------
   Watches Add picker — search results with real images
   -------------------------------------------------------- */
/* Add-picker search results = an image-forward GALLERY grid (EVERY picker shares
   this layout, so they all upgrade together). The cover/product photo is the hero;
   name + one meta line sit beneath. Per-catalogue tile shapes are set further down. */
.watch-results {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  gap: 9px; max-height: 62vh; overflow-y: auto; margin-top: 10px; padding: 2px 1px;
}
.watch-result {
  display: flex; flex-direction: column; gap: 7px; width: 100%; text-align: left;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px; cursor: pointer; overflow: hidden;
  /* At-rest depth (not just on hover) so the gallery reads premium, not flat. */
  box-shadow: var(--elev-1);
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.watch-result:active { transform: scale(0.98); }
.watch-result:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (hover: hover) { .watch-result:hover { border-color: var(--gold-border); background: var(--surface-2); box-shadow: var(--elev-2), 0 0 0 1px var(--gold-border); transform: translateY(-2px); } }
/* Staggered entrance — pure CSS so EVERY picker's results cascade in (no JS, no
   node-cloning). Re-runs on each innerHTML replace because new nodes animate fresh. */
.watch-results > .watch-result { animation: picker-rise var(--dur-base) var(--ease) both; }
.watch-results > .watch-result:nth-child(1)  { animation-delay: 0ms; }
.watch-results > .watch-result:nth-child(2)  { animation-delay: 26ms; }
.watch-results > .watch-result:nth-child(3)  { animation-delay: 52ms; }
.watch-results > .watch-result:nth-child(4)  { animation-delay: 78ms; }
.watch-results > .watch-result:nth-child(5)  { animation-delay: 104ms; }
.watch-results > .watch-result:nth-child(6)  { animation-delay: 130ms; }
.watch-results > .watch-result:nth-child(7)  { animation-delay: 156ms; }
.watch-results > .watch-result:nth-child(8)  { animation-delay: 182ms; }
.watch-results > .watch-result:nth-child(9)  { animation-delay: 208ms; }
.watch-results > .watch-result:nth-child(n+10) { animation-delay: 234ms; }
@keyframes picker-rise { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .watch-results > .watch-result { animation: none; } }
.watch-result-thumb {
  width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.watch-result-thumb img { width: 100%; height: 100%; object-fit: contain; }
.watch-result-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 0 2px 2px; }
.watch-result-name { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.watch-result-sub { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Fragrances picker — search bar, house chips, monogram thumb (catalogue has no images) */
.frag-searchbar { margin-top: 8px; }
.frag-houses { display: flex; gap: 7px; overflow-x: auto; padding: 10px 0 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.frag-houses::-webkit-scrollbar { display: none; }
.frag-house-chip { flex: 0 0 auto; padding: 6px 13px; border-radius: var(--r-pill); font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted-strong); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; white-space: nowrap; transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease); }
.frag-house-chip:hover { color: var(--text); border-color: var(--gold-border); }
.frag-house-chip.is-active { color: #1a1710; background: var(--gold); border-color: var(--gold); }
.frag-thumb { background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--gold) 24%, var(--surface-3)), var(--surface-2)) !important; }
.frag-thumb-mono { font-family: var(--display); font-size: 22px; font-weight: 600; color: var(--gold-light); }

/* Fragrance shelf-management widgets: interactive fill gauge, rating dots, choice chips */
.cf-fill .form-label { display: flex; align-items: baseline; gap: 6px; }
.cf-fill-pct { font-size: 12px; font-weight: 700; color: var(--gold-light); }
.cf-fill-body { display: flex; align-items: center; gap: 16px; padding-top: 4px; }
.cf-fill-bottle { width: 42px; height: 76px; flex: 0 0 auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.35)); }
.cf-fill-cap { fill: color-mix(in srgb, var(--gold) 55%, var(--surface-3)); }
.cf-fill-neck { fill: color-mix(in srgb, var(--gold) 20%, var(--surface-3)); }
.cf-fill-glass { fill: none; stroke: var(--gold-border); stroke-width: 1.6; }
.cf-fill-liquid { fill: color-mix(in srgb, var(--gold) 60%, transparent); y: calc(13px + 56px * (1 - var(--pct,100)/100)); height: calc(56px * var(--pct,100)/100); transition: y 0.18s var(--ease), height 0.18s var(--ease); }
.cf-fill-range {
  flex: 1; min-width: 0; accent-color: var(--gold); height: 5px; cursor: pointer;
  /* Pin the gauge's pre-reskin skin: the base input restyle (surface bg, 12px radius,
     14px side padding) must not reshape this slim track. */
  padding: 12px; background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-strong); border-radius: var(--r-input);
}
.cf-rating-dots { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding-top: 4px; }
.cf-rating-num { font-size: 12px; font-weight: 700; color: var(--gold-light); }
.cf-rating-dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); background: var(--surface-2); cursor: pointer; padding: 0; transition: background 0.12s var(--ease), border-color 0.12s var(--ease), transform 0.1s var(--ease); }
.cf-rating-dot.on { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 6px color-mix(in srgb, var(--gold) 45%, transparent); }
.cf-rating-dot:active { transform: scale(0.86); }
.cf-rating-clear { width: 22px; height: 22px; border-radius: 50%; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 12px; margin-left: 2px; }
.cf-rating-clear:hover { color: var(--loss); }
.cf-chips-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.cf-chip { padding: 8px 16px; border-radius: var(--r-pill); font: inherit; font-size: 13px; font-weight: 600; color: var(--muted-strong); background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; transition: color 0.12s var(--ease), background 0.12s var(--ease), border-color 0.12s var(--ease); }
.cf-chip:hover { border-color: var(--gold-border); }
.cf-chip.on { color: #1a1710; background: var(--gold); border-color: var(--gold); }

/* Bottle-fill bar on a fragrance tile (how much is left, at a glance) */
.frag-fill-pill { display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto; padding: 3px 9px; border: 1px solid var(--gold-border); border-radius: var(--r-pill); background: var(--gold-dim); font-size: 10px; font-weight: 700; color: var(--gold-light); }
.frag-fill-pill-track { width: 26px; height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.frag-fill-pill-track > span { display: block; height: 100%; background: var(--gold); border-radius: 3px; }

/* Watches picker: Watches / Movements segmented toggle */
.watch-modebar {
  display: inline-flex; gap: 3px; margin-top: 10px; padding: 3px;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 11px;
}
.watch-modebtn {
  appearance: none; border: 0; cursor: pointer; padding: 6px 16px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: var(--text-dim); background: transparent;
  transition: color var(--dur-fast) var(--ease), background var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.watch-modebtn.is-active { color: var(--ink, #1a1a1a); background: var(--gold); box-shadow: var(--elev-1); }
@media (hover: hover) { .watch-modebtn:not(.is-active):hover { color: var(--text); } }

/* Movements browser — caliber card: movement photo + spec sheet */
.watch-mv {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: 12px;
  padding: 9px 11px; cursor: pointer;
  transition: border-color var(--dur-base) var(--ease), background var(--dur-base) var(--ease), transform var(--dur-fast) var(--ease);
}
.watch-mv:active { transform: scale(0.99); }
@media (hover: hover) { .watch-mv:hover { border-color: var(--gold-border); background: var(--surface-2); } }
.watch-mv-thumb {
  flex: 0 0 auto; width: 60px; height: 60px; border-radius: 9px; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #2a2a2e, #161618);
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05);
}
.watch-mv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.watch-mv-noimg { font-size: 26px; opacity: 0.5; }
.watch-mv-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.watch-mv-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.watch-mv-sub { font-size: 11.5px; color: var(--text-dim); }
.watch-mv-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 1px; }
.watch-mv-chip {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 7px; border-radius: var(--r-pill);
  font-size: 10.5px; color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border);
}
.watch-mv-chip b { font-size: 11.5px; font-weight: 700; color: var(--text); }
.watch-mv-fns { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* Per-catalogue tile shapes in the gallery (all full-width): covers = portrait/cover,
   products = square/contain, coins & crypto = round logo centered in a square tile. */
.watch-result-thumb.sneaker-thumb { aspect-ratio: 4 / 3; background: #f4f4f5; }
.watch-result-thumb.sneaker-thumb img { object-fit: contain; padding: 8px; }
.watch-result-thumb.crypto-thumb { background: var(--surface-2); }
.watch-result-thumb.crypto-thumb img { object-fit: contain; padding: 20px; }
.watch-result-thumb.lego-thumb { background: #fff; }
.watch-result-thumb.lego-thumb img { object-fit: contain; padding: 8px; }
.watch-result-thumb.comic-thumb { aspect-ratio: 2 / 3; background: var(--surface-2); }
.watch-result-thumb.comic-thumb img { object-fit: cover; }

/* Cover-art catalogues → full-bleed portrait POSTERS, not white-letterboxed squares.
   The image fills the tile (image-forward gallery); the dark stage only shows through
   if the cover fails to load. This is what makes the manga / games / books / anime
   pickers read like a gallery instead of a spec list. */
.watch-result-thumb.manga-thumb,
.watch-result-thumb.anime-thumb,
.watch-result-thumb.book-thumb,
.watch-result-thumb.game-thumb {
  aspect-ratio: 3 / 4;
  background: linear-gradient(162deg, var(--surface-3), var(--surface-1));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}
.watch-result-thumb.manga-thumb img,
.watch-result-thumb.anime-thumb img,
.watch-result-thumb.book-thumb img,
.watch-result-thumb.game-thumb img { object-fit: cover; }
/* a soft gradient scrim grounds the title against busy cover art */
.watch-result-thumb.manga-thumb::after,
.watch-result-thumb.anime-thumb::after,
.watch-result-thumb.book-thumb::after,
.watch-result-thumb.game-thumb::after,
.watch-result-thumb.comic-thumb::after,
.watch-result-thumb.vinyl-thumb::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 38%; pointer-events: none;
  background: linear-gradient(to top, rgba(0,0,0,0.34), transparent);
}
.watch-result-thumb { position: relative; }
/* Album art is square */
.watch-result-thumb.vinyl-thumb { aspect-ratio: 1 / 1; background: linear-gradient(162deg, var(--surface-3), var(--surface-1)); box-shadow: inset 0 0 0 1px rgba(255,255,255,0.05); }
.watch-result-thumb.vinyl-thumb img { object-fit: cover; }

/* (Source-attribution styling lives at the canonical .cf-picker-credit rule further
   down — a quiet but legible footnote. Don't duplicate it here.) */
.comic-num { opacity: .6; }
.watch-result-thumb.coin-thumb { background: var(--surface-2); }
.watch-result-thumb.coin-thumb img { object-fit: contain; padding: 14px; }
.lego-num { opacity: .55; font-size: .85em; }
.crypto-tick {
  display: inline-block; margin-left: 5px; padding: 1px 6px; border-radius: var(--r-pill);
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.02em; vertical-align: middle;
  color: var(--text-dim); background: var(--surface-2); border: 1px solid var(--border);
}

/* Books — portrait cover */
.watch-result-thumb.book-thumb { aspect-ratio: 2 / 3; background: var(--surface-2); box-shadow: var(--elev-1); }
.watch-result-thumb.book-thumb img { object-fit: cover; }
.book-noimg { font-size: 30px; opacity: 0.5; }

/* Vinyl — square album art; disc fallback when CAA 404s */
.watch-result-thumb.vinyl-thumb { background: var(--surface-2); }
.watch-result-thumb.vinyl-thumb img { object-fit: cover; }
.watch-result-thumb.vinyl-thumb.is-empty::after { content: '💿'; font-size: 30px; opacity: 0.5; }

/* Video games — box art (mixed aspect → contain) */
.watch-result-thumb.game-thumb { aspect-ratio: 3 / 4; background: var(--surface-2); box-shadow: var(--elev-1); }
.watch-result-thumb.game-thumb img { object-fit: contain; }
.game-noimg { font-size: 30px; opacity: 0.5; }

/* Manga + Anime — portrait cover */
.watch-result-thumb.manga-thumb,
.watch-result-thumb.anime-thumb { aspect-ratio: 2 / 3; background: var(--surface-2); box-shadow: var(--elev-1); }
.watch-result-thumb.manga-thumb img,
.watch-result-thumb.anime-thumb img { object-fit: cover; }
.manga-noimg, .anime-noimg, .hw-noimg { font-size: 30px; opacity: 0.5; }

/* Audit fix: keep the toast + bulk-bar in the content column (not over the rail)
   and off the phantom bottom-nav height on the desktop left-rail layout.
   The toast centers via left/right + margin-inline:auto (the base rule dropped
   translateX(-50%)) — so span the content column, not a midpoint left. */
@media (min-width: 1024px) {
  #toast { left: var(--rail-w); right: 0; bottom: 24px; }
  .bulk-bar { left: var(--rail-w); right: 0; bottom: 24px; }
}


/* ── Lists bar (Vault) — user-named groupings; pick one to filter + make it the
   active target for new adds/scans. One list per item. ─────────────────────── */
.browse-lists {
  display: flex; gap: 8px; align-items: center;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 4px 2px 10px; scrollbar-width: none;
}
.browse-lists::-webkit-scrollbar { display: none; }
.list-chip {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  cursor: pointer; white-space: nowrap;
  padding: 7px 13px; border-radius: var(--r-pill);
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-2, rgba(255,255,255,.04));
  color: var(--text, #e8e8ea); font: inherit; font-size: 13px; font-weight: 600;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.list-chip:hover { background: var(--surface-3, rgba(255,255,255,.08)); }
.list-chip.is-active {
  border-color: var(--gold, #d8b25a);
  background: rgba(216,178,90,.16);
  color: var(--gold, #d8b25a);
}
.list-chip-count {
  font-size: 11px; font-weight: 700; opacity: .85;
  padding: 1px 7px; border-radius: var(--r-pill);
  background: var(--surface-3, rgba(255,255,255,.10));
}
.list-chip.is-active .list-chip-count { background: rgba(216,178,90,.22); }
.list-chip-edit { margin-left: 1px; opacity: .75; font-weight: 700; letter-spacing: 1px; }
.list-chip-edit:hover { opacity: 1; }
.list-chip-new { border-style: dashed; color: var(--text-dim, #9aa0a6); font-weight: 600; }

/* Collection showcase banner — shown atop the Vault when one Collection is filtered. */
.coll-showcase {
  position: relative; overflow: hidden;
  grid-column: 1 / -1; /* span every column — the Vault host is a CSS grid */
  display: flex; align-items: flex-end;
  min-height: 132px; margin: 2px 0 16px; padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--gold-border, rgba(201,168,76,.30));
  background: var(--surface-2, #1A1815);
  isolation: isolate;
}
.coll-showcase-cover {
  position: absolute; inset: 0; z-index: -2; overflow: hidden;
}
.coll-showcase-cover img {
  width: 100%; height: 100%; object-fit: cover; transform: scale(1.04);
}
/* Legibility scrim over the cover art so the title always reads. */
.coll-showcase::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--bg, #0c0b0a) 8%, transparent) 0%,
    color-mix(in srgb, var(--bg, #0c0b0a) 78%, transparent) 100%);
}
.coll-showcase-cover-empty {
  background:
    radial-gradient(120% 80% at 80% 0%, var(--gold-dim, rgba(201,168,76,.15)) 0%, transparent 60%),
    var(--surface-3, #24211C);
  transform: none;
}
.coll-showcase[data-empty="1"]::after { display: none; }
.coll-showcase-body { position: relative; }
.coll-showcase-eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--gold-light, #E8C96A); margin-bottom: 3px;
}
.coll-showcase-name {
  font-size: 24px; font-weight: 800; line-height: 1.1; color: var(--text, #F5F2EB);
  text-shadow: 0 1px 12px rgba(0,0,0,.45);
}
.coll-showcase-stats {
  margin-top: 5px; font-size: 13px; font-weight: 600;
  color: var(--muted-strong, #B9B29E); text-shadow: 0 1px 8px rgba(0,0,0,.4);
}

/* ── Real Estate map (Leaflet + OSM) ─────────────────────────────────────── */
/* "Map" action on the Real Estate filter bar */
.cat-map-btn {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  margin-left: auto; cursor: pointer; white-space: nowrap;
  padding: 7px 13px; border-radius: var(--r-pill); font: inherit; font-size: 13px; font-weight: 700;
  color: var(--gold, #C9A84C);
  border: 1px solid var(--gold-border, rgba(201,168,76,.30));
  background: var(--gold-dim, rgba(201,168,76,.12));
  transition: background .15s ease, border-color .15s ease;
}
.cat-map-btn:hover { background: rgba(201,168,76,.20); border-color: var(--gold, #C9A84C); }
.re-map-credit { margin: -4px 2px 10px; font-size: 10.5px; color: var(--muted, #918A78); opacity: .8; }
.re-map-credit a { color: inherit; text-decoration: underline; }

/* Map containers — Leaflet needs an explicit height or it renders 0px tall. */
.re-map {
  width: 100%; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--border, rgba(255,255,255,.12));
  background: var(--surface-2, #1A1815);
}
.re-map-mini { height: 200px; }
.re-map-addr { margin-top: 8px; font-size: 13px; color: var(--muted-strong, #B9B29E); }
.re-map-fallback {
  display: flex; align-items: center; justify-content: center; height: 100%;
  padding: 18px; text-align: center; font-size: 13px; color: var(--muted, #918A78);
}
.leaflet-container { background: var(--surface-3, #24211C); font: inherit; }

/* Gold Trove pin (CSS divIcon — no marker image) */
.re-pin { background: none; border: 0; }
.re-pin-dot {
  display: block; width: 20px; height: 20px; margin: 3px;
  border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: var(--gold, #C9A84C); border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.45);
}

/* Popup content */
.re-pop { display: flex; flex-direction: column; gap: 4px; min-width: 120px; }
.re-pop b { font-size: 13.5px; }
.re-pop-val { font-size: 12.5px; color: var(--gold, #A9842F); font-weight: 700; }
.re-pop-open {
  margin-top: 4px; align-self: flex-start; cursor: pointer;
  background: none; border: 0; padding: 0; font: inherit; font-weight: 700;
  color: var(--gold, #A9842F);
}

/* Full Property Map sheet */
.re-map-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
@media (min-width: 560px) { .re-map-overlay { align-items: center; } }
.re-map-sheet {
  position: relative; width: 100%; max-width: 720px; height: 86vh; display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.5); overflow: hidden;
}
@media (min-width: 560px) { .re-map-sheet { border-radius: 18px; height: 80vh; } }
.re-map-sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  font-size: 16px; color: var(--text); border-bottom: 1px solid var(--border);
}
.re-map-sheet-sub { font-size: 12.5px; color: var(--muted, #918A78); font-weight: 600; }
.re-map-sheet-close { margin-left: auto; background: none; border: 0; color: var(--muted-strong); font-size: 18px; cursor: pointer; line-height: 1; }
.re-map-full { flex: 1 1 auto; border: 0; border-radius: 0; min-height: 0; }
.re-map-empty {
  position: absolute; left: 0; right: 0; bottom: 0; top: 53px; z-index: 1;
  display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; font-size: 14px; line-height: 1.6; color: var(--muted, #918A78);
  background: var(--surface-1);
}

/* Source attribution — kept legible (some sources are CC BY-SA) but understated: a
   small, muted, centered footnote, never hidden. */
.cf-picker-credit { margin-top: 10px; font-size: 11px; opacity: .85; color: var(--muted); text-align: center; }
.cf-picker-credit a { color: inherit; text-decoration: underline; }
@media (hover: hover) { .cf-picker-credit:hover { opacity: 1; } }

/* "Adding to your list" note in the Add flow (ties the lists feature into Add). */
.add-listnote {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 0 12px; padding: 9px 13px; border-radius: 12px;
  font-size: 13px; color: var(--text, #e8e8ea);
  border: 1px solid rgba(216,178,90,.30); background: rgba(216,178,90,.10);
}
.add-listnote b { color: var(--gold, #d8b25a); font-weight: 700; }
.add-listnote-clear {
  margin-left: auto; cursor: pointer; font: inherit; font-size: 12px;
  color: var(--text-dim, #9aa0a6); background: none; border: 0; text-decoration: underline;
}
.add-listnote-clear:hover { color: var(--text, #e8e8ea); }

/* Picker gallery: a broken/404 remote thumbnail falls back to a neutral placeholder
   (set by the global capture-phase error handler in app.js) — never the browser glyph. */
.watch-result-thumb.is-broken { background: var(--surface-2); }
.watch-result-thumb.is-broken::after { content: "🖼️"; font-size: 28px; opacity: .32; }

/* Item detail → Collections (per-item membership chips + manage button) */
.detail-collections { display: flex; flex-wrap: wrap; gap: 7px; }
.coll-chip {
  display: inline-flex; align-items: center; padding: 5px 11px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--cc, var(--border));
}
.coll-chip-add { cursor: pointer; color: var(--gold); background: transparent; border: 1px dashed rgba(216,178,90,.42); }
.coll-chip-add:hover { background: rgba(216,178,90,.10); }

/* Collections manager sheet */
.coll-sheet-overlay {
  position: fixed; inset: 0; z-index: 1000; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
@media (min-width: 560px) { .coll-sheet-overlay { align-items: center; } }
.coll-sheet {
  width: 100%; max-width: 460px; max-height: 80vh; display: flex; flex-direction: column;
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  box-shadow: 0 -8px 40px rgba(0,0,0,.5); overflow: hidden;
}
@media (min-width: 560px) { .coll-sheet { border-radius: 18px; } }
.coll-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 4px; font-size: 16px; color: var(--text); }
.coll-sheet-close { background: none; border: 0; color: var(--text-dim); font-size: 18px; cursor: pointer; line-height: 1; }
.coll-sheet-sub { padding: 0 18px 10px; font-size: 12.5px; color: var(--text-dim); }
.coll-sheet-body { flex: 1; overflow-y: auto; padding: 4px 10px; }
/* Scan chooser (Vault) — pick which kind of scan. */
.scan-menu { max-height: none; }
.scan-menu-body { padding: 6px 12px 16px; display: flex; flex-direction: column; gap: 9px; }
.scan-menu-opt {
  display: flex; align-items: center; gap: 13px; text-align: left; width: 100%; cursor: pointer;
  padding: 14px; border-radius: 14px; font: inherit;
  background: var(--surface-2); border: 1px solid var(--border); box-shadow: var(--elev-1);
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-base) var(--ease), box-shadow var(--dur-base) var(--ease);
}
.scan-menu-opt:active { transform: scale(0.985); }
@media (hover: hover) { .scan-menu-opt:hover { border-color: var(--gold-border); box-shadow: var(--elev-2); } }
.scan-menu-ico { flex: 0 0 auto; font-size: 26px; width: 30px; text-align: center; }
.scan-menu-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.scan-menu-text b { font-size: 14.5px; color: var(--text); }
.scan-menu-text small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.coll-sheet-row { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; cursor: pointer; }
.coll-sheet-row:hover { background: var(--surface-2); }
.coll-sheet-row input { width: 20px; height: 20px; accent-color: var(--gold); flex: 0 0 auto; }
.coll-sheet-name { flex: 1; font-size: 14px; font-weight: 600; color: var(--text); }
.coll-sheet-count { font-size: 12px; color: var(--text-dim); }
.coll-sheet-empty { padding: 24px 14px; text-align: center; color: var(--text-dim); font-size: 13px; }
.coll-sheet-foot { display: flex; gap: 10px; align-items: center; padding: 12px 16px 18px; border-top: 1px solid var(--border); }
.coll-sheet-new { flex: 1; background: none; border: 0; color: var(--text-dim); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.coll-sheet-new:hover { color: var(--text); }
.coll-sheet-done { padding: 9px 22px; }

/* iOS Safari zooms the page when a focused input's font is < 16px. Scope the bump
   to iOS only (-webkit-touch-callout) so desktop/other visual sizing is unchanged. */
@supports (-webkit-touch-callout: none) {
  input, textarea, select,
  .search-bar input, .coll-search input, .binder-pick-search input, .prof-field, .cf-picker-input {
    font-size: 16px;
  }
}

/* ── Bare checkboxes — explicit skin + gold check ─────────────────
   The global appearance reset strips the native checkmark in WebKit, so any
   checkbox NOT wrapped in the custom .toggle (collection sheet rows, the
   share-values toggle, the photo-share consent) rendered as a blank box in
   both states. Attribute selector outranks the bare element rules. */
input[type="checkbox"]:not(.toggle input) {
  appearance: none; -webkit-appearance: none;
  width: 19px; height: 19px; min-height: 0; padding: 0;
  border: 1.5px solid var(--border-strong); border-radius: 5.5px;
  background: var(--surface-2);
  display: inline-block; vertical-align: middle; flex: 0 0 auto;
  cursor: pointer;
}
input[type="checkbox"]:not(.toggle input):checked {
  background-color: var(--gold);
  border-color: var(--gold);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23151310' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E");
  background-size: 13px; background-position: center; background-repeat: no-repeat;
}
/* .toggle's own checkbox stays invisible — the track/thumb is its skin */
.toggle input[type="checkbox"] { appearance: none; -webkit-appearance: none; }
