/* ─── variables.css ──────────────────────────────────────────────
   CSS custom properties (:root), dark mode variable overrides
   ([data-theme="dark"]), and the theme toggle button (.btn-theme).

   Design system: "Toy Shelf" — Adopt Me's own chunky, saturated,
   3D-plastic-toy visual language, executed with real confidence.
   Pink and purple are solid color-blocked fills, not pastel tints;
   chunky rounded-square shapes carry genuine depth via a solid-color
   offset shadow (the toy/game-UI "button lip"), not blurred glows.
   The two sources are two solid colored tabs, directly, no metaphor.
   ─────────────────────────────────────────────────────────────── */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #fef6fa;
  --bg-panel:     #ffffff;
  --bg-row-hover: #fdeef6;

  --pink:         #e91e8c;
  --pink-mid:     #c21774;
  --pink-deep:    #9c0f5c;
  --pink-soft:    #fce4f1;
  --pink-pale:    #fef2f8;
  --rose:         #f6c9e0;

  --positive:     #2e8f5c;
  --negative:     #c2373b;
  --neutral:      #b8a0ad;

  --text:         #211129;
  --text-sec:     #6b5470;
  --text-muted:   #7a6685;
  --border:       #f0d3e5;
  --shadow:       rgba(33, 17, 41, 0.10);
  --shadow-lg:    rgba(33, 17, 41, 0.20);

  /* -mid variants are for TEXT on themed panels (4.5:1+) and shift
     lighter in dark mode so they stay legible on dark surfaces.
     -fill variants are for solid panel/button fills paired with
     hardcoded white — deliberately NOT overridden in dark mode,
     since a white-on-fill or fill-on-white pairing needs the same
     dark, saturated ink regardless of page theme. -deep is the
     solid-color "button lip" depth shadow for a -mid fill; -fill-deep
     is the lip for a -fill fill. */
  --pink-fill:      #c21774;
  --pink-fill-deep: #8f0e56;

  --amvgg:        #a855f7;
  --amvgg-mid:    #8829c4;
  --amvgg-deep:   #6a1fad;
  --amvgg-fill:      #8829c4;
  --amvgg-fill-deep: #6a1fad;
  --amvgg-soft:   #f2e6fd;
  --amvgg-border: #ddc7f7;

  --warning-bg:     #fdf1c7;
  --warning-border: #c9932a;
  --warning-text:   #5c3d0a;

  /* Display: chunky, rounded, confident — a toy-shelf face, not the
     incumbent's cursive-party register. Body: quiet humanist
     workhorse. Mono: ledger numerals for prices/deltas only. */
  --font-display: 'Baloo 2', sans-serif;
  --font-body:    'Manrope', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius:       16px;
  --radius-lg:    24px;
  --radius-pill:  100px;

  --transition:     150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-theme: 320ms ease;
  --duration-enter: 0.55s;

  --warning-amber:      #ffb74d;
  --warning-amber-glow: rgba(255, 183, 77, 0.22);

  --bg-surface:   #ffffff;
  --bg-glass:     rgba(255, 255, 255, 0.94);
  --row-border:   #f5dfec;
  --bg-gradient:  var(--bg-row-hover);

  /* Source-color roles: the two-source mechanism lives directly in
     color — a solid pink tab and a solid purple tab, everywhere. */
  --stamp-elve:   var(--pink);
  --stamp-amvgg:  var(--amvgg);
}

/* ─── Theme toggle button ────────────────────────────────────── */
.btn-theme {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--pink-soft);
  border: 2px solid var(--rose);
  border-radius: 50%;
  color: var(--pink-mid);
  font-size: 1.15rem;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.btn-theme:hover {
  transform: translateY(-2px);
  background: var(--pink-mid);
  color: white;
  box-shadow: 0 4px 14px var(--shadow-lg);
}
.btn-theme:active { transform: scale(0.95); }

/* ─── Dark mode variables ─────────────────────────────────────── */
/* Same solid-color-block logic against a near-black ground — colors
   stay bold and saturated at night, not dimmed to muted pastels. */
[data-theme="dark"] {
  --bg:           #170f1c;
  --bg-panel:     #1f1526;
  --bg-surface:   #241a2c;
  --bg-row-hover: #2b1f34;
  --bg-glass:     rgba(23, 15, 28, 0.94);
  --row-border:   #3a2a45;

  --pink-mid:     #f06292;
  --pink-deep:    #c21774;
  --pink-soft:    rgba(233, 30, 140, 0.18);
  --pink-pale:    rgba(233, 30, 140, 0.1);
  --rose:         #522a44;

  --text:         #f4e6f5;
  --text-sec:     #c9a8ce;
  --text-muted:   #9a80a0;
  --border:       #3a2a45;
  --shadow:       rgba(0, 0, 0, 0.45);
  --shadow-lg:    rgba(0, 0, 0, 0.65);

  --amvgg-mid:    #c495fb;
  --amvgg-deep:   #8829c4;
  --amvgg-soft:   rgba(168, 85, 247, 0.18);
  --amvgg-border: #4a2a70;

  --warning-bg:     #241a05;
  --warning-border: #a07800;
  --warning-text:   #f0c060;

  --positive:     #4cb47f;
  --negative:     #e06467;
}


[data-theme="dark"] .rarity-common     { background: #1e1e1e; color: #aaaaaa; border-color: #333; }
[data-theme="dark"] .rarity-uncommon   { background: #0d1f10; color: #66bb6a; border-color: #1b3e1f; }
[data-theme="dark"] .rarity-rare       { background: #0d1929; color: #64b5f6; border-color: #1a3a5a; }
[data-theme="dark"] .rarity-ultra-rare,
[data-theme="dark"] .rarity-ultra_rare { background: #1a0d2a; color: #ce93d8; border-color: #3d1a5a; }
[data-theme="dark"] .rarity-legendary  { background: #1a1400; color: #ffd740; border-color: #3a2d00; }

[data-theme="dark"] .demand-high   { background: #0d1f10; color: #66bb6a; border-color: #1b3e1f; }
[data-theme="dark"] .demand-medium { background: #1a1400; color: #ffd740; border-color: #3a2d00; }

/* ─── base.css ───────────────────────────────────────────────────
   Reset, body, polka-dot background, floating decorations,
   and .main layout wrapper.
   ─────────────────────────────────────────────────────────────── */

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background-color var(--transition-theme), color var(--transition-theme);
}

/* Toy-shelf ground: a clean near-white surface the bold color-blocked
   panels sit on top of, like toy packaging on a shelf — no texture,
   no gradient wash. */
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ─── Shared spinner (used on home and values pages) ────────── */
.spinner-ring {
  width: 34px;
  height: 34px;
  border: 3px solid var(--rose);
  border-top-color: var(--pink-mid);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── View Transitions API (cross-page navigation) ──────────── */
@view-transition {
  navigation: auto;
}

@keyframes vt-out {
  to { opacity: 0; transform: translateY(-6px); }
}

@keyframes vt-in {
  from { opacity: 0; transform: translateY(8px); }
}

::view-transition-old(root) {
  animation: 160ms ease-out both vt-out;
}

::view-transition-new(root) {
  animation: 240ms ease-in both vt-in;
}

/* Logo morphs smoothly between pages */
::view-transition-old(site-logo),
::view-transition-new(site-logo) {
  animation-duration: 380ms;
  animation-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ─── Discord CTA card (homepage) ───────────────────────────── */
.discord-cta-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #5865f205;
  border: 1.5px solid #5865f230;
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
  flex-wrap: wrap;
}
.discord-cta-card:hover {
  border-color: #5865f2;
  box-shadow: 0 4px 20px var(--shadow-lg);
  transform: translateY(-2px);
}
.discord-cta-card:active { transform: scale(0.99); }

.discord-cta-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: #5865f2;
  border-radius: var(--radius);
  flex-shrink: 0;
  font-size: 1.6rem;
  color: white;
}
.discord-cta-body {
  flex: 1;
  min-width: 180px;
}
.discord-cta-body strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
}
.discord-cta-body span {
  font-size: 0.85rem;
  color: var(--text-sec);
  line-height: 1.4;
}
.discord-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #5865f2;
  color: white;
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius);
  white-space: nowrap;
  flex-shrink: 0;
  transition: background var(--transition), box-shadow var(--transition);
}
.discord-cta-card:hover .discord-cta-btn {
  background: #4752c4;
  box-shadow: 0 2px 12px var(--shadow-lg);
}

/* ─── Discord CTA banner (values page) ──────────────────────── */
.discord-cta-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #5865f205;
  border: 1.5px solid #5865f230;
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin: 1.5rem 0;
  text-decoration: none;
  color: inherit;
  transition: border-color var(--transition), box-shadow var(--transition);
  flex-wrap: wrap;
}
.discord-cta-banner:hover {
  border-color: #5865f2;
  box-shadow: 0 3px 14px var(--shadow);
}
.discord-cta-banner .discord-cta-icon {
  width: 36px;
  height: 36px;
  font-size: 1.15rem;
  border-radius: 8px;
}
.discord-cta-banner .discord-cta-body {
  min-width: 120px;
}
.discord-cta-banner .discord-cta-body strong {
  font-size: 0.95rem;
}
.discord-cta-banner .discord-cta-btn {
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
  margin-left: auto;
}

[data-theme="dark"] .discord-cta-card,
[data-theme="dark"] .discord-cta-banner {
  background: rgba(88, 101, 242, 0.08);
  border-color: rgba(88, 101, 242, 0.25);
}
[data-theme="dark"] .discord-cta-card:hover,
[data-theme="dark"] .discord-cta-banner:hover {
  border-color: #5865f2;
}

/* ─── Screen-reader only (visually hidden but indexable) ─────── */
.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;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3 { text-wrap: balance; }

/* Tabular data (prices, deltas, catalog numbers) reads in the ledger
   mono face with lining figures, everywhere it appears. */
.num, .ledger-figure {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.01em;
}

/* ─── Browser surfaces ───────────────────────────────────────
   The parts we didn't draw still carry the design: selection,
   focus rings, and scrollbars are themed from the palette rather
   than left as generic OS chrome. ─────────────────────────── */
::selection {
  background: var(--pink-fill);
  color: #fff;
}

a { text-underline-offset: 0.15em; }

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
  border-radius: 3px;
}

html {
  scrollbar-color: var(--rose) transparent;
  scrollbar-width: thin;
}

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--rose);
  border-radius: var(--radius-pill);
  border: 3px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--pink-fill); }

/* ─── About / FAQ explanatory content ─────────────────────────
   Shared across home, values, and calculator: static prose for
   crawlers/AI citation plus an optional FAQ disclosure list. ─── */
.about-section {
  max-width: 860px;
  margin: 48px auto 16px;
  padding: 0 20px;
}

.about-section h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--text);
  margin: 32px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.about-section h2::before {
  content: '';
  display: block;
  width: 4px;
  height: 1.1em;
  background: var(--pink-fill);
  border-radius: 2px;
  flex-shrink: 0;
}

.about-section h2:first-child { margin-top: 0; }

.about-section p {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-sec);
  margin: 0 0 12px;
}

.about-section ul {
  margin: 0 0 16px;
  padding-left: 0;
  list-style: none;
}

.about-section li {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-sec);
  padding: 8px 0 8px 18px;
  border-top: 1px solid var(--border);
  position: relative;
}
.about-section li:last-child { border-bottom: 1px solid var(--border); }

.about-section li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 15px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--pink-fill);
}

.about-section li strong { color: var(--text); }

.faq-list { margin-top: 28px; display: flex; flex-direction: column; gap: 6px; }

.faq-item {
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.faq-item[open] {
  border-color: var(--pink-mid);
  box-shadow: 0 4px 16px var(--shadow);
}

.faq-question {
  display: block;
  padding: 13px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background var(--transition), color var(--transition);
}

.faq-question:hover { background: var(--pink-pale); }

.faq-question::-webkit-details-marker { display: none; }
.faq-question::before { content: '+ '; color: var(--pink-mid); font-weight: 800; }
.faq-item[open] .faq-question::before { content: '\2212 '; }

.faq-answer {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-sec);
  padding: 0 16px 16px;
  margin: 0;
  border-top: 1px solid var(--border);
}

/* ─── Main ───────────────────────────────────────────────────── */
.main {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* ─── Toast notifications ───────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 10px 22px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  box-shadow: 0 4px 20px var(--shadow-lg);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
  white-space: nowrap;
}

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

.toast--success { border-color: rgba(46, 143, 92, 0.45); color: var(--positive); }
.toast--error   { border-color: rgba(220, 60, 80, 0.4);   color: var(--negative); }

/* ─── Mobile: keep toast clear of the safe-area inset ─────────── */
@media (max-width: 599px) {
  #toast-container {
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 32px);
    max-width: 100%;
  }
  .toast { white-space: normal; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════
   SHARED DATA PRIMITIVES
   Source chips, rarity ink and AMVGG demand meters are used by the
   values ledger, trade calculator and search, so they live here.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Rarity colours (Adopt Me's own tier hues, as ink not fills) */
.rarity-common     { --rar: #857a8a; }
.rarity-uncommon   { --rar: #3a8a3e; }
.rarity-rare       { --rar: #1f6fc4; }
.rarity-ultra-rare,
.rarity-ultra_rare { --rar: #8e44ad; }
.rarity-legendary  { --rar: #b86400; }
.rarity-event,
.rarity-exotic,
.rarity-limited    { --rar: var(--pink-mid); }

[data-theme="dark"] .rarity-common     { --rar: #aba1b0; }
[data-theme="dark"] .rarity-uncommon   { --rar: #72c476; }
[data-theme="dark"] .rarity-rare       { --rar: #6fb1f2; }
[data-theme="dark"] .rarity-ultra-rare,
[data-theme="dark"] .rarity-ultra_rare { --rar: #c992e4; }
[data-theme="dark"] .rarity-legendary  { --rar: #f2ac45; }

/* Source chip: miniature of the solid source tabs */
.src-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
  flex-shrink: 0;
}
.src-chip-e { background: var(--pink-fill); }
.src-chip-a { background: var(--amvgg-fill); }
.src-chip-sp { background: #15803d; }   /* StarPets € prices */

/* Rarity tag: coloured dot + ink label. [class] lifts specificity past the
   pill-badge colour rules (incl. dark-mode overrides) that share .rarity-* */
.rarity-tag[class],
.pet-rarity-inline[class] {
  background: none;
  border: 0;
  padding: 0;
  color: var(--rar, var(--text-sec));
}

.rarity-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--rar, var(--text-sec));
  white-space: nowrap;
  text-transform: capitalize;
}
.rarity-tag::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: currentColor;
  flex-shrink: 0;
}

/* AMVGG demand meter: three rising bars, filled in AMVGG purple */
.demand-meter {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 11px;
  flex-shrink: 0;
}
.demand-meter i {
  display: block;
  width: 3px;
  border-radius: 1px;
  background: var(--border);
}
.demand-meter i:nth-child(1) { height: 5px; }
.demand-meter i:nth-child(2) { height: 8px; }
.demand-meter i:nth-child(3) { height: 11px; }
.demand-meter-low    i:nth-child(-n+1),
.demand-meter-medium i:nth-child(-n+2),
.demand-meter-high   i:nth-child(-n+3) { background: var(--amvgg-mid); }


/* ─── header.css ─────────────────────────────────────────────────
   Header bar, logo, version badge, sync button, status dot,
   animations, and page nav tabs.
   ─────────────────────────────────────────────────────────────── */

/* ─── Reserve header height before JS populates it (prevents CLS) */
#app-header { min-height: 68px; }

/* ─── Header ─────────────────────────────────────────────────── */
/* Clean white strip, no glass blur — the toy pieces (nav, buttons)
   sit on top of it with their own solid color and depth. */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: 68px;
  background: var(--bg-panel);
  border-bottom: 2px solid var(--border);
  box-shadow: none;
  transition: box-shadow 220ms ease, background-color var(--transition-theme), border-color var(--transition-theme);
}

.header--scrolled {
  box-shadow: 0 4px 28px var(--shadow-lg);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 44px;
  width: auto;
  display: block;
  view-transition-name: site-logo;
  contain: layout;
  transition: transform var(--transition);
}
/* The two blocks nudge like a pressed toy on hover */
a:hover > .header-logo { transform: translateY(-1px) rotate(-1deg); }
a:active > .header-logo { transform: translateY(1px); }

@media (max-width: 599px) { .header-logo { height: 32px; } }
@media (max-width: 379px) { .header-logo { height: 28px; } }
/* Narrow phones: the wordmark needs the room; the version stays in the footer */
@media (max-width: 419px) { .header-version { display: none; } }
@media (prefers-reduced-motion: reduce) { .header-logo { transition: none; } a:hover > .header-logo { transform: none; } }

.header-version {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pink-mid);
  background: var(--pink-soft);
  border: 1px solid var(--rose);
  border-radius: 4px;
  padding: 2px 7px;
  letter-spacing: 0.02em;
  align-self: center;
  margin-left: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 18px;
}

.last-updated {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sec);
}

/* ─── Live badge ──────────────────────────────────────────────── */
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(46, 143, 92, 0.1);
  border: 1px solid rgba(46, 143, 92, 0.3);
  border-radius: var(--radius-pill);
  padding: 3px 8px 3px 6px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--positive);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.live-badge--stale {
  background: rgba(255, 183, 77, 0.1);
  border-color: rgba(255, 183, 77, 0.35);
  color: var(--warning-amber);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
  transition: background var(--transition);
}

.live-badge:not(.live-badge--stale) .live-dot {
  animation: pulse-dot 2.5s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.5); opacity: 0.7; }
}

/* legacy status-dot kept for backwards compat */
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ─── Search hint button (desktop only) ──────────────────────── */
.btn-search-hint {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  min-height: 36px;
}

@media (min-width: 800px) {
  .btn-search-hint { display: flex; }
}

.btn-search-hint:hover {
  background: rgba(233, 30, 140, 0.08);
  border-color: var(--pink-mid);
  color: var(--pink-mid);
}

.search-hint-icon { font-size: 0.85rem; line-height: 1; }

.search-hint-kbd {
  display: inline-flex;
  white-space: nowrap;
  align-items: center;
  padding: 1px 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-body);
  line-height: 1.4;
}

.btn-sync {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 22px;
  background: var(--pink-fill);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 44px;
}

.btn-sync:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px var(--shadow-lg);
}

.btn-sync:active { transform: scale(0.97); }

.btn-sync.spinning .btn-icon { animation: spin 0.9s linear infinite; }
.btn-icon { display: inline-block; font-size: 1rem; line-height: 1; }

/* ─── Page routing ───────────────────────────────────────────── */
.page.page-hidden { display: none; }

/* ─── Page nav: chunky toy tabs ────────────────────────────────
   Solid color-blocked rounded-rects with a real 3D "button lip" —
   the active tab sits on a solid pink offset shadow like a pressed
   toy switch, not a gradient pill or a paper folder tab. */
.page-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.page-tab {
  display: inline-flex;
  align-items: center;
  padding: 9px 16px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  position: relative;
}

.page-tab:hover {
  background: var(--pink-pale);
  color: var(--pink-mid);
}

.page-tab.active {
  background: var(--pink-fill);
  color: #fff;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
  transform: translateY(-1px);
}

.page-tab.active:hover { background: var(--pink-fill); }

.page-tab.active:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--pink-fill-deep);
}

/* ─── Apps nav dropdown ──────────────────────────────────────── */
.page-tab-dropdown {
  position: relative;
}

.page-tab-dropdown-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-tab-dropdown-caret {
  font-size: 0.75rem;
  transition: transform var(--transition);
}

.page-tab-dropdown.open .page-tab-dropdown-caret {
  transform: rotate(180deg);
}

.page-tab-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bg-panel);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 60;
}

.page-tab-dropdown.open .page-tab-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.page-tab-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border-radius: var(--radius);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.page-tab-dropdown-item i {
  width: 16px;
  text-align: center;
  color: var(--pink-mid);
}

.page-tab-dropdown-item:hover {
  background: var(--pink-soft);
  color: var(--pink-mid);
}

.page-tab-dropdown-item.active {
  background: var(--pink-fill);
  color: #fff;
}

.page-tab-dropdown-item.active i {
  color: #fff;
}

@media (max-width: 599px) {
  .page-tab { padding: 5px 14px; font-size: 0.8rem; }
  /* Hide desktop nav tabs — the hamburger drawer replaces them */
  .page-nav { display: none; }
}

/* ─── Trade Calculator CTA button ──────────────────────────────
   The chunky toy-button language: solid pink fill, a solid-color
   offset "lip" for depth, presses flush on click. */
.btn-trade-cta {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: var(--pink-fill);
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  min-height: 44px;
  white-space: nowrap;
  position: relative;
  box-shadow: 0 4px 0 var(--pink-fill-deep);
  transition: transform var(--transition), box-shadow var(--transition);
}

.btn-trade-icon {
  font-size: 1.05rem;
  line-height: 1;
  display: inline-block;
}

.btn-trade-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 0 var(--pink-fill-deep);
}

.btn-trade-cta:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--pink-fill-deep);
}

/* ─── Hamburger menu trigger (mobile only) ───────────────────── */
.btn-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius-pill);
  color: var(--pink-mid);
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
  line-height: 1;
}

.btn-hamburger:hover {
  transform: translateY(-2px);
  background: var(--pink-fill);
  color: white;
  box-shadow: 0 4px 14px var(--shadow-lg);
}

.btn-hamburger:active { transform: scale(0.95); }

@media (max-width: 599px) {
  .btn-hamburger { display: flex; }

  /* Compact the remaining quick-access buttons to icon-only circles */
  .btn-search-hint {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }
  .btn-search-hint .search-hint-label,
  .btn-search-hint .search-hint-kbd { display: none; }

  .btn-trade-cta {
    display: flex;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    box-shadow: none;
  }
  .btn-trade-cta::before { display: none; }
  .btn-trade-cta .btn-trade-label { display: none; }

  /* Theme toggle + account move into the drawer to keep the header uncrowded */
  .btn-theme,
  #headerUserWrap { display: none; }

  .header-right { gap: 8px; }
}

/* ─── Header user / login ─────────────────────────────────────── */
.header-user-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.header-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--rose);
  object-fit: cover;
  transition: border-color var(--transition), transform var(--transition);
}

.header-user-avatar:hover {
  border-color: var(--pink-mid);
  transform: scale(1.08);
}

.header-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 16px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius);
  color: var(--pink-mid);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
  white-space: nowrap;
}

.header-login-btn:hover {
  background: var(--pink-fill);
  border-color: var(--pink-mid);
  color: #fff;
}

/* ─── Mobile slide-out drawer (hamburger menu) ───────────────── */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity var(--transition);
}

.mobile-drawer-backdrop.open {
  display: block;
  opacity: 1;
}

.mobile-drawer {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  width: min(300px, 84vw);
  flex-direction: column;
  gap: 4px;
  background: var(--bg-panel);
  border-left: 1.5px solid var(--border);
  box-shadow: -8px 0 32px var(--shadow-lg);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(100%);
  transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
}

@media (max-width: 599px) {
  .mobile-drawer { display: flex; }
}

.mobile-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
}

.mobile-drawer-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--text);
}

.mobile-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  border-radius: 50%;
  color: var(--text-sec);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.mobile-drawer-close:hover {
  background: var(--pink-fill);
  color: #fff;
}

.mobile-drawer-user {
  padding: 6px 2px 12px;
}

.mobile-drawer-user:empty { display: none; }

.mobile-drawer-user .header-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
}

.mobile-drawer-user .header-user-avatar {
  width: 38px;
  height: 38px;
}

.mobile-drawer-user .header-login-btn {
  display: flex;
  width: 100%;
  justify-content: center;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.mobile-drawer-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.mobile-drawer-link i {
  width: 18px;
  text-align: center;
  color: var(--pink-mid);
}

.mobile-drawer-link:hover {
  background: var(--pink-soft);
  color: var(--pink-mid);
}

.mobile-drawer-link.active {
  background: var(--pink-fill);
  color: #fff;
}

.mobile-drawer-link.active i {
  color: #fff;
}

.mobile-drawer-divider {
  height: 1px;
  margin: 10px 4px;
  background: var(--border);
}

/* ── Login chooser dialog ──────────────────────────────────────── */
.login-chooser-dialog {
  position: fixed;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: var(--bg-panel);
  padding: 28px 24px 24px;
  max-width: 320px;
  width: calc(100% - 32px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.18);
}

.login-chooser-dialog::backdrop {
  background: rgba(0,0,0,0.45);
}

.login-chooser-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}

.login-chooser-close:hover { background: var(--bg-alt); }

.login-chooser-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  margin: 0 0 6px;
  text-align: center;
}

.login-chooser-sub {
  font-size: 0.8rem;
  color: var(--text-sec);
  text-align: center;
  margin: 0 0 20px;
  line-height: 1.5;
}

.login-chooser-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-chooser-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: opacity 140ms;
}

.login-chooser-btn:hover { opacity: 0.88; }

.login-chooser-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.login-chooser-btn--discord {
  background: #5865f2;
  color: #fff;
}

.login-chooser-btn--roblox {
  background: #e52207;
  color: #fff;
}

/* ─── palette.css ─────────────────────────────────────────────────
   Global pet search (⌘K / Ctrl+K / "/"). Included in every bundle
   that renders the site header.
   ─────────────────────────────────────────────────────────────── */

html.palette-lock { overflow: hidden; }

/* ─── Backdrop ───────────────────────────────────────────────── */
#cmdBackdrop {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(33, 17, 41, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
#cmdBackdrop.palette-open { opacity: 1; }
#cmdBackdrop[hidden], #cmdPalette[hidden] { display: none; }

/* ─── Panel ──────────────────────────────────────────────────── */
#cmdPalette {
  position: fixed;
  top: 12vh;
  left: 50%;
  z-index: 501;
  display: flex;
  flex-direction: column;
  width: min(620px, calc(100vw - 32px));
  max-height: min(620px, 76vh);
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  box-shadow: 0 30px 70px var(--shadow-lg), 0 8px 22px var(--shadow);
  overflow: hidden;
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.985);
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
#cmdPalette.palette-open { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ─── Search row: a solid pink band, the site's toy-tab language ─ */
.palette-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 18px;
  background: var(--pink-fill);
  box-shadow: inset 0 -4px 0 var(--pink-fill-deep);
}

.palette-search-icon { font-size: 1.05rem; color: rgba(255, 255, 255, 0.85); flex-shrink: 0; }

#cmdInput {
  flex: 1;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-radius: 14px;
  background: #fff;
  color: #211129;
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 700;
  outline: none;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
}
#cmdInput::placeholder { color: #8a7490; font-weight: 600; }
#cmdInput:focus-visible { box-shadow: 0 3px 0 var(--pink-fill-deep), 0 0 0 3px rgba(255, 255, 255, 0.5); }

.palette-spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.palette-spinner[hidden] { display: none; }

.palette-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  min-width: 44px;
  padding: 0 10px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}
.palette-close:hover { background: rgba(255, 255, 255, 0.26); }
.palette-close i { display: none; font-size: 0.95rem; }

/* ─── Body ───────────────────────────────────────────────────── */
.palette-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) transparent;
}

.palette-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px 6px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.palette-section[hidden] { display: none; }
.palette-section-action {
  border: none;
  background: none;
  padding: 2px 4px;
  font: inherit;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 6px;
}
.palette-section-action:hover { color: var(--pink-mid); }
.palette-section-action[hidden] { display: none; }

#cmdResults { list-style: none; margin: 0; padding: 0; }

.palette-result {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 14px;
  cursor: pointer;
  transition: background var(--transition);
}
.palette-result.palette-active { background: var(--bg-row-hover); box-shadow: inset 0 0 0 2px var(--pink); }

.palette-result-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--pink-pale);
  object-fit: contain;
  flex-shrink: 0;
}
.palette-result-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-mid);
}
.palette-result-all .palette-result-placeholder { background: var(--bg); color: var(--text-sec); }
.palette-result-all .palette-result-rarity { text-transform: none; color: var(--text-muted); }

.palette-result-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

.palette-result-name {
  font-weight: 800;
  font-size: 0.92rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-result-rarity {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--rar, var(--text-muted));
}
.palette-result-rarity[class] { background: none; border: 0; padding: 0; }

.palette-result-vals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
}
.palette-result-vals > span { display: inline-flex; align-items: center; gap: 6px; }
.palette-result-vals .src-chip,
.palette-footer .src-chip { width: 16px; height: 16px; font-size: 0.6rem; border-radius: 5px; }

.palette-result-arrow {
  grid-column: 4;
  font-size: 0.8rem;
  color: var(--pink-mid);
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity var(--transition), transform var(--transition);
}
.palette-result.palette-active .palette-result-arrow { opacity: 1; transform: none; }

/* ─── Status (hint, empty, error) ────────────────────────────── */
.palette-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 34px 24px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-sec);
}
.palette-status[hidden], .palette-status:empty { display: none; }
.palette-status i { font-size: 1.3rem; color: var(--pink-mid); opacity: 0.6; }
.palette-status strong { color: var(--text); }

/* ─── Footer ─────────────────────────────────────────────────── */
.palette-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}
.palette-footer > span { display: inline-flex; align-items: center; gap: 4px; }
.palette-footer-src { margin-left: auto; }

.palette-footer kbd {
  min-width: 20px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg);
  box-shadow: 0 2px 0 var(--border);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-sec);
}

@media (prefers-reduced-motion: reduce) {
  #cmdPalette, #cmdBackdrop { transition: none; }
}

/* ─── Phones: pinned to the top so the keyboard never covers it ─ */
@media (max-width: 599px) {
  #cmdPalette {
    top: calc(8px + env(safe-area-inset-top, 0px));
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px));
    border-radius: 20px;
  }
  .palette-search-row { padding: 10px 10px 10px 14px; gap: 10px; }
  #cmdInput { font-size: 16px; height: 46px; }
  .palette-close { min-width: 40px; height: 40px; padding: 0; }
  .palette-close-kbd { display: none; }
  .palette-close i { display: inline; }
  .palette-footer > span:not(.palette-footer-src) { display: none; }
  .palette-result { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; }
  .palette-result-img { width: 40px; height: 40px; }
  .palette-result-arrow { display: none; }
}

@media (pointer: coarse) {
  .palette-result { -webkit-tap-highlight-color: transparent; }
}

/* ─── alerts.css ─────────────────────────────────────────────────
   Alerts/changes banner with collapsible chips.
   ─────────────────────────────────────────────────────────────── */

/* ─── Alerts Banner ──────────────────────────────────────────── */
.alerts-banner {
  background: var(--pink-pale);
  border: 2px solid var(--rose);
  border-radius: var(--radius-lg);
  overflow: hidden;
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  from { opacity: 0; transform: scale(0.96) translateY(-6px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.alerts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--rose);
}

.alerts-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--pink-mid);
}

.alerts-toggle {
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sec);
  cursor: pointer;
  transition: color var(--transition);
  min-height: 44px;
  padding: 0 8px;
}

.alerts-toggle:hover { color: var(--pink-mid); }

.alerts-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 18px;
}

.alerts-chips.collapsed { display: none; }

.alert-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius-pill);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  min-height: 36px;
}

.alert-chip:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px var(--shadow-lg);
  border-color: var(--pink-mid);
}

.alert-chip-delta.delta-pos,
.alert-chip-delta.pos {
  color: var(--positive);
  background: rgba(46, 143, 92, 0.12);
  border: 1px solid rgba(46, 143, 92, 0.25);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
}

.alert-chip-delta.delta-neg,
.alert-chip-delta.neg {
  color: var(--negative);
  background: rgba(194, 55, 59, 0.1);
  border: 1px solid rgba(194, 55, 59, 0.2);
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
}

/* ─── filters.css ────────────────────────────────────────────────
   Values/calculator page head, toolbar (search, selects, toggle
   chips) and the shared search/input primitives the trade picker
   dialog also uses.
   ─────────────────────────────────────────────────────────────── */

/* ─── Page head ──────────────────────────────────────────────── */
.values-brand-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: end;
  gap: 12px 40px;
  padding: 24px 0 8px;
}

.values-brand-head {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.values-page-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  line-height: 1;
  letter-spacing: -0.01em;
}

/* Source tabs: the two-source mechanism as two solid toy tabs */
.values-source-pills {
  display: flex;
  align-items: center;
  gap: 10px;
}

.vsource-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 6px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.01em;
}

.vsource-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.22);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.vsource-e { background: var(--pink-fill);  box-shadow: 0 3px 0 var(--pink-fill-deep); }
.vsource-a { background: var(--amvgg-fill); box-shadow: 0 3px 0 var(--amvgg-fill-deep); }

.vsource-sep {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.values-page-intro {
  max-width: 72ch;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--text-sec);
}
.values-page-intro strong { color: var(--text); font-weight: 700; }

/* Narrow screens: the intro paragraph moves below the table so the
   first pet is on screen straight away (content unchanged for crawlers) */
@media (max-width: 759px) {
  .values-brand-strip { display: contents; }
  .values-brand-head { padding-top: 12px; }
  .values-page-intro { order: 1; }
  .main > .discord-cta-banner,
  .main > .about-section { order: 2; }
}

@media (max-width: 899px) {
  .values-brand-strip {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px 0 4px;
  }
  .values-page-title { font-size: 2rem; }
}

/* ─── Toolbar ────────────────────────────────────────────────── */
.values-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-panel);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: 0 3px 0 var(--border);
}

.values-toolbar .search-wrap { flex: 1 1 260px; }

.toolbar-selects {
  display: flex;
  gap: 10px;
}

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

/* ─── Search + inputs (shared with the trade picker dialog) ──── */
.search-wrap {
  position: relative;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  color: var(--text-muted);
  pointer-events: none;
}

.filter-input {
  height: 44px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
  outline: none;
}

.filter-input::placeholder { color: var(--text-muted); font-weight: 500; }

.filter-input:hover { border-color: var(--rose); }

.filter-input:focus {
  border-color: var(--pink-mid);
  box-shadow: 0 0 0 3px var(--pink-soft);
  background: var(--bg-panel);
}

.search-input { width: 100%; padding: 0 14px 0 40px; }

.filter-select {
  padding: 0 34px 0 14px;
  min-width: 150px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath fill='%23e91e8c' d='M0 0l5 6 5-6z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.filter-select option { background: var(--bg-panel); color: var(--text); }

/* ─── Toggle chips (checkbox filters + delta visibility) ─────── */
.toggle-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-panel);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.toggle-chip input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.toggle-chip i { font-size: 0.8rem; color: var(--text-muted); transition: color var(--transition); }

.toggle-chip:hover { border-color: var(--rose); color: var(--pink-mid); background: var(--pink-pale); }
.toggle-chip:hover i { color: var(--pink-mid); }

.toggle-chip:has(input:focus-visible) {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.toggle-chip:has(input:checked),
.toggle-chip[aria-pressed="true"] {
  background: var(--pink-fill);
  border-color: var(--pink-fill);
  color: #fff;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
  transform: translateY(-1px);
}
.toggle-chip:has(input:checked) i,
.toggle-chip[aria-pressed="true"] i { color: #fff; }

.toggle-chip:active {
  transform: translateY(1px);
  box-shadow: 0 1px 0 var(--pink-fill-deep);
}

/* ─── Dev scrape button (localhost only, shown via JS) ───────── */
.dev-scrape-btn {
  height: 44px;
  padding: 0 16px;
  background: #1e293b;
  color: #94a3b8;
  border: 1.5px solid #334155;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}
.dev-scrape-btn:hover:not(:disabled) { background: #0f172a; color: #e2e8f0; }
.dev-scrape-btn:disabled { opacity: 0.6; cursor: default; }

/* ─── Toolbar responsive ─────────────────────────────────────── */
@media (max-width: 1099px) {
  .values-toolbar .search-wrap { flex-basis: 100%; }
}

@media (max-width: 599px) {
  .values-toolbar { padding: 8px; gap: 8px; }
  .toolbar-selects { flex: 1 1 100%; }
  .toolbar-selects .filter-select { flex: 1; min-width: 0; }
  .toolbar-toggles {
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin: -3px -8px -6px;
    padding: 3px 8px 6px;
  }
  .toolbar-toggles::-webkit-scrollbar { display: none; }
  .toggle-chip { height: 40px; padding: 0 12px; flex-shrink: 0; }

  /* iOS Safari zooms the viewport on any input with font-size < 16px */
  .filter-input,
  .filter-select { font-size: 16px; }
}

/* ─── table.css ──────────────────────────────────────────────────
   Pet values ledger: one right-aligned column per source per tier
   (Regular / Neon / Mega × Elvebredd / AMVGG), single-height rows,
   inline deltas and AMVGG demand meters. Collapses to source-labelled
   cards under 760px. Also carries shared rarity/dual-value helpers,
   loading states, and the page-shell responsive rules.
   ─────────────────────────────────────────────────────────────── */

/* ─── SSR pet rows: shown to no-JS crawlers, JS hides them on hydration */
.ssr-pet-row { font-size: 0.85rem; }
.ssr-pet-row td { padding: 8px 14px; border-bottom: 1px solid var(--row-border); font-family: var(--font-mono); text-align: right; }
.ssr-pet-row td.col-name,
.ssr-pet-row td.col-rarity { font-family: var(--font-body); text-align: left; }
.ssr-pet-row .col-name a { color: var(--text); text-decoration: none; font-weight: 700; }

/* ─── Ledger panel ───────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  overflow: clip;   /* clip, not hidden: keeps the sticky thead working */
  box-shadow: 0 4px 0 var(--border);
}

.table-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  padding: 14px 20px;
  border-bottom: 1px solid var(--row-border);
}

.table-count {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.table-key {
  display: flex;
  align-items: center;
  gap: 6px 18px;
  flex-wrap: wrap;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sec);
}

.key-item { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.key-delta i { font-size: 0.8rem; }
.key-delta i:first-child { color: var(--positive); }
.key-delta i:nth-child(2) { color: var(--negative); margin-left: -3px; margin-right: 2px; }

/* ─── Table grid ─────────────────────────────────────────────── */
.pet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.pet-table col.c-rarity { width: 124px; }
.pet-table col.c-val    { width: 112px; }
/* StarPets € columns: value columns narrow a little so the pet name keeps room */
.pet-table col.c-sp { width: 88px; }
.table-wrap:not(.prices-hidden) .pet-table col.c-val:not(.c-sp) { width: 100px; }

.pet-table thead {
  position: sticky;
  top: var(--app-header-h, 68px);
  z-index: 10;
}

.pet-table th {
  background: var(--bg-panel);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-align: right;
  white-space: nowrap;
  user-select: none;
  padding: 0 14px;
}

.thead-tiers th { padding-top: 14px; padding-bottom: 6px; }
.thead-tiers .col-name,
.thead-tiers .col-rarity {
  text-align: left;
  vertical-align: bottom;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
}
.thead-tiers .col-name { padding-left: 20px; }

/* Tier label sits centred over its E/A pair with a bracket rule */
.thead-tiers .col-tier {
  text-align: center;
  color: var(--text);
  border-left: 1px solid var(--row-border);
  background-image: linear-gradient(var(--border), var(--border));
  background-size: calc(100% - 28px) 2px;
  background-position: center bottom;
  background-repeat: no-repeat;
}

.thead-sources th {
  padding-top: 8px;
  padding-bottom: 10px;
  border-bottom: 1.5px solid var(--border);
}

.pet-table .tier-start { border-left: 1px solid var(--row-border); }

/* Sorting */
.pet-table th[data-sort] { cursor: pointer; transition: color var(--transition); }
.pet-table th[data-sort]:hover { color: var(--pink-mid); }
.pet-table th[data-sort]:focus-visible { outline: 2px solid var(--pink); outline-offset: -4px; border-radius: 8px; }
.pet-table th[data-sort]::after {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  content: '\f0dc';
  margin-left: 6px;
  font-size: 0.7rem;
  opacity: 0.3;
}
.pet-table th.sort-asc,
.pet-table th.sort-desc { color: var(--pink-mid); }
.pet-table th.sort-asc::after  { content: '\f0de'; opacity: 1; }
.pet-table th.sort-desc::after { content: '\f0dd'; opacity: 1; }

/* ─── Rows ───────────────────────────────────────────────────── */
.pet-table td {
  height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid var(--row-border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.pet-table tbody tr:last-child td { border-bottom: none; }

.pet-row {
  cursor: pointer;
  transition: background-color var(--transition);
}
.pet-row:hover { background: var(--bg-row-hover); }
.pet-row:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: -2px;
  background: var(--bg-row-hover);
}

/* Pet identity cell */
.pet-table td.col-name { padding-left: 16px; }

.pet-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.pet-img-wrap {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  overflow: hidden;
  background: var(--pink-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pet-img { width: 100%; height: 100%; object-fit: contain; }
.pet-img-placeholder { font-size: 16px; line-height: 1; color: var(--pink-mid); opacity: 0.6; }

.pet-id {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.pet-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* With the € columns on, the name column is narrower: let long names use two
   lines instead of cutting them off (rows are tall enough for two) */
@media (min-width: 760px) {
  .table-wrap:not(.prices-hidden) .pet-name {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    white-space: normal;
    line-height: 1.25;
  }
}

/* Moved since the last scrape: a small pink marker, no animation */
.row-changed .pet-name::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 7px;
  border-radius: 50%;
  background: var(--pink);
  vertical-align: 2px;
}

.pet-rarity-inline {
  display: none;
  text-transform: capitalize;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--rar, var(--text-muted));
}

.pet-track-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  background: transparent;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0;
  flex-shrink: 0;
  transition: opacity var(--transition), background var(--transition), border-color var(--transition), color var(--transition);
}

.pet-row:hover .pet-track-btn,
.pet-row:focus-within .pet-track-btn { opacity: 1; }

.pet-track-btn:hover,
.pet-track-btn:focus-visible {
  background: var(--pink-soft);
  border-color: var(--rose);
  color: var(--pink-mid);
  opacity: 1;
}

/* ─── Value cells ────────────────────────────────────────────── */
.val-cell { text-align: right; }

.val-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.val-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.val-num {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
  white-space: nowrap;
}

.val-empty .val-num {
  color: var(--text-muted);
  font-weight: 500;
  opacity: 0.55;
}

.val-delta {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}
.val-delta i { font-size: 0.72rem; }
.val-delta.delta-pos { color: var(--positive); }
.val-delta.delta-neg { color: var(--negative); }

.deltas-hidden .val-delta { display: none; }

/* "Show €" off: hide the StarPets price columns (specific enough to beat the phone card layout) */
/* Fixed table layout ignores display:none on <col>, so the € columns collapse to
   zero width instead (nothing shifts; tier headers keep spanning 3) */
.prices-hidden .pet-table col.c-sp { width: 0; }
.prices-hidden .pet-table .col-src-sp,
.prices-hidden .pet-table tbody tr td.val-sp {
  visibility: hidden;
  padding: 0;
  border: 0;
  font-size: 0;
}

/* One-shot flash on a cell whose value just moved */
@keyframes flash-gain {
  0%, 100% { background-color: transparent; }
  20%      { background-color: color-mix(in srgb, var(--positive) 16%, transparent); }
}
@keyframes flash-loss {
  0%, 100% { background-color: transparent; }
  20%      { background-color: color-mix(in srgb, var(--negative) 16%, transparent); }
}
.val-flash-gain { animation: flash-gain 1.8s cubic-bezier(0.16, 1, 0.3, 1); }
.val-flash-loss { animation: flash-loss 1.8s cubic-bezier(0.16, 1, 0.3, 1); }

@media (prefers-reduced-motion: reduce) {
  .val-flash-gain, .val-flash-loss { animation: none; }
}

/* ─── Shared helpers used by pet page, trade calc and admin ──── */
.rarity-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: capitalize;
  white-space: nowrap;
}

.rarity-common                    { background: #f5f5f5;         color: #9e9e9e; border: 1px solid #e0e0e0; }
.rarity-uncommon                  { background: #e8f5e9;         color: #388e3c; border: 1px solid #c8e6c9; }
.rarity-rare                      { background: #e3f2fd;         color: #1976d2; border: 1px solid #bbdefb; }
.rarity-ultra-rare,
.rarity-ultra_rare                { background: #f3e5f5;         color: #7b1fa2; border: 1px solid #e1bee7; }
.rarity-legendary                 { background: #fffde7;         color: #f57f17; border: 1px solid #fff9c4; }
.rarity-event,
.rarity-exotic,
.rarity-limited                   { background: var(--pink-soft); color: var(--pink-mid); border: 1px solid var(--rose); }

.delta-pos  { color: var(--positive); }
.delta-neg  { color: var(--negative); }
.delta-zero { color: var(--neutral);  }

.dual-val {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0 4px;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}

.dv-elve  { color: var(--pink-mid);  text-align: right;  }
.dv-amvgg { color: var(--amvgg-mid); text-align: left;   }
.dv-sep   { color: var(--text-muted); font-weight: 400; font-size: 0.75rem; text-align: center; }

.legend-elve  { color: var(--pink-mid);  }
.legend-amvgg { color: var(--amvgg-mid); }

/* ─── Loading / empty ────────────────────────────────────────── */
.loading-row td, .empty-row td {
  height: auto;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  max-width: 44ch;
  margin: 0 auto;
  font-size: 0.85rem;
  line-height: 1.55;
}
.empty-state i { font-size: 1.4rem; color: var(--pink-mid); opacity: 0.5; margin-bottom: 4px; }
.empty-state strong { font-size: 1rem; color: var(--text); }

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-sec);
}

.spinner-ring {
  width: 34px;
  height: 34px;
  border: 3px solid var(--rose);
  border-top-color: var(--pink-mid);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ─── Skeleton rows ──────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-cell {
  border-radius: 6px;
  background: linear-gradient(90deg, var(--bg) 25%, var(--border) 50%, var(--bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-row .pet-cell { gap: 12px; }
.sk-img   { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; }
.sk-name  { height: 13px; width: 150px; max-width: 70%; }
.sk-badge { height: 12px; width: 70px; }
.sk-val   { height: 13px; width: 52px; margin-left: auto; }

/* ─── Infinite scroll sentinel ──────────────────────────────── */
#scrollSentinel td { height: auto; padding: 0; border: none; }
.sentinel-inner    { height: 1px; }

/* ─── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--rose); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--pink-fill); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ─── Page shell, tablet ─────────────────────────────────────── */
@media (min-width: 600px) and (max-width: 899px) {
  .header { padding: 0 20px; }
  .main   { padding: 16px 16px 60px; }
}

/* ─── Mid widths: drop the rarity column, rarity moves under the name */
/* 1024-1279px with € on: nine value columns + rarity leave the pet name no room,
   so rarity moves under the name (as it does below 1024px) and columns tighten.
   Collapsed to zero width rather than display:none, which would shift cells in
   the fixed table layout. */
@media (min-width: 1024px) and (max-width: 1279px) {
  .table-wrap:not(.prices-hidden) .pet-table col.c-rarity { width: 0; }
  .table-wrap:not(.prices-hidden) .pet-table .col-rarity {
    visibility: hidden;
    padding: 0;
    border: 0;
    font-size: 0;
  }
  .table-wrap:not(.prices-hidden) .pet-rarity-inline { display: block; }
  .table-wrap:not(.prices-hidden) .pet-table col.c-val:not(.c-sp) { width: 92px; }
  .table-wrap:not(.prices-hidden) .pet-table col.c-sp { width: 84px; }
}

@media (max-width: 1023px) {
  .pet-table col.c-rarity { width: 0; }
  .pet-table .col-rarity { display: none; }
  .pet-table colgroup { display: none; }
  .pet-table { table-layout: auto; }
  .pet-rarity-inline { display: block; }
  .pet-table th, .pet-table td { padding-left: 10px; padding-right: 10px; }
  .pet-table td.val-cell { min-width: 84px; }
  .table-caption { padding: 12px 16px; }
}

/* ─── Narrow (< 760px): each pet becomes a source-labelled card ─
   Card grid:  [pet identity ················· ]
               [E] [reg-E]  [neon-E]  [mega-E]
               [A] [reg-A]  [neon-A]  [mega-A]
   The thead stays as one sticky label strip aligned to the card grid. */
@media (max-width: 759px) {
  .table-wrap {
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .table-caption {
    padding: 4px 4px 10px;
    border-bottom: none;
    gap: 6px 14px;
  }
  .table-key { gap: 6px 14px; font-size: 0.75rem; }
  .key-delta { display: none; }

  .pet-table,
  .pet-table tbody { display: block; }

  .pet-table thead {
    display: block;
    background: var(--bg);
    padding: 6px 0 8px;
  }
  .thead-sources { display: none; }
  .thead-tiers {
    display: grid;
    grid-template-columns: 30px repeat(3, minmax(0, 1fr));
    column-gap: 10px;
    padding: 0 14px;
  }
  .pet-table .thead-tiers th {
    display: block;
    padding: 8px 0;
    background: none;
    border: none;
    font-size: 0.68rem;
    text-align: right;
  }
  .thead-tiers .col-name { text-align: left; padding-left: 0; }
  .pet-table th[data-sort]::after { margin-left: 4px; }

  /* Card */
  .pet-table tbody tr.pet-row,
  .pet-table tbody tr.skeleton-row {
    display: grid;
    grid-template-columns: 30px repeat(3, minmax(0, 1fr));
    grid-template-areas:
      "pet pet pet pet"
      "e   re  ne  me"
      "a   ra  na  ma"
      ".   rs  ns  ms";
    column-gap: 10px;
    row-gap: 4px;
    padding: 12px 14px 12px;
    margin-bottom: 10px;
    background: var(--bg-panel);
    border-radius: var(--radius);
    box-shadow: 0 3px 0 var(--border);
  }

  .pet-row:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--border); }
  .pet-row:hover { background: var(--bg-panel); }

  .pet-table tbody tr.pet-row::before,
  .pet-table tbody tr.pet-row::after,
  .pet-table tbody tr.skeleton-row::before,
  .pet-table tbody tr.skeleton-row::after {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: start;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: #fff;
  }
  .pet-table tbody tr.pet-row::before,
  .pet-table tbody tr.skeleton-row::before { content: 'E'; grid-area: e; background: var(--pink-fill); }
  .pet-table tbody tr.pet-row::after,
  .pet-table tbody tr.skeleton-row::after  { content: 'A'; grid-area: a; background: var(--amvgg-fill); }

  .pet-table tbody tr.pet-row td,
  .pet-table tbody tr.skeleton-row td {
    display: block;
    height: auto;
    min-width: 0;
    padding: 0;
    border: none;
  }

  .pet-table tbody tr td.col-name {
    grid-area: pet;
    padding: 0 0 10px;
    margin-bottom: 6px;
    border-bottom: 1px solid var(--row-border);
  }
  .pet-table .thead-tiers th.col-rarity,
  .pet-table tbody tr.pet-row td.col-rarity,
  .pet-table tbody tr.skeleton-row td.col-rarity { display: none; }

  /* Cells per tier: E, A, € (the € line needs no chip - its values start with €) */
  .pet-table tbody tr td:nth-child(3)  { grid-area: re; }
  .pet-table tbody tr td:nth-child(4)  { grid-area: ra; }
  .pet-table tbody tr td:nth-child(5)  { grid-area: rs; }
  .pet-table tbody tr td:nth-child(6)  { grid-area: ne; }
  .pet-table tbody tr td:nth-child(7)  { grid-area: na; }
  .pet-table tbody tr td:nth-child(8)  { grid-area: ns; }
  .pet-table tbody tr td:nth-child(9)  { grid-area: me; }
  .pet-table tbody tr td:nth-child(10) { grid-area: ma; }
  .pet-table tbody tr td:nth-child(11) { grid-area: ms; }
  .pet-table tbody tr td.val-sp .val-num { color: #15803d; }
  [data-theme="dark"] .pet-table tbody tr td.val-sp .val-num { color: #4ade80; }

  /* "Show €" off: drop the € line from the card */
  .prices-hidden .pet-table tbody tr td.val-sp { display: none; }
  .prices-hidden .pet-table tbody tr.pet-row,
  .prices-hidden .pet-table tbody tr.skeleton-row {
    grid-template-areas:
      "pet pet pet pet"
      "e   re  ne  me"
      "a   ra  na  ma";
  }

  .val-stack { min-height: 20px; justify-content: center; }
  .val-num { font-size: 0.82rem; }
  .val-line { gap: 5px; }

  .pet-track-btn { opacity: 1; }

  .loading-row,
  .empty-row {
    display: block;
    background: var(--bg-panel);
    border-radius: var(--radius);
    box-shadow: 0 3px 0 var(--border);
  }
  .loading-row td,
  .empty-row td { display: block; border-bottom: none; padding: 44px 16px; }

  #scrollSentinel { display: block; }
  #scrollSentinel td { display: block; }
}

/* ─── Mobile (< 600px): page shell + dialogs ─────────────────── */
@media (max-width: 599px) {
  .dual-val { font-size: 0.76rem; }
}

/* ─── Mobile (< 600px): cards ────────────────────────────────── */
@media (max-width: 599px) {

  /* ── Header ── */
  .header {
    height: auto;
    padding: 10px 14px;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 56px;
  }

  .header-logo { height: 32px; }

  .last-updated {
    font-size: 0.75rem;
    gap: 6px;
  }

  #lastUpdatedText { display: none; } /* live badge alone is sufficient on mobile */

  .btn-sync { padding: 9px 16px; font-size: 0.82rem; }

  /* ── Main ── */
  .main { padding: 10px 10px calc(80px + env(safe-area-inset-bottom, 0px)); gap: 10px; }

  /* ── Alerts ── */
  .alerts-banner { border-radius: var(--radius); }

  .alerts-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 14px;
    gap: 6px;
  }
  .alerts-chips::-webkit-scrollbar { display: none; }
  .alert-chip { flex-shrink: 0; }


  /* ── Chart Dialog: full screen on mobile ── */
  dialog {
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }

  .dialog-inner {
    border-radius: 0;
    border: none;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    box-shadow: none;
    animation: dialog-slide-up 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
  }

  @keyframes dialog-slide-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  .dialog-header { padding: 14px 16px; }
  .dialog-pet-name { font-size: 1.1rem; }
  .dialog-pet-img  { width: 44px; height: 44px; }
  .dialog-pet-info { gap: 10px; }

  /* Source label: horizontal across top on mobile */
  .dialog-source-row { flex-direction: column; }

  .dialog-source-label {
    writing-mode: horizontal-tb;
    transform: none;
    min-width: unset;
    width: 100%;
    padding: 5px 14px;
    font-size: 0.75rem;
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    text-align: left;
    letter-spacing: 0.05em;
  }

  .dialog-source-vals {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
  }
  .dialog-source-vals::-webkit-scrollbar { display: none; }

  .dialog-val-item {
    flex: none;
    min-width: 90px;
    padding: 10px 10px;
  }

  .dialog-val-number { font-size: 1.1rem; }

  .variant-toggle-wrap { padding: 10px 14px 2px; gap: 8px; }
  .variant-btn { padding: 7px 16px; font-size: 0.78rem; }

  .chart-source-toggle-wrap { padding: 10px 14px 0; }
  .chart-source-btn { padding: 7px 14px; font-size: 0.74rem; }

  .chart-container {
    flex: 1;
    min-height: 200px;
    padding: 12px;
    height: auto;
  }

  .dialog-footer { text-align: center; font-size: 0.7rem; }
}

/* ─── Responsive: mobile FAB offset (sits above the mobile nav) ─ */
@media (max-width: 599px) {
  .trade-fab {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    padding: 12px 18px;
    font-size: 0.9rem;
  }
}

/* Hide Trade FAB while keyboard is open over search on mobile */
@media (max-width: 599px) {
  body.search-active .trade-fab {
    display: none !important;
  }
}


/* ─── Touch optimizations (mobile) ──────────────────────────── */
@media (max-width: 599px) {
  /* Remove tap highlight flash on interactive elements */
  .pet-row,
  .alert-chip,
  .picker-pet-card,
  .trade-pet-card,
  .btn-sync,
  .trade-fab,
  .dialog-close,
  .alerts-toggle,
  .trade-add-btn,
  .picker-confirm-btn,
  .picker-tier-btn,
  .picker-mode-btn,
  .variant-btn,
  .chart-source-btn,
  .chart-range-btn,
  .picker-back-btn,
  .toggle-chip {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

}

/* ─── Very small screens (< 380px) ──────────────────────────── */
@media (max-width: 379px) {
  .header-logo { height: 28px; }

  /* Hide timestamp text on tiny screens - status dot still visible */
  #lastUpdatedText { display: none; }
  .header-right { gap: 12px; }

  .btn-sync {
    padding: 8px 12px;
    font-size: 0.78rem;
    gap: 5px;
  }

  .thead-tiers,
  .pet-table tbody tr.pet-row,
  .pet-table tbody tr.skeleton-row {
    column-gap: 6px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .val-num { font-size: 0.76rem; }
  .demand-meter { display: none; }

  .main {
    padding: 8px 8px calc(24px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .trade-fab {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

}

/* ─── dialogs.css ────────────────────────────────────────────────
   Chart dialog, dialog header/values, variant toggle (Ride/Fly),
   chart source toggle, demand badges, and scrollbar for dialog.
   ─────────────────────────────────────────────────────────────── */

/* ─── Chart Dialog ───────────────────────────────────────────── */
dialog {
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  background: transparent;
  max-width: 760px;
  width: calc(100vw - 40px);
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
}

/* Chart dialog: fixed height so it never resizes while history loads */
.chart-dialog {
  height: min(88vh, 740px);
}

.chart-dialog .dialog-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  /* Replace scale animation (causes visible size change) with fade + slide */
  animation: chart-dialog-in 0.25s ease;
}

@keyframes chart-dialog-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Chart container fills remaining space instead of fixed 300px */
.chart-dialog .chart-container {
  flex: 1;
  min-height: 180px;
  height: auto;
}

dialog::backdrop {
  background: rgba(61, 26, 46, 0.45);
  backdrop-filter: blur(8px) saturate(0.35);
}

.dialog-inner {
  background: var(--bg-surface);
  border: 2px solid var(--rose);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 32px 70px var(--shadow-lg), 0 8px 24px var(--shadow);
  animation: dialog-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes dialog-pop {
  from { opacity: 0; transform: scale(0.88); }
  to   { opacity: 1; transform: scale(1); }
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  background: var(--bg-gradient);
  border-bottom: 1.5px solid var(--rose);
}

.dialog-pet-info { display: flex; align-items: center; gap: 14px; }

.dialog-pet-img {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--pink-soft);
  border: 2px solid var(--rose);
  object-fit: contain;
}

.dialog-pet-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--pink-mid);
  margin-bottom: 4px;
}

.dialog-pet-rarity { font-size: 0.78rem; font-weight: 700; text-transform: capitalize; }

.dialog-view-page-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius-pill);
  color: var(--pink-mid);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
}
.dialog-view-page-btn:hover {
  background: var(--pink-fill);
  color: white;
}

.dialog-close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--rose);
  border-radius: 50%;
  background: var(--bg-surface);
  color: var(--text-sec);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
}

.dialog-close:hover {
  background: var(--negative);
  border-color: var(--negative);
  color: white;
  transform: rotate(90deg) scale(1.1);
}

.dialog-values { display: flex; flex-direction: column; }

.dialog-source-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

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

.amvgg-row { background: #fdf8ff; }

.dialog-source-label {
  display: flex;
  align-items: center;
  justify-content: center;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  transform: rotate(180deg);
  padding: 8px 6px;
  font-family: var(--font-display);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  min-width: 28px;
  border-right: 1.5px solid var(--border);
  flex-shrink: 0;
}

.elve-label  { color: var(--pink-mid);  background: var(--pink-soft); border-color: var(--rose); }
.amvgg-label { color: var(--amvgg-mid); background: var(--amvgg-soft); border-color: var(--amvgg-border); }

.dialog-source-vals {
  display: flex;
  flex: 1;
  gap: 1px;
  background: var(--border);
}

.dialog-val-item {
  flex: 1;
  padding: 12px 14px;
  background: var(--bg-surface);
  text-align: center;
}

.amvgg-row .dialog-val-item { background: #fdf8ff; }

.dialog-val-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.dialog-val-number {
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.elve-num  { color: var(--pink-mid);  }
.amvgg-num { color: var(--amvgg-mid); }

.dialog-val-delta {
  font-size: 0.75rem;
  font-weight: 800;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.dialog-val-delta.delta-zero { display: none; }

.dialog-val-demand { margin-top: 4px; }

/* ─── Variant toggle (Ride / Fly buttons) ───────────────────── */
.variant-toggle-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px 4px;
  background: var(--bg-surface);
}

.variant-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 20px;
  background: var(--pink-pale);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
  min-height: 36px;
  white-space: nowrap;
}

.variant-btn:hover {
  background: var(--rose);
  border-color: var(--pink-mid);
  color: var(--text);
}

.variant-btn.active {
  background: var(--pink-fill);
  border-color: var(--pink-mid);
  color: white;
  box-shadow: 0 3px 10px var(--shadow);
}

.variant-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px var(--shadow-lg);
}

/* ─── Chart source toggle (inside dialog) ───────────────────── */
.chart-source-toggle-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 20px 0;
  background: var(--bg-surface);
}

.chart-source-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.chart-source-btn {
  padding: 8px 18px;
  background: var(--pink-pale);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  min-height: 36px;
}

.chart-source-btn:last-child { border-right: none; }

.chart-source-btn.active {
  background: var(--pink-fill);
  color: white;
}

.chart-source-btn[data-csource="amvgg"].active {
  background: var(--amvgg-fill);
}

/* "Both" is neither source's color — a neutral solid ink fill reads
   as "combined" without inventing a gradient blend of the two brand
   hues (banned: gradient fills on any toggle/button/panel). */
.chart-source-btn[data-csource="both"].active {
  background: var(--text);
}

.chart-source-btn:not(.active):hover {
  background: var(--rose);
  color: var(--text);
}

/* ─── Chart range toggle (7d / 30d / All) ───────────────────── */
.chart-range-toggle-wrap {
  display: flex;
  justify-content: center;
  padding: 6px 20px 0;
  background: var(--bg-surface);
}

.chart-range-toggle {
  display: flex;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.chart-range-btn {
  padding: 5px 14px;
  background: var(--pink-pale);
  border: none;
  border-right: 1px solid var(--border);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
  min-height: 30px;
}

.chart-range-btn:last-child { border-right: none; }
.chart-range-btn.active { background: var(--pink-fill); color: white; }
.chart-range-btn:not(.active):hover { background: var(--rose); color: var(--text); }

.chart-container { padding: 20px; height: 300px; }
.chart-container canvas { width: 100% !important; height: 100% !important; }

.dialog-footer {
  padding: 10px 22px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  background: var(--bg);
}

/* ─── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  dialog { width: calc(100vw - 16px); }

  .dialog-header { padding: 14px 16px; }
  .dialog-pet-img { width: 44px; height: 44px; }
  .dialog-pet-name { font-size: 1.1rem; }

  .dialog-val-item { padding: 10px 8px; }
  .dialog-val-number { font-size: 1.05rem; }

  .chart-dialog .chart-container { flex: 1; min-height: 160px; padding: 12px; }
}

/* ─── Demand Badges ──────────────────────────────────────────── */
.demand-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.demand-high   { background: #e8f5e9; color: #388e3c; border: 1px solid #c8e6c9; }
.demand-medium { background: #fffde7; color: #f57f17; border: 1px solid #fff9c4; }
.demand-low    { background: var(--pink-soft); color: var(--pink-mid); border: 1px solid var(--rose); }

/* ─── PiP trade pop-out button ───────────────────────────────── */
.btn-pip-trade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.78rem;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  flex-shrink: 0;
}

.btn-pip-trade:hover {
  background: var(--pink-soft);
  color: var(--pink-mid);
  border-color: var(--rose);
}

/* ─── Desktop app download modal ────────────────────────────── */
.desktop-app-modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  background: transparent;
  max-width: 420px;
  width: calc(100vw - 32px);
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.desktop-app-modal::backdrop {
  background: rgba(0,0,0,0.45);
}

.desktop-app-modal-inner {
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px 28px;
  position: relative;
  text-align: center;
}

.desktop-app-modal-inner .dialog-close {
  position: absolute;
  top: 14px;
  right: 14px;
}

.desktop-app-modal-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--pink-soft);
  color: var(--pink-mid);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.desktop-app-modal-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 10px;
}

.desktop-app-modal-body {
  font-size: 0.875rem;
  color: var(--text-sec);
  line-height: 1.55;
  margin-bottom: 24px;
}

.desktop-app-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.desktop-app-modal-primary {
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--pink-fill);
  color: #fff;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  transition: opacity 140ms;
}

.desktop-app-modal-primary:hover { opacity: 0.88; }

.desktop-app-modal-secondary {
  padding: 10px 24px;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-sec);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 120ms, border-color 120ms;
}

.desktop-app-modal-secondary:hover {
  background: var(--pink-soft);
  border-color: var(--rose);
  color: var(--pink-mid);
}

/* ─── trade.css ──────────────────────────────────────────────────
   Floating Trade button, the Trade Calculator window (.tc-*) and
   the pet picker (.tp-*). Shared by home, values, calculator and
   pet pages.
   ─────────────────────────────────────────────────────────────── */

/* ─── Floating Action Button ──────────────────────────────────── */
.trade-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--pink-fill);
  border: none;
  border-radius: var(--radius);
  color: white;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 20px var(--shadow-lg);
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 52px;
}

/* Tooltip label that slides in from the right on hover */
.trade-fab::after {
  content: 'Trade Calculator';
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(8px);
  background: var(--text);
  color: var(--bg-panel);
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

.trade-fab:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.trade-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 26px var(--shadow-lg);
}
.trade-fab:active { transform: scale(0.96); }

@media (max-width: 600px) {
  .trade-fab {
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    padding: 12px 20px;
    font-size: 0.92rem;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TRADE CALCULATOR WINDOW (.tc-*)
   Two neutral sides (pink and purple are reserved for the two
   sources), a solid pink header band, and a dual-source verdict
   strip: one balance meter per source, never a blended answer.
   ═══════════════════════════════════════════════════════════════ */

.trade-dialog {
  /* Verdict tones: theme-stable fills paired with white or dark ink */
  --tc-win:        #2e8f5c;  --tc-win-deep:   #1d6541;
  --tc-lose:       #c2373b;  --tc-lose-deep:  #8c2326;
  --tc-split:      #f3aa3c;  --tc-split-deep: #b8761a;  --tc-split-ink: #2b1904;
  --tc-even:       #6b5470;  --tc-even-deep:  #4b3a50;

  width: min(1060px, calc(100vw - 40px));
  max-width: none;
  height: min(88vh, 800px);
  border-radius: var(--radius-lg);
}

.tc-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 70px var(--shadow-lg), 0 8px 22px var(--shadow);
  animation: tc-in 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes tc-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

/* ─── Header band ───────────────────────────────────────────── */
.tc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 18px 24px;
  background-color: var(--pink-fill);
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1.2px, transparent 1.4px);
  background-size: 14px 14px;
  color: #fff;
  box-shadow: inset 0 -4px 0 var(--pink-fill-deep);
}

.tc-title-wrap { display: flex; align-items: center; gap: 14px; min-width: 0; }

.tc-title-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: #fff;
  color: var(--pink-fill);
  font-size: 1.25rem;
  flex-shrink: 0;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
  transform: rotate(-4deg);
}

.tc-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.05;
  color: #fff;
  margin: 0;
}

.tc-sub {
  margin: 2px 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.tc-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.tc-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}
.tc-action:hover { background: rgba(255, 255, 255, 0.24); border-color: rgba(255, 255, 255, 0.6); }
.tc-action:active { transform: translateY(1px); }
.tc-action:disabled { opacity: 0.6; cursor: default; }
.tc-action-icon { width: 40px; padding: 0; justify-content: center; }
.tc-action:focus-visible,
.tc-close:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.tc-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 12px;
  background: #fff;
  color: var(--pink-fill);
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
  transition: transform var(--transition), box-shadow var(--transition);
}
.tc-close:hover  { transform: translateY(-1px); box-shadow: 0 4px 0 var(--pink-fill-deep); }
.tc-close:active { transform: translateY(2px);  box-shadow: 0 1px 0 var(--pink-fill-deep); }

/* ─── Two sides ─────────────────────────────────────────────── */
.tc-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr);
  min-height: 0;
  padding: 18px 18px 0;
}

.tc-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg);
  border-radius: 18px;
  padding: 14px 12px 12px;
}

.tc-side-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 4px 12px;
}

.tc-side-name { display: flex; flex-direction: column; gap: 2px; }

.tc-side-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}
.tc-side-tag::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.8rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: var(--text);
  color: var(--bg-panel);
}
.tc-side-give .tc-side-tag::before { content: '\f062'; }  /* arrow-up: leaving you */
.tc-side-get  .tc-side-tag::before { content: '\f063'; }  /* arrow-down: coming to you */

.tc-side-count {
  padding-left: 32px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tc-side-totals { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }

.tc-total {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.tc-total-num {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
}

.tc-list {
  list-style: none;
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) transparent;
}

/* Pet entry */
.tc-pet {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 32px;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 10px;
  background: var(--bg-panel);
  border-radius: 14px;
  box-shadow: 0 2px 0 var(--border);
  animation: tc-pet-in 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tc-pet-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.tc-pet-img,
.tp-row-img,
.tp-pet-img {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--pink-pale);
  object-fit: contain;
  flex-shrink: 0;
}
.tc-img-placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-mid);
  opacity: 0.6;
}

.tc-pet-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.tc-pet-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-pet-tags { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }

.tc-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 6px;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sec);
}
.tc-tag-neon { color: #13806f; border-color: color-mix(in srgb, #13806f 35%, transparent); }
.tc-tag-mega { color: #b0550a; border-color: color-mix(in srgb, #b0550a 35%, transparent); }
[data-theme="dark"] .tc-tag-neon { color: #5fd3bf; }
[data-theme="dark"] .tc-tag-mega { color: #f3a15a; }
.tc-tag-potion { padding: 0; width: 18px; justify-content: center; }
.tc-pet-tags .demand-meter { margin-left: 4px; }

.tc-pet-vals { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }

.tc-val { display: inline-flex; align-items: center; gap: 6px; }
.tc-val .src-chip { width: 16px; height: 16px; font-size: 0.6rem; border-radius: 5px; }
.tc-val-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
  min-width: 3ch;
  text-align: right;
}
.tc-val-missing { color: var(--text-muted); opacity: 0.6; cursor: help; }

.tc-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.tc-remove:hover,
.tc-remove:focus-visible { background: color-mix(in srgb, var(--negative) 12%, transparent); color: var(--negative); }

/* Empty side */
.tc-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  padding: 20px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}
.tc-empty-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--bg-panel);
  color: var(--pink-mid);
  box-shadow: 0 2px 0 var(--border);
}

.tc-add {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-shrink: 0;
  min-height: 46px;
  margin-top: 10px;
  border: 1.5px solid var(--rose);
  border-radius: 14px;
  background: var(--bg-panel);
  color: var(--pink-mid);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.tc-add:hover {
  background: var(--pink-fill);
  border-color: var(--pink-fill);
  color: #fff;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
  transform: translateY(-1px);
}
.tc-add:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--pink-fill-deep); }

/* Swap */
.tc-swap-col { display: flex; align-items: center; justify-content: center; }
.tc-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--bg-panel);
  color: var(--text-sec);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--border);
  transition: color var(--transition), border-color var(--transition), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.tc-swap:hover:not(:disabled) { color: var(--pink-mid); border-color: var(--rose); transform: rotate(180deg); }
.tc-swap:disabled { opacity: 0.45; cursor: default; }

/* ─── Verdict strip ─────────────────────────────────────────── */
.tc-verdict {
  display: grid;
  grid-template-columns: minmax(250px, 0.8fr) minmax(0, 2fr);
  gap: 18px;
  align-items: stretch;
  padding: 18px;
}

.tc-verdict-idle { grid-template-columns: 1fr; }

.tc-idle {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 18px;
  background: var(--bg);
  color: var(--text-sec);
  font-size: 0.88rem;
}
.tc-idle i { font-size: 1.3rem; color: var(--text-muted); }
.tc-idle p { margin: 0; }
.tc-idle strong { color: var(--text); }

.tc-headline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: 18px;
  color: #fff;
  background: var(--tc-even);
  box-shadow: 0 4px 0 var(--tc-even-deep);
  animation: tc-verdict-in 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tc-verdict-in {
  from { transform: translateY(4px) scale(0.98); }
  to   { transform: none; }
}
.tc-verdict-win   .tc-headline { background: var(--tc-win);   box-shadow: 0 4px 0 var(--tc-win-deep); }
.tc-verdict-lose  .tc-headline { background: var(--tc-lose);  box-shadow: 0 4px 0 var(--tc-lose-deep); }
.tc-verdict-split .tc-headline { background: var(--tc-split); box-shadow: 0 4px 0 var(--tc-split-deep); color: var(--tc-split-ink); }

.tc-headline-icon { font-size: 1.7rem; line-height: 1; flex-shrink: 0; }
.tc-headline-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tc-headline-text strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.1;
}
.tc-headline-text span { font-size: 0.8rem; font-weight: 600; line-height: 1.4; opacity: 0.92; }

.tc-meters { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-width: 0; }

.tc-meter-legend,
.tc-meter-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 132px 72px;
  align-items: center;
  gap: 14px;
}
.tc-meter-legend {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.tc-meter-legend span { grid-row: 1; grid-column: 2; }
.tc-meter-legend span:last-child { justify-self: end; }

.tc-meter-src {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text);
}

/* The balance: the whole track is what you get, the neutral block from
   the left is what you give. Past the centre tick = you give more. */
.tc-meter {
  position: relative;
  height: 14px;
  border-radius: var(--radius-pill);
  overflow: visible;
}
.tc-meter-e { background: var(--pink-fill); }
.tc-meter-a { background: var(--amvgg-fill); }
.tc-meter-empty { background: var(--bg); box-shadow: inset 0 0 0 1.5px var(--border); }

.tc-meter-give {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: var(--radius-pill) 0 0 var(--radius-pill);
  background: var(--rose);
  box-shadow: 2px 0 0 var(--bg-panel);
  transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .tc-meter-give { background: #5d4a66; }

.tc-meter-mid {
  position: absolute;
  left: 50%;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  border-radius: 1px;
  background: var(--text);
}

.tc-meter-ends {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-muted);
}

.tc-meter-row { padding-bottom: 14px; }

.tc-meter-diff {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
  line-height: 1.15;
}
.tc-meter-diff small { font-size: 0.7rem; font-weight: 700; opacity: 0.8; }
.tc-diff-win  { color: var(--positive); }
.tc-diff-lose { color: var(--negative); }

.tc-outcome {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 60px;
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #fff;
  background: var(--tc-even);
}
.tc-outcome-win  { background: var(--tc-win); }
.tc-outcome-lose { background: var(--tc-lose); }
.tc-outcome-none { background: transparent; color: var(--text-muted); box-shadow: inset 0 0 0 1.5px var(--border); }

.tc-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sec);
}
.tc-note i { margin-top: 2px; color: var(--text-muted); }

/* ═══════════════════════════════════════════════════════════════
   PET PICKER (.tp-*)
   ═══════════════════════════════════════════════════════════════ */

.picker-dialog {
  width: min(580px, calc(100vw - 40px));
  max-width: none;
  height: min(82vh, 680px);
  border-radius: var(--radius-lg);
}

.tp-shell {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--bg-panel);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 30px 70px var(--shadow-lg), 0 8px 22px var(--shadow);
  animation: tc-in 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

.tp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 16px 12px 20px;
}
.tp-head .tc-close {
  margin-left: auto;
  background: var(--bg);
  color: var(--text-sec);
  box-shadow: none;
}
.tp-head .tc-close:hover { background: var(--pink-soft); color: var(--pink-mid); transform: none; }
.tp-head .tc-close:focus-visible,
.tp-back:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }

.tp-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text-sec);
  cursor: pointer;
}
.tp-back:hover { background: var(--bg); color: var(--pink-mid); }
.tp-back[hidden] { display: none; }

.trade-dialog:focus,
.picker-dialog:focus { outline: none; }

.tp-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}

.tp-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 0 16px 16px;
}
.picker-step-hidden { display: none !important; }

.tp-search {
  position: relative;
  flex-shrink: 0;
  margin-bottom: 10px;
}
.tp-search i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--pink-mid);
  pointer-events: none;
}
.tp-search input {
  width: 100%;
  height: 50px;
  padding: 0 16px 0 44px;
  border: 2px solid var(--border);
  border-radius: 14px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.tp-search input::placeholder { color: var(--text-muted); font-weight: 500; }
.tp-search input:focus { border-color: var(--pink-mid); background: var(--bg-panel); box-shadow: 0 0 0 4px var(--pink-soft); }
.tp-search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.tp-list {
  list-style: none;
  flex: 1;
  min-height: 0;
  margin: 0 -6px;
  padding: 2px 6px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) transparent;
}

.tp-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto 14px;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition);
}
.tp-row:hover { background: var(--bg-row-hover); }
.tp-row:focus-visible { outline: 2px solid var(--pink); outline-offset: -2px; background: var(--bg-row-hover); }

.tp-row-id { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tp-row-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tp-row-rarity {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: capitalize;
  color: var(--rar, var(--text-muted));
}
.tp-row-rarity[class] { background: none; border: 0; padding: 0; }

.tp-row-vals {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.tp-row-vals > span { display: inline-flex; align-items: center; gap: 6px; }
.tp-row-vals .src-chip { width: 16px; height: 16px; font-size: 0.6rem; border-radius: 5px; }

.tp-row-go { font-size: 0.72rem; color: var(--text-muted); opacity: 0; transition: opacity var(--transition), transform var(--transition); }
.tp-row:hover .tp-row-go,
.tp-row:focus-visible .tp-row-go { opacity: 1; color: var(--pink-mid); transform: translateX(2px); }

.tp-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
}
.tp-msg i { font-size: 1.3rem; color: var(--pink-mid); opacity: 0.6; }
.tp-msg-error, .tp-msg-error i { color: var(--negative); opacity: 1; }

.tp-note {
  padding: 12px 10px 4px;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* Variant step */
.tp-pet {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px;
  margin-bottom: 18px;
  border-radius: 18px;
  background: var(--bg);
}
.tp-pet .tp-pet-img { width: 64px; height: 64px; border-radius: 16px; background: var(--bg-panel); }
.tp-pet-id { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tp-pet-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text);
}

.tp-group { margin-bottom: 16px; }
.tp-group[hidden] { display: none; }

.tp-label {
  margin-bottom: 8px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-sec);
}

.tp-seg {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
  grid-auto-flow: column;
  gap: 8px;
}

.tp-seg-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--bg-panel);
  color: var(--text);
  font-family: var(--font-body);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.tp-seg-btn[hidden] { display: none; }
.tp-seg-btn:hover { border-color: var(--rose); background: var(--pink-pale); }
.tp-seg-btn:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.tp-seg-name { font-size: 0.9rem; font-weight: 800; }
.tp-seg-vals {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-sec);
}
.tp-seg-vals > span { display: inline-flex; align-items: center; gap: 5px; }

.tp-mini {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 700;
  width: 13px;
  height: 13px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.tp-mini-e { background: var(--pink-fill); }
.tp-mini-a { background: var(--amvgg-fill); }

.tp-seg-btn.active {
  background: var(--pink-fill);
  border-color: var(--pink-fill);
  color: #fff;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
  transform: translateY(-1px);
}
.tp-seg-btn.active .tp-seg-vals { color: rgba(255, 255, 255, 0.9); }
.tp-seg-btn.active .tp-mini { background: rgba(255, 255, 255, 0.25); }

.tp-potions { display: flex; gap: 8px; }
.tp-potion {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: var(--bg-panel);
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 800;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition);
}
.tp-potion:hover { border-color: var(--rose); color: var(--pink-mid); background: var(--pink-pale); }
.tp-potion:focus-visible { outline: 2px solid var(--pink); outline-offset: 2px; }
.tp-potion[aria-pressed="true"] {
  background: var(--pink-fill);
  border-color: var(--pink-fill);
  color: #fff;
  box-shadow: 0 3px 0 var(--pink-fill-deep);
  transform: translateY(-1px);
}

.tp-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 16px;
  background: var(--bg);
}
.tp-preview-src {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--bg-panel);
}
.tp-preview-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-sec);
}
.tp-preview-num {
  grid-column: 1 / -1;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 1.4rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
  transition: color var(--transition);
}
.tp-preview-num.no-val { color: var(--text-muted); opacity: 0.6; }
.tp-preview-note {
  grid-column: 1 / -1;
  margin: 2px 2px 0;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-sec);
}

.tp-confirm {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-shrink: 0;
  min-height: 54px;
  border: none;
  border-radius: 16px;
  background: var(--pink-fill);
  color: #fff;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--pink-fill-deep);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.tp-confirm:hover:not(:disabled)  { transform: translateY(-1px); box-shadow: 0 5px 0 var(--pink-fill-deep); }
.tp-confirm:active:not(:disabled) { transform: translateY(3px);  box-shadow: 0 1px 0 var(--pink-fill-deep); }
.tp-confirm:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; }
.tp-confirm:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .tc-shell, .tp-shell, .tc-pet, .tc-headline { animation: none; }
  .tc-meter-give { transition: none; }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* Verdict stacks before the sides do */
@media (max-width: 959px) {
  .tc-verdict { grid-template-columns: 1fr; }
}

/* Phones and narrow tablets: full-screen sheet, one scroll, verdict pinned */
@media (max-width: 699px) {
  .trade-dialog,
  .picker-dialog {
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .tc-shell, .tp-shell { border-radius: 0; box-shadow: none; }

  .tc-shell { grid-template-rows: auto minmax(0, 1fr) auto; }

  .tc-head { padding: calc(12px + env(safe-area-inset-top, 0px)) 12px 12px 16px; }
  .tc-title-icon { width: 38px; height: 38px; font-size: 1rem; border-radius: 12px; }
  .tc-title { font-size: 1.25rem; }
  .tc-sub { display: none; }
  .tc-action { width: 40px; padding: 0; justify-content: center; }
  .tc-action-label {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
  .tc-actions { gap: 6px; }

  .tc-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 12px 12px 0;
    gap: 0;
    align-content: start;
  }
  .tc-list { overflow: visible; flex: none; }
  .tc-empty { min-height: 0; padding: 12px; flex-direction: row; }
  .tc-empty-icon { width: 36px; height: 36px; }
  .tc-swap-col { height: 44px; }
  .tc-swap i { transform: rotate(90deg); }
  .tc-side:last-child { margin-bottom: 12px; }

  .tc-verdict {
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border);
    background: var(--bg-panel);
  }
  .tc-headline { padding: 10px 14px; gap: 12px; }
  .tc-headline-icon { font-size: 1.3rem; }
  .tc-headline-text strong { font-size: 1.05rem; }
  .tc-headline-text span { font-size: 0.72rem; }
  .tc-idle { padding: 12px 14px; font-size: 0.8rem; }

  .tc-meter-legend { display: none; }
  .tc-meter-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "src diff out" "bar bar bar";
    gap: 6px 10px;
    padding-bottom: 16px;
  }
  .tc-meter-src  { grid-area: src; }
  .tc-meter      { grid-area: bar; height: 10px; }
  .tc-meter-diff { grid-area: diff; flex-direction: row; align-items: baseline; gap: 6px; font-size: 0.85rem; }
  .tc-outcome    { grid-area: out; min-width: 0; height: 22px; font-size: 0.66rem; }
  .tc-meters { gap: 4px; }
  .tc-note { font-size: 0.7rem; }

  .tp-head { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
  .tp-step { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .tp-search input { font-size: 16px; }   /* no iOS zoom */
  .tp-seg-btn { padding: 10px; }
  .tp-preview-num { font-size: 1.2rem; }
}

@media (max-width: 379px) {
  .tc-pet { grid-template-columns: 36px minmax(0, 1fr) auto 28px; gap: 8px; }
  .tc-pet-img { width: 36px; height: 36px; }
  .tp-row { grid-template-columns: 36px minmax(0, 1fr) auto; }
  .tp-row-img { width: 36px; height: 36px; }
  .tp-row-go { display: none; }
}

/* Touch: no tap flash, no double-tap zoom delay */
@media (pointer: coarse) {
  .tc-action, .tc-close, .tc-add, .tc-remove, .tc-swap,
  .tp-row, .tp-seg-btn, .tp-potion, .tp-confirm, .tp-back {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .tc-remove { width: 40px; height: 40px; }
  .tc-pet { grid-template-columns: 42px minmax(0, 1fr) auto 40px; }
}

/* ─── footer.css ─────────────────────────────────────────────────
   Site footer layout, brand, links, copyright, and version badge.
   ─────────────────────────────────────────────────────────────── */

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  border-top: 1.5px solid var(--border);
  background: var(--bg-panel);
  transition: background-color var(--transition-theme), border-color var(--transition-theme);
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--pink-mid);
  letter-spacing: 0.01em;
}

.footer-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.55;
  max-width: 560px;
}

.footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-sources {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: 2px;
}

.footer-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-sec);
  text-decoration: none;
  transition: color var(--transition);
}
.footer-link:hover { color: var(--pink-mid); }
.footer-link-icon { font-size: 1rem; line-height: 1; vertical-align: middle; }

.footer-dot {
  font-size: 0.75rem;
  color: var(--border);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-version {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--pink-mid);
  background: var(--pink-soft);
  border: 1px solid var(--rose);
  border-radius: 4px;
  padding: 2px 8px;
  letter-spacing: 0.02em;
}

@media (max-width: 599px) {
  .footer-inner { padding: 16px 14px calc(16px + env(safe-area-inset-bottom, 0px)); gap: 12px; }

  .footer-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-right {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* Dot separators look orphaned when items wrap on narrow screens */
  .footer-dot { display: none; }
}

/* ─── Sync status in footer ──────────────────────────────────── */
.footer-sync-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.footer-sync-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--positive);
  flex-shrink: 0;
  animation: pulse-dot 2.5s ease-in-out infinite;
}

.footer-sync-dot--stale {
  background: var(--warning-amber);
  animation: none;
}

/* ─── consent.css ─────────────────────────────────────────────
   Blocking overlay and centered modal for cookie consent.
   Overrides the cookieconsent library's bottom-banner defaults.
   ─────────────────────────────────────────────────────────── */

/* Backdrop – covers the entire viewport until user chooses */
#cc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9998;
  transition: opacity 0.25s ease;
}

/* Block scroll while overlay is in the DOM */
body:has(#cc-overlay) {
  overflow: hidden;
}

/* ─── Center the consent window as a modal ─────────────────── */
.cc-window {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  bottom: auto !important;
  right: auto !important;
  transform: translate(-50%, -50%) !important;
  width: min(90vw, 460px) !important;
  max-width: none !important;
  border-radius: 20px !important;
  padding: 28px 28px 24px !important;
  flex-direction: column !important;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55) !important;
  z-index: 9999 !important;
}

.cc-message {
  font-size: 0.95rem !important;
  line-height: 1.6 !important;
  text-align: center !important;
  margin-bottom: 20px !important;
}

.cc-compliance {
  display: flex !important;
  flex-direction: row !important;
  gap: 10px !important;
  width: 100% !important;
}

.cc-btn {
  flex: 1 !important;
  text-align: center !important;
  padding: 11px 0 !important;
  border-radius: 100px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.02em !important;
  transition: opacity 0.15s ease, transform 0.15s ease !important;
  cursor: pointer !important;
}

.cc-btn:hover {
  opacity: 0.85 !important;
  transform: translateY(-1px) !important;
}

.cc-deny {
  background: transparent !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
}

/* Stack buttons vertically on very small screens */
@media (max-width: 360px) {
  .cc-compliance {
    flex-direction: column !important;
  }
}
