/* ─── variables.css ──────────────────────────────────────────────
   CSS custom properties (:root), dark mode variable overrides
   ([data-theme="dark"]), and the theme toggle button (.btn-theme).
   ─────────────────────────────────────────────────────────────── */

/* ─── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #fff5f9;
  --bg-panel:     #ffffff;
  --bg-row-hover: #fff5f9;

  --pink:         #e91e8c;
  --pink-mid:     #f06292;
  --pink-soft:    #fce4ec;
  --pink-pale:    #fff0f6;
  --rose:         #f8bbd0;

  --positive:     #2ecc8f;
  --negative:     #f0607e;
  --neutral:      #d4a8bd;

  --text:         #3d1a2e;
  --text-sec:     #8d5a72;
  --text-muted:   #c4a0b5;
  --border:       #fad4e4;
  --shadow:       rgba(233, 30, 140, 0.08);
  --shadow-lg:    rgba(233, 30, 140, 0.15);

  --amvgg:        #a855f7;
  --amvgg-soft:   #f3e8ff;
  --amvgg-border: #ddd6fe;

  --warning-bg:     #fef9c3;
  --warning-border: #eab308;
  --warning-text:   #713f12;

  --font-display: 'Fredoka One', cursive;
  --font-body:    'Plus Jakarta Sans', sans-serif;

  --radius:       12px;
  --radius-lg:    20px;
  --radius-pill:  100px;

  --transition:    150ms cubic-bezier(0.4, 0, 0.2, 1);
  --duration-enter: 0.55s;

  --warning-amber:      #ffb74d;
  --warning-amber-glow: rgba(255, 183, 77, 0.22);

  --bg-surface:   #ffffff;
  --bg-gradient:  linear-gradient(135deg, #fff0f6, #fce4ec);
  --bg-glass:     rgba(255, 255, 255, 0.92);
  --row-border:   #fff0f5;
}

/* ─── Theme toggle button ────────────────────────────────────── */
.btn-theme {
  display: flex;
  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);
  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);
  color: white;
  box-shadow: 0 4px 14px var(--shadow-lg);
}
.btn-theme:active { transform: scale(0.95); }

/* ─── Dark mode variables ─────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #1a0d15;
  --bg-panel:     #231218;
  --bg-surface:   #2a1420;
  --bg-row-hover: #351825;
  --bg-gradient:  linear-gradient(135deg, #2d1422, #3d1a2e);
  --bg-glass:     rgba(26, 13, 21, 0.94);
  --row-border:   #3a1a2e;

  --pink-soft:    rgba(233, 30, 140, 0.18);
  --pink-pale:    rgba(233, 30, 140, 0.1);
  --rose:         #5a2040;

  --text:         #f0d4e6;
  --text-sec:     #c4829b;
  --text-muted:   #7d4a63;
  --border:       #3a1a2e;
  --shadow:       rgba(0, 0, 0, 0.45);
  --shadow-lg:    rgba(0, 0, 0, 0.65);

  --amvgg-soft:   rgba(168, 85, 247, 0.18);
  --amvgg-border: #3d1a5a;

  --warning-bg:     #1e1400;
  --warning-border: #a07800;
  --warning-text:   #f0c060;
}


[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;
}

/* Ambient mesh gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 10% 45%, rgba(249, 168, 212, 0.52) 0%, transparent 48%),
    radial-gradient(ellipse at 88% 12%, rgba(216, 180, 254, 0.42) 0%, transparent 40%),
    radial-gradient(ellipse at 55% 90%, rgba(251, 207, 232, 0.48) 0%, transparent 46%),
    radial-gradient(ellipse at 4%  88%, rgba(233, 30, 140, 0.16) 0%, transparent 32%);
  background-attachment: fixed;
  pointer-events: none;
  z-index: 0;
}

/* Grain overlay for texture depth */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse at 10% 45%, rgba(90, 15, 55, 0.75) 0%, transparent 48%),
    radial-gradient(ellipse at 88% 12%, rgba(55, 10, 95, 0.6) 0%, transparent 40%),
    radial-gradient(ellipse at 55% 90%, rgba(70, 10, 55, 0.65) 0%, transparent 46%),
    radial-gradient(ellipse at 4%  88%, rgba(180, 20, 100, 0.22) 0%, transparent 30%);
}

/* ─── Floating decorations ───────────────────────────────────── */
.bg-deco {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.deco {
  position: absolute;
  font-size: 0; /* hide original emoji text */
  color: transparent;
  --dx: 0px;
  opacity: 0;
  will-change: transform, opacity;
  animation: float-deco linear infinite, deco-enter 1.8s ease forwards;
}

/* All decos render as glowing ✦ stars via ::before */
.deco::before {
  content: '✦';
  font-size: 1.3rem;
  color: var(--pink);
  text-shadow:
    0 0 10px rgba(233, 30, 140, 0.8),
    0 0 25px rgba(233, 30, 140, 0.4),
    0 0 50px rgba(233, 30, 140, 0.15);
  display: block;
  line-height: 1;
}

/* Alternating purple sparkles for visual variety */
.d2::before, .d5::before, .d8::before {
  color: var(--amvgg);
  text-shadow:
    0 0 10px rgba(168, 85, 247, 0.8),
    0 0 25px rgba(168, 85, 247, 0.4),
    0 0 50px rgba(168, 85, 247, 0.15);
}

/* Size variations */
.d3::before { font-size: 0.9rem; }
.d6::before { font-size: 0.85rem; }
.d4::before { font-size: 1.6rem; }
.d7::before { font-size: 1.5rem; }
.d8::before { font-size: 0.8rem; }

/* Staggered entry: fades+unblurs in at different times */
@keyframes deco-enter {
  from { opacity: 0; filter: blur(6px); }
  to   { opacity: 0.5; filter: blur(0); }
}

/* Unique horizontal drift per element via --dx custom property */
.d1 { left:  4%;  top: 12%; animation-duration: 13s, 1.8s; animation-delay: 0s,   0.1s; --dx:  10px; }
.d2 { left: 14%;  top: 68%; animation-duration: 16s, 1.8s; animation-delay: -4s,  0.3s; --dx: -14px; }
.d3 { left: 28%;  top: 32%; animation-duration: 19s, 1.8s; animation-delay: -8s,  0.5s; --dx:   8px; }
.d4 { left: 48%;  top: 82%; animation-duration: 14s, 1.8s; animation-delay: -2s,  0.7s; --dx: -10px; }
.d5 { left: 63%;  top:  8%; animation-duration: 17s, 1.8s; animation-delay: -6s,  0.2s; --dx:  12px; }
.d6 { left: 76%;  top: 52%; animation-duration: 12s, 1.8s; animation-delay: -9s,  0.6s; --dx:  -8px; }
.d7 { left: 87%;  top: 28%; animation-duration: 15s, 1.8s; animation-delay: -3s,  0.4s; --dx:  16px; }
.d8 { left: 93%;  top: 74%; animation-duration: 18s, 1.8s; animation-delay: -7s,  0.8s; --dx: -11px; }

@keyframes float-deco {
  0%   { transform: translate(0, 0)              rotate(0deg);   opacity: 0.22; }
  25%  { transform: translate(calc(var(--dx) * 0.5), -13px)  rotate(90deg);  opacity: 0.55; }
  50%  { transform: translate(var(--dx), -24px)  rotate(180deg); opacity: 0.6; }
  75%  { transform: translate(calc(var(--dx) * 0.5), -11px)  rotate(270deg); opacity: 0.5; }
  100% { transform: translate(0, 0)              rotate(360deg); opacity: 0.22; }
}

/* ─── Shared spinner (used on home and values pages) ────────── */
.spinner-ring {
  width: 34px;
  height: 34px;
  border: 3px solid var(--rose);
  border-top-color: var(--pink);
  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 rgba(88, 101, 242, 0.15);
  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-pill);
  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 rgba(88, 101, 242, 0.35);
}

/* ─── Discord CTA banner (values page) ──────────────────────── */
.discord-cta-banner {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #5865f205;
  border: 1.5px solid #5865f230;
  border-left: 4px solid #5865f2;
  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 rgba(88, 101, 242, 0.12);
}
.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; }

/* ─── 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, 204, 143, 0.45); color: var(--positive); }
.toast--error   { border-color: rgba(220, 60, 80, 0.4);   color: var(--negative); }

/* ─── Mobile: push toast above bottom nav ───────────────────── */
@media (max-width: 599px) {
  #toast-container {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
    width: calc(100% - 32px);
    max-width: 100%;
  }
  .toast { white-space: normal; text-align: center; }
}

/* ─── 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 ─────────────────────────────────────────────────── */
.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-glass);
  backdrop-filter: blur(16px);
  border-bottom: 2px solid var(--rose);
  box-shadow: none;
  transition: box-shadow 220ms ease;
}

.header--scrolled {
  box-shadow: 0 4px 28px var(--shadow-lg);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  height: 56px;
  width: auto;
  display: block;
  view-transition-name: site-logo;
  contain: layout;
}

.header-version {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--pink-mid);
  background: var(--pink-soft);
  border: 1px solid var(--rose);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
  letter-spacing: 0.03em;
  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, 204, 143, 0.1);
  border: 1px solid rgba(46, 204, 143, 0.3);
  border-radius: var(--radius-pill);
  padding: 3px 8px 3px 6px;
  font-size: 0.62rem;
  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-pill);
  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);
}

.search-hint-icon { font-size: 0.85rem; line-height: 1; }

.search-hint-kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.68rem;
  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);
  border: none;
  border-radius: var(--radius-pill);
  color: white;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(233, 30, 140, 0.38);
  transition: transform var(--transition), box-shadow var(--transition);
  min-height: 44px;
}

.btn-sync:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(233, 30, 140, 0.48);
}

.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 tabs ──────────────────────────────────────────── */
.page-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius-pill);
  padding: 4px;
}

.page-tab {
  display: inline-flex;
  align-items: center;
  padding: 6px 18px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.page-tab:hover {
  background: rgba(233, 30, 140, 0.08);
  color: var(--pink);
}

.page-tab.active {
  background: var(--pink);
  color: #fff;
  box-shadow: 0 2px 10px rgba(233, 30, 140, 0.35);
}

@media (max-width: 599px) {
  .page-tab { padding: 5px 14px; font-size: 0.8rem; }
  /* Hide desktop nav tabs — mobile bottom nav replaces them */
  .page-nav { display: none; }
}

/* ─── Trade Calculator CTA button ────────────────────────────── */
.btn-trade-cta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--pink) 0%, var(--amvgg) 100%);
  border: none;
  border-radius: var(--radius-pill);
  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;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(233, 30, 140, 0.38), 0 2px 8px rgba(168, 85, 247, 0.28);
  transition: transform var(--transition), box-shadow var(--transition);
}

/* shimmer sweep */
.btn-trade-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 100%
  );
  transform: translateX(-120%);
  animation: trade-shimmer 3.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes trade-shimmer {
  0%      { transform: translateX(-120%); }
  35%, 100% { transform: translateX(220%); }
}

.btn-trade-icon {
  font-size: 1.05rem;
  line-height: 1;
  display: inline-block;
}

.btn-trade-cta:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 28px rgba(233, 30, 140, 0.52), 0 4px 14px rgba(168, 85, 247, 0.4);
}

.btn-trade-cta:active {
  transform: scale(0.97);
}

@media (max-width: 599px) {
  /* Bottom nav has a Trade button, so hide the duplicate header CTA */
  .btn-trade-cta { display: none; }
  /* Tighter gap — fewer items visible without page-nav */
  .header-right { gap: 10px; }
}

/* ─── 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);
  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-pill);
  color: var(--pink);
  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);
  border-color: var(--pink);
  color: #fff;
}

/* ─── Mobile bottom navigation ───────────────────────────────── */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1.5px solid var(--border);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0px));
  justify-content: space-around;
  align-items: center;
}

@media (max-width: 599px) {
  .mobile-bottom-nav { display: flex; }
}

.mbnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 18px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0;
  cursor: pointer;
  text-decoration: none;
  border-radius: var(--radius);
  transition: color var(--transition), background var(--transition);
  min-width: 56px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.mbnav-item:hover,
.mbnav-item.active {
  color: var(--pink);
  background: var(--pink-soft);
}

.mbnav-icon {
  font-size: 1.2rem;
  line-height: 1;
}

.mbnav-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.mbnav-item.active .mbnav-icon {
  filter: drop-shadow(0 0 6px rgba(233, 30, 140, 0.5));
}

/* ─── palette.css ─────────────────────────────────────────────────
   Command palette (⌘K / Ctrl+K) global search overlay.
   ─────────────────────────────────────────────────────────────── */

/* ─── Backdrop ───────────────────────────────────────────────── */
#cmdBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

#cmdBackdrop.palette-open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Palette container ──────────────────────────────────────── */
#cmdPalette {
  position: fixed;
  top: 18%;
  left: 50%;
  transform: translateX(-50%) scale(0.96);
  width: min(560px, 90vw);
  z-index: 501;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 8px 24px rgba(233, 30, 140, 0.12);
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.34, 1.4, 0.64, 1);
}

#cmdPalette.palette-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) scale(1);
}

/* ─── Search input row ───────────────────────────────────────── */
.palette-search-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1.5px solid var(--border);
}

.palette-search-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
}

#cmdInput {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  outline: none;
  min-width: 0;
}

#cmdInput::placeholder { color: var(--text-muted); }

.palette-close-hint {
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 2px 7px;
  font-weight: 600;
  flex-shrink: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}

.palette-close-hint:hover {
  background: var(--pink-soft);
  color: var(--pink);
}

/* ─── Results list ───────────────────────────────────────────── */
#cmdResults {
  list-style: none;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--rose) transparent;
}

#cmdResults:empty::after {
  content: 'No pets found';
  display: block;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
  padding: 28px 0;
}

.palette-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 10px;
  margin: 2px 6px;
  transition: background var(--transition), color var(--transition);
}

.palette-result:hover,
.palette-result.palette-active {
  background: var(--pink-soft);
}

.palette-result.palette-active {
  outline: 2px solid var(--pink);
  outline-offset: -2px;
}

.palette-result-img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.palette-result-placeholder {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--pink-pale);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.palette-result-info {
  flex: 1;
  min-width: 0;
}

.palette-result-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.palette-result-rarity {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 1px;
}

.palette-result-arrow {
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.palette-result:hover .palette-result-arrow,
.palette-result.palette-active .palette-result-arrow {
  opacity: 1;
  color: var(--pink);
}

/* ─── Footer hint ────────────────────────────────────────────── */
.palette-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  font-size: 0.7rem;
  color: var(--text-muted);
}

.palette-footer kbd {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  color: var(--text-sec);
}

/* ─── Dark mode ──────────────────────────────────────────────── */
[data-theme="dark"] #cmdPalette {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), 0 8px 24px rgba(233, 30, 140, 0.1);
}

/* ─── Mobile ─────────────────────────────────────────────────── */
@media (max-width: 599px) {
  #cmdPalette {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(20px) scale(0.98);
    width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 80dvh;
  }
  #cmdPalette.palette-open {
    transform: translateY(0) scale(1);
  }
  #cmdResults { max-height: 50dvh; }
}

/* ─── table.css ──────────────────────────────────────────────────
   Pet table, rarity badges, value/delta cells, dual-value display,
   loading spinner, infinite scroll sentinel, scrollbar styling,
   and ALL responsive media queries for table/main layout
   (tablet 600–899px, mobile cards < 600px, extra mobile adjustments).
   ─────────────────────────────────────────────────────────────── */

/* ─── 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: 6px 10px; border-bottom: 1px solid var(--border); }
.ssr-pet-row .col-name a { color: var(--pink); text-decoration: none; font-weight: 600; }

/* ─── Table ──────────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: clip;   /* clip instead of hidden — allows sticky thead */
  box-shadow: 0 8px 32px var(--shadow);
}

.pet-table { width: 100%; border-collapse: collapse; }

.pet-table thead {
  background: var(--bg-gradient);
  border-bottom: 2px solid var(--rose);
  position: sticky;
  top: 68px;   /* sits just below the sticky site header */
  z-index: 10;
  box-shadow: 0 3px 10px var(--shadow);
}

.pet-table th {
  padding: 13px 14px;
  font-family: var(--font-display);
  font-size: 0.92rem;
  color: var(--pink);
  text-align: left;
  white-space: nowrap;
  user-select: none;
}

.pet-table th[data-sort] { cursor: pointer; transition: color var(--transition); }
.pet-table th[data-sort]:hover { color: #c2185b; }

.col-img    { width: 52px; }
.col-name   { min-width: 160px; }
.col-rarity { min-width: 130px; }
.col-val    { min-width: 140px; text-align: center !important; }

/* ─── Sort indicators ────────────────────────────────────────── */
.pet-table th[data-sort]::after        { content: ' ↕'; opacity: 0.25; font-size: 0.65rem; }
.pet-table th[data-sort].sort-asc::after  { content: ' ↑'; opacity: 1; }
.pet-table th[data-sort].sort-desc::after { content: ' ↓'; opacity: 1; }

/* ─── Zebra striping ─────────────────────────────────────────── */
.pet-table tbody tr:nth-child(even):not(.skeleton-row):not(.loading-row):not(.empty-row):not(#scrollSentinel) {
  background: var(--bg);
}

/* ─── Column group shading (Neon=col5, Mega=col6) ───────────── */
.pet-table th:nth-child(5),
.pet-table td:nth-child(5) {
  border-left: 1.5px solid var(--border);
  background-color: rgba(168, 85, 247, 0.025);
}
.pet-table th:nth-child(6),
.pet-table td:nth-child(6) {
  border-left: 1.5px solid var(--border);
  background-color: rgba(233, 30, 140, 0.025);
}
/* thead th: gradient overrides tint — keep tint subtle via mix */
.pet-table thead th:nth-child(5),
.pet-table thead th:nth-child(6) {
  background-blend-mode: overlay;
}

/* ─── Inline value + delta cell ──────────────────────────────── */
.val-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 14px;
  width: 100%;
}

.val-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.val-row {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.dv-label {
  font-size: 0.6rem;
  font-weight: 800;
  width: 11px;
  flex-shrink: 0;
  text-align: center;
}

.dv-num {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
}

.delta-inline {
  font-size: 0.62rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: opacity var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 1px;
  padding: 1px 5px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.delta-inline.delta-zero {
  display: none;
}

.delta-inline.delta-pos {
  background: rgba(46, 204, 143, 0.12);
  border: 1px solid rgba(46, 204, 143, 0.28);
  color: var(--positive);
}

.delta-inline.delta-neg {
  background: rgba(240, 96, 126, 0.1);
  border: 1px solid rgba(240, 96, 126, 0.22);
  color: var(--negative);
}

/* ─── Delta toggle (hide deltas) ─────────────────────────────── */
.deltas-hidden .delta-inline { display: none; }

/* Demand badge under value */
.val-demand { margin-top: 4px; text-align: center; }

/* Single-source column sub-legend (A only) */
.col-legend-single {
  margin-top: 3px;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

/* Column sub-legend (E / A) in header - same grid as .dual-val */
.col-legend {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0 4px;
  width: 100%;
  margin-top: 3px;
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 800;
  line-height: 1;
}

.pet-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--row-border);
  font-size: 0.875rem;
  vertical-align: middle;
}

.pet-table tbody tr {
  background: var(--bg-surface);
  cursor: pointer;
  transition: background var(--transition);
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Scroll-driven reveal: rows start invisible, enter-viewport triggers animation */
.pet-table tbody tr.row-pending {
  opacity: 0;
  transform: translateY(10px);
}

.pet-table tbody tr.row-visible {
  animation: row-in 0.28s ease both;
}

/* Changed rows combine both animations */
.pet-table tbody tr.row-visible.row-changed {
  animation: row-in 0.28s ease both, row-changed-pulse 2.8s 0.4s ease-in-out infinite;
}

/* Already-revealed changed rows keep the pulse */
.pet-table tbody tr.row-changed {
  border-left: 3px solid var(--pink);
}
.pet-table tbody tr.row-changed:not(.row-pending):not(.row-visible) {
  animation: row-changed-pulse 2.8s ease-in-out infinite;
}

@keyframes row-changed-pulse {
  0%, 100% { box-shadow: inset 3px 0 0 var(--pink); }
  50%       { box-shadow: inset 3px 0 0 var(--pink), inset 7px 0 18px rgba(233, 30, 140, 0.10); }
}

/* ─── Value change flash animations ─────────────────────────── */
@keyframes flash-gain {
  0%, 100% { background-color: transparent; }
  25%       { background-color: rgba(46, 204, 143, 0.18); }
}

@keyframes flash-loss {
  0%, 100% { background-color: transparent; }
  25%       { background-color: rgba(240, 96, 126, 0.18); }
}

.val-flash-gain { animation: flash-gain 2.6s ease-out; }
.val-flash-loss { animation: flash-loss 2.6s ease-out; }

.pet-table tbody tr:hover { background: var(--bg-row-hover); }
.pet-table tbody tr:last-child td { border-bottom: none; }
.pet-table tbody tr.row-changed td:first-child { padding-left: 11px; }

/* Image cell */
.pet-img-wrap {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pet-img { width: 100%; height: 100%; object-fit: contain; }
.pet-img-placeholder { font-size: 18px; line-height: 1; }

/* Name */
.pet-name {
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pet-track-btn {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  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);
  line-height: 1.4;
}

tr:hover .pet-track-btn,
tr:focus-within .pet-track-btn {
  opacity: 1;
}

.pet-track-btn:hover {
  background: var(--pink-soft);
  border-color: var(--rose);
  color: var(--pink);
}

/* Rarity badges */
.rarity-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  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); border: 1px solid var(--rose); }

/* Value cells */
.val-cell {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Delta cells */
.delta-cell {
  text-align: right;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.delta-pos  { color: var(--positive); }
.delta-neg  { color: var(--negative); }
.delta-zero { color: var(--neutral);  }

/* ─── Dual-value display (E / A) ────────────────────────────── */
.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);  text-align: right;  }
.dv-amvgg { color: var(--amvgg); text-align: left;   }
.dv-sep   { color: var(--text-muted); font-weight: 400; font-size: 0.72rem; text-align: center; }

/* Stats bar legend squares */
.legend-elve  { color: var(--pink);  }
.legend-amvgg { color: var(--amvgg); }

/* Loading / empty */
.loading-row td, .empty-row td {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
}

.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);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

/* ─── Skeleton loading rows ─────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-cell {
  border-radius: 6px;
  background: linear-gradient(
    90deg,
    var(--bg-panel) 25%,
    var(--border)   50%,
    var(--bg-panel) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

.skeleton-row { animation: none !important; opacity: 1 !important; transform: none !important; }
.skeleton-row td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--row-border);
  vertical-align: middle;
}

.sk-img   { width: 38px;  height: 38px; border-radius: 10px; }
.sk-name  { height: 14px; width: 130px; max-width: 90%; }
.sk-badge { height: 22px; width: 76px;  border-radius: var(--radius-pill); }
.sk-val   { height: 28px; width: 68px;  margin-left: auto; }
.sk-delta { height: 18px; width: 44px;  margin-left: auto; }

/* ─── Infinite scroll sentinel ──────────────────────────────── */
#scrollSentinel td { 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-mid); }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

/* ─── Tablet (600–899px): table with horizontal scroll ───────── */
@media (min-width: 600px) and (max-width: 899px) {
  .header { padding: 0 20px; }
  .main   { padding: 16px 16px 60px; }

  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  .col-name   { min-width: 120px; }
  .col-rarity { min-width: 100px; }
  .col-val    { min-width: 110px; }

  .pet-table th,
  .pet-table td { padding: 9px 10px; }

  .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: 34px; }

  .last-updated {
    font-size: 0.72rem;
    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; }

  /* ── Filter bar: 2-column grid (checkboxes side-by-side) ── */
  .filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 8px 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
  }

  .search-wrap {
    grid-column: 1 / -1;
    min-width: unset;
    width: auto;
  }

  .filter-select {
    /* Stay in their natural 1fr columns — side by side keeps the filter bar compact */
    min-width: unset;
    width: 100%;
  }

  .filter-checkbox {
    background: var(--pink-pale);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    justify-content: center;
    min-height: 40px;
  }

  /* ── Stats bar ── */
  .stats-bar { font-size: 0.7rem; gap: 6px; }
  .stat-item:last-child { display: none; } /* hide long legend on tiny screens */

  /* ── Table → Card transform ── */
  .table-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
  }

  .pet-table          { display: block; }
  .pet-table thead    { display: none; }
  .pet-table tbody    { display: flex; flex-direction: column; gap: 10px; }

  /* Special rows: keep as plain blocks */
  .loading-row,
  .empty-row {
    display: block;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px var(--shadow);
  }

  .loading-row td,
  .empty-row td {
    display: block;
    border-bottom: none;
    padding: 48px 16px;
  }

  #scrollSentinel {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    display: block;
    animation: none;
  }
  #scrollSentinel td { display: block; padding: 0; border: none; }

  /* ── Data row = card (4-column grid) ──
     col 1 (56px): image
     col 2–4 (equal): Regular / Neon / Mega
     row 1: image | name (spans cols 2-4)
     row 2: image | rarity (spans cols 2-4)
     row 3: image | reg-val+Δ | neon-val+Δ | mega-val+Δ
  ── */
  .pet-table tbody tr:not(.loading-row):not(.empty-row):not(#scrollSentinel) {
    display: grid;
    grid-template-columns: 56px 1fr 1fr 1fr;
    grid-template-rows: auto auto auto;
    background: var(--bg-surface);
    border: 1.5px solid var(--border);
    border-radius: 16px;
    box-shadow: 0 4px 16px var(--shadow);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  }

  .pet-table tbody tr:not(.loading-row):not(.empty-row):not(#scrollSentinel):active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px var(--shadow);
  }

  /* Changed indicator: full border on cards */
  .pet-table tbody tr.row-changed {
    border: 2px solid var(--pink) !important;
  }
  .pet-table tbody tr.row-changed td:first-child { padding-left: 6px; }

  /* All td: reset desktop borders */
  .pet-table tbody tr:not(.loading-row):not(.empty-row):not(#scrollSentinel) td {
    border-bottom: none;
    padding: 0;
  }

  /* td1: image - spans all 4 rows on col 1 */
  .pet-table tbody td:nth-child(1) {
    grid-column: 1;
    grid-row: 1 / 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 6px;
    border-right: 1.5px solid var(--border);
    background: var(--pink-pale);
  }

  /* td2: name - row 1, cols 2–4 */
  .pet-table tbody td:nth-child(2) {
    grid-column: 2 / 5;
    grid-row: 1;
    padding: 10px 12px 3px;
    font-size: 0.9rem;
    font-weight: 800;
    align-self: end;
  }

  /* td3: rarity - row 2, cols 2–4 */
  .pet-table tbody td:nth-child(3) {
    grid-column: 2 / 5;
    grid-row: 2;
    padding: 0 12px 8px;
    border-bottom: 1.5px solid var(--border);
  }

  /* td4: Regular value - row 3, col 2 */
  .pet-table tbody td:nth-child(4) {
    grid-column: 2;
    grid-row: 3;
    padding: 7px 4px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
  }

  /* td5: Neon value - row 3, col 3 */
  .pet-table tbody td:nth-child(5) {
    grid-column: 3;
    grid-row: 3;
    padding: 7px 4px 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
  }

  /* td6: Mega value - row 3, col 4 */
  .pet-table tbody td:nth-child(6) {
    grid-column: 4;
    grid-row: 3;
    padding: 7px 4px 9px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  /* Column header labels via ::before pseudo-elements */
  .pet-table tbody td:nth-child(4)::before,
  .pet-table tbody td:nth-child(5)::before,
  .pet-table tbody td:nth-child(6)::before {
    display: block;
    font-family: var(--font-display);
    font-size: 0.62rem;
    color: var(--pink);
    opacity: 0.65;
    margin-bottom: 3px;
    letter-spacing: 0.03em;
  }

  .pet-table tbody td:nth-child(4)::before { content: 'REG'; }
  .pet-table tbody td:nth-child(5)::before { content: 'NEON'; }
  .pet-table tbody td:nth-child(6)::before { content: 'MEGA'; }

  .delta-inline { font-size: 0.6rem; }

  /* ── Track button: always visible in mobile cards (no hover on touch) ── */
  .pet-table tbody tr .pet-track-btn {
    opacity: 1;
    padding: 2px 6px;
    font-size: 0.66rem;
  }

  /* ── Value pair: stack E and A vertically in narrow card cells ── */
  .val-pair {
    grid-template-columns: 1fr;
    gap: 2px 0;
  }
  .val-col { align-items: center; }

  /* Pet image in card: slightly smaller */
  .pet-img-wrap {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  /* ── Cancel column-group shading on mobile cards ── */
  .pet-table td:nth-child(5),
  .pet-table td:nth-child(6) {
    border-left: none;
    background-color: transparent;
  }

  /* ── 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.68rem;
    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 (trade + picker dialogs) ─────────────── */
@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;
  }

  .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;
  }

  .trade-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .trade-side { border-right: none; border-bottom: 1.5px solid var(--border); }
  .trade-side:last-child { border-bottom: none; }

  /* Constrain each side's pet list height so both sides are visible */
  .trade-pets-list { min-height: 100px; max-height: 220px; }

  .trade-diff-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    padding: 10px 16px;
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    gap: 10px;
  }
  .trade-diff-value { font-size: 1.1rem; }

  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); }
}

/* 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-table tbody tr:not(.loading-row):not(.empty-row):not(#scrollSentinel),
  .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 {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Value cells in mobile cards get a subtle background */
  .pet-table tbody tr:not(.loading-row):not(.empty-row):not(#scrollSentinel) td:nth-child(n+4):nth-child(-n+6) {
    background: var(--bg);
  }

  /* Picker grid: prevent scroll bounce */
  .picker-grid {
    overscroll-behavior: contain;
  }
}

/* ─── Very small screens (< 380px) ──────────────────────────── */
@media (max-width: 379px) {
  .header-logo { height: 30px; }

  /* 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;
  }

  /* Slightly tighter card image column */
  .pet-table tbody tr:not(.loading-row):not(.empty-row):not(#scrollSentinel) {
    grid-template-columns: 44px 1fr 1fr 1fr;
  }

  .pet-table tbody td:nth-child(1) {
    padding: 10px 4px;
  }

  .pet-img-wrap {
    width: 30px;
    height: 30px;
    border-radius: 7px;
  }

  /* Scale down values to fit narrow columns */
  .dv-elve,
  .dv-amvgg {
    font-size: 0.68rem;
  }

  .main {
    padding: 8px 8px calc(72px + env(safe-area-inset-bottom, 0px));
    gap: 8px;
  }

  .trade-fab {
    padding: 10px 14px;
    font-size: 0.85rem;
  }

  .picker-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); }
}

/* ─── 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 80px rgba(233, 30, 140, 0.18), 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);
  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);
  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);
  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);  background: var(--pink-soft); border-color: var(--rose); }
.amvgg-label { color: var(--amvgg); 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.68rem;
  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);  }
.amvgg-num { color: var(--amvgg); }

.dialog-val-delta {
  font-size: 0.72rem;
  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);
  border-color: var(--pink);
  color: white;
  box-shadow: 0 3px 10px rgba(233, 30, 140, 0.32);
}

.variant-btn.active:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(233, 30, 140, 0.42);
}

/* ─── 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);
  color: white;
}

.chart-source-btn[data-csource="amvgg"].active {
  background: var(--amvgg);
}

.chart-source-btn[data-csource="both"].active {
  background: linear-gradient(90deg, var(--pink) 0%, var(--amvgg) 100%);
}

.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.72rem;
  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); 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.72rem;
  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); border: 1px solid var(--rose); }

/* ─── trade.css ──────────────────────────────────────────────────
   Floating action button (FAB), trade dialog inner layout,
   trade sides, pet cards, difference panel, and pet picker dialog.
   ─────────────────────────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════
   TRADE CALCULATOR
   ═══════════════════════════════════════════════════════════════ */

/* ─── 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: linear-gradient(135deg, var(--pink), #c2185b);
  border: none;
  border-radius: var(--radius-pill);
  color: white;
  font-family: var(--font-display);
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(233, 30, 140, 0.42);
  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 32px rgba(233, 30, 140, 0.52);
}
.trade-fab:active { transform: scale(0.96); }

/* ─── Trade Dialog sizing ─────────────────────────────────────── */
.trade-dialog {
  max-width: 980px;
  width: calc(100vw - 40px);
}

/* ─── Trade inner layout ──────────────────────────────────────── */
.trade-inner {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}

.trade-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 14px;
  background: var(--bg-gradient);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.trade-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
.trade-title-icon { font-size: 1.3rem; }
.trade-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--pink);
}
.trade-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-copy-link {
  padding: 7px 18px;
  background: linear-gradient(135deg, var(--pink), #c2185b);
  border: none;
  border-radius: var(--radius-pill);
  color: #fff;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  min-height: 34px;
  box-shadow: 0 4px 16px rgba(233, 30, 140, 0.38);
  transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
}
.btn-copy-link:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(233, 30, 140, 0.52);
}
.btn-copy-link:active { transform: scale(0.96); }
.btn-copy-link:disabled { opacity: 0.65; cursor: default; transform: none; }

.btn-clear-trade {
  padding: 7px 16px;
  background: var(--bg-surface);
  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), color var(--transition), border-color var(--transition);
  min-height: 34px;
}
.btn-clear-trade:hover {
  background: var(--negative);
  border-color: var(--negative);
  color: white;
}

/* ─── Trade body 3-column grid ────────────────────────────────── */
.trade-body {
  display: grid;
  grid-template-columns: 1fr 172px 1fr;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ─── Each trade side ─────────────────────────────────────────── */
.trade-side {
  min-width: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1.5px solid var(--border);
}
.trade-side:last-child { border-right: none; }

.trade-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 10px;
  background: var(--pink-pale);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
  gap: 8px;
}
.trade-side-label {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--pink);
}
.trade-side-totals {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
}
.trade-side-total-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--radius-pill);
}
.trade-side-total-row:first-child {
  background: var(--pink-soft);
  border: 1px solid var(--rose);
}
.trade-side-total-row:last-child {
  background: var(--amvgg-soft);
  border: 1px solid var(--amvgg-border);
}
.trade-src-label {
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}
.trade-side-total {
  font-family: var(--font-display);
  font-size: 1.55rem;
  color: var(--pink);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.trade-side-total.amvgg { color: var(--amvgg); }

/* Scrollable pets list */
.trade-pets-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-height: 180px;
}

/* ─── Pet card on trade side ──────────────────────────────────── */
.trade-pet-card {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  background: var(--pink-pale);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  animation: pop-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#mySide .trade-pet-card    { border-left: 3px solid var(--pink); }
#theirSide .trade-pet-card { border-left: 3px solid var(--amvgg); }
.trade-pet-card-img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  object-fit: contain;
  flex-shrink: 0;
}
.trade-pet-card-placeholder {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  border-radius: 8px;
  background: var(--pink-soft);
  flex-shrink: 0;
}
.trade-pet-card-info {
  flex: 1;
  min-width: 0;
}
.trade-pet-card-name {
  font-weight: 800;
  font-size: 0.82rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trade-pet-card-variant {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-sec);
  margin-top: 1px;
}
.trade-pet-card-demand { margin-top: 3px; }
.trade-pet-dual-val {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  flex-shrink: 0;
}
.trade-pet-val-row {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}
.trade-pet-val-row .val { font-weight: 800; color: var(--pink); }
.trade-pet-val-row .val.amvgg { color: var(--amvgg); }
.trade-pet-val-row .val.no-val { color: var(--text-muted); font-size: 0.68rem; }
.trade-pet-remove {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 0.65rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}
.trade-pet-remove:hover {
  background: var(--negative);
  border-color: var(--negative);
  color: white;
}

/* ─── Add Pet button ──────────────────────────────────────────── */
.trade-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px 10px 10px;
  padding: 9px;
  background: var(--pink-pale);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius);
  color: var(--pink);
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), background var(--transition), box-shadow var(--transition);
  flex-shrink: 0;
}
.trade-add-btn:hover {
  border-color: var(--pink);
  background: var(--pink-soft);
  box-shadow: 0 2px 10px var(--shadow);
}
.trade-add-icon {
  font-size: 1.1rem;
  line-height: 1;
}

/* ─── Difference panel (center column) ───────────────────────── */
.trade-diff-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 10px;
  background: var(--bg);
  gap: 6px;
}

.trade-diff-verdict {
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1.15;
  text-align: center;
  color: var(--text-muted);
  min-height: 1.2em;
}
.trade-diff-verdict.verdict-win  { color: var(--positive); text-shadow: 0 2px 16px rgba(46, 204, 143, 0.3); }
.trade-diff-verdict.verdict-lose { color: var(--negative); text-shadow: 0 2px 16px rgba(240, 96, 126, 0.3); }
.trade-diff-verdict.verdict-even { color: var(--text-muted); }

.trade-diff-divider {
  width: 28px;
  height: 1.5px;
  background: var(--border);
  border-radius: 1px;
  flex-shrink: 0;
  margin: 2px 0;
}

.trade-diff-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trade-diff-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}
.trade-diff-value.diff-pos  { color: var(--positive); }
.trade-diff-value.diff-neg  { color: var(--negative); }
.trade-diff-value.diff-even { color: var(--text-muted); }

.trade-diff-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE / MOBILE
   ═══════════════════════════════════════════════════════════════ */

/* Coarse pointer (touchscreens): increase tap targets */
@media (pointer: coarse) {
  .trade-pet-remove {
    width: 36px;
    height: 36px;
    font-size: 0.75rem;
  }
  .trade-add-btn { min-height: 44px; }
  .picker-tier-btn,
  .picker-mode-btn {
    min-height: 42px;
    padding: 10px 20px;
  }
}

/* Mobile layout - stack the trade sides vertically */
@media (max-width: 600px) {
  /* FAB - bring in from edge, respect safe area */
  .trade-fab {
    bottom: calc(70px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    padding: 12px 20px;
    font-size: 0.92rem;
  }

  /* Dialog - narrower margin on small screens */
  .trade-dialog {
    width: calc(100vw - 16px);
  }

  /* Inner - single outer scroll instead of clipped sides */
  .trade-inner {
    max-height: 90vh;
    overflow-y: auto;
  }

  /* Header - allow wrapping on very narrow phones */
  .trade-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }
  .btn-copy-link,
  .btn-clear-trade {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  /* 3-column grid → vertical flex stack */
  .trade-body {
    display: flex;
    flex-direction: column;
    overflow: visible;
    flex: unset;
  }

  /* Sides: drop right border, add bottom border as separator */
  .trade-side {
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    overflow: visible;
  }
  .trade-side:last-child { border-bottom: none; }

  /* Pet list: let it expand naturally - outer dialog scrolls */
  .trade-pets-list {
    overflow-y: visible;
    min-height: 0;
  }

  /* Diff panel: horizontal row on mobile */
  .trade-diff-panel {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    padding: 10px 16px;
    border-top: 1.5px solid var(--border);
    border-bottom: 1.5px solid var(--border);
  }
  .trade-diff-verdict { font-size: 1.2rem; width: 100%; }
  .trade-diff-divider { display: none; }
  .trade-diff-label   { width: 100%; text-align: center; }
  .trade-diff-value   { font-size: 1.1rem; }
}

/* ─── Pet Picker Dialog ───────────────────────────────────────── */
.picker-dialog {
  max-width: 680px;
  width: calc(100vw - 40px);
}
.picker-inner {
  max-height: 88vh;
  display: flex;
  flex-direction: column;
}
.picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 14px;
  background: var(--bg-gradient);
  border-bottom: 1.5px solid var(--border);
  flex-shrink: 0;
}
.picker-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--pink);
}

/* Picker steps */
.picker-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.picker-step-hidden { display: none !important; }

/* Search row inside picker */
.picker-search-wrap {
  margin: 12px 16px 8px;
  flex-shrink: 0;
  position: relative;
}

/* Pet grid */
.picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  padding: 8px 16px 16px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.picker-pet-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px 6px 8px;
  background: var(--pink-pale);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition), background var(--transition);
  text-align: center;
}
.picker-pet-card:hover {
  border-color: var(--pink);
  background: var(--bg-surface);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--shadow-lg);
}
.picker-pet-card:active { transform: scale(0.96); }
.picker-pet-card-img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--pink-soft);
}
.picker-pet-card-name {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  word-break: break-word;
}

/* Variant step */
.picker-back-btn {
  background: none;
  border: none;
  color: var(--text-sec);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  padding: 12px 18px 4px;
  text-align: left;
  transition: color var(--transition);
  flex-shrink: 0;
}
.picker-back-btn:hover { color: var(--pink); }

.picker-selected-pet {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--bg-gradient);
  border-bottom: 1.5px solid var(--border);
  border-top: 1.5px solid var(--border);
  flex-shrink: 0;
}
.picker-selected-img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--pink-soft);
  border: 2px solid var(--rose);
}
.picker-selected-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--pink);
}

.picker-option-group {
  padding: 14px 18px 4px;
  flex-shrink: 0;
}
.picker-option-label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.picker-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.picker-tier-btn,
.picker-mode-btn {
  padding: 7px 16px;
  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.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  min-height: 34px;
}
.picker-tier-btn:hover,
.picker-mode-btn:hover {
  background: var(--rose);
  border-color: var(--pink-mid);
  color: var(--text);
}
.picker-tier-btn.active,
.picker-mode-btn.active {
  background: var(--pink);
  border-color: var(--pink);
  color: white;
  box-shadow: 0 3px 10px rgba(233, 30, 140, 0.3);
}

.picker-value-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 18px 14px;
  margin: 10px 18px 0;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  flex-shrink: 0;
}
.picker-preview-label {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.picker-preview-vals {
  display: flex;
  gap: 8px;
}
.picker-preview-row {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius);
  flex: 1;
}
.picker-preview-row:first-child {
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
}
.picker-preview-row:last-child {
  background: var(--amvgg-soft);
  border: 1.5px solid var(--amvgg-border);
}
.picker-preview-row span:last-child {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}
.picker-preview-row span.no-val {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.picker-confirm-btn {
  margin: 12px 18px 18px;
  flex-shrink: 0;
  justify-content: center;
  width: calc(100% - 36px);
}

/* Mobile picker overrides */
@media (max-width: 600px) {
  .picker-dialog { width: calc(100vw - 16px); }
  .picker-inner  { max-height: 90vh; }

  .picker-grid {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    padding: 8px 12px 12px;
    gap: 6px;
  }
  .picker-pet-card-img {
    width: 40px;
    height: 40px;
  }
  .picker-selected-pet { padding: 10px 14px; gap: 10px; }
  .picker-option-group { padding: 12px 14px 4px; }
  .picker-value-preview { margin: 8px 14px 0; padding: 10px 14px; }
  .picker-confirm-btn {
    margin: 10px 14px 14px;
    width: calc(100% - 28px);
  }
}

/* ─── 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);
}

.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);
  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.72rem;
  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); }
.footer-link-icon { font-size: 1rem; line-height: 1; vertical-align: middle; }

.footer-dot {
  font-size: 0.55rem;
  color: var(--border);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-copyright {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.footer-version {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--pink-mid);
  background: var(--pink-soft);
  border: 1px solid var(--rose);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  letter-spacing: 0.03em;
}

@media (max-width: 599px) {
  .footer-inner { padding: 16px 14px calc(72px + 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;
}

/* ─── SSR prose: visible to crawlers, hidden once JS loads pet content */
.ssr-pet-prose {
  max-width: 760px;
  margin: 16px auto 0;
  padding: 0 20px;
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text-sec);
}

.ssr-pet-prose h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--pink);
  margin: 0 0 10px;
}

.ssr-values-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 0.88rem;
}
.ssr-values-table th,
.ssr-values-table td {
  padding: 7px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ssr-values-table th { color: var(--pink); font-weight: 700; }

/* Hide SSR prose once the real pet content is rendered */
.pet-content:not([hidden]) ~ .ssr-pet-prose,
#petContent:not([hidden]) + .ssr-pet-prose { display: none; }

/* ─── SSR table rows: visible to crawlers, hidden once JS hydrates */
.ssr-pet-row { display: none; }

/* ─── Back link ───────────────────────────────────────────────── */
.pet-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-sec);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  margin-bottom: 20px;
  transition: color var(--transition), transform var(--transition);
}
.pet-back-link:hover {
  color: var(--pink);
  transform: translateX(-3px);
}

/* ─── Hero ────────────────────────────────────────────────────── */
.pet-hero {
  animation: fade-up 0.4s ease both;
}

.pet-hero-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: 0 8px 32px var(--shadow);
}

.pet-hero-image-wrap {
  flex-shrink: 0;
  width: 120px;
  height: 120px;
  border-radius: var(--radius-lg);
  background: var(--pink-pale);
  border: 2px solid var(--rose);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.pet-hero-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pet-hero-image-placeholder {
  font-size: 3rem;
  line-height: 1;
}

.pet-hero-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pet-hero-name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: var(--pink);
  margin: 0;
}

.pet-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pet-category-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  background: var(--amvgg-soft);
  color: var(--amvgg);
  border: 1px solid var(--amvgg-border);
  text-transform: capitalize;
}

.pet-flyride-tag {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-sec);
}

.pet-first-seen {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
}

.pet-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.btn-pet-track {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: var(--pink-soft);
  border: 1.5px solid var(--rose);
  border-radius: var(--radius-pill);
  color: var(--pink);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  min-height: 44px;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
}

.btn-pet-track:hover {
  background: var(--pink);
  border-color: var(--pink);
  color: #fff;
  transform: translateY(-1px);
}

.btn-pet-track:active { transform: scale(0.97); }
.btn-pet-track:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ─── Section ─────────────────────────────────────────────────── */
.pet-content {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.pet-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: fade-up 0.45s ease both;
}

.pet-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pet-section-icon {
  font-size: 1rem;
  color: var(--pink);
  line-height: 1;
}

.pet-section-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--text);
  margin: 0;
}

.pet-values-legend {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
}

.pet-legend-elve {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-sec);
}

.pet-legend-amvgg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--amvgg);
}

/* ─── Values table ────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--border);
  box-shadow: 0 4px 16px var(--shadow);
}

.pet-values-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
}

.pet-values-table thead {
  border-bottom: 2px solid var(--rose);
}

.pet-values-table thead th {
  padding: 11px 16px;
  font-family: var(--font-display);
  font-size: 0.88rem;
  color: var(--pink);
  text-align: center;
  background: var(--bg-panel);
}

.pet-variant-header {
  text-align: left !important;
  min-width: 72px;
}

.pet-variant-label {
  padding: 12px 16px;
  font-family: var(--font-display);
  font-size: 0.82rem;
  color: var(--text-sec);
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}

.pet-val-cell {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  border-left: 1px solid var(--border);
  min-width: 120px;
}

.pet-val-pair {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.pet-val-source {
  display: flex;
  align-items: center;
  gap: 6px;
}

.pet-src-badge {
  font-size: 0.65rem;
  font-weight: 800;
  min-width: 14px;
  text-align: center;
}

.pet-val-number {
  font-size: 0.95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.pet-val-delta {
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.pet-val-demand {
  line-height: 1;
}

.pet-no-amvgg {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
  padding: 2px 0;
}

/* ─── Chart card ──────────────────────────────────────────────── */
.pet-chart-card {
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--shadow);
}

/* Taller chart on the full pet page vs the dialog */
.pet-chart-container {
  height: 400px !important;
  flex: unset !important;
}

/* ─── Loading / error states ──────────────────────────────────── */
.pet-loading {
  padding: 80px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.pet-loading[hidden] { display: none; }

.pet-loading .loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.pet-error-inner {
  background: var(--bg-panel);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.pet-error-inner a {
  color: var(--pink);
  text-decoration: none;
  font-weight: 700;
}

.pet-error-inner a:hover {
  text-decoration: underline;
}

/* ─── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 599px) {
  .pet-hero-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    padding: 20px 18px;
  }

  .pet-hero-image-wrap {
    width: 80px;
    height: 80px;
    align-self: center;
  }

  .pet-hero-name {
    font-size: 1.4rem;
  }

  .pet-values-table thead th,
  .pet-variant-label,
  .pet-val-cell {
    padding: 8px 10px;
  }

  .pet-val-number {
    font-size: 0.85rem;
  }

  .pet-chart-container {
    height: 280px !important;
  }
}

/* ─── 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;
  }
}

/* Hide the "Cookie Policy" revoke tab on mobile — it clutters the bottom nav area */
@media (max-width: 599px) {
  .cc-revoke {
    display: none !important;
  }
}
