:root {
  color-scheme: light;
  /* SightDex design system: a professional, research-SaaS palette.
     Blue = trust/discovery, yellow = highlight CTAs, semantic status
     colors for sightings. Every fg/bg pair below is WCAG AA checked. */
  --primary: #2563EB;         /* blue — primary actions, brand, links */
  --primary-hover: #1D4ED8;
  --primary-active: #1E40AF;
  --primary-tint: #EFF6FF;    /* light blue wash: hovers, selected rows */
  --on-primary: #FFFFFF;      /* text on a primary-blue fill */
  --cta: #FBBF24;             /* yellow — highlight CTAs only */
  --cta-hover: #F59E0B;
  --cta-ink: #78350F;         /* text on a yellow fill */
  --secondary: #F1F5F9;       /* slate-100 — subtle neutral surfaces */
  --secondary-hover: #E2E8F0;
  --accent: #2563EB;          /* text-safe accent (eyebrows, links, focus) */
  --brand: #2563EB;
  --success: #22C55E;         /* confirmed sightings */
  --success-strong: #16A34A;
  --success-ink: #15803D;
  --success-tint: #DCFCE7;
  --warning: #F59E0B;         /* needs review */
  --warning-ink: #92400E;
  --warning-tint: #FEF3C7;
  --warning-border: #FDE68A;
  --danger: #EF4444;          /* disputed submissions */
  --danger-strong: #DC2626;
  --danger-ink: #B91C1C;
  --danger-tint: #FEF2F2;
  --danger-border: #FECACA;
  --info-ink: #1D4ED8;
  --info-tint: #DBEAFE;
  /* neutrals — slate scale on an off-white page */
  --bg: #F8FAFC;              /* page background */
  --surface: #FFFFFF;         /* cards */
  --surface-2: #F1F5F9;       /* inset fills */
  --text: #111827;
  --ink: var(--text);
  --muted: #6B7280;
  --line: #E5E7EB;
  --line-strong: #CBD5E1;
  --neutral-tint: #EEF2F7;
  /* radius: cards 18, controls 14 */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  /* very soft shadows on a cool slate base */
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.12);
  /* type */
  --font-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  font-family: var(--font-body);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

#app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1,
h2 {
  font-family: var(--font-display);
}

.metric,
.leader-score {
  font-family: var(--font-mono);
}

button,
input,
select {
  font: inherit;
}

button,
.link-button {
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  min-height: 42px;
  padding: 0 16px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 120ms ease, background 120ms ease, border-color 120ms ease;
}

button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.topbar {
  padding: 12px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* On desktop the collapse wrapper contributes only the primary tabs; below
   the breakpoint it becomes the primary-navigation drawer. */
.nav-collapse {
  display: contents;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  min-height: 40px;
  padding: 0 10px;
  border-color: var(--line-strong);
  background: white;
  color: var(--ink);
}

.topbar .tabs {
  margin-left: 6px;      /* sits just after the wordmark */
  order: 1;
}

.topbar .topbar-actions {
  order: 3;
}

.desktop-search {
  order: 2;
}

.mobile-search-toggle,
.mobile-search-panel {
  display: none;
}

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
    order: 3;
  }

  .nav-collapse {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px clamp(18px, 4vw, 48px);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }

  .nav-collapse.open {
    display: flex;
  }

  /* Tabs become a vertical menu inside the dropdown. */
  .topbar .tabs {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin-left: 0;
    gap: 4px;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 0;
  }

  .topbar .tab {
    justify-content: flex-start;
    border-radius: var(--radius-md);
    min-height: 44px;
  }

  .desktop-search {
    display: none;
  }

  .mobile-search-toggle {
    display: inline-flex;
    order: 1;
    margin-left: auto;
    min-height: 40px;
    padding: 0 10px;
    border-color: var(--line-strong);
    background: var(--surface);
    color: var(--ink);
  }

  .topbar .topbar-actions {
    order: 2;
  }

  .topbar .account-box {
    width: auto;
  }

  .account-chip {
    width: 44px;
    min-height: 44px;
    padding: 4px;
    justify-content: center;
  }

  .account-chip .avatar {
    flex: 0 0 34px;
  }

  #account-name,
  .account-menu-caret {
    display: none;
  }

  .mobile-search-panel {
    display: block;
    padding: 0 clamp(18px, 4vw, 48px) 14px;
  }

  .mobile-search-panel .nav-search {
    width: 100%;
    margin: 0;
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.brand:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
}

.brand:hover {
  transform: none;
}

.brand-logo {
  width: 44px;
  height: 44px;
}

.brand h1 {
  font-size: 1.35rem;
}

.tagline {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--neutral-tint);
  border: 2px solid var(--primary);
  image-rendering: pixelated;
}

.avatar-large {
  width: 72px;
  height: 72px;
}

.avatar-form {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.avatar-form input {
  flex: 1;
  min-width: 180px;
}

.profile-field {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-field:first-of-type {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

.profile-inline {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}

.profile-inline input {
  flex: 1;
  min-width: 180px;
}

.profile-static {
  margin: 6px 0 0;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-search {
  position: relative;
  margin-left: auto;
  width: 220px;
  flex-shrink: 0;
}

.nav-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}

#nav-search-input,
#mobile-search-input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: 0.875rem;
  color: var(--text);
  transition: border-color 120ms, background 120ms;
  min-height: unset;
}

#nav-search-input::placeholder,
#mobile-search-input::placeholder {
  color: var(--muted);
}

#nav-search-input:focus,
#mobile-search-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-tint);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(100%, 420px);
  display: grid;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: clamp(22px, 5vw, 34px);
}

.login-panel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-height: 42px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

h1 {
  font-size: clamp(1.45rem, 2.4vw, 2.3rem);
}

h2 {
  font-size: 1.25rem;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 6px;
  text-transform: uppercase;
}

.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
}

.tab {
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
}

.tab:hover {
  color: var(--text);
  background: var(--secondary);
}

.tab.active {
  background: var(--primary);
  color: var(--on-primary);
}

main {
  flex: 1;
  width: 100%;
  padding: clamp(18px, 4vw, 48px);
  max-width: 1400px;
  margin: 0 auto;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 28px clamp(18px, 4vw, 48px);
  margin-top: 24px;
}

.site-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.6;
}

.site-footer-inner p {
  margin: 0 0 4px;
}

.site-footer-links {
  display: flex;
  gap: 18px;
  margin-bottom: 12px !important;
}

.inline-link {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inline-link:hover {
  transform: none;
  color: var(--primary-hover);
}

.hero-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

/* ---------------------------------------------------------------- homepage */
.home {
  display: grid;
  gap: 40px;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 32px;
  padding: 24px 0 8px;
}

.hero-title {
  font-size: clamp(2rem, 4.4vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.hero-sub {
  margin: 18px 0 26px;
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta {
  background: var(--cta);
  border-color: var(--cta);
  color: var(--cta-ink);
  font-weight: 700;
  padding: 0 22px;
}

.cta:hover {
  background: var(--cta-hover);
  border-color: var(--cta-hover);
}

.hero-art {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--primary-tint), #fff);
  border: 1px solid var(--line);
}

.hero-art img {
  width: 45%;
  filter: drop-shadow(var(--shadow-md));
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  display: grid;
  gap: 4px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-num {
  font-family: var(--font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 600;
}

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.discoveries-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.discoveries-viewport {
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.discoveries-viewport::-webkit-scrollbar {
  display: none;
}

.discoveries-track {
  display: flex;
  gap: 18px;
}

.discoveries-track > * {
  flex: 0 0 180px;
  scroll-snap-align: start;
}

.discoveries-track > .message {
  flex-basis: 100%;
}

.carousel-control {
  width: 42px;
  min-height: 42px;
  padding: 0;
  border-color: var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  font-size: 1.15rem;
}

.carousel-control:disabled {
  cursor: default;
  opacity: 0.45;
}

.carousel-control:disabled:hover {
  transform: none;
}

.discovery-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 120ms ease, box-shadow 120ms ease;
}

@media (max-width: 860px) {
  .discoveries-track > * {
    flex-basis: 180px;
  }
}

@media (max-width: 560px) {
  .discoveries-carousel {
    gap: 8px;
  }

  .discoveries-track > * {
    flex-basis: 100%;
  }

  .carousel-control {
    width: 38px;
    min-height: 38px;
  }
}

.discovery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.discovery-card img {
  width: 100%;
  aspect-ratio: 0.716;
  object-fit: contain;
  background: var(--surface-2);
  padding: 12px 12px 0;
}

.discovery-body {
  padding: 12px 14px 16px;
}

.discovery-sighting {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
}

.discovery-sighting strong {
  color: var(--primary-active);
}

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

.mini-badge {
  background: var(--secondary);
  color: var(--ink);
  border-radius: var(--radius-pill);
  padding: 3px 8px;
  font-size: 0.74rem;
  font-weight: 700;
}

.community-band {
  text-align: center;
  padding: 40px clamp(18px, 5vw, 56px);
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--primary), var(--primary-active));
  color: #fff;
}

.community-band h2 {
  font-size: 1.7rem;
}

.community-band p {
  margin: 10px auto 0;
  max-width: 62ch;
  opacity: 0.92;
  line-height: 1.6;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    display: none;
  }

  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- about */
.about {
  display: grid;
  gap: 20px;
  max-width: 1000px;
  margin: 0 auto;
}

.about-hero h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin-bottom: 12px;
}

.about-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  gap: 24px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface) 42%, var(--primary-tint));
}

.about-hero p {
  color: var(--muted);
  line-height: 1.7;
  max-width: 70ch;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.about-grid h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}

.about-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.about-card {
  position: relative;
  overflow: hidden;
}

.about-card-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 16px;
  border-radius: 50%;
  background: var(--primary-tint);
  color: var(--primary-active);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
}

.about-hero-art {
  position: relative;
  display: grid;
  place-items: center;
}

.about-hero-art img {
  width: min(160px, 100%);
  filter: drop-shadow(0 16px 20px rgba(37, 99, 235, 0.2));
}

.about-hero-spark {
  position: absolute;
  border-radius: 50%;
  background: var(--cta);
}

.about-hero-spark-one {
  width: 16px;
  height: 16px;
  top: 8px;
  right: 4px;
}

.about-hero-spark-two {
  width: 9px;
  height: 9px;
  bottom: 12px;
  left: 8px;
  background: var(--success);
}

.signin-cta {
  margin-top: 18px;
}

.about-cta .hero-actions {
  justify-content: center;
  margin-top: 18px;
}

.about-disclaimer {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0;
}

@media (max-width: 700px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-hero {
    grid-template-columns: 1fr;
  }

  .about-hero-art {
    display: none;
  }
}

/* ---------------------------------------------------------------- card detail */
.is-clickable {
  cursor: pointer;
}

.card-detail {
  display: grid;
  gap: 24px;
}

.card-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 320px) 1fr;
  gap: 32px;
  align-items: start;
}

.card-detail-art img {
  width: 100%;
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}

.card-detail-info h2 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  margin: 4px 0 6px;
}

.card-detail-meta {
  color: var(--muted);
  margin: 0 0 18px;
}

.card-detail-stats {
  display: flex;
  gap: 28px;
  margin: 0 0 8px;
}

.card-detail-info h3 {
  margin: 20px 0 10px;
  font-size: 1.15rem;
}

.detail-pokemon {
  display: grid;
  gap: 8px;
}

.detail-pokemon-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.detail-pokemon-row img,
.detail-pokemon-row .sprite-placeholder {
  width: 34px;
  height: 34px;
  object-fit: contain;
  image-rendering: pixelated;
}

.detail-pokemon-name {
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.detail-confidence {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
}

.card-timeline h3 {
  margin: 0 0 4px;
}

.timeline {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.timeline li {
  display: flex;
  gap: 14px;
  padding-bottom: 18px;
  position: relative;
}

.timeline li:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 16px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary);
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-main {
  margin: 0;
}

.timeline-when {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

#card-detail-back {
  margin-bottom: 16px;
}

@media (max-width: 720px) {
  .card-detail-grid {
    grid-template-columns: 1fr;
  }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(260px, 390px) minmax(320px, 1fr) 220px;
  gap: 22px;
  align-items: start;
}

.card-stage,
.panel,
.stats-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.card-stage {
  overflow: hidden;
}

.image-shell {
  background: var(--neutral-tint);
  aspect-ratio: 0.716;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

#card-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* ------------------------------------------------
   Interactive artwork markers
   ------------------------------------------------ */
.marker-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.image-shell.placing {
  cursor: crosshair;
}

.marker-pin {
  position: absolute;
  /* Rotating the teardrop moves its tip 5px below the element's unrotated
     bottom edge. Offset that movement so the tip lands on the click point. */
  transform: translate(-50%, calc(-100% - 5px));
  width: 26px;
  height: 26px;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: var(--primary);
  border: 2px solid white;
  box-shadow: var(--shadow-sm);
  pointer-events: all;
  transition: transform 120ms ease;
}

.marker-pin:hover {
  transform: translate(-50%, calc(-105% - 5px)) scale(1.15);
}

.marker-pin::after {
  content: attr(data-label);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  rotate: 45deg;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms;
}

.marker-pin:hover::after {
  opacity: 1;
}

.marker-pin[data-color="0"] { background: #2563EB; }
.marker-pin[data-color="1"] { background: #16A34A; }
.marker-pin[data-color="2"] { background: #DC2626; }
.marker-pin[data-color="3"] { background: #9333EA; }
.marker-pin[data-color="4"] { background: #EA580C; }

.token-pin-btn {
  background: none;
  border: none;
  min-height: unset;
  padding: 2px 4px;
  cursor: pointer;
  color: var(--muted);
  border-radius: 6px;
  font-size: 0.9em;
  line-height: 1;
}

.token-pin-btn.placed { color: var(--primary); }
.token-pin-btn.active { color: var(--primary); background: var(--primary-tint); }

.marker-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--primary-tint);
  color: var(--info-ink);
  font-size: 0.875rem;
  border-top: 1px solid var(--primary);
}

.marker-hint-cancel {
  margin-left: auto;
  min-height: unset;
  padding: 2px 10px;
  font-size: 0.8rem;
}

/* Card detail frame — wraps image + marker overlay */
.card-art-frame {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-meta {
  padding: 16px;
  display: grid;
  gap: 4px;
}

.card-meta span,
.metric-label,
.message {
  color: var(--muted);
}

.panel {
  padding: clamp(18px, 3vw, 28px);
}

.prompt-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 22px;
}

.field-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.token-field {
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
  background: var(--surface);
  position: relative;
}

.tokens {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.token {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--success-tint);
  color: var(--success-ink);
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-weight: 700;
}

.token img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  margin: -6px 0;
  image-rendering: pixelated;
}

.token-appearance {
  width: auto;
  min-height: 26px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 600;
  background: white;
}

.token button {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.token-field input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  min-height: 42px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.token-field input {
  border: 0;
  min-height: 34px;
  padding: 0;
  outline: 0;
  background: transparent;
}

.pokemon-suggestions {
  position: absolute;
  left: 10px;
  right: 10px;
  top: calc(100% - 8px);
  z-index: 4;
  display: none;
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: white;
  box-shadow: var(--shadow-lg);
}

.pokemon-suggestions.open {
  display: block;
}

.pokemon-suggestion {
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 0;
  padding: 6px 12px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.pokemon-suggestion:hover,
.pokemon-suggestion.active {
  background: var(--primary-tint);
  transform: none;
}

.pokemon-suggestion img,
.sprite-placeholder {
  width: 40px;
  height: 40px;
}

.pokemon-suggestion img {
  object-fit: contain;
  image-rendering: pixelated;
}

.sprite-placeholder {
  border-radius: 50%;
  background: var(--neutral-tint);
}

.pokemon-suggestion span {
  font-weight: 800;
}

.pokemon-suggestion small {
  color: var(--muted);
  font-weight: 800;
}

.confidence-standalone {
  margin-top: 18px;
}

.confidence {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  margin: 0;
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}

.confidence label,
.checkline,
.no-pokemon-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.no-pokemon-option {
  margin-top: 12px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--ink);
  background: white;
  font-weight: 700;
}

.actions,
.export-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.actions {
  margin-top: 22px;
}

.primary {
  background: var(--primary);
  border-color: var(--primary-active);
  color: var(--on-primary);
}

.primary:hover {
  background: var(--primary-hover);
}

.primary:active {
  background: var(--primary-active);
}

.primary:disabled {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.secondary,
.ghost {
  background: white;
  border-color: var(--line-strong);
  color: var(--text);
}

.secondary:hover {
  background: var(--surface-2);
}

.ghost {
  border-color: transparent;
  background: transparent;
  color: var(--accent);
}

.ghost:hover {
  background: var(--secondary);
}

.danger {
  background: var(--danger);
  border-color: var(--danger-strong);
  color: white;
}

.danger:hover {
  background: var(--danger-strong);
}

.message {
  min-height: 24px;
  margin: 16px 0 0;
}

.stats-panel {
  padding: 20px;
  display: grid;
  gap: 18px;
}

.metric {
  display: block;
  font-size: 2rem;
  font-weight: 900;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--primary-tint);
  color: var(--primary-active);
  border: 1px solid #BFDBFE;
  border-radius: var(--radius-pill);
  padding: 6px 10px;
  font-size: 0.84rem;
  font-weight: 700;
}

.badge-next {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.leader-badge {
  font-size: 0.95rem;
  line-height: 1;
}

/* Profile "Trainer progress" card */
.profile-progress {
  margin: 4px 0 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  display: grid;
  gap: 14px;
}

.progress-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.progress-metrics .metric {
  font-size: 1.5rem;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.admin-layout,
.catalog-layout {
  display: grid;
  gap: 22px;
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.45);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 20;
}

.onboarding-dialog {
  position: relative;
  width: min(100%, 520px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(24px, 5vw, 40px);
}

.onboarding-skip {
  position: absolute;
  top: 12px;
  right: 12px;
}

.onboarding-art {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
}

.onboarding-slide {
  min-height: 190px;
}

.onboarding-slide h2 {
  font-size: 1.6rem;
  margin-bottom: 10px;
}

.onboarding-slide p {
  color: var(--muted);
  line-height: 1.55;
}

.onboarding-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.onboarding-dots {
  display: flex;
  gap: 8px;
}

.onboarding-dot {
  width: 10px;
  height: 10px;
  min-height: 10px;
  padding: 0;
  border-radius: 50%;
  border: 0;
  background: var(--line-strong);
}

.onboarding-dot.active {
  background: var(--accent);
}

.confirm-dialog {
  width: min(100%, 440px);
}

.confirm-dialog h2 {
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.confirm-dialog p {
  color: var(--muted);
  line-height: 1.55;
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.confirm-danger {
  background: var(--danger);
  border-color: var(--danger-strong);
  color: #fff;
}

.confirm-danger:hover {
  background: var(--danger-strong);
}

.collections-layout {
  display: grid;
  gap: 22px;
  max-width: 1100px;
}

.collection-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.collection-form input {
  flex: 1;
  min-width: 200px;
}

.master-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  cursor: pointer;
}

.master-toggle input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.master-toggle-text {
  display: grid;
  gap: 2px;
}

.master-toggle-hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.master-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--secondary);
  color: var(--success-ink);
  font-size: 0.85rem;
  font-weight: 600;
}

.collection-sort-row {
  display: inline-grid;
  gap: 6px;
  margin: 4px 0 16px;
}

.collection-sort-row select {
  width: auto;
  min-width: 190px;
}

.master-badge {
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-tint);
  color: var(--primary-active);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  vertical-align: middle;
}

.collections-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.collection-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  cursor: pointer;
}

.collection-tile img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}

.collection-tile-body {
  flex: 1;
  display: grid;
  gap: 6px;
}

.collection-tile-body h3 {
  margin: 0;
  text-transform: capitalize;
}

.collection-tile-body span {
  color: var(--muted);
  font-size: 0.85rem;
}

.collection-delete {
  align-self: flex-start;
  color: var(--danger-strong);
}

.message.is-error {
  color: var(--danger-strong);
}

.message.is-success {
  color: var(--success-strong);
}

.progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--neutral-tint);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--success-strong);
  transition: width 0.25s ease;
}

.chip-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.chip-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.lang-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: white;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.lang-flag {
  width: 16px;
  height: 11px;
  flex-shrink: 0;
  border-radius: 2px;
  background-size: 100% 100%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.lang-flag.lang-en  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 30'%3E%3Crect width='60' height='30' fill='%23012169'/%3E%3Cpath d='M0 0 60 30M60 0 0 30' stroke='%23fff' stroke-width='6'/%3E%3Cpath d='M0 0 60 30M60 0 0 30' stroke='%23C8102E' stroke-width='2'/%3E%3Cpath d='M30 0V30M0 15H60' stroke='%23fff' stroke-width='10'/%3E%3Cpath d='M30 0V30M0 15H60' stroke='%23C8102E' stroke-width='6'/%3E%3C/svg%3E"); }
.lang-flag.lang-fr  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23fff'/%3E%3Crect width='1' height='2' fill='%230055A4'/%3E%3Crect x='2' width='1' height='2' fill='%23EF4135'/%3E%3C/svg%3E"); }
.lang-flag.lang-de  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'%3E%3Crect width='5' height='3' fill='%23FFCE00'/%3E%3Crect width='5' height='2' fill='%23DD0000'/%3E%3Crect width='5' height='1'/%3E%3C/svg%3E"); }
.lang-flag.lang-es  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23AA151B'/%3E%3Crect y='.5' width='3' height='1' fill='%23F1BF00'/%3E%3C/svg%3E"); }
.lang-flag.lang-it  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23fff'/%3E%3Crect width='1' height='2' fill='%23009246'/%3E%3Crect x='2' width='1' height='2' fill='%23CE2B37'/%3E%3C/svg%3E"); }
.lang-flag.lang-pt  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 5 3'%3E%3Crect width='5' height='3' fill='%23F00'/%3E%3Crect width='2' height='3' fill='%23060'/%3E%3Ccircle cx='2' cy='1.5' r='.5' fill='%23FF0'/%3E%3C/svg%3E"); }
.lang-flag.lang-pt-br { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 7'%3E%3Crect width='10' height='7' fill='%23009C3B'/%3E%3Cpath d='M5 .8 9.2 3.5 5 6.2.8 3.5z' fill='%23FEDF00'/%3E%3Ccircle cx='5' cy='3.5' r='1.5' fill='%23002776'/%3E%3C/svg%3E"); }
.lang-flag.lang-ja  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23fff'/%3E%3Ccircle cx='1.5' cy='1' r='.6' fill='%23BC002D'/%3E%3C/svg%3E"); }
.lang-flag.lang-ko  { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23fff'/%3E%3Ccircle cx='1.5' cy='1' r='.5' fill='%23CD2E3A'/%3E%3Cpath d='M1 1a.5.5 0 0 1 1 0 .25.25 0 0 0-.5 0 .25.25 0 0 1-.5 0z' fill='%230047A0'/%3E%3C/svg%3E"); }
.lang-flag.lang-zh-hans { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23DE2910'/%3E%3Ccircle cx='.6' cy='.5' r='.22' fill='%23FFDE00'/%3E%3C/svg%3E"); }
.lang-flag.lang-zh-hant { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'%3E%3Crect width='3' height='2' fill='%23FE0000'/%3E%3Crect width='1.5' height='1' fill='%23000095'/%3E%3Ccircle cx='.75' cy='.5' r='.28' fill='%23fff'/%3E%3C/svg%3E"); }

.lang-chip.owned {
  background: var(--success-tint);
  border-color: var(--success);
  color: var(--success-ink);
}

.lang-chip.static {
  cursor: default;
}

.lang-chip.static:hover {
  transform: none;
}

.trust-warning {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--danger-tint);
  border: 1px solid var(--danger-border);
  color: var(--danger-ink);
  font-size: 0.82rem;
  font-weight: 600;
}

.leaderboard-block {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
}

#verify-leaderboard {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  counter-reset: rank;
}

#verify-leaderboard li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  min-width: 0;   /* let the row shrink to the sidebar track */
}

#verify-leaderboard li::before {
  counter-increment: rank;
  content: counter(rank);
  color: var(--muted);
  font-weight: 800;
  width: 16px;
  flex-shrink: 0;
}

.avatar-small {
  width: 24px;
  height: 24px;
  border-width: 1px;
  flex-shrink: 0;
}

.avatar-empty {
  display: inline-block;
  border-radius: 50%;
  background: var(--neutral-tint);
  border: 1px solid var(--line);
}

.leader-name {
  flex: 1;
  min-width: 0;   /* allow ellipsis inside the flex row */
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-score {
  font-weight: 800;
  color: var(--success-strong);
  flex-shrink: 0;
}

/* Standalone Top Spotters leaderboard page */
.spotters-panel {
  max-width: 920px;
}

.spotters {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.spotters-head,
.spotter-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 110px 90px 80px 72px;
  align-items: center;
  gap: 12px;
}

.spotters-head {
  padding: 0 14px 4px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.spotter-row {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.spotter-rank {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--muted);
  text-align: center;
}

.spotter-trainer {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.spotter-name {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spotter-stat {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.spotter-score {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--primary);
  text-align: right;
}

@media (max-width: 720px) {
  .spotters-head {
    display: none;
  }

  .spotter-row {
    grid-template-columns: 32px 1fr auto;
    row-gap: 6px;
  }

  .spotter-trainer {
    flex-wrap: wrap;
  }

  /* Stats drop below the trainer, each labelled by its column name. */
  .spotter-stat {
    grid-column: 2 / -1;
    font-size: 0.86rem;
    color: var(--muted);
  }

  .spotter-stat::before {
    content: attr(data-label) ": ";
    font-weight: 700;
  }

  .spotter-score {
    grid-row: 1;
    grid-column: 3;
  }
}

.catalog-card.missing img {
  filter: grayscale(0.9);
  opacity: 0.55;
}

.catalog-card.owned {
  border-color: var(--success);
}

.account-layout {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  align-items: start;
  max-width: 900px;
}

.account-form {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.account-form label {
  display: grid;
  gap: 6px;
}

.account-box {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-menu {
  position: relative;
}

.account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: white;
  cursor: pointer;
}

.account-chip:hover {
  border-color: var(--success);
}

.account-menu-caret {
  color: var(--muted);
  font-size: 0.75rem;
}

.account-menu-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.account-menu-popover button {
  width: 100%;
  min-height: 38px;
  justify-content: flex-start;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
}

.account-menu-popover button:hover {
  background: var(--secondary);
  transform: none;
}

#account-name {
  font-weight: 700;
  font-size: 0.9rem;
}

.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 6px 0 0;
}

.catalog-browser {
  display: grid;
  gap: 18px;
}

.catalog-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
}

.catalog-toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  /* Top-align the label/field stacks so every label lines up regardless of
     whether the field is an input or a taller-rendering select. */
  align-items: start;
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  box-shadow: var(--shadow-md);
}

.catalog-toolbar label {
  display: grid;
  gap: 6px;
}

/* Bare action buttons have no label above them, so drop them to the bottom of
   the row to line up with the fields rather than the labels. */
.catalog-toolbar > button {
  align-self: end;
}

.catalog-toolbar input:not([type="checkbox"]),
.catalog-toolbar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  height: 42px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

.catalog-confirmed {
  min-height: 42px;
  align-self: end;
  white-space: nowrap;
  gap: 8px;
}

.catalog-summary {
  min-height: 0;
}

.catalog-heading {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
  min-width: 230px;
}

.catalog-heading img,
.catalog-heading .sprite-placeholder {
  width: 58px;
  height: 58px;
  object-fit: contain;
  image-rendering: pixelated;
}

.catalog-heading h3 {
  margin: 0;
  font-size: 1.1rem;
}

.catalog-heading span {
  color: var(--muted);
}

.catalog-controls {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.segmented {
  display: inline-flex;
  background: var(--neutral-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 3px;
}

.segment {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
}

.segment.active {
  background: white;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.catalog-grid {
  display: grid;
  gap: 20px;
}

.catalog-grid.large {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}

.catalog-grid.small {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.catalog-card,
.review-item,
.leaderboard li {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
}

.catalog-card {
  display: grid;
  align-content: start;
  gap: 10px;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.catalog-card:hover {
  border-color: var(--primary-active);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.catalog-card img {
  width: 100%;
  aspect-ratio: 0.716;
  object-fit: contain;
  background: linear-gradient(180deg, var(--surface-2), var(--neutral-tint));
  border-radius: var(--radius-sm);
}

.catalog-card-body {
  display: grid;
  gap: 7px;
}

.catalog-card h3,
.catalog-card p {
  margin: 0;
}

.catalog-card h3 {
  font-size: 0.98rem;
  line-height: 1.25;
}

.catalog-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.catalog-grid.small .catalog-card {
  padding: 10px;
}

.catalog-grid.small .catalog-card h3 {
  font-size: 0.85rem;
}

.catalog-grid.small .catalog-card p,
.catalog-grid.small .catalog-card .pill-line {
  display: none;
}

.review-list,
.leaderboard {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
}

.leaderboard {
  list-style-position: inside;
}

.review-item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 14px;
}

.review-item .secondary {
  margin-top: 10px;
}

.review-item img {
  width: 72px;
  aspect-ratio: 0.716;
  object-fit: contain;
  background: var(--neutral-tint);
  border-radius: var(--radius-sm);
}

.ai-review-item strong,
.ai-review-item p {
  margin: 0;
}

.pill-line {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

/* Base pill is neutral metadata (appearance type, %, source). Status pills
   opt into semantic color: green confirmed, amber needs-review, red disputed. */
.pill {
  color: var(--ink);
  background: var(--secondary);
  border-radius: var(--radius-pill);
  padding: 4px 8px;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill.is-confirmed {
  color: var(--success-ink);
  background: var(--success-tint);
}

.pill.is-review {
  color: var(--warning-ink);
  background: var(--warning-tint);
}

.pill.is-disputed {
  color: var(--danger-ink);
  background: var(--danger-tint);
}

.approved-pill {
  color: var(--info-ink);
  background: var(--info-tint);
}

.inline-action {
  min-height: 26px;
  padding: 0 9px;
  font-size: 0.78rem;
}

@media (max-width: 980px) {
  .workspace {
    grid-template-columns: minmax(240px, 340px) 1fr;
  }

  .stats-panel {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
  }

  .catalog-toolbar {
    grid-template-columns: 1fr 1fr;
  }

  .catalog-toolbar .primary,
  .catalog-toolbar .secondary {
    grid-column: span 1;
  }
}

@media (max-width: 720px) {
  .workspace,
  .catalog-toolbar {
    grid-template-columns: 1fr;
  }

  .catalog-header,
  .catalog-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .catalog-heading {
    justify-content: flex-start;
    min-width: 0;
  }

  .stats-panel {
    grid-template-columns: 1fr;
  }
}
