/* Manrope only — we used to also load Syne for headers but its broken
   descender metrics clipped the "g"/"p"/"y" tails (Mega-Evolution etc.). */
@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&display=swap");

:root {
  --bg: #f4f8f8;
  --surface: #ffffff;
  --surface-soft: #eef5f4;
  --text: #101418;
  --muted: #53606c;
  --line: #d8e4e2;
  --brand: #0f766e;
  --brand-strong: #0a4f4a;
  --accent: #f97316;
  --accent-soft: #ffe9d6;
  --radius: 18px;
  --shadow: 0 15px 35px rgba(13, 34, 32, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eaf4f3 0%, #f8fbfb 35%, #f4f8f8 100%);
  line-height: 1.55;
}

.site-shell {
  position: relative;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  z-index: -1;
  border-radius: 999px;
  filter: blur(2px);
}

.bg-orb-a {
  width: 460px;
  height: 460px;
  right: -140px;
  top: -80px;
  background: radial-gradient(circle at 20% 20%, #99f6e4 0%, rgba(153, 246, 228, 0) 70%);
}

.bg-orb-b {
  width: 560px;
  height: 560px;
  left: -220px;
  bottom: -170px;
  background: radial-gradient(circle at 70% 40%, #fed7aa 0%, rgba(254, 215, 170, 0) 70%);
}

.container {
  width: min(1120px, 92vw);
  margin-inline: auto;
}

.topbar {
  padding: 1.2rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
}

.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand) 0%, #0ea5a0 100%);
  color: #fff;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.topbar nav {
  display: flex;
  gap: 1rem;
}

.topbar nav a {
  color: #154d49;
  text-decoration: none;
  font-weight: 700;
}

.hero {
  margin-top: 1.2rem;
  padding: 2.3rem;
  background: linear-gradient(135deg, #ffffff 0%, #ecf7f5 100%);
  border: 1px solid #d5e8e5;
  border-radius: 28px;
  box-shadow: var(--shadow);
  animation: fade-slide 500ms ease;
}

.eyebrow {
  color: #0a4f4a;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  margin: 0 0 0.35rem;
}

h1,
h2,
h3 {
  /* Syne (the previous header font) ships with broken descender metrics on
     Google Fonts: the "g"/"p"/"y" tails render outside the font's declared
     em-box, and any container's tight padding clips them. Manrope (which we
     already load for body text) renders cleanly at any size — keep it. */
  font-family: "Manrope", "Trebuchet MS", sans-serif;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin: 0 0 0.65rem;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  max-width: 17ch;
}

.hero-copy {
  margin: 0;
  color: var(--muted);
  max-width: 68ch;
}

.hero-cta {
  margin-top: 1.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 999px;
  font-weight: 800;
  padding: 0.72rem 1.1rem;
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-strong);
  box-shadow: 0 10px 24px rgba(14, 116, 110, 0.25);
}

.btn-ghost {
  background: #fff;
  color: #0e5a54;
  border: 1px solid #cbe3e0;
}

.section-pad {
  padding: 2.2rem 0;
}

.section-head p {
  margin-top: 0;
  color: var(--muted);
}

.article-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.article-card {
  background: #fff;
  border: 1px solid #dce9e7;
  border-radius: var(--radius);
  padding: 1.1rem;
  box-shadow: 0 6px 20px rgba(10, 31, 29, 0.05);
}

.article-card p {
  color: var(--muted);
}

.chip {
  margin: 0 0 0.5rem;
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: 800;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}

.text-link {
  color: #0f766e;
  text-decoration: none;
  font-weight: 800;
}

.text-link:hover {
  text-decoration: underline;
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.money-grid article {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid #dce9e7;
  padding: 1rem 1.1rem;
}

.money-grid p {
  margin: 0;
  color: var(--muted);
}

.footer {
  border-top: 1px solid #d7e5e2;
  margin-top: 1rem;
  padding: 1rem 0 2rem;
  color: #60717d;
  font-size: 0.92rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.live-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.mini-card {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d7e7e5;
  padding: 0.65rem;
  display: grid;
  gap: 0.4rem;
  box-shadow: 0 6px 16px rgba(11, 30, 29, 0.06);
}

.mini-card img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border-radius: 10px;
}

.mini-card h3 {
  margin: 0;
  font-size: 0.95rem;
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-weight: 800;
}

.mini-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.skeleton {
  min-height: 220px;
  background:
    linear-gradient(120deg, #f0f5f4 8%, #f8fbfb 18%, #f0f5f4 33%),
    #f0f5f4;
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
}

.article-layout {
  display: grid;
  gap: 1rem;
}

.info-banner {
  padding: 0.9rem 1rem;
  border: 1px solid #f6d2b4;
  border-radius: 14px;
  background: var(--accent-soft);
  color: #974911;
  font-size: 0.93rem;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem;
}

.metric span {
  display: block;
  color: #62727d;
  font-size: 0.82rem;
}

.metric strong {
  font-size: 1.05rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.poke-card {
  background: #fff;
  border: 1px solid #d8e7e4;
  border-radius: var(--radius);
  padding: 0.95rem;
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 0.9rem;
  box-shadow: 0 8px 20px rgba(8, 25, 25, 0.05);
  animation: fade-slide 420ms ease;
}

.poke-img-wrap {
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #f0f5f4 0%, #e6efee 100%);
}

.poke-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms ease;
}

.poke-card:hover .poke-img-wrap img {
  transform: scale(1.03);
}

.poke-title {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: flex-start;
}

.poke-title h3 {
  margin: 0;
  font-size: 1.1rem;
}

.price {
  background: #dcfce7;
  color: #166534;
  border-radius: 999px;
  font-weight: 800;
  padding: 0.28rem 0.55rem;
  white-space: nowrap;
  font-size: 0.87rem;
}

.meta {
  margin: 0.4rem 0 0.6rem;
  color: #5f7281;
  font-size: 0.88rem;
}

.card-insights {
  margin: 0;
  display: grid;
  gap: 0.35rem;
  color: #30414f;
  font-size: 0.9rem;
}

.card-insights b {
  color: #15374d;
}

.link-row {
  margin-top: 0.7rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.link-row a {
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 800;
  padding: 0.35rem 0.62rem;
  border-radius: 999px;
  background: #ebf5ff;
  color: #11497c;
}

.link-row a.amazon {
  background: #fff4d1;
  color: #915c00;
}

.error-box {
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid #f6d2b4;
  background: #fff6ef;
}

.error-box p {
  margin: 0;
  color: #8b4513;
}

.refresh-row {
  display: flex;
  gap: 0.55rem;
  align-items: center;
  flex-wrap: wrap;
}

.note {
  color: #617484;
  font-size: 0.86rem;
}

.ebay-links-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

.ebay-link-card {
  text-decoration: none;
  border: 1px solid #f2d2ab;
  background: linear-gradient(160deg, #fff8ef 0%, #fffbf7 100%);
  border-radius: 14px;
  padding: 0.8rem;
  box-shadow: 0 5px 14px rgba(62, 38, 4, 0.08);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.ebay-link-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(62, 38, 4, 0.14);
}

.ebay-link-card strong {
  display: block;
  color: #8b4a03;
  font-size: 0.92rem;
}

.ebay-link-card span {
  display: block;
  margin-top: 0.2rem;
  color: #8d642e;
  font-size: 0.82rem;
}

.series-board {
  display: grid;
  gap: 1.2rem;
}

.series-page .section-pad {
  padding-top: 0.7rem;
}

.set-page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.set-page .series-group h1 {
  margin: 0;
}

.set-page .set-cards-panel {
  background: #ffffff;
}

.compact-tools {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.status-line {
  min-height: 1.1rem;
  margin: 0;
}

.status-line p {
  margin: 0;
  font-size: 0.86rem;
  color: #5f7281;
}

.status-line-hidden {
  display: none;
}

.status-line-error {
  padding: 0.55rem 0.7rem;
  border: 1px solid #f6d2b4;
  border-radius: 10px;
  background: #fff6ef;
}

.status-line-error p {
  color: #8b4513;
}

.price-progress {
  margin-top: 0.65rem;
  display: grid;
  gap: 0.36rem;
}

.price-progress-hidden {
  display: none;
}

.price-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: #4f6574;
}

.price-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #e3efed;
  overflow: hidden;
  border: 1px solid #d6e8e5;
}

.price-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e 0%, #14b8a6 100%);
  transition: width 220ms ease;
}

.series-section,
.series-group {
  background: #fff;
  border: 1px solid #dce9e7;
  border-radius: 18px;
  padding: 1rem;
  box-shadow: 0 8px 20px rgba(8, 25, 25, 0.05);
}

.series-head,
.series-group-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.series-head p,
.series-group-head p {
  margin: 0;
  color: #5f7281;
}

.series-group-tools {
  display: flex;
  gap: 0.5rem;
}

.sets-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.set-tile {
  position: relative;
  background: #fbfefe;
  border: 1px solid #ddecea;
  border-radius: 12px;
  padding: 0.55rem;
  display: grid;
  gap: 0.35rem;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.set-tile:hover,
.set-tile:focus-visible {
  border-color: #8fd0c9;
  box-shadow: 0 8px 20px rgba(10, 52, 49, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.set-tile[data-loading="true"] {
  opacity: 0.75;
}

.set-tile.is-loaded {
  border-color: #acd9d3;
}

.set-tile.is-open {
  border-color: #66bdb3;
  box-shadow: 0 10px 22px rgba(9, 68, 63, 0.14);
}

.set-code {
  display: inline-flex;
  width: fit-content;
  background: #1f2937;
  color: #fff;
  border-radius: 6px;
  padding: 0.12rem 0.32rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.set-logo-wrap {
  min-height: 78px;
  border-radius: 10px;
  border: 1px solid #e0ecea;
  background: linear-gradient(180deg, #f4f9f8 0%, #edf4f3 100%);
  display: grid;
  place-items: center;
  padding: 0.2rem;
}

.set-logo-wrap img {
  max-width: 90%;
  max-height: 70px;
  object-fit: contain;
}

.set-tile h3 {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  font-family: "Manrope", "Segoe UI", sans-serif;
}

.set-meta {
  margin: 0;
  color: #60717d;
  font-size: 0.79rem;
}

.set-open-btn {
  margin-top: 0.2rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.78rem;
  width: 100%;
}

.set-symbol {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  width: 20px;
  height: 20px;
  object-fit: contain;
  opacity: 0.75;
}

.series-meta-line {
  margin-top: 0.6rem;
  margin-bottom: 0.8rem;
}

.series-cards-stack {
  margin-top: 0.9rem;
  display: grid;
  gap: 0.8rem;
}

.set-cards-panel {
  border: 1px solid #dce9e7;
  border-radius: 14px;
  padding: 0.7rem;
  background: #f8fcfb;
}

.set-cards-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.set-cards-panel-head h3 {
  margin: 0;
  font-size: 1.02rem;
}

.set-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.series-cards-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.7rem;
}

.series-card-tile {
  background: #ffffff;
  border: 1px solid #d9e7e5;
  border-radius: 14px;
  padding: 0.6rem;
  display: grid;
  gap: 0.4rem;
  cursor: pointer;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.series-card-tile:hover,
.series-card-tile:focus-visible {
  border-color: #8fd0c9;
  box-shadow: 0 10px 24px rgba(11, 53, 50, 0.12);
  transform: translateY(-1px);
  outline: none;
}

.series-card-tile img {
  width: 100%;
  aspect-ratio: 5 / 7;
  object-fit: cover;
  border-radius: 8px;
  background: #eef5f4;
}

.series-card-tile h3 {
  margin: 0.15rem 0 0;
  font-size: 0.9rem;
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.22;
}

.series-card-tile p {
  margin: 0;
  color: #60717d;
  font-size: 0.79rem;
}

.card-meta-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.card-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.52rem;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
}

.card-number {
  background: #eef7f5;
  color: #215955;
}

.card-rarity {
  border: 1px solid transparent;
}

.rarity-common {
  background: #f3f4f6;
  color: #374151;
}

.rarity-uncommon {
  background: #ecfdf5;
  color: #0f766e;
}

.rarity-rare {
  background: #eff6ff;
  color: #1d4ed8;
}

.rarity-holo {
  background: #fef3c7;
  color: #92400e;
}

.rarity-elite {
  background: #fee2e2;
  color: #b91c1c;
}

.card-price {
  font-size: 0.82rem;
  color: #4a5f6d;
}

.card-price strong {
  color: #0b6f66;
  font-size: 0.93rem;
}

.card-details {
  display: none;
  border-top: 1px solid #e3efed;
  padding-top: 0.45rem;
}

.series-card-tile.is-open .card-details {
  display: block;
  margin-top: 0.35rem;
}

/* Marketplace links: uniform light background, brand accent only on the icon
   chip and on hover (border + chevron). Stacked vertically inside the open
   card panel so the labels never get clipped on narrow tiles. */
.card-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.market-link {
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.5rem 0.65rem;
  font-size: 0.79rem;
  font-weight: 600;
  line-height: 1;
  color: #1f2937;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  text-decoration: none;
  transition: border-color 150ms ease, background 150ms ease, transform 120ms ease,
    box-shadow 150ms ease;
}

.market-link:hover,
.market-link:focus-visible {
  transform: translateY(-1px);
  background: #f9fbfb;
  border-color: var(--accent, #cbd5e1);
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.06);
  outline: none;
}

.market-link .market-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: var(--accent, #475569);
  color: var(--accent-fg, #fff);
}

.market-link .market-label {
  font-weight: 700;
  color: #1f2937;
  letter-spacing: 0.01em;
}

.market-link .market-arrow {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent, #94a3b8);
  opacity: 0.6;
  transition: transform 150ms ease, opacity 150ms ease;
}

.market-link:hover .market-arrow {
  opacity: 1;
  transform: translateX(2px);
}

.market-link.market-ebay {
  --accent: #e53238;
  --accent-fg: #fff;
}

.market-link.market-leboncoin {
  --accent: #ec5a13;
  --accent-fg: #fff;
}

/* Floating EN/FR language toggle (injected by scripts/lang-toggle.js).      */
.lang-toggle {
  position: fixed;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 200;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: "Manrope", "Segoe UI", sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(13, 34, 32, 0.08);
  transition: transform 120ms ease, box-shadow 150ms ease, border-color 150ms ease;
}
.lang-toggle:hover,
.lang-toggle:focus-visible {
  transform: translateY(-1px);
  border-color: var(--brand);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.18);
  outline: none;
}
.lang-toggle .lang-flag { font-size: 1rem; line-height: 1; }
.lang-toggle .lang-label { letter-spacing: 0.04em; }

/* When relocated into the topnav slot, drop the fixed positioning + shadow. */
.lang-toggle.lang-toggle-inline {
  position: static;
  top: auto;
  right: auto;
  box-shadow: none;
}

/* ----- Top nav -------------------------------------------------------- */

.topnav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
}

.topnav-brand {
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--brand-strong);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}
.topnav-brand:hover { color: var(--brand); }

.topnav-tabs {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
}
.topnav-tabs::-webkit-scrollbar { display: none; }

.topnav-tab {
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background 150ms ease, color 150ms ease;
}
.topnav-tab:hover {
  background: #eef5f4;
  color: var(--text);
}
.topnav-tab.is-active {
  background: var(--brand);
  color: #fff;
}
.topnav-tab.is-active:hover {
  background: var(--brand-strong);
}

.topnav-tab-admin {
  margin-left: 0.4rem;
  border: 1px dashed var(--line);
}
.topnav-tab-admin.is-active {
  border-color: transparent;
}

.topnav-tools {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.topnav-slot {
  display: inline-flex;
  align-items: center;
}

.topnav-auth {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.topnav-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}
.topnav-btn-ghost {
  color: var(--brand);
  border-color: var(--line);
  background: #fff;
}
.topnav-btn-ghost:hover {
  border-color: var(--brand);
  background: #eef5f4;
}
.topnav-btn-primary {
  background: var(--brand);
  color: #fff;
}
.topnav-btn-primary:hover {
  background: var(--brand-strong);
}

/* ----- User menu ----------------------------------------------------- */

.user-menu {
  position: relative;
}
.user-menu summary {
  list-style: none;
  cursor: pointer;
}
.user-menu summary::-webkit-details-marker { display: none; }

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.6rem 0.35rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.user-menu[open] .user-menu-trigger,
.user-menu-trigger:hover {
  border-color: var(--brand);
  box-shadow: 0 6px 14px rgba(13, 34, 32, 0.08);
}

.user-menu-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  font-weight: 900;
  font-size: 0.8rem;
  color: #fff;
  background: linear-gradient(135deg, #0f766e, #14b8a6);
}
.user-menu-label { letter-spacing: 0.01em; }
.user-menu-badge { color: #f59e0b; font-size: 0.85rem; }
.user-menu-caret { font-size: 0.7rem; opacity: 0.6; }

.user-menu-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 220px;
  padding: 0.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 14px 30px rgba(13, 34, 32, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
}

.user-menu-item {
  display: block;
  padding: 0.5rem 0.7rem;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-radius: 7px;
  cursor: pointer;
  width: 100%;
}
.user-menu-item:hover {
  background: #eef5f4;
  color: var(--brand-strong);
}
.user-menu-logout { color: #b91c1c; }
.user-menu-logout:hover { background: #fef2f2; color: #b91c1c; }
.user-menu-sep {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0.3rem 0;
}

@media (max-width: 720px) {
  .topnav { gap: 0.5rem; padding: 0.6rem 0.85rem; }
  .topnav-brand { font-size: 0.85rem; }
  .user-menu-label { display: none; }
  .topnav-btn { padding: 0.4rem 0.7rem; }
}

/* ----- Auth pages ---------------------------------------------------- */

.auth-page {
  max-width: 420px;
  margin: 3rem auto;
  padding: 1.6rem 1.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.auth-page h1 {
  margin: 0 0 1rem;
  font-size: 1.6rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.auth-field label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.auth-field input {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.auth-submit {
  margin-top: 0.4rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}
.auth-submit:hover { background: var(--brand-strong); transform: translateY(-1px); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.auth-error {
  padding: 0.55rem 0.7rem;
  border: 1px solid #f6caca;
  background: #fff5f5;
  border-radius: 10px;
  color: #991b1b;
  font-size: 0.85rem;
  display: none;
}
.auth-error.is-visible { display: block; }

.auth-alt {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}
.auth-alt a {
  color: var(--brand-strong);
  font-weight: 700;
  text-decoration: none;
}
.auth-alt a:hover { text-decoration: underline; }

/* Stub pages (Produits / Notre boutique while phases 3-4 are in flight). */
.stub-page {
  max-width: 640px;
  margin: 3rem auto;
  padding: 2rem 1.6rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.stub-page h1 { font-size: 1.6rem; margin: 0 0 0.5rem; }
.stub-page p { margin: 0; color: var(--muted); }

/* ----- Sealed products grid (phase 3) -------------------------------- */

.products-grid {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.product-tile {
  background: #fff;
  border: 1px solid #d9e7e5;
  border-radius: 14px;
  padding: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}
.product-tile:hover {
  border-color: #8fd0c9;
  box-shadow: 0 10px 24px rgba(11, 53, 50, 0.08);
  transform: translateY(-1px);
}

.product-tile-imgwrap {
  position: relative;
  background: #eef5f4;
  border-radius: 10px;
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-tile-imgwrap img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.product-tile-type {
  position: absolute;
  top: 0.35rem;
  left: 0.35rem;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.92);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.product-tile-name {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--text);
}

.product-tile-price {
  margin: 0;
  font-weight: 900;
  font-size: 1rem;
  color: var(--brand-strong);
}

.product-tile-link {
  margin-top: auto;
  align-self: flex-start;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--brand);
  background: #eef5f4;
  border-radius: 8px;
  text-decoration: none;
  transition: background 120ms ease;
}
.product-tile-link:hover { background: #d9e7e5; }

.products-filters {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0.75rem 0 0.5rem;
}
.products-category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.products-category-bar .subtab {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}
.muted-help {
  margin: 0.3rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.listing-desc {
  margin: 0;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.35;
}

/* Admin-only delete button on listing tiles. Hidden by default; shown via
   our-listings.js when the current user is admin. */
.product-tile { position: relative; }
.listing-delete {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: rgba(255, 255, 255, 0.95);
  color: #b91c1c;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 120ms ease, transform 120ms ease;
}
.listing-delete:hover {
  background: #b91c1c;
  color: #fff;
  transform: scale(1.05);
}
.listing-delete:disabled { opacity: 0.5; cursor: not-allowed; }

/* Admin edit button on listing tiles (sits left of the delete button). */
.listing-edit {
  position: absolute;
  top: 0.4rem;
  right: 2.4rem;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: rgba(255, 255, 255, 0.95);
  color: #0f766e;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 120ms ease, transform 120ms ease;
}
.listing-edit:hover {
  background: #0f766e;
  color: #fff;
  transform: scale(1.05);
}

/* Sold / hidden listings: badge + dimmed tile. */
.listing-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  z-index: 2;
}
.listing-badge-sold { background: #b91c1c; color: #fff; }
.listing-badge-hidden { background: #475569; color: #fff; }
.listing-tile-inactive .product-tile-imgwrap img,
.listing-tile-inactive .product-tile-name,
.listing-tile-inactive .listing-desc,
.listing-tile-inactive .product-tile-price {
  opacity: 0.55;
}

/* Inline edit panel inside a listing tile. */
.listing-edit-panel {
  margin-top: 0.5rem;
  border-top: 1px solid var(--line);
  padding-top: 0.6rem;
}
.listing-edit-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.le-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}
.le-field textarea,
.le-field input,
.le-field select {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.le-field textarea { resize: vertical; min-height: 54px; }
.le-field textarea:focus,
.le-field input:focus,
.le-field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.16);
}
.listing-edit-actions {
  display: flex;
  gap: 0.4rem;
}
.le-save,
.le-cancel {
  flex: 1;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 800;
  cursor: pointer;
  border: 1px solid transparent;
}
.le-save { background: var(--brand); color: #fff; }
.le-save:hover { background: var(--brand-strong); }
.le-save:disabled { opacity: 0.6; cursor: not-allowed; }
.le-cancel { background: #fff; border-color: var(--line); color: var(--muted); }
.le-cancel:hover { border-color: var(--text); color: var(--text); }
.le-msg {
  font-size: 0.78rem;
  padding: 0.35rem 0.5rem;
  border-radius: 7px;
}
.le-msg-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.le-msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* =====================================================================
   Legal pages, footer, account self-service
   ===================================================================== */

.legal-page {
  max-width: 780px;
  margin: 1.5rem auto 3rem;
  padding: 1.8rem 1.6rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  line-height: 1.55;
}
.legal-page h1 { margin: 0 0 0.5rem; font-size: 1.7rem; }
.legal-page h2 { margin: 1.6rem 0 0.6rem; font-size: 1.15rem; }
.legal-page p, .legal-page li { font-size: 0.93rem; color: #2a3742; }
.legal-page a { color: var(--brand-strong); }
.legal-page ul { margin: 0.4rem 0 0.6rem 1.1rem; padding: 0; }
.legal-page code { background: #eef5f4; padding: 0.05rem 0.4rem; border-radius: 4px; font-size: 0.85em; }
.legal-meta {
  margin: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.legal-callout {
  margin: 0.8rem 0 1.2rem;
  padding: 0.6rem 0.8rem;
  background: #fff7e1;
  border: 1px solid #f1dca1;
  border-radius: 10px;
  font-size: 0.9rem;
}
.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin: 0.5rem 0;
}
.legal-table th, .legal-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  vertical-align: top;
}
.legal-table th { background: #f8fbfb; font-weight: 800; }
.legal-details {
  margin: 0.6rem 0 1rem;
  padding: 0.6rem 0.8rem;
  background: #f8fbfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.88rem;
}
.legal-details summary { cursor: pointer; font-weight: 700; }
.legal-details pre {
  margin: 0.6rem 0 0;
  white-space: pre-wrap;
  font-family: inherit;
  font-size: 0.86rem;
}

/* Site footer (injected by topnav.js) */
.site-footer {
  margin-top: 3rem;
  padding: 1.2rem 1.25rem 1.6rem;
  border-top: 1px solid var(--line);
  background: #fff;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer-brand { font-weight: 700; color: var(--text); }
.site-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.9rem;
}
.site-footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.site-footer-links a:hover { color: var(--brand); text-decoration: underline; }

/* Register page consent checkboxes */
.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  font-size: 0.86rem;
  color: var(--muted);
  margin-top: 0.2rem;
}
.auth-consent input[type="checkbox"] {
  margin-top: 0.2rem;
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.auth-consent a { color: var(--brand-strong); font-weight: 700; text-decoration: none; }
.auth-consent a:hover { text-decoration: underline; }

/* Account page */
.account-page {
  max-width: 720px;
  margin: 1.5rem auto 3rem;
  padding: 1.5rem 1.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.account-page h1 { margin: 0 0 1rem; font-size: 1.5rem; }
.account-block {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfb;
  margin-bottom: 1rem;
}
.account-block h2 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.account-block .muted { color: var(--muted); font-size: 0.88rem; margin: 0 0 0.7rem; }
.account-block-danger {
  background: #fff7f7;
  border-color: #fecaca;
}
.account-summary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
  font-size: 0.88rem;
}
.account-summary dt {
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.account-summary dd { margin: 0; color: var(--text); }
.account-delete-form { display: flex; flex-direction: column; gap: 0.7rem; }

.btn-danger {
  background: #b91c1c;
  color: #fff;
  border: none;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  align-self: flex-start;
  transition: background 150ms ease;
}
.btn-danger:hover { background: #7f1d1d; }

/* ----- Engagement page + admin security ------------------------------- */
.engagement-page section { margin: 1.4rem 0; }
.engagement-page section h2 { font-size: 1.1rem; margin-bottom: 0.4rem; }
.engagement-page section ul { padding-left: 1.2rem; }
.engagement-page section ul li { margin: 0.35rem 0; line-height: 1.5; }
.engagement-call {
  margin-top: 1.4rem;
  padding: 0.8rem 1rem;
  background: #f9fbfb;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 600;
}

.admin-section-title {
  margin: 1.4rem 0 0.5rem;
  font-size: 1rem;
  color: var(--brand-strong);
}
.admin-cluster-list { display: flex; flex-direction: column; gap: 0.7rem; }
.admin-cluster {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fbfb;
  padding: 0.5rem 0.85rem;
}
.admin-cluster summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  padding: 0.2rem 0;
}
.admin-cluster summary::-webkit-details-marker { display: none; }
.admin-cluster .admin-table { margin-top: 0.4rem; background: #fff; }
.admin-cluster .muted { color: var(--muted); font-weight: 500; }
.admin-table .pill-ok { background: #ecfdf5; color: #047857; }
.admin-table .pill-warn { background: #fef3c7; color: #92400e; }
.admin-security-stats { margin-bottom: 0.5rem; }

/* Honeypot: visually hidden, removed from the a11y tree. Real users never
   touch it; only bots that fill every input get caught server-side. */
.honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.account-resend-row {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}

.subtabs {
  display: inline-flex;
  background: #eef5f4;
  padding: 4px;
  border-radius: 999px;
  gap: 2px;
}
.subtab {
  border: none;
  background: transparent;
  padding: 0.4rem 0.95rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.subtab.is-active {
  background: var(--brand);
  color: #fff;
}
.subtab:not(.is-active):hover {
  color: var(--text);
}

.muted-empty {
  margin: 0;
  padding: 2rem 0;
  text-align: center;
  color: var(--muted);
}

/* ----- Autocomplete ----------------------------------------------- */

.ac-wrapper { position: relative; }

.search-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.ac-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 90;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(13, 34, 32, 0.14);
  max-height: 360px;
  overflow-y: auto;
  padding: 0.3rem;
}

.ac-empty {
  padding: 0.9rem 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.ac-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 120ms ease;
}
.ac-item:hover, .ac-item:focus-visible {
  background: #eef5f4;
  outline: none;
}

.ac-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef5f4;
}
.ac-thumb-empty {
  display: inline-block;
}

.ac-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.ac-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-item-sub {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ----- Admin tables / forms -------------------------------------- */

.admin-page {
  max-width: 920px;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
}
.admin-page h1 { margin: 0 0 1rem; font-size: 1.5rem; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #eef5f4;
}
.admin-table th {
  font-weight: 800;
  font-size: 0.8rem;
  color: var(--muted);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.admin-table .pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.74rem;
}
.admin-table .pill-admin { background: #fef3c7; color: #92400e; }
.admin-table .pill-user { background: #eef5f4; color: #475569; }

.admin-toggle {
  border: none;
  background: var(--brand);
  color: #fff;
  padding: 0.32rem 0.7rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
}
.admin-toggle:hover { background: var(--brand-strong); }
.admin-toggle.is-revoke { background: #b91c1c; }
.admin-toggle.is-revoke:hover { background: #7f1d1d; }

.admin-pick {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.admin-pick-result {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbfb;
  display: none;
}
.admin-pick-result.is-visible { display: flex; }
.admin-pick-result img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
}
.admin-pick-result .pick-title { font-weight: 800; }
.admin-pick-result .pick-sub { color: var(--muted); font-size: 0.85rem; }

.admin-msg {
  margin-top: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.86rem;
}
.admin-msg-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.admin-msg-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.admin-msg.is-hidden { display: none; }

.search-bar {
  margin: 0 0 1rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.search-bar .ac-wrapper { flex: 1; min-width: 0; }

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

@keyframes fade-slide {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .article-grid,
  .money-grid,
  .metrics,
  .live-grid,
  .ebay-links-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cards-grid {
    grid-template-columns: 1fr;
  }

  .sets-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .set-cards-grid,
  .series-cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    padding: 1.2rem;
    border-radius: 20px;
  }

  .article-grid,
  .money-grid,
  .metrics,
  .live-grid,
  .ebay-links-grid {
    grid-template-columns: 1fr;
  }

  .poke-card {
    grid-template-columns: 1fr;
  }

  .poke-img-wrap img {
    aspect-ratio: 5 / 7;
  }

  .sets-grid {
    grid-template-columns: 1fr;
  }

  .set-cards-grid,
  .series-cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .set-page-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* =====================================================================
   Autocomplete (used by search bar + admin item picker)
   ===================================================================== */

.ac-wrapper { position: relative; }

.search-input {
  width: 100%;
  padding: 0.65rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.ac-dropdown {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  z-index: 90;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(13, 34, 32, 0.14);
  max-height: 360px;
  overflow-y: auto;
  padding: 0.3rem;
}

.ac-empty {
  padding: 0.9rem 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.ac-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.45rem 0.55rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: background 120ms ease;
}
.ac-item:hover, .ac-item:focus-visible {
  background: #eef5f4;
  outline: none;
}

.ac-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #eef5f4;
}
.ac-thumb.ac-thumb-empty { display: inline-block; }

.ac-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.ac-item-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ac-item-sub {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-bar {
  margin: 0 0 1rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
}
.search-bar .ac-wrapper { flex: 1; min-width: 0; }

/* =====================================================================
   Admin pages (users list, add-card, add-product, dashboard)
   ===================================================================== */

.admin-page {
  max-width: 920px;
  margin: 1.5rem auto;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.admin-page h1 { margin: 0 0 1rem; font-size: 1.5rem; }
.admin-page .admin-intro { margin: 0 0 1.2rem; color: var(--muted); }

.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
}
.admin-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fbfb;
  text-decoration: none;
  color: var(--text);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 100ms ease;
}
.admin-card:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 18px rgba(13, 34, 32, 0.08);
  transform: translateY(-1px);
}
.admin-card h2 { font-size: 1.05rem; margin: 0 0 0.3rem; }
.admin-card p { font-size: 0.86rem; color: var(--muted); margin: 0; }

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid #eef5f4;
}
.admin-table th {
  font-weight: 800;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.admin-table .pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.74rem;
}
.admin-table .pill-admin { background: #fef3c7; color: #92400e; }
.admin-table .pill-user { background: #eef5f4; color: #475569; }

.admin-toggle {
  border: none;
  background: var(--brand);
  color: #fff;
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 150ms ease;
}
.admin-toggle:hover { background: var(--brand-strong); }
.admin-toggle.is-revoke { background: #b91c1c; }
.admin-toggle.is-revoke:hover { background: #7f1d1d; }
.admin-toggle:disabled { opacity: 0.6; cursor: not-allowed; }

/* "Pick a card/product" picker block on add-card / add-product pages */
.admin-pick {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 0.85rem;
}
.admin-pick-result {
  display: none;
  align-items: center;
  gap: 0.7rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fbfb;
}
.admin-pick-result.is-visible { display: flex; }
.admin-pick-result img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef5f4;
  flex-shrink: 0;
}
.admin-pick-result .pick-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.admin-pick-result .pick-title {
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-pick-result .pick-sub {
  color: var(--muted);
  font-size: 0.85rem;
}
.admin-pick-result .pick-clear {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  cursor: pointer;
  color: var(--muted);
}
.admin-pick-result .pick-clear:hover { color: var(--text); border-color: var(--text); }

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.admin-field { display: flex; flex-direction: column; gap: 0.3rem; }
.admin-field label {
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.admin-field input,
.admin-field textarea {
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 0.95rem;
  background: #fff;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.admin-field input:focus,
.admin-field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}
.admin-field textarea { resize: vertical; min-height: 90px; }

.admin-submit {
  align-self: flex-start;
  padding: 0.65rem 1.1rem;
  border: none;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  transition: background 150ms ease, transform 100ms ease;
}
.admin-submit:hover { background: var(--brand-strong); transform: translateY(-1px); }
.admin-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.admin-msg {
  margin-top: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  font-size: 0.86rem;
}
.admin-msg.is-hidden { display: none; }
.admin-msg.admin-msg-ok {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}
.admin-msg.admin-msg-error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ---------- Checkout / order confirmation ---------- */
.checkout-page { max-width: 560px; }

.shop-login-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 0.75rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
  font-size: 0.92rem;
}
.shop-login-note a { font-weight: 600; }

.listing-buy {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
  text-align: center;
}

.auth-field-row {
  display: flex;
  gap: 0.75rem;
}
.auth-field-row .auth-field { flex: 1; }

.checkout-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin: 1rem 0 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
}
.checkout-summary img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 8px;
}
.checkout-summary h2 { margin: 0 0 0.35rem; font-size: 1.05rem; }

.order-status-icon {
  font-size: 3rem;
  text-align: center;
  margin-bottom: 0.5rem;
}

.order-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.order-score {
  display: inline-block;
  min-width: 2.2em;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-weight: 700;
  text-align: center;
  color: #fff;
}
.order-score.score-good { background: #16a34a; }
.order-score.score-mid { background: #d97706; }
.order-score.score-bad { background: #dc2626; }
.order-score.score-na { background: #94a3b8; }
.order-flag { cursor: help; color: #dc2626; font-size: 1.05em; }

.listing-badge-review {
  background: #7c3aed;
  color: #fff;
}
.le-field-check {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
}
.le-field-check input { width: auto; }
.order-actions-cell { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.order-actions-cell .btn { padding: 0.3rem 0.6rem; font-size: 0.85rem; }
.order-row-review { background: rgba(124, 58, 237, 0.06); }

.account-orders { display: flex; flex-direction: column; gap: 0.6rem; }
.account-order-row {
  display: grid;
  grid-template-columns: 2fr 1.5fr auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  background: rgba(255, 255, 255, 0.5);
}
.account-order-row:hover { border-color: rgba(99, 102, 241, 0.6); }
.account-order-title { font-weight: 600; }
.account-order-meta { font-size: 0.85rem; opacity: 0.7; }
.account-order-price { font-weight: 700; text-align: right; }
@media (max-width: 560px) {
  .account-order-row { grid-template-columns: 1fr auto; }
  .account-order-meta { grid-column: 1 / -1; }
}
