:root {
  /* v2 redesign — light parchment is the default. The gothic dark mode
     moved to [data-theme="dark"] below. Token names follow the design
     handoff (canvas/surface/ink/rose/gold/blush) and are then aliased to
     the existing semantic names (bg/panel/ink/rose/gold/etc.) the rest
     of the stylesheet already reads, so this swap reaches every rule
     without a full rewrite of the 2000-line file. */

  /* Public design tokens — readable, single source of truth. */
  --canvas:        #f4eff3;  /* parchment background */
  --surface:       #ffffff;  /* cards, header, inputs */
  --surface-2:    #f9f4f8;  /* hover / subtle fill */
  --ink-1:         #2b1830;  /* primary text */
  --ink-2:         #3c2150;  /* deep plum — headings + wordmark */
  --muted-1:       #6a5570;  /* body / secondary text */
  --muted-2:       #9a8aa3;  /* tertiary text, placeholders */
  --muted-3:       #8a7895;  /* compact-row meta */
  --rose-1:        #c23a6b;  /* primary rose accent */
  --rose-2:        #a02a57;  /* rose-dark, hover */
  --blush:         #fbe4ed;  /* soft pink fill */
  --rose-edge:     #eac3d6;  /* secondary button border */
  --rose-seam:     #e7c0d4;  /* dashed stitched-seam color */
  --rose-hover-edge: #f0bcd2;
  --gold-1:        #a9762f;  /* antique gold */
  --gold-fill:     #faf3e6;  /* gold pill background */
  --gold-edge:     #e8d3a8;  /* gold pill border */
  --positive-fill: #e7f3ec;
  --positive-text: #1f7a4d;
  --positive-edge: #c3e3cf;
  --negative-fill: var(--blush);
  --negative-text: var(--rose-2);
  --negative-edge: #f3c6d8;
  --pending-fill:  #ece4f4;
  --pending-text:  #5a3a78;
  --pending-edge:  #d7c8e8;
  --accept-1:      #1f8a5b;  /* green Accept button */
  --accept-2:      #176b46;
  --danger-1:      #c2334f;
  --danger-soft:   #fdeef0;
  --segment-track: #e6dce8;  /* density toggle track */
  --hairline:      rgba(43,24,48,.09);
  --hairline-2:    rgba(43,24,48,.12);
  --hairline-3:    rgba(43,24,48,.06);
  --shadow-card-rgba:  rgba(43,24,48,.06);
  --shadow-lift-rgba:  rgba(43,24,48,.16);
  --shadow-card-soft:  0 4px 16px rgba(43,24,48,.06);
  --shadow-card-lift:  0 16px 36px rgba(43,24,48,.16);
  --shadow-popover:    0 16px 40px rgba(43,24,48,.18);
  --bat-fill:      #c23a6b;
  --bat-eye:       #ffffff;

  /* Aliases to the existing semantic names the rest of the file uses.
     Keep these synced if a rule is restyled — it lets the legacy code
     paths get the new colors for free. */
  --bg: var(--canvas);
  --bg-2: var(--surface-2);
  --panel: var(--surface);
  --panel-2: var(--surface);
  --panel-hi: var(--blush);
  --ink: var(--ink-1);
  --ink-dim: var(--muted-1);
  --ink-mute: var(--muted-2);
  --rose: var(--rose-1);
  --rose-hi: var(--rose-2);
  --rose-soft: var(--blush);
  --gold: var(--gold-1);
  --retired: var(--gold-1);
  --danger: var(--danger-1);
  --bg-grad-1: transparent;       /* no overlay on parchment */
  --bg-grad-2: transparent;
  --header-bg-1: rgba(244,239,243,.92);
  --header-bg-2: rgba(244,239,243,.85);
  --header-border: var(--hairline);
  --modal-backdrop: rgba(22,10,30,.55);

  /* Hairline tiers used by dividers + soft borders. The redesign moved
     borders from rose-tinted to neutral ink-tinted hairlines. */
  --border-rose-mist:    rgba(43,24,48,.04);
  --border-rose-faint:   rgba(43,24,48,.07);
  --border-rose-vague:   var(--hairline-3);
  --border-rose-mild:    var(--hairline);
  --border-rose:         var(--hairline-2);
  --border-rose-strong:  var(--rose-edge);
  --border-rose-hi:      var(--rose-1);
  --border-rose-glow:    var(--rose-1);

  /* Glows replaced with subtle ink-tinted shadows. The neon look is gone;
     these slots are kept so old box-shadow/text-shadow rules don't break.*/
  --rose-glow-soft:      transparent;
  --rose-glow-med:       rgba(194,58,107,.18);
  --rose-glow-hard:      rgba(194,58,107,.30);

  /* Rose button drop-shadow — softer than the old neon. */
  --rose-shadow:         rgba(194,58,107,.20);
  --rose-shadow-md:      rgba(194,58,107,.28);
  --rose-shadow-hi:      rgba(194,58,107,.40);

  /* Soft hover surfaces / focus rings. */
  --rose-hover-bg:       rgba(194,58,107,.05);
  --row-hover-bg:        var(--surface-2);
  --focus-ring:          rgba(194,58,107,.18);

  /* Card / modal shadow colors. */
  --shadow-card:         rgba(43,24,48,.06);
  --shadow-strong:       rgba(43,24,48,.10);
  --shadow-deep:         rgba(43,24,48,.18);
  --shadow-soft:         var(--shadow-card-soft);
  --shadow-hi:           var(--shadow-card-lift);

  /* Status badges — light chip + dark text on parchment. */
  --badge-bg:            var(--surface);
  --badge-border-white:  var(--hairline);
  --owned-text:          var(--gold-1);
  --stock-blue:          var(--pending-text);     /* purple now */
  --stock-blue-border:   var(--pending-edge);
  --stock-blue-glow:     transparent;
  --stock-purple:        var(--pending-text);
  --stock-purple-border: var(--pending-edge);
  --stock-purple-glow:   transparent;
  --mini-grad-1:         var(--blush);
  --mini-grad-2:         var(--blush);
  --mini-text:           var(--rose-2);
  --retired-grad-2:      #b88940;
  --text-on-gold:        #ffffff;                 /* white on the gold pill */
  --text-on-rose:        #ffffff;
  --ink-on-pill:         #ffffff;
  --watermark-bg:        rgba(43,24,48,.78);
  --watermark-border:    rgba(255,255,255,.18);

  /* Positive (available) family — green. */
  --success:             var(--positive-text);
  --success-strong:      var(--accept-2);
  --success-bg:          var(--positive-fill);
  --success-border:      var(--positive-edge);
  --teal-text:           var(--positive-text);
  --teal-grad-1:         var(--positive-fill);
  --teal-grad-2:         var(--positive-fill);
  --teal-border:         var(--positive-edge);

  /* Danger / destructive red family. */
  --danger-hi:           var(--danger-1);
  --danger-bg:           var(--danger-soft);
  --danger-border:       var(--negative-edge);

  /* Gold accent tints. */
  --gold-bg:             var(--gold-fill);
  --gold-border:         var(--gold-edge);
  --gold-glow:           rgba(169,118,47,.18);
  --gold-soft-border:    var(--gold-edge);
  --gold-soft-bg:        var(--gold-fill);
  --gold-inset-glow:     rgba(169,118,47,.06);

  /* Misc. */
  --ink-link-underline:  var(--rose-edge);
  --select-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23c23a6b' d='M5 6 0 0h10z'/></svg>");

  /* Radii bumped up — the redesign favors softer 16-18px cards. */
  --radius: 16px;
  --radius-sm: 11px;
  /* Typography — three-font system.
     --display: decorative Cinzel for the wordmark and personal
                plushie nicknames (the interlocking-O moments).
     --sans:    Nunito for everything functional (nav, buttons, body,
                meta, prices, eyebrows).
     --serif:   Cormorant for italic "meaning" quotes only. */
  --sans:    'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif:   'Cormorant Garamond', Georgia, serif;
  --display: 'Cinzel Decorative', 'Cormorant Garamond', Georgia, serif;
}

/* Dark theme — the original gothic plum + rose, refined. Opt-in via the
   header moon button (persists to localStorage.theme = 'dark'); the
   early-load script in <head> applies it before paint. */
[data-theme="dark"] {
  --canvas:        #1a0d26;
  --surface:       #25153a;
  --surface-2:     #2e1944;
  --ink-1:         #f3e6ff;
  --ink-2:         #ffd6f0;
  --muted-1:       #b598d4;
  --muted-2:       #7d6394;
  --muted-3:       #9176af;
  --rose-1:        #ff5fa8;
  --rose-2:        #c43d6e;
  --blush:         rgba(255,95,168,.15);
  --rose-edge:     rgba(255,95,168,.35);
  --rose-seam:     rgba(255,95,168,.18);
  --rose-hover-edge: var(--rose-1);
  --gold-1:        #e6b85e;
  --gold-fill:     rgba(230,184,94,.10);
  --gold-edge:     rgba(230,184,94,.35);
  --positive-fill: rgba(110,255,168,.12);
  --positive-text: #6effa6;
  --positive-edge: rgba(110,255,168,.4);
  --negative-fill: rgba(255,95,168,.12);
  --negative-text: #ff7a8a;
  --negative-edge: rgba(255,95,168,.35);
  --pending-fill:  rgba(196,163,255,.12);
  --pending-text:  #c4a3ff;
  --pending-edge:  rgba(196,163,255,.35);
  --accept-1:      #4ec98a;
  --accept-2:      #2f9a64;
  --danger-1:      #ff5e76;
  --danger-soft:   rgba(255,77,109,.12);
  --segment-track: rgba(255,255,255,.06);
  --hairline:      rgba(255,95,168,.18);
  --hairline-2:    rgba(255,95,168,.30);
  --hairline-3:    rgba(255,95,168,.10);
  --shadow-card-soft:  0 6px 18px rgba(0,0,0,.4);
  --shadow-card-lift:  0 12px 32px rgba(0,0,0,.6);
  --shadow-popover:    0 16px 40px rgba(0,0,0,.55);
  --bat-fill:      #c23a6b;
  --bat-eye:       #ffd6f0;

  --bg: var(--canvas);
  --bg-2: #1a0d26;
  --panel: var(--surface);
  --panel-2: #311a4a;
  --panel-hi: #3d2257;
  --ink: var(--ink-1);
  --ink-dim: var(--muted-1);
  --ink-mute: var(--muted-2);
  --rose: var(--rose-2);
  --rose-hi: var(--rose-1);
  --rose-soft: rgba(255,95,168,.15);
  --gold: var(--gold-1);
  --retired: #d4a35e;
  --danger: var(--danger-1);
  --bg-grad-1: rgba(122,59,143,.30);
  --bg-grad-2: rgba(196,61,110,.22);
  --header-bg-1: rgba(26,13,38,.95);
  --header-bg-2: rgba(18,8,32,.85);
  --header-border: var(--hairline);
  --modal-backdrop: rgba(6,2,14,.7);

  --border-rose-mist:    rgba(255,95,168,.05);
  --border-rose-faint:   rgba(255,95,168,.10);
  --border-rose-vague:   rgba(255,95,168,.12);
  --border-rose-mild:    rgba(255,95,168,.18);
  --border-rose:         rgba(255,95,168,.25);
  --border-rose-strong:  rgba(255,95,168,.30);
  --border-rose-hi:      rgba(255,95,168,.45);
  --border-rose-glow:    rgba(255,95,168,.50);

  --rose-glow-soft:      rgba(255,95,168,.20);
  --rose-glow-med:       rgba(255,95,168,.35);
  --rose-glow-hard:      rgba(255,95,168,.45);

  --rose-shadow:         rgba(196,61,110,.40);
  --rose-shadow-md:      rgba(196,61,110,.45);
  --rose-shadow-hi:      rgba(196,61,110,.60);

  --rose-hover-bg:       rgba(255,95,168,.06);
  --row-hover-bg:        rgba(255,95,168,.05);
  --focus-ring:          rgba(255,95,168,.18);

  --shadow-card:         rgba(0,0,0,.4);
  --shadow-strong:       rgba(0,0,0,.45);
  --shadow-deep:         rgba(0,0,0,.55);
  --shadow-soft:         0 6px 18px rgba(0,0,0,.45);
  --shadow-hi:           0 12px 32px rgba(0,0,0,.6);

  --badge-bg:            rgba(20,8,32,.85);
  --badge-border-white:  rgba(255,255,255,.15);
  --owned-text:          #ffd8a8;
  --stock-blue:          #74c0ff;
  --stock-blue-border:   #4a7ab8;
  --stock-blue-glow:     rgba(116,192,255,.40);
  --stock-purple:        #c4a3ff;
  --stock-purple-border: #8a6fc4;
  --stock-purple-glow:   rgba(196,163,255,.40);
  --mini-grad-1:         #5a3a78;
  --mini-grad-2:         #3d2257;
  --mini-text:           #f3e6ff;
  --retired-grad-2:      #b88940;
  --text-on-gold:        #2a1500;
  --text-on-rose:        #ffffff;
  --ink-on-pill:         #1a0d26;
  --watermark-bg:        rgba(8,4,14,.78);
  --watermark-border:    rgba(255,255,255,.15);

  --success:             #6effa6;
  --success-strong:      #aaffcc;
  --success-bg:          rgba(110,255,168,.12);
  --success-border:      rgba(110,255,168,.45);
  --teal-text:           #6effd8;
  --teal-grad-1:         #2a4d4f;
  --teal-grad-2:         #1a2f30;
  --teal-border:         rgba(110,255,216,.30);

  --danger-hi:           #ff7a8a;
  --danger-bg:           rgba(255,77,109,.12);
  --danger-border:       rgba(255,77,109,.35);

  --gold-bg:             rgba(255,215,142,.08);
  --gold-border:         rgba(255,215,142,.35);
  --gold-glow:           rgba(255,215,142,.30);
  --gold-soft-border:    rgba(212,175,55,.40);
  --gold-soft-bg:        rgba(212,175,55,.15);
  --gold-inset-glow:     rgba(255,215,142,.05);

  --ink-link-underline:  rgba(181,152,212,.40);
  --select-arrow: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23ff5fa8' d='M5 6 0 0h10z'/></svg>");
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(ellipse 60% 40% at 15% 0%, var(--bg-grad-1) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 100% 100%, var(--bg-grad-2) 0%, transparent 60%),
    var(--bg);
  min-height: 100vh;
  font-size: 15.5px;
  line-height: 1.5;
  padding-bottom: 64px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Header ────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, var(--header-bg-1), var(--header-bg-2));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--header-border);
  padding-top: env(safe-area-inset-top);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 22px 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bat-logo {
  width: 44px;
  height: 30px;
  filter: none;
  animation: floatBat 4s ease-in-out infinite;
  transform-origin: center;
  flex: 0 0 auto;
}

@keyframes floatBat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-6px) rotate(3deg); }
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.55rem;
  margin: 0;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  text-shadow: none;
  line-height: 1.05;
}

.header-actions { display: flex; gap: 8px; align-items: center; }

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  color: var(--ink);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.icon-btn:hover { background: var(--blush); border-color: var(--rose-hover-edge); color: var(--rose-2); }
.icon-btn.active {
  background: var(--rose-1);
  border-color: var(--rose-1);
  color: #fff;
  box-shadow: 0 4px 12px var(--rose-shadow-md);
}

/* ─── Tabs ────────────────────────────── */
.tabs {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
}
.tabs::-webkit-scrollbar { display: none; }
.tab { scroll-snap-align: start; flex-shrink: 0; }

.tab {
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted-1);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0;
  padding: 14px 14px 11px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--ink); }
.tab.active {
  color: var(--rose-1);
  font-weight: 800;
  border-bottom-color: var(--rose-1);
}
/* The old gradient pseudo-element is gone — the bottom border IS the active
   indicator in the redesign. */
.tab.active::after { content: none; }

/* ─── Main ────────────────────────────── */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 22px 32px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

#search {
  flex: 1;
  min-width: 200px;
  padding: 11px 16px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-style: normal;
}
#search::placeholder { color: var(--muted-2); }
#search:focus {
  outline: none;
  border-color: var(--rose-1);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

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

.chip {
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  letter-spacing: 0;
  transition: all 0.15s ease;
}
.chip:hover { color: var(--rose-2); border-color: var(--rose-edge); background: var(--blush); }
.chip.active {
  background: var(--rose-1);
  color: #fff;
  border-color: var(--rose-1);
  box-shadow: 0 4px 12px var(--rose-shadow);
}
.chip-action { color: var(--rose-1); border-color: var(--rose-edge); background: var(--surface); }
.chip-action:hover { background: var(--blush); color: var(--rose-2); }

.chip-toggle::before {
  content: '○';
  margin-right: 6px;
  opacity: 0.5;
}
.chip-toggle.active::before { content: '●'; opacity: 1; }
.chip-toggle.active {
  background: var(--blush);
  color: var(--rose-2);
  border-color: var(--rose-edge);
  box-shadow: none;
}
.chip-sep {
  width: 1px;
  height: 18px;
  background: var(--hairline);
  margin: 0 4px;
}
.chip-select {
  padding: 9px 12px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
}
.chip-select:focus { outline: none; border-color: var(--rose-1); color: var(--ink); }

/* ─── Filter widgets ──────────────────────────────
   Replacements for the old chip rows. Native <select> for single-value
   filters; <details>/<summary> + checkboxes for multi-value. */
.filter-select {
  padding: 11px 32px 11px 15px;
  background: var(--surface) var(--select-arrow) no-repeat right 12px center;
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 130px;
}
.filter-select:focus { outline: none; border-color: var(--rose-1); }

.filter-multi {
  position: relative;
}
.filter-multi summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 15px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  min-width: 130px;
}
.filter-multi summary::-webkit-details-marker { display: none; }
.filter-multi summary::after {
  content: '▾';
  margin-left: auto;
  color: var(--rose-1);
  font-size: 0.7rem;
}
.filter-multi[open] summary { border-color: var(--rose-1); }
.filter-multi .filter-label {
  color: var(--muted-1);
  font-style: normal;
  font-weight: 600;
}
.filter-multi .filter-summary {
  color: var(--rose-1);
  font-weight: 800;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.filter-options {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--shadow-popover);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.filter-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  cursor: pointer;
}
.filter-options label:hover { background: var(--surface-2); }
.filter-options input[type=checkbox] {
  width: 16px;
  height: 16px;
  accent-color: var(--rose-1);
  cursor: pointer;
}

.filter-clear, .filter-action {
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  color: var(--muted-1);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 11px 15px;
  border-radius: 12px;
  cursor: pointer;
  font-style: normal;
  margin-left: auto;
}
.filter-clear:hover, .filter-action:hover {
  border-color: var(--rose-1);
  color: var(--rose-1);
  background: var(--blush);
}
.filter-action {
  color: var(--gold-1);
  border-color: var(--gold-edge);
  background: var(--gold-fill);
  margin-left: 0;
}
.filter-action:hover { background: var(--gold-fill); border-color: var(--gold-1); color: var(--gold-1); }

.add-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.add-btn {
  background: var(--rose-1);
  border: none;
  color: #fff;
  padding: 12px 22px;
  border-radius: 11px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 18px var(--rose-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}
.add-btn:hover { background: var(--rose-2); transform: translateY(-1px); box-shadow: 0 8px 20px var(--rose-shadow-hi); }
.add-btn:active { transform: translateY(0); }

.count {
  color: var(--muted-2);
  font-style: normal;
  font-weight: 600;
  font-size: 0.88rem;
}

/* ─── Grid & Cards ────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}
/* List view: one card per row, small photo on the left, body on the right.
   Used for My Collection so filled-in fields have room and the photo doesn't
   dominate. */
.grid-list {
  grid-template-columns: 1fr;
  gap: 10px;
}
.grid-list .card {
  display: grid;
  grid-template-columns: 88px 1fr;
  grid-template-rows: auto auto;
  align-items: stretch;
}
.grid-list .card-photo {
  grid-row: 1 / span 2;
  aspect-ratio: 1 / 1;
  height: 100%;
}
.grid-list .card-body { padding: 10px 14px 4px; }
.grid-list .card-actions {
  padding: 4px 14px 10px;
  border-top: 0;
  flex-wrap: wrap;
}

.grid-tight {
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 12px;
}

.card-status {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  background: var(--positive-fill);
  color: var(--positive-text);
  border: 1px solid var(--positive-edge);
  white-space: nowrap;
  text-shadow: none;
}
.card-status.owned {
  background: var(--gold-1);
  color: #fff;
  border-color: var(--gold-1);
  box-shadow: 0 2px 8px rgba(169,118,47,.35);
}
.card-status.wished {
  background: var(--blush);
  color: var(--rose-2);
  border-color: var(--rose-edge);
}

.card-actions .btn-have {
  color: #fff;
  background: var(--rose-1);
  border: 1px solid var(--rose-1);
  font-weight: 800;
}
.card-actions .btn-have:hover { background: var(--rose-2); border-color: var(--rose-2); color: #fff; }
.card-actions .btn-want {
  color: var(--rose-2);
  background: var(--surface);
  border: 1.5px solid var(--rose-edge);
  font-weight: 700;
}
.card-actions .btn-want:hover { background: var(--blush); color: var(--rose-2); border-color: var(--rose-1); }

.grid-tight .card-name { font-size: 0.95rem; }
.grid-tight .card-body { padding: 10px 12px 8px; }
.grid-tight .card-actions { padding: 8px 10px 10px; gap: 4px; }
.grid-tight .card-actions button { font-size: 0.78rem; padding: 7px 4px; }

.card {
  background: var(--surface);
  border: 1px solid var(--hairline-3);
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card-soft);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--rose-hover-edge);
  box-shadow: var(--shadow-card-lift);
}

.card-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, var(--blush), var(--canvas));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-photo .no-photo {
  font-size: 3rem;
  opacity: 0.4;
}

.badge-stack {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  pointer-events: none;
}
.badge {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  padding: 4px 9px;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow: none;
  white-space: nowrap;
}
.badge-retired {
  background: var(--gold-1);
  color: #fff;
  border: 1px solid var(--gold-1);
}
.badge-oos {
  background: var(--negative-fill);
  color: var(--negative-text);
  border: 1px solid var(--negative-edge);
  text-shadow: none;
}
.badge-soon {
  background: var(--pending-fill);
  color: var(--pending-text);
  border: 1px solid var(--pending-edge);
  text-shadow: none;
}
.badge-fyc {
  background: var(--pending-fill);
  color: var(--pending-text);
  border: 1px solid var(--pending-edge);
  text-shadow: none;
}
.badge-mini {
  background: var(--blush);
  color: var(--rose-2);
  border: 1px solid var(--rose-edge);
}

.card-body {
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

/* Card eyebrow (theme/category above the name) — uppercase rose */
.card-eyebrow {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.6rem;
  color: var(--rose-1);
  margin: 0 0 2px;
}

.card-name {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.98rem;
  margin: 0;
  letter-spacing: 0;
  color: var(--ink);
  line-height: 1.25;
}
/* Nickname on personal collection rows — Cinzel display for the
   decorative "interlocking-O" feel the user specifically called out.
   The smaller catalog/wishlist card names stay Nunito. */
.card-name.nickname {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  line-height: 1.15;
  color: var(--ink-2);
}

.card-meaning {
  font-style: italic;
  color: var(--muted-1);
  font-size: 1rem;
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.4;
  font-family: var(--serif);
}
/* Subtitle: the original catalog name when a nickname is set. */
.card-product {
  margin: 0 0 4px;
  font-family: var(--sans);
  font-weight: 600;
  font-style: normal;
  color: var(--rose-1);
  font-size: 0.82rem;
}

/* Price — Cormorant, deep plum, pushed to bottom of body. */
.card-price {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ink-2);
  margin: auto 0 0;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 0.82rem;
  color: var(--muted-1);
  margin-top: 4px;
  font-family: var(--sans);
  font-weight: 600;
}
.card-meta span::before { content: ''; }
.card-meta .meta-warn { color: var(--rose-1); font-style: normal; font-weight: 700; }
/* On the tight catalog grid keep the type scale a notch smaller so the cards stay compact. */
.grid-tight .card-meta { font-size: 0.78rem; }

/* Meta pills (date / acquired / has-bag) on collection rows. */
.meta-pill {
  display: inline-block;
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.74rem;
}
.meta-pill.muted { color: var(--muted-2); background: var(--canvas); }

/* Quantity control on collection cards — gold pill stepper. */
.qty-control {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gold-fill);
  border: 1px solid var(--gold-edge);
  border-radius: 999px;
  padding: 2px;
}
.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--gold-1);
  font-size: 1rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  font-family: var(--sans);
}
.qty-btn:hover { background: var(--surface); color: var(--gold-1); }
.qty-display {
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--gold-1);
  min-width: 28px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.badge-qty {
  background: var(--gold-1);
  color: #fff;
  border: 1px solid var(--gold-1);
  font-variant-numeric: tabular-nums;
}

/* Stitched-seam dashed divider — the redesign's signature detail. */
.card-actions {
  display: flex;
  gap: 8px;
  padding: 12px 16px 14px;
  border-top: 1.5px dashed var(--rose-seam);
  margin-top: auto;
}
.card-actions button {
  flex: 1;
  background: var(--surface);
  border: 1.5px solid var(--rose-edge);
  color: var(--rose-2);
  padding: 8px 10px;
  border-radius: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.card-actions button:hover { color: var(--rose-2); border-color: var(--rose-1); background: var(--blush); }
.card-actions .btn-got { color: #fff; background: var(--rose-1); border-color: var(--rose-1); font-weight: 800; }
.card-actions .btn-got:hover { background: var(--rose-2); border-color: var(--rose-2); }
.card-actions .btn-danger:hover { color: var(--danger-1); border-color: var(--danger-1); background: var(--danger-soft); }

/* Icon-only trash button used for collection delete. */
.card-actions .btn-trash {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 10px;
  border: 1.5px solid var(--hairline-2);
  background: var(--surface);
  color: var(--muted-1);
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
  margin-left: auto;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}
.card-actions .btn-trash:hover {
  background: var(--danger-soft);
  border-color: var(--negative-edge);
  color: var(--danger-1);
}
.card-actions .btn-link {
  flex: 0 0 auto;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.card-actions .btn-buy {
  flex: 0 0 auto;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--positive-fill);
  color: var(--positive-text);
  border: 1.5px solid var(--positive-edge);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
}
.card-actions .btn-buy:hover {
  background: var(--success-bg);
  color: var(--success-strong);
  border-color: var(--success);
}

/* ─── Active filters bar ────────────────────────────── */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px;
  padding: 8px 10px;
  background: var(--panel);
  border: 1px solid var(--border-rose-mild);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  font-size: 0.9rem;
}
.active-filters.hidden { display: none; }
.active-filters .active-count {
  color: var(--ink-dim);
  margin-right: 6px;
  font-style: italic;
}
.active-pill {
  background: var(--bg-2);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: 3px 10px;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.82rem;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.12s ease;
}
.active-pill:hover { background: var(--panel-2); border-color: var(--gold); }
.active-clear-all {
  background: transparent;
  border: 0;
  color: var(--rose-hi);
  font-family: var(--sans);
  font-style: italic;
  font-size: 0.85rem;
  margin-left: auto;
  cursor: pointer;
  padding: 3px 6px;
  text-decoration: underline;
}
.active-clear-all:hover { color: var(--rose); }

/* ─── Pens checklist ────────────────────────────── */
.pens-progress {
  margin-bottom: 24px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--border-rose-mild);
  border-radius: var(--radius);
}
.pens-progress-text {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--display);
  letter-spacing: 0.05em;
}
.pens-count { font-size: 1.7rem; color: var(--gold); font-weight: 700; }
.pens-total { color: var(--ink-dim); font-size: 0.9rem; }
.pens-bar {
  height: 8px;
  background: var(--bg-2);
  border-radius: 4px;
  overflow: hidden;
}
.pens-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--rose), var(--gold));
  transition: width 0.3s ease;
  box-shadow: 0 0 8px var(--rose-glow-med);
}

.pens-list { display: flex; flex-direction: column; gap: 24px; }
.pens-group { }
.pens-group-title {
  font-family: var(--display);
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--rose-hi);
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--border-rose-mild);
  padding-bottom: 6px;
}
.pens-group-count {
  font-size: 0.8rem;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: italic;
  letter-spacing: 0.02em;
}

.pen-rows {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}

.pen-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px 8px 14px;
  background: var(--panel);
  border: 1px solid var(--border-rose-vague);
  border-radius: var(--radius-sm);
  font-family: var(--sans);
  transition: all 0.12s ease;
}
.pen-row.owned {
  background: linear-gradient(135deg, var(--panel-2), var(--panel));
  border-color: var(--gold);
}
.pen-row.owned .pen-name { color: var(--ink); font-style: normal; }
.pen-name {
  font-size: 0.98rem;
  color: var(--ink-dim);
  font-style: italic;
  flex: 1;
  min-width: 0;
}
.pen-qty {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.pen-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-rose-strong);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.12s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.pen-btn:hover { border-color: var(--gold); color: var(--gold); background: var(--panel); }
.pen-btn:active { transform: scale(0.92); }
.pen-count {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-family: var(--display);
  font-size: 1.05rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.pen-row:not(.owned) .pen-count { color: var(--ink-dim); }
.pens-total-grand {
  color: var(--gold);
  font-size: 0.9rem;
  font-family: var(--sans);
  font-style: italic;
}

/* ─── Empty ────────────────────────────── */
.empty {
  text-align: center;
  padding: 72px 24px;
  color: var(--ink-dim);
}
.empty .ghost {
  font-size: 3.5rem;
  margin-bottom: 12px;
  animation: floatGhost 3s ease-in-out infinite;
}
.empty p {
  font-style: italic;
  font-size: 1.05rem;
  margin: 0;
}
@keyframes floatGhost {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.hidden { display: none !important; }

/* ─── Modal ────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 18px;
  padding: 28px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-popover);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: transparent;
  border: none;
  color: var(--muted-1);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
  font-family: var(--sans);
}
.modal-close:hover { color: var(--rose-1); }
.modal-card h2 {
  font-family: var(--display);
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.modal-name {
  margin: 0 0 18px;
  font-family: var(--serif);
  font-style: italic;
  color: var(--muted-1);
  font-size: 1.05rem;
}

/* ─── Form ────────────────────────────── */
.photo-upload {
  text-align: center;
  margin-bottom: 18px;
}
.photo-label { display: inline-block; cursor: pointer; }
.photo-preview {
  width: 120px;
  height: 120px;
  border-radius: var(--radius);
  background: var(--bg-2);
  border: 2px dashed var(--rose-glow-med);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin: 0 auto;
  transition: border-color 0.15s ease;
}
.photo-preview:hover { border-color: var(--rose-hi); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-hint {
  color: var(--ink-mute);
  font-family: var(--display);
  font-size: 0.85rem;
  text-align: center;
  letter-spacing: 0.08em;
}
.link-btn {
  background: none;
  border: none;
  color: var(--ink-dim);
  text-decoration: underline;
  font-family: var(--sans);
  font-style: italic;
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 8px;
}
.link-btn:hover { color: var(--rose-hi); }

.field {
  display: block;
  margin-bottom: 14px;
}
.field span {
  display: block;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted-1);
  margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.95rem;
}
.field textarea { resize: vertical; min-height: 60px; font-style: normal; }
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--rose-1);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0;
  color: var(--ink);
}
.checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--rose-1);
  cursor: pointer;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.btn-ghost, .btn-primary {
  padding: 11px 20px;
  border-radius: 11px;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 0.86rem;
  letter-spacing: 0;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all 0.12s ease;
}
.btn-ghost {
  background: var(--surface);
  border-color: var(--hairline-2);
  color: var(--muted-1);
}
.btn-ghost:hover { color: var(--rose-2); border-color: var(--rose-edge); background: var(--blush); }
.btn-primary {
  background: var(--rose-1);
  color: #fff;
  border-color: var(--rose-1);
  box-shadow: 0 6px 18px var(--rose-shadow);
}
.btn-primary:hover { background: var(--rose-2); border-color: var(--rose-2); box-shadow: 0 8px 22px var(--rose-shadow-hi); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; box-shadow: none; }

/* ─── Footer ────────────────────────────── */
.app-footer {
  max-width: 1080px;
  margin: 40px auto 0;
  padding: 24px 22px 12px;
  border-top: 1.5px dashed var(--rose-seam);
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px;
}
.footer-links {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  flex-wrap: wrap;
  color: var(--muted-2);
}
.footer-link {
  background: transparent;
  border: 0;
  padding: 4px 6px;
  color: var(--muted-1);
  font-family: var(--sans);
  font-weight: 600;
  font-style: normal;
  font-size: 0.84rem;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: var(--rose-edge);
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}
.footer-link:hover { color: var(--rose-1); }

/* ─── Legal modal ────────────────────────────── */
/* Sits above the auth overlay (z-index 1000) so it can be opened from the
   sign-in card's Terms/Privacy links before the user is authenticated. */
#legal-modal { z-index: 1100; }
.legal-section { padding: 12px 0; }
.legal-section.hidden { display: none; }
.legal-section h2 {
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-2);
  margin: 0 0 14px;
  letter-spacing: 0.01em;
}
.legal-section p { margin: 0 0 12px; line-height: 1.55; color: var(--ink); font-family: var(--sans); }
.legal-section ul { margin: 0 0 12px; padding-left: 22px; font-family: var(--sans); }
.legal-section li { margin-bottom: 8px; line-height: 1.5; color: var(--ink); }
.legal-section strong { color: var(--rose-2); font-weight: 700; }
.legal-section a { color: var(--rose-1); }
.footer-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted-1);
  font-style: italic;
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.45;
  max-width: 64ch;
}

/* ─── Toast ────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink-2);
  border: 0;
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-style: normal;
  font-family: var(--sans);
  font-weight: 600;
  z-index: 200;
  box-shadow: var(--shadow-popover);
  animation: toastIn 0.25s ease;
}
@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.card-clickable {
  cursor: pointer;
  transition: background 0.12s ease;
}
.card-clickable:hover { background: var(--rose-hover-bg); }
.card-clickable::after {
  content: '›';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-dim);
  font-size: 1.4rem;
  pointer-events: none;
}
.grid-list .card-body.card-clickable { position: relative; padding-right: 28px; }

.trade-history-toggle {
  margin: 14px 0;
  text-align: center;
}
.trade-history-toggle button {
  background: transparent;
  border: 1px dashed var(--border-rose-strong);
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: italic;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.trade-history-toggle button:hover { color: var(--rose-hi); border-color: var(--rose); }

/* ─── Trade tab ────────────────────────────── */
.tab-badge {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  margin-left: 4px;
  background: var(--gold);
  color: var(--ink-on-pill);
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 9px;
  vertical-align: middle;
  line-height: 18px;
  text-align: center;
}

.subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-rose-mild);
  overflow-x: auto;
  scrollbar-width: none;
}
.subtabs::-webkit-scrollbar { display: none; }
.subtab { flex-shrink: 0;
  background: transparent;
  border: 0;
  color: var(--muted-1);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: all 0.12s ease;
  white-space: nowrap;
}
.subtab:hover { color: var(--ink); }
.subtab.active {
  color: var(--rose-1);
  font-weight: 800;
  border-bottom-color: var(--rose-1);
}
.subview { display: block; }
.subview.hidden { display: none; }

.badge-trade {
  background: var(--pending-fill);
  color: var(--pending-text);
  border: 1px solid var(--pending-edge);
}

.trader-group, .my-items-section, .trades-section { margin-bottom: 28px; }
.trader-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--ink-2);
  border-bottom: 1.5px dashed var(--rose-seam);
  padding-bottom: 10px;
  margin: 0 0 14px;
  gap: 10px;
  flex-wrap: wrap;
}
.empty-note {
  color: var(--muted-1);
  font-style: italic;
  font-family: var(--serif);
  font-size: 1rem;
  padding: 8px 0;
}

.card-small { font-size: 0.92rem; }
.card-small .card-name { font-size: 1rem; }

.trade-card {
  background: var(--surface);
  border: 1px solid var(--hairline-3);
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-card-soft);
}
.trade-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.trade-with {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink-2);
  margin-right: 10px;
}
.trade-status {
  display: inline-block;
  font-family: var(--sans);
  font-style: normal;
  font-weight: 700;
  color: var(--muted-1);
  font-size: 0.78rem;
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--hairline-2);
  background: var(--surface-2);
}
/* Color-coded so users can scan their trade list for what needs action. */
.trade-status-your  { color: var(--gold-1); border-color: var(--gold-edge); background: var(--gold-fill); font-weight: 800; }
.trade-status-their { color: var(--pending-text); border-color: var(--pending-edge); background: var(--pending-fill); }
.trade-status-done  { color: var(--positive-text); border-color: var(--positive-edge); background: var(--positive-fill); }
.trade-status-dead  { color: var(--muted-2); border-color: var(--hairline); background: var(--canvas); }

.trade-filters { margin-bottom: 16px; }
.trade-list .empty-note { padding: 24px 12px; text-align: center; }
.trade-lines {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 10px;
}
.trade-lines h4 {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.trade-lines ul { margin: 0; padding-left: 18px; }
.trade-lines li { margin-bottom: 2px; }
.trade-lines li.dim { color: var(--ink-dim); font-style: italic; list-style: none; padding-left: 0; }
.trade-message {
  margin: 6px 0 10px;
  font-family: var(--sans);
  font-style: italic;
  color: var(--ink-dim);
  border-left: 2px solid var(--gold-border);
  padding-left: 10px;
}
.ship-first-banner {
  margin: 8px 0;
  padding: 8px 12px;
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
}
.dim { color: var(--ink-dim); font-style: italic; font-size: 0.9rem; }

/* Offer builder */
.modal-card-wide { max-width: 600px; }
.picker-panel {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
}
.picker-panel h3 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--rose-hi);
}
.picker-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-rose-faint);
}
.picker-row:last-child { border-bottom: 0; }
.picker-name { font-family: var(--sans); }
.picker-controls {
  display: flex;
  align-items: center;
  gap: 6px;
}
.picker-count {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  font-family: var(--display);
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* Feedback modal — three structured thumbs rows. */
.thumb-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0;
}
.thumb-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--panel-2);
  border: 1px solid var(--border-rose-mild);
  border-radius: var(--radius-sm);
}
.thumb-label { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.thumb-label strong { font-family: var(--display); font-size: 0.9rem; letter-spacing: 0.04em; color: var(--ink); }
.thumb-label .dim { font-family: var(--sans); font-style: italic; font-size: 0.85rem; line-height: 1.3; }
.thumb-choice { display: flex; gap: 6px; flex-shrink: 0; }
.thumb-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border-rose-mild);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.12s ease;
}
.thumb-btn:hover { border-color: var(--rose-hi); }
.thumb-btn.selected[data-value="up"] {
  background: var(--success-bg);
  border-color: var(--success-border);
  box-shadow: 0 0 10px var(--success-bg);
}
.thumb-btn.selected[data-value="down"] {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  box-shadow: 0 0 10px var(--danger-bg);
}

/* Reputation badge — used everywhere a username appears next to a
   trade context. Format: "@user · 12t · 92%". Clickable; opens the
   mini-profile popover. */
.rep-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid var(--border-rose-mild);
  border-radius: 999px;
  padding: 3px 10px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.12s ease;
  vertical-align: baseline;
}
.rep-badge:hover { border-color: var(--rose-hi); background: var(--rose-hover-bg); }
.rep-badge .rep-name { font-weight: 600; }
.rep-badge .rep-sep { color: var(--ink-mute); }
.rep-badge .rep-count, .rep-badge .rep-percent { color: var(--ink-dim); font-size: 0.85rem; }
.rep-badge .rep-percent.rep-good   { color: var(--success); }
.rep-badge .rep-percent.rep-meh    { color: var(--gold); }
.rep-badge .rep-percent.rep-bad    { color: var(--danger-hi); }
.rep-badge .rep-percent.rep-empty  { color: var(--ink-mute); font-style: italic; }
.rep-badge.rep-large {
  font-size: 1.05rem;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Mini-profile popover — opens from any rep-badge. */
.mini-profile-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-rose-mild);
  padding-bottom: 12px;
}
.mini-profile-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.4rem;
  color: var(--rose-hi);
  letter-spacing: 0.04em;
}
.mini-profile-pct {
  font-family: var(--display);
  font-size: 1.6rem;
  font-weight: 700;
}
.mini-profile-pct.rep-good  { color: var(--success); }
.mini-profile-pct.rep-meh   { color: var(--gold); }
.mini-profile-pct.rep-bad   { color: var(--danger-hi); }
.mini-profile-pct.rep-empty { color: var(--ink-mute); font-style: italic; font-size: 1rem; }
.mini-profile-meta {
  display: block;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: italic;
  font-size: 0.85rem;
}
.mini-profile-cats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.mini-profile-cat {
  padding: 10px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  text-align: center;
}
.mini-profile-cat .cat-name {
  font-family: var(--display);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 4px;
}
.mini-profile-cat .cat-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--display);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}
.mini-profile-cat .cat-up   { color: var(--success); }
.mini-profile-cat .cat-down { color: var(--danger-hi); }
.mini-profile-cat .cat-empty { color: var(--ink-mute); font-style: italic; font-size: 0.85rem; }

.mini-profile-comments h3 {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-transform: uppercase;
  margin: 0 0 10px;
}
.mini-profile-comment {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--panel-2);
  border-left: 3px solid var(--border-rose-mild);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.mini-profile-comment.rating-good { border-left-color: var(--success); }
.mini-profile-comment.rating-meh  { border-left-color: var(--gold); }
.mini-profile-comment.rating-bad  { border-left-color: var(--danger-hi); }
.mini-profile-comment-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-family: var(--sans);
  font-size: 0.85rem;
}
.mini-profile-comment-head .from { color: var(--gold); }
.mini-profile-comment-head .when { color: var(--ink-mute); font-style: italic; }
.mini-profile-comment p {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--ink);
}
.mini-profile-empty {
  color: var(--ink-dim);
  font-style: italic;
  font-family: var(--sans);
  padding: 20px 0;
  text-align: center;
}

@media (max-width: 768px) {
  .thumb-row { padding: 10px 12px; gap: 8px; }
  .thumb-label .dim { font-size: 0.8rem; }
  .thumb-btn { width: 40px; height: 40px; font-size: 1.05rem; }
  .mini-profile-cats { grid-template-columns: 1fr; gap: 6px; }
}

/* ─── Account modal ────────────────────────────── */
.account-section {
  padding: 14px 0;
  border-bottom: 1px solid var(--border-rose-vague);
}
.account-section:last-child { border-bottom: 0; }
.account-section h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--rose-hi);
  margin: 0 0 12px;
}
.account-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.account-row.right { justify-content: flex-end; align-items: center; }
.account-row .field { flex: 1; margin-bottom: 0; }
.account-hint {
  margin: 6px 0 0;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: italic;
  font-size: 0.88rem;
}

.feedback-summary {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  text-align: center;
}
.fb-cell {
  padding: 10px 6px;
  background: var(--bg-2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fb-num {
  font-family: var(--display);
  font-size: 1.3rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.fb-num.fb-good { color: var(--teal-text); }
.fb-num.fb-meh  { color: var(--ink-dim); }
.fb-num.fb-bad  { color: var(--danger-hi); }
.fb-label {
  font-family: var(--sans);
  font-style: italic;
  font-size: 0.75rem;
  color: var(--ink-dim);
  text-transform: lowercase;
}
.active-dot { color: var(--gold); margin-right: 4px; }

/* ─── Share modal & menu ────────────────────────────── */
.menu-section { padding: 4px 0; }
.menu-section.hidden { display: none; }
.menu-divider {
  height: 1px;
  background: var(--border-rose-mild);
  margin: 4px 6px;
}
.menu-item.active { color: var(--gold); }

.share-section { margin-top: 18px; }
.share-section h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  letter-spacing: 0.05em;
  color: var(--rose-hi);
  margin: 0 0 8px;
}
.share-hint {
  margin: 0 0 12px;
  color: var(--ink-dim);
  font-family: var(--sans);
  font-style: italic;
  font-size: 0.92rem;
}
.member-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.member-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border-rose-faint);
  font-family: var(--sans);
}
.member-list li:last-child { border-bottom: 0; }
.role-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 8px;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  background: var(--gold);
  color: var(--ink-on-pill);
  border-radius: 9px;
  font-family: var(--display);
}
.role-tag.editor { background: var(--rose); color: var(--text-on-rose); }
.role-tag.viewer { background: var(--ink-dim); color: var(--bg); }

.invite-link-wrap {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.invite-link-wrap.hidden { display: none; }
.invite-link-wrap input {
  flex: 1;
  background: var(--bg-2);
  border: 1px solid var(--border-rose);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: var(--ink);
  font-family: monospace;
  font-size: 0.78rem;
}

/* ─── Address modal ────────────────────────────── */
.address-their {
  background: var(--bg-2);
  border: 1px solid var(--gold-glow);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-top: 14px;
}
.address-their.hidden { display: none; }
.address-their h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 0.9rem;
  color: var(--gold);
  letter-spacing: 0.05em;
}
.address-their pre {
  margin: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  color: var(--ink);
  white-space: pre-wrap;
}

/* ─── Auth overlay ────────────────────────────── */
body.locked { overflow: hidden; }
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background:
    radial-gradient(circle at 20% 20%, rgba(194,58,107,.12), transparent 55%),
    radial-gradient(circle at 80% 80%, rgba(169,118,47,.10), transparent 55%),
    var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
[data-theme="dark"] .auth-overlay {
  background:
    radial-gradient(circle at 30% 20%, var(--bg-grad-1), transparent 50%),
    radial-gradient(circle at 70% 80%, var(--bg-grad-2), transparent 50%),
    var(--bg);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  padding: 40px 32px;
  box-shadow: 0 30px 70px rgba(43,24,48,.16);
  text-align: center;
}
.auth-mark {
  font-size: 2.4rem;
  margin-bottom: 12px;
  filter: none;
}
.auth-spinner {
  font-size: 2rem;
  color: var(--rose-1);
  letter-spacing: 0.3em;
  animation: pulse 1.4s ease-in-out infinite;
  padding: 30px 0;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
.auth-title {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.01em;
  margin: 0 0 10px;
  line-height: 1.05;
}
.auth-sub {
  font-family: var(--sans);
  font-style: normal;
  color: var(--muted-1);
  font-size: 0.98rem;
  line-height: 1.5;
  margin: 0 0 22px;
}
.auth-sub code {
  background: var(--blush);
  color: var(--rose-2);
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 0.9em;
  font-family: var(--sans);
}
.auth-card .field { text-align: left; margin-bottom: 16px; }
.auth-card .btn { width: 100%; }
.auth-hint {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--muted-1);
  font-style: italic;
  font-family: var(--serif);
}
.auth-error {
  margin-top: 14px;
  color: var(--danger-1);
  font-size: 0.9rem;
  font-family: var(--sans);
  font-weight: 600;
}

/* Consent row on the sign-in form — keeps the magic-link button disabled
   until the checkbox is ticked. */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 18px;
  font-family: var(--sans);
  font-size: 0.92rem;
  color: var(--ink-dim);
  text-align: left;
  line-height: 1.45;
  cursor: pointer;
}
.auth-consent input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--rose-hi);
  cursor: pointer;
}
.auth-consent .inline-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--rose-hi);
  font-family: inherit;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.auth-consent .inline-link:hover { color: var(--rose); }
.btn.primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

/* ─── User badge & menu ────────────────────────────── */
.user-badge {
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  color: var(--ink-2);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.86rem;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.12s ease;
}
.user-badge:hover { border-color: var(--rose-edge); color: var(--rose-2); background: var(--blush); }
.user-badge .user-name { letter-spacing: 0; }
.user-badge .user-caret { font-size: 0.7rem; opacity: 0.7; }

.user-menu {
  position: fixed;
  z-index: 950;
  background: var(--surface);
  border: 1px solid var(--hairline-2);
  border-radius: 12px;
  box-shadow: var(--shadow-popover);
  min-width: 190px;
  padding: 6px;
}
.user-menu .menu-item {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  cursor: pointer;
}
.user-menu .menu-item:hover { background: var(--canvas); color: var(--rose-2); }
.user-menu .menu-item.danger { color: var(--danger-1); font-weight: 700; }
.user-menu .menu-item.danger:hover { background: var(--danger-soft); color: var(--danger-1); }

/* ─── Admin ────────────────────────────── */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--sans);
  margin-top: 12px;
}
.admin-table th, .admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-rose-vague);
  text-align: left;
  vertical-align: middle;
}
.admin-table th {
  font-family: var(--display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-transform: uppercase;
}
.admin-table tr:hover td { background: var(--border-rose-mist); }
.admin-table button {
  background: var(--panel-2);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  padding: 5px 10px;
  border-radius: 999px;
  font-family: var(--sans);
  cursor: pointer;
}
.admin-back { margin-bottom: 12px; }
.admin-back button {
  background: transparent;
  border: 0;
  color: var(--rose-hi);
  font-family: var(--sans);
  font-size: 0.95rem;
  cursor: pointer;
}

/* ─── Mobile ────────────────────────────── */
@media (max-width: 768px) {
  /* Header */
  h1 { font-size: 1.25rem; letter-spacing: 0.05em; }
  .bat-logo { width: 44px; height: 30px; }
  .header-inner { padding: 12px 14px 4px; gap: 8px; }
  .brand { gap: 10px; }
  .header-actions { gap: 6px; }
  .user-badge { padding: 5px 10px; font-size: 0.85rem; }
  .icon-btn { padding: 6px; font-size: 1rem; }

  /* Tabs: scrollable strip, smaller padding */
  .tabs { padding: 0 12px; gap: 0; }
  .tab { padding: 12px 14px 10px; font-size: 0.85rem; letter-spacing: 0.04em; }
  .tab.active::after { left: 8px; right: 8px; }

  /* Sub-tabs */
  .subtab { padding: 10px 12px; font-size: 0.78rem; }

  /* Main padding */
  main { padding: 14px 12px; }

  /* Search bar: full width, then filters wrap below */
  .toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  #search { min-width: 0; padding: 10px 14px; font-size: 0.95rem; }

  /* Filter widgets: shrink and wrap to multiple short rows */
  .filters { flex-wrap: wrap; gap: 6px; }
  .filter-select, .filter-multi summary {
    padding: 8px 28px 8px 12px;
    font-size: 0.85rem;
    min-width: 0;
    flex: 1 1 calc(50% - 6px);
  }
  .filter-multi summary { padding-right: 12px; }
  .filter-clear, .filter-action {
    padding: 8px 12px;
    font-size: 0.82rem;
    margin-left: 0;
    flex: 1 1 100%;
  }
  .filter-options {
    left: 0;
    right: 0;
    min-width: 0;
  }

  /* Active filters bar — wrap normally, smaller text */
  .active-filters { padding: 6px 10px; font-size: 0.82rem; }
  .active-pill { padding: 3px 8px; font-size: 0.78rem; }
  .active-clear-all { font-size: 0.8rem; }

  /* Cards / grids */
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  /* Re-assert single-column for list view — the .grid rule above and this
     .grid-list rule have equal specificity, and the .grid rule otherwise
     wins by source order. */
  .grid-list { grid-template-columns: 1fr; }
  .grid-tight { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .card-name { font-size: 0.98rem; }
  .card-meaning { font-size: 0.88rem; }
  .card-actions { padding: 8px 10px 10px; gap: 4px; }
  .card-actions button, .card-actions .btn-buy { font-size: 0.82rem; padding: 6px 8px; }
  .qty-control { padding: 1px; }
  .qty-btn { width: 28px; height: 28px; font-size: 0.95rem; }
  .qty-display { font-size: 0.85rem; min-width: 22px; }

  /* List view (My Collection) — compact photo, body fills rest */
  .grid-list .card { grid-template-columns: 96px 1fr; }
  .grid-list .card-body { padding: 8px 10px 2px; }
  .grid-list .card-actions {
    padding: 4px 10px 8px;
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-rose-faint);
    margin-top: 4px;
  }
  .grid-list .card-photo { aspect-ratio: 1 / 1; }

  /* Modals: full-width, less inner padding, sticky close */
  .modal-card { max-width: 100%; padding: 18px 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
  .modal-card-wide { max-width: 100%; }
  .modal-card h2 { font-size: 1.2rem; }
  .modal-name { font-size: 0.95rem; }
  .form-actions { flex-direction: column-reverse; gap: 8px; }
  .form-actions button { width: 100%; }

  /* User menu / dropdowns */
  .user-menu { left: 12px; right: 12px; }

  /* Trade lines: stack the two columns */
  .trade-lines { grid-template-columns: 1fr; gap: 8px; }
  .trade-card { padding: 10px 12px; }
  .trade-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .trade-with { margin-right: 0; }

  /* Offer builder — already vertical, just tighten spacing */
  .picker-panel { padding: 10px; }

  /* Account modal sections */
  .account-row { flex-direction: column; align-items: stretch; gap: 6px; }
  .account-row.right { flex-direction: row; justify-content: flex-end; }
  .feedback-summary { grid-template-columns: repeat(5, 1fr); gap: 4px; }
  .fb-cell { padding: 8px 4px; }
  .fb-num { font-size: 1.05rem; }
  .fb-label { font-size: 0.68rem; }

  /* Pens */
  .pens-progress { padding: 12px 14px; }
  .pens-progress-text { gap: 6px; }
  .pen-rows { grid-template-columns: 1fr; }
  .pen-row { padding: 8px 12px; }

  /* Admin table → make horizontally scrollable so columns don't squish */
  .admin-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  /* Auth overlay */
  .auth-card { padding: 28px 22px; }
  .auth-title { font-size: 1.4rem; }
}

/* Extra-small phones — squeeze even more */
@media (max-width: 380px) {
  h1 { font-size: 1.1rem; }
  .bat-logo { width: 36px; height: 24px; }
  .tab { padding: 11px 11px 9px; font-size: 0.8rem; }
  .grid-list .card { grid-template-columns: 80px 1fr; }
  .grid { grid-template-columns: 1fr; }
  .grid-tight { grid-template-columns: repeat(2, 1fr); }
  .card-actions button, .card-actions .btn-buy { font-size: 0.78rem; padding: 5px 7px; }
}
