/* RADAR — StereoNET-aligned dark design system
   =============================================
   Class names match the BEM structure used across templates/*.twig.
   Palette: deep near-black bg, white text, red accent, Playfair serif display,
   system sans UI. Red accent #e63946 matches stereonet.com.
*/

:root, :root[data-theme="dark"] {
  /* Dark mode — StereoNET new-site aligned */
  --bg:          #0D0D0D;
  --bg-raised:   #141414;
  --bg-card:     #1C1C1C;
  --bg-hover:    #1A1A1A;
  --bg-deep:     #111111;
  --bg-ticker:   #000000;
  --border:      rgba(255,255,255,0.10);
  --border-soft: rgba(255,255,255,0.07);
  --text:        #F0EDE8;
  --text-strong: #ffffff;
  --text-muted:  #8A8680;
  --text-dim:    #4A4845;
  --text-on-accent: #ffffff;
  --accent:      #E8230A;
  --accent-hover:#FF3A1E;
  --danger:      #ef4444;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --shadow-lg:   0 12px 40px rgba(0,0,0,0.5);
  --shadow-md:   0 12px 28px rgba(0,0,0,0.5);
  --overlay:     rgba(0,0,0,0.78);
  --scrim:       rgba(0,0,0,0.6);
  --accent-tint-bg:     rgba(232,35,10,0.08);
  --accent-tint-border: rgba(232,35,10,0.35);
  --dealer-bg:     rgba(31,111,235,0.15);
  --dealer-border: rgba(31,111,235,0.35);
  --dealer-text:   #5a8af0;
  --hero-glow:     rgba(232,35,10,0.08);

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-display: "Playfair Display", "Times New Roman", Georgia, serif;

  --max-width: 1440px;
  --gutter: 24px;
  --gutter-sm: 16px;
  --radius: 6px;
  --radius-lg: 10px;
  --header-height: 64px;
}

/* ---------- Light theme — StereoNET new-site aligned (html.light) ---------- */
:root[data-theme="light"] {
  --bg:          #F5F3F0;
  --bg-raised:   #FFFFFF;
  --bg-card:     #FFFFFF;
  --bg-hover:    #EBE9E5;
  --bg-deep:     #F5F3F0;
  --bg-ticker:   #0D0D0D;        /* keep ticker dark for brand consistency */
  --border:      rgba(0,0,0,0.10);
  --border-soft: rgba(0,0,0,0.08);
  --text:        #1A1A1A;
  --text-strong: #0D0D0D;
  --text-muted:  #5C5955;
  --text-dim:    #9A9690;
  --text-on-accent: #ffffff;
  --accent:      #D41A06;
  --accent-hover:#B81505;
  --danger:      #dc2626;
  --success:     #16a34a;
  --warning:     #d97706;
  --shadow-lg:   0 12px 40px rgba(0, 0, 0, 0.10);
  --shadow-md:   0 8px 24px rgba(0, 0, 0, 0.08);
  --overlay:     rgba(255,255,255,0.92);
  --scrim:       rgba(0,0,0,0.45);
  --accent-tint-bg:     rgba(212,26,6,0.08);
  --accent-tint-border: rgba(212,26,6,0.30);
  --dealer-bg:     rgba(31,111,235,0.10);
  --dealer-border: rgba(31,111,235,0.35);
  --dealer-text:   #1f4fb8;
  --hero-glow:     rgba(212,26,6,0.06);
  color-scheme: light;
}

:root[data-theme="dark"] { color-scheme: dark; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; transition: color .15s; }
a:hover { color: var(--accent); }

img { max-width: 100%; display: block; }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
button { cursor: pointer; }

h1, h2, h3, h4, h5 { margin: 0; }

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: 100%;
}
@media (max-width: 768px) {
  .container { padding: 0 var(--gutter-sm); }
}
@media (max-width: 380px) {
  .container { padding: 0 12px; }
}

.site-main {
  flex: 1;
  padding: 0 0 64px;
}

.list-plain { list-style: none; margin: 0; padding: 0; }

.small { font-size: 12px; }
.muted { color: var(--text-muted); }

.stack { display: flex; flex-direction: column; gap: 16px; }

.inline-form { display: inline; }
.inline-form--row { display: inline-flex; gap: 8px; align-items: center; }

.link-btn {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  padding: 0;
  font-size: 13px;
  cursor: pointer;
}
.link-btn:hover { color: var(--accent); }
.link-btn--danger:hover { color: var(--danger); }

/* ---------- Ticker (live listings) ---------- */
.ticker {
  background: var(--bg-ticker);
  color: #f5f5f5;
  border-bottom: 1px solid var(--border);
  height: 36px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  position: relative;
}
.ticker__label {
  background: var(--accent);
  color: var(--text-strong);
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  z-index: 2;
}
.ticker__label::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: #fff;
  animation: pulse-white 1.5s infinite;
}
.ticker__track {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 20px;
  white-space: nowrap;
  flex: 1;
  overflow: hidden;
}
.ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text);
}
.ticker__item strong { color: var(--accent); font-weight: 700; }
.ticker__item--muted { color: var(--text-dim); font-style: italic; }

@keyframes pulse-white {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ---------- Header / nav ---------- */
.site-header {
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text-strong);
}
.brand:hover { color: var(--text-strong); }
.brand__mark {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: var(--text-strong);
  line-height: 1;
}
.brand__by {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.brand__by strong { color: var(--text-strong); font-weight: 700; }
.brand--sm .brand__mark { font-size: 20px; }
.brand--sm .brand__by { font-size: 10px; }
.brand__logo {
  height: 64px;
  width: auto;
  display: block;
}
@media (min-width: 1024px) {
  .brand__logo { height: 72px; }
}
.brand__logo--sm { height: 56px; margin-bottom: 12px; }
.site-footer .brand__logo { opacity: 0.95; }

.searchbar {
  display: flex;
  flex: 1;
  max-width: 520px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: visible;
  position: relative;
  transition: border-color .15s;
}
.searchbar:focus-within { border-color: var(--accent); }

/* Autocomplete dropdown */
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,.45);
  max-height: min(70vh, 420px);
  overflow-y: auto;
}
.search-suggest[hidden] { display: none; }
.suggest__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-strong);
  cursor: pointer;
  line-height: 1.3;
}
.suggest__item--active,
.suggest__item:hover { background: rgba(255,255,255,.06); }
.suggest__icon {
  flex: 0 0 18px;
  width: 18px; height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  border-radius: 3px;
  background: rgba(255,255,255,.08);
  color: var(--text-dim);
}
.suggest__icon--search {
  background: var(--accent);
  color: var(--text-strong);
}
.suggest__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.suggest__hint  { flex: 0 0 auto; color: var(--text-dim); font-size: 11px; }
@media (max-width: 640px) {
  .search-suggest { max-height: 60vh; }
  .suggest__hint  { display: none; }
}
.searchbar input[type="search"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text-strong);
  padding: 0 14px;
  outline: none;
  font-size: 14px;
}
.searchbar input[type="search"]::placeholder { color: var(--text-dim); }
.searchbar button {
  background: var(--accent);
  color: var(--text-strong);
  border: 0;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: background .15s;
}
.searchbar button:hover { background: var(--accent-hover); }

.site-nav {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-left: auto;
  font-size: 13px;
}
.site-nav a {
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-strong);
  padding: 8px 0;
}
.site-nav a:hover { color: var(--accent); }

/* ===== User dropdown menu (header) ===== */
.user-menu { position: relative; display: inline-block; }
.user-menu__trigger {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text-strong);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  transition: border-color .15s, background .15s;
}
.user-menu__trigger::-webkit-details-marker { display: none; }
.user-menu__trigger::marker { content: ''; }
.user-menu__trigger:hover { border-color: var(--accent); }
.user-menu[open] .user-menu__trigger { border-color: var(--accent); background: var(--bg); }
.user-menu[open] .user-menu__chev { transform: rotate(180deg); }
.user-menu__avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}
.user-menu__name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-transform: none;
  letter-spacing: 0;
}
.user-menu__chev {
  font-size: 10px;
  color: var(--text-muted);
  transition: transform .2s;
}
.user-menu__panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 240px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  padding: 6px;
  z-index: 200;
}
.user-menu__header {
  padding: 8px 10px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.user-menu__email {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.user-menu__badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  background: var(--accent);
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}
.user-menu__item {
  display: block;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong);
  text-transform: none;
  letter-spacing: 0;
  border-radius: 6px;
  transition: background .12s, color .12s;
}
.user-menu__item:hover { background: var(--bg); color: var(--accent); }
.user-menu__item--admin { color: var(--accent); }
.user-menu__item--danger { color: #d9534f; }
.user-menu__item--danger:hover { background: rgba(217,83,79,0.12); color: #d9534f; }
.user-menu__item--btn {
  background: transparent;
  border: 0;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.user-menu__sep {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 6px 0;
}
.user-menu__form { margin: 0; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(ellipse at top left, rgba(230,57,70,0.08), transparent 60%),
    linear-gradient(180deg, #0f1420 0%, var(--bg) 100%);
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--border);
}
.hero__title {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin: 0 0 16px;
}
.hero__lede {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 640px;
  margin: 0 0 36px;
}
.hero__search {
  display: flex;
  flex-wrap: wrap;
  position: relative;
  max-width: 720px;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.hero__search input[name="q"] { border-top-left-radius: var(--radius-lg); border-bottom-left-radius: var(--radius-lg); }
.hero__search button { border-top-right-radius: var(--radius-lg); border-bottom-right-radius: var(--radius-lg); }
.hero__search input[name="q"] {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--text-strong);
  padding: 18px 22px;
  font-size: 17px;
  outline: none;
}
.hero__search input[name="q"]::placeholder { color: var(--text-dim); }
.hero__search button {
  background: var(--accent);
  color: var(--text-strong);
  border: 0;
  padding: 18px 32px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  transition: background .15s;
}
.hero__search button:hover { background: var(--accent-hover); }

.hero__stats {
  display: flex;
  gap: 40px;
  margin-top: 32px;
  flex-wrap: wrap;
}
.hero__stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.hero__stats strong {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1;
}
.hero__stats span {
  color: var(--text-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ---------- Section ---------- */
.section {
  padding: 48px 0;
  border-bottom: 1px solid var(--border-soft);
}
.section:last-child { border-bottom: 0; }
.section--alt { background: var(--bg-raised); }

.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.section__head h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
}
.section__more {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.section__more:hover { color: var(--accent); }

/* ---------- Page head (generic h1 area) ---------- */
.page-head {
  padding: 40px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.page-head h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.6px;
}
.page-head .muted { margin-top: 6px; }

.crumbs {
  font-size: 12px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.crumbs a:hover { color: var(--accent); }

/* ---------- Brand grid (Popular brands) ---------- */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 4px 32px;
}
.brand-grid--wide {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.brand-grid li a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-soft);
  font-size: 14px;
}
.brand-grid li a:hover { color: var(--accent); }
.brand-grid__name { font-weight: 500; }
.brand-grid__count {
  color: var(--text-dim);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* ---------- Alpha index (brands page) ---------- */
.alpha-index {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  position: sticky;
  top: var(--header-height);
  background: var(--bg);
  z-index: 50;
}
.alpha-index a {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
}
.alpha-index a:hover { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }

.brand-block { margin-bottom: 40px; }
.brand-block__letter {
  font-family: var(--font-display);
  font-size: 56px;
  font-weight: 900;
  color: var(--accent);
  opacity: 0.35;
  line-height: 1;
  margin: 0 0 16px;
}

/* ---------- Chip / tag ---------- */
.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  transition: background .15s, border-color .15s, color .15s;
}
.chip:hover {
  background: var(--bg-hover);
  border-color: var(--accent);
  color: var(--text-strong);
}
.chip--sm { padding: 5px 10px; font-size: 12px; }
.chip__brand {
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
}
.chip__model { font-weight: 500; }
.chip__count {
  color: var(--text-dim);
  font-size: 11px;
  padding-left: 6px;
  border-left: 1px solid var(--border);
}

/* ---------- Listing card + grid ---------- */
/* Mobile-first: 2 columns on phones, scaling up. */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 600px)  { .listing-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px)  { .listing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
/* 5-col only when there's genuinely room — prevents text truncation in cards */
.listing-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.listing-card:hover {
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
.listing-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-ticker);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.listing-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.listing-card:hover .listing-card__media img { transform: scale(1.03); }
.listing-card__noimg {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.listing-card__source {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  max-width: calc(100% - 12px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-card__dealer {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #1f6feb;
  color: #fff;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.listing-card__cond {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.listing-card__expired {
  position: absolute;
  top: 6px;
  right: 6px;
  background: #4a4a4a;
  color: #fff;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
.listing-card__sold {
  position: absolute;
  top: 6px;
  right: 6px;
  background: var(--accent);
  color: var(--text-on-accent);
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}
/* Stack: dealer badge at right, cond/expired/sold tucks below when both present */
.listing-card__dealer ~ .listing-card__cond,
.listing-card__dealer ~ .listing-card__expired,
.listing-card__dealer ~ .listing-card__sold { top: 32px; }
.listing-card.is-expired { opacity: 0.6; }
.listing-card.is-expired .listing-card__media img { filter: grayscale(0.8); }
.listing-card.is-expired .listing-card__price { color: var(--text-dim); }
.listing-card.is-expired:hover { opacity: 0.9; }
.listing-card.is-sold { opacity: 0.85; }
.listing-card.is-sold .listing-card__media img { filter: grayscale(0.4); }
.listing-card.is-sold .listing-card__price-main { text-decoration: line-through; color: var(--text-muted); }
.listing-card.is-sold:hover { opacity: 1; }
.listing-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
@media (min-width: 900px) {
  .listing-card__body { padding: 12px 14px 14px; gap: 8px; }
}

/* Meta row: single line, ellipsis on overflow. Prevents chip-wrap jitter. */
.listing-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  min-width: 0;
}
.listing-card__brand {
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.listing-card__brand:hover { color: var(--accent); }
.listing-card__cat {
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 1;
  min-width: 0;
}
.listing-card__meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
  flex-shrink: 0;
}

/* Title: clamp to exactly 2 lines, uniform min-height so all cards align. */
.listing-card__title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-strong);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
  overflow-wrap: anywhere;
  word-break: break-word;
}
@media (min-width: 900px) {
  .listing-card__title { font-size: 14.5px; }
}
.listing-card__title a { color: var(--text-strong); }
.listing-card__title a:hover { color: var(--accent); }

.listing-card__price-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border-soft);
  min-width: 0;
}
.listing-card__research {
  display: block;
  margin-top: 10px;
  padding: 6px 10px;
  text-align: center;
  background: var(--accent);
  color: var(--text-strong);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 5px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s;
}
.listing-card__research:hover { background: var(--accent-hover); color: var(--text-strong); }
.listing-card.is-sold .listing-card__research,
.listing-card.is-expired .listing-card__research {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
}
.listing-card__price {
  color: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}
.listing-card__price-main {
  font-size: 17px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  max-width: 100%;
}
.listing-card__price-main .price-cur,
.listing-card__price-main .price-sym { display: inline; }
.price-cur {
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-right: 2px;
  text-transform: uppercase;
}
.price-sym {
  font-weight: 700;
  opacity: 0.85;
  margin-right: 1px;
}
@media (min-width: 900px) {
  .listing-card__price-main { font-size: 18px; }
}
.listing-card__price-usd {
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.listing-card__where {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: right;
  font-size: 9.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  white-space: nowrap;
}
.listing-card__country {
  display: inline-block;
  align-self: flex-end;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: #6b7280;
  border: 1px solid transparent;
  border-radius: 3px;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.5;
  flex-shrink: 0;
}
/* Country-specific tints (subtle, flag-derived) */
.listing-card__country[data-cc="AU"] { background: #00843D; }  /* green & gold */
.listing-card__country[data-cc="GB"] { background: #012169; }  /* union blue */
.listing-card__country[data-cc="US"] { background: #B22234; }  /* old glory red */
.listing-card__country[data-cc="CA"] { background: #D52B1E; }  /* maple red */
.listing-card__country[data-cc="NZ"] { background: #00247D; }  /* nz blue */
.listing-card__country[data-cc="DE"] { background: #1A1A1A; border-color: #DD0000; }
.listing-card__country[data-cc="FR"] { background: #0055A4; }
.listing-card__country[data-cc="IT"] { background: #008C45; }
.listing-card__country[data-cc="ES"] { background: #AA151B; }
.listing-card__country[data-cc="NL"] { background: #AE1C28; }
.listing-card__country[data-cc="JP"] { background: #BC002D; }
.listing-card__country[data-cc="CH"] { background: #D52B1E; }
.listing-card__country[data-cc="SE"] { background: #006AA7; }
.listing-card__country[data-cc="IE"] { background: #169B62; }
.listing-card__country[data-cc="HK"] { background: #DE2910; }
.listing-card__country[data-cc="SG"] { background: #EF3340; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  background: var(--bg-raised);
  color: var(--text);
  transition: background .15s, border-color .15s, color .15s;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--bg-hover); color: var(--text-strong); }
.btn--primary { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--text-on-accent); }
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:hover { background: var(--bg-raised); border-color: var(--accent); color: var(--accent); }
.btn--block { display: flex; width: 100%; }

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], input[type="url"],
select, textarea {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-strong);
  padding: 10px 14px;
  border-radius: var(--radius);
  outline: none;
  width: 100%;
  transition: border-color .15s;
  font-size: 14px;
}

/* Normalise native <select> so OS defaults (blue caret / highlight) don't
   break the dark theme. Custom caret rendered via inline SVG in the brand
   text color — swapped in light mode below. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%23F0EDE8' d='M0 0h10L5 6z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}
[data-theme="light"] select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%230D0D0D' d='M0 0h10L5 6z'/></svg>");
}
select::-ms-expand { display: none; }
select option {
  background: var(--bg-card);
  color: var(--text-strong);
}

input:focus, select:focus, textarea:focus { border-color: var(--accent); }

label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  margin: 0;
}
.check input { width: auto; margin: 0; accent-color: var(--accent); }

/* ---------- Filters / search layout ---------- */
.search-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
  padding-top: 32px;
}
.search-filters {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: sticky;
  top: calc(var(--header-height) + 16px);
  /* Cap height so the panel never exceeds the viewport and its lower
     controls (Apply / Reset, Save Search) remain reachable on short
     screens. The inner content scrolls independently. */
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow-y: auto;
  /* Slim, theme-aware scrollbar so it doesn't look like a leftover. */
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.search-filters::-webkit-scrollbar { width: 8px; }
.search-filters::-webkit-scrollbar-track { background: transparent; }
.search-filters::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
.search-filters::-webkit-scrollbar-thumb:hover { background: var(--border-soft); }
.filter-group {
  padding: 16px 0;
  border-bottom: 1px solid var(--border-soft);
}
.filter-group:last-child { border-bottom: 0; }
.filter-group h3 {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.filter-group--row { display: flex; gap: 8px; }
.filter-group--row input { flex: 1; }

.search-results { min-width: 0; }
.search-results__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.search-results__head h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}

.save-search {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 16px;
  margin-bottom: 20px;
  font-size: 13px;
}
.save-search h4 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}
.save-search input[type="text"] {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 13px;
}
.save-search input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}
.save-search .check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}
.save-search .check input { margin: 0; }
.save-search .btn { width: 100%; }
.save-search--locked {
  color: var(--text-muted);
}
.save-search--locked p {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0;
}
.pagination a, .pagination span {
  min-width: 36px;
  height: 36px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-raised);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.pagination a:hover { background: var(--accent); border-color: var(--accent); color: var(--text-on-accent); }
.pagination__pages {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.pagination .is-current {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-strong);
}

/* ---------- Model list (brand page) ---------- */
.model-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 4px 24px;
}
.model-list li { display: flex; }
.model-list li a {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border-soft);
}
.model-list li a:hover { color: var(--accent); }
.model-list__name { font-weight: 500; }
.model-list__cat {
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.model-list__count {
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Stat row ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-row--admin { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stat-row > div {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.stat-row strong {
  display: block;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text-strong);
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat-row span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

/* ---------- Price sparkline (model page) ---------- */
.price-spark {
  margin: 18px 0 0;
  padding: 14px 16px;
  background: var(--surface-2, rgba(255,255,255,0.04));
  border: 1px solid var(--border, rgba(255,255,255,0.08));
  border-radius: 10px;
}
.price-spark__caption {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.price-spark__delta { font-weight: 600; }
.price-spark__delta--up   { color: #ef4444; }
.price-spark__delta--down { color: #22c55e; }
.price-spark__svg {
  display: block;
  width: 100%;
  height: 80px;
}

/* ---------- Grid helpers ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
}

/* ---------- Pills / badges ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: var(--bg-raised);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.pill--on { background: rgba(34,197,94,0.12); color: var(--success); border-color: rgba(34,197,94,0.3); }
.pill--off { background: rgba(107,114,128,0.12); color: var(--text-dim); }
.pill--dealer { background: rgba(31,111,235,0.15); color: #5a8af0; border-color: rgba(31,111,235,0.35); font-weight: 700; }

.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim);
  display: inline-block;
}

/* ---------- Alerts / empty states ---------- */
.alert {
  background: rgba(230,57,70,0.08);
  border: 1px solid rgba(230,57,70,0.35);
  color: var(--text-strong);
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-size: 14px;
}
.alert--error   { background: rgba(239,68,68,0.10); border-color: rgba(239,68,68,0.40); }
.alert--warning { background: rgba(234,179,8,0.10);  border-color: rgba(234,179,8,0.40); }
.alert--success { background: rgba(34,197,94,0.10);  border-color: rgba(34,197,94,0.40); }

/* Consent checkbox on register form */
.consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  padding: 10px 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.consent input[type="checkbox"] {
  margin: 2px 0 0 0;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  accent-color: var(--accent, #e8230a);
}

.empty-state {
  background: var(--bg-raised);
  border: 1px dashed var(--border);
  padding: 56px 24px;
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-muted);
}
.empty-state h3 {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--text-strong);
  margin-bottom: 8px;
}

/* ---------- Data table (admin) ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-soft);
}
.data-table th {
  background: var(--bg-raised);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.data-table tr:last-child td { border-bottom: 0; }
.data-table tr:hover td { background: var(--bg-hover); }
.data-table--dense th, .data-table--dense td { padding: 8px 10px; font-size: 12px; }
.data-table a:hover { color: var(--accent); }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Admin models (fingerprints) ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.stat-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-card__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-card__value {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.filter-bar__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 160px;
  position: relative;
}
.filter-bar__field--narrow { flex: 0 0 120px; }
.filter-bar__field span {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.filter-bar__field input,
.filter-bar__field select {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 6px;
}
.filter-bar__field input:focus,
.filter-bar__field select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 0;
  border-color: transparent;
}
.filter-bar__actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
@media (max-width: 640px) {
  .filter-bar__actions { margin-left: 0; width: 100%; }
  .filter-bar__field--narrow { flex: 1 1 calc(50% - 5px); }
}

.conf-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.5;
}
.conf-pill--high { background: rgba(46, 160, 67, 0.15); color: #3fb950; border: 1px solid rgba(46, 160, 67, 0.35); }
.conf-pill--med  { background: rgba(210, 153, 34, 0.15); color: #d29922; border: 1px solid rgba(210, 153, 34, 0.35); }
.conf-pill--low  { background: rgba(139, 148, 158, 0.15); color: #8b949e; border: 1px solid rgba(139, 148, 158, 0.35); }

.table-wrap {
  overflow-x: auto;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.table-wrap .data-table { margin: 0; }

/* Light mode overrides for conf pills — slightly darker text for contrast */
[data-theme="light"] .conf-pill--high { color: #1a7f37; }
[data-theme="light"] .conf-pill--med  { color: #9a6700; }
[data-theme="light"] .conf-pill--low  { color: #57606a; }

/* ---------- Admin layout ---------- */
.admin-nav {
  display: flex;
  gap: 4px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-nav a {
  padding: 8px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
}
.admin-nav a:hover { background: var(--bg-raised); color: var(--text-strong); border-color: var(--border); }
.admin-nav a.is-active { background: var(--accent); color: var(--text-on-accent); border-color: var(--accent); }

/* ---------- Sticky admin section nav (admin/_nav.twig) ---------- */
.admin-nav--sticky {
  position: sticky;
  top: var(--header-height);
  z-index: 40;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0;
  margin-bottom: 0;
  backdrop-filter: saturate(140%) blur(6px);
  -webkit-backdrop-filter: saturate(140%) blur(6px);
}
:root[data-theme="light"] .admin-nav--sticky { background: rgba(255,255,255,0.92); }
:root[data-theme="dark"]  .admin-nav--sticky { background: rgba(15,15,17,0.92); }
.admin-nav__inner {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 44px;
  padding: 6px 0;
  flex-wrap: wrap;
}
.admin-nav__home {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
  white-space: nowrap;
  text-decoration: none;
}
.admin-nav__home:hover { color: var(--accent); }
.admin-nav__tabs {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}
.admin-nav__tab {
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid transparent;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.admin-nav__tab:hover {
  background: var(--bg-raised);
  color: var(--text-strong);
  border-color: var(--border);
}
.admin-nav__tab--active {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}
.admin-nav__tab--active:hover {
  background: var(--accent);
  color: var(--text-on-accent);
  border-color: var(--accent);
}
@media (max-width: 720px) {
  .admin-nav__inner { gap: 10px; }
  .admin-nav__home { font-size: 14px; }
  .admin-nav__tab { padding: 5px 10px; font-size: 12px; }
}

.admin-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-list > * {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 14px 16px;
}

/* ---------- Auth pages ---------- */
.auth-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 48px 20px 80px;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
}
.auth-card h1 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 6px;
}
.auth-card .muted { margin-bottom: 24px; display: block; }
.auth-card .form-row,
.auth-card label + input {
  margin-bottom: 16px;
}
.auth-alt {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-alt a { color: var(--accent); font-weight: 600; }

/* ---------- Toast ---------- */
.toast-region {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 200;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius);
  box-shadow: 0 12px 36px rgba(0,0,0,0.6);
  animation: toast-in .3s ease-out;
  pointer-events: auto;
  cursor: pointer;
  max-width: 360px;
}
.toast:hover { border-color: var(--accent); }
.toast__title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.toast__sub { font-size: 12px; color: var(--text-muted); }
@keyframes toast-in {
  from { transform: translateX(400px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-raised);
  border-top: 1px solid var(--border);
  padding: 40px 0 24px;
  margin-top: 64px;
  color: var(--text-muted);
  font-size: 13px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 24px;
  align-items: start;
}
.site-footer__brand p { margin-top: 12px; max-width: 360px; }
.site-footer .link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.site-footer .link-btn:hover { color: var(--accent); }
.site-footer h5 {
  color: var(--text-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 12px;
}
.site-footer a:hover { color: var(--accent); }
.site-footer ul li { padding: 4px 0; }
.site-footer__bottom {
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .search-layout { grid-template-columns: 1fr; gap: 16px; padding-top: 16px; }
  .search-filters {
    position: static;
    padding: 14px 16px;
  }
  /* Collapse filter groups on mobile into a tighter 2-col layout */
  .search-filters .filter-group { padding: 10px 0; }
  .site-footer__inner { grid-template-columns: 1fr 1fr; gap: 28px; }
  .site-footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .site-header__inner {
    height: auto;
    padding: 10px 0;
    flex-wrap: wrap;
    gap: 10px;
  }
  .searchbar { order: 3; flex-basis: 100%; max-width: none; }
  .site-nav { order: 2; margin-left: 0; gap: 14px; font-size: 12px; }
  /* Hide the brand__by marker on tight viewports (logo SVG carries branding) */

  .hero { padding: 48px 0 40px; }
  .hero__title { font-size: 34px; letter-spacing: -0.8px; }
  .hero__lede { font-size: 15px; }
  .hero__search { flex-direction: column; }
  .hero__search input[name="q"] { padding: 14px 18px; font-size: 15px; }
  .hero__search button { padding: 14px 20px; }
  .hero__stats { gap: 24px; }
  .hero__stats strong { font-size: 22px; }

  .section { padding: 28px 0; }
  .section__head h2 { font-size: 22px; }

  .search-results__head { margin-bottom: 14px; padding-bottom: 10px; }
  .search-results__head h1 { font-size: 22px; }

  .brand-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 20px; }
  .site-footer__inner { grid-template-columns: 1fr; }
  .alpha-index { top: auto; position: static; }
}

/* Extra-small phones: keep 2 columns but drop gutters further */
@media (max-width: 380px) {
  .listing-grid { gap: 8px; }
  .listing-card__body { padding: 8px 10px 10px; }
  .listing-card__title { font-size: 12.5px; }
  .listing-card__price-main { font-size: 14.5px; }
}

/* ===== Category browse ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}
@media (min-width: 600px)  { .category-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 900px)  { .category-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1280px) { .category-grid { grid-template-columns: repeat(5, 1fr); } }

.category-tile {
  display: flex;
  flex-direction: column;
  background: #141821;
  border: 1px solid #1f242f;
  border-radius: 10px;
  color: #e8ebf0;
  text-decoration: none;
  overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.category-tile:hover,
.category-tile:focus-visible {
  border-color: #e63946;
  transform: translateY(-1px);
}

.category-tile__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0b0e14;
  overflow: hidden;
}
.category-tile__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}
.category-tile:hover .category-tile__media img { transform: scale(1.04); }

.category-tile__noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #171b25 0%, #0b0e14 100%);
  color: #3a4252;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 2.4rem;
  font-weight: 900;
}

.category-tile__count {
  position: absolute;
  top: 8px; right: 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: #e8ebf0;
  background: rgba(11, 14, 20, 0.88);
  backdrop-filter: blur(4px);
  padding: 3px 9px;
  border-radius: 99px;
  border: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.02em;
}

.category-tile__body { padding: 10px 12px 12px; }
.category-tile__name {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.3;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Empty categories disclosure */
.empty-cats {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid #1f242f;
}
.empty-cats summary {
  cursor: pointer;
  color: #8a93a3;
  font-size: 0.85rem;
  padding: 6px 0;
  list-style: none;
}
.empty-cats summary::-webkit-details-marker { display: none; }
.empty-cats summary::before { content: '+ '; color: #e63946; font-weight: 700; }
.empty-cats[open] summary::before { content: '− '; }
.empty-cats__list {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 10px;
}
.empty-cat-chip {
  display: inline-block;
  padding: 4px 10px;
  font-size: 0.78rem;
  background: #0b0e14;
  border: 1px solid #1f242f;
  border-radius: 99px;
  color: #8a93a3;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.empty-cat-chip:hover { border-color: #e63946; color: #e8ebf0; }

/* Breadcrumb + chip row shared by category page */
.breadcrumb { color: #8a93a3; margin-bottom: 6px; display: inline-flex; gap: 6px; align-items: center; }
.breadcrumb a { color: #8a93a3; text-decoration: none; }
.breadcrumb a:hover { color: #e8ebf0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #141821;
  border: 1px solid #1f242f;
  border-radius: 99px;
  font-size: 0.82rem;
  color: #e8ebf0;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.chip:hover { border-color: #e63946; background: #171b25; }
.chip__count { font-size: 0.72rem; color: #8a93a3; }

.section--tight { padding-top: 8px; padding-bottom: 0; }
.h-small { font-size: 0.95rem; color: #8a93a3; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 4px; font-weight: 600; }

.list-toolbar { display: flex; justify-content: flex-end; margin: 10px 0 14px; }
.sort-form { display: inline-flex; gap: 8px; align-items: center; }
.sort-form select {
  background: #141821; color: #e8ebf0;
  border: 1px solid #1f242f; border-radius: 6px;
  padding: 6px 10px; font-size: 0.85rem;
}

/* ===== Listing detail page ===== */
.listing-detail { padding: 18px 0 40px; }
@media (max-width: 640px) { .listing-detail { padding: 12px 0 28px; } }

.listing-detail__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 14px;
  align-items: start;
}
.listing-detail__media {
  position: relative;
  background: #0b0e14;
  border: 1px solid #1f242f;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  width: 100%;
}
@media (max-width: 640px) {
  .listing-detail__media { aspect-ratio: 1 / 1; border-radius: 10px; }
}
@media (min-width: 900px) {
  .listing-detail__grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 32px;
    align-items: start;
  }
  .listing-detail__media {
    aspect-ratio: auto;
    height: 560px;
    align-self: start;
  }
}
@media (min-width: 1200px) {
  .listing-detail__media { height: 620px; }
}
.listing-detail__img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
.listing-detail__noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 3rem; font-weight: 900;
  color: #3a4252;
}
.badge--expired {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: var(--text-on-accent);
  padding: 4px 10px; border-radius: 4px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
}

.listing-detail__info { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.listing-detail__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.chip--brand { background: #1a1f2b; border-color: #2a3240; }

.listing-detail__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.35rem, 3.4vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  margin: 2px 0 0;
  color: var(--text-strong);
  word-break: break-word;
}

.listing-detail__price-block {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  margin: 0;
}
.listing-detail__price {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 700;
  color: #e8ebf0;
}
.listing-detail__price .price-cur { font-size: 0.55em; }
.listing-detail__price--poa { color: #8a93a3; font-weight: 500; }
.listing-detail__price-usd { color: #8a93a3; font-size: 0.95rem; }

.listing-detail__facts {
  display: grid;
  grid-template-columns: minmax(90px, max-content) 1fr;
  gap: 8px 16px;
  margin: 4px 0 0;
  font-size: 0.88rem;
  padding: 14px 0;
  border-top: 1px solid #1f242f;
  border-bottom: 1px solid #1f242f;
}
@media (max-width: 420px) {
  .listing-detail__facts { grid-template-columns: 1fr; gap: 2px 0; }
  .listing-detail__facts dt { margin-top: 8px; }
  .listing-detail__facts dt:first-of-type { margin-top: 0; }
}
.listing-detail__facts dt { color: #8a93a3; font-weight: 500; }
.listing-detail__facts dd { margin: 0; color: #e8ebf0; min-width: 0; word-break: break-word; }

.listing-views {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 14px;
  margin: 4px 0 0;
  background: rgba(230, 57, 70, 0.08);
  border: 1px solid rgba(230, 57, 70, 0.25);
  border-radius: 999px;
  font-size: 0.9rem;
  color: #c7cbd3;
  align-self: flex-start;
  max-width: 100%;
}
.listing-views--inline {
  margin: 0;
  padding: 6px 12px;
  gap: 6px;
  font-size: 0.82rem;
  line-height: 1.4;
  align-self: center;
}
.listing-views--inline .listing-views__eye { font-size: 0.65rem; }
.listing-views--inline .listing-views__count { font-size: 0.82rem; }
.listing-views__label { white-space: normal; }
.listing-views__eye {
  color: #e63946;
  font-size: 0.7rem;
  line-height: 1;
  animation: listing-views-pulse 2.4s ease-in-out infinite;
}
.listing-views__count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--text-strong);
  letter-spacing: 0.3px;
}
.listing-views__label { color: #8a93a3; }
@keyframes listing-views-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
@media (max-width: 520px) {
  .listing-views { font-size: 0.82rem; padding: 7px 12px; }
}

.listing-detail__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}
.listing-detail__cta,
.listing-detail__research {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  flex: 1 1 200px;
  padding: 14px 22px;
  border-radius: 8px;
  font-weight: 700; font-size: 1rem;
  text-decoration: none;
  border: 2px solid var(--accent);
  transition: background .15s, color .15s, transform .15s;
  box-sizing: border-box;
}
.listing-detail__cta { background: var(--accent); color: var(--text-on-accent); }
.listing-detail__cta:hover { background: #d12d3a; border-color: #d12d3a; transform: translateY(-1px); }
.listing-detail__cta-arrow { font-size: 1.2em; transition: transform .15s; }
.listing-detail__cta:hover .listing-detail__cta-arrow,
.listing-detail__research:hover .listing-detail__cta-arrow { transform: translateX(3px); }
.listing-detail__research { background: transparent; color: var(--text-strong); }
.listing-detail__research:hover { background: var(--accent); color: var(--text-on-accent); transform: translateY(-1px); }
@media (max-width: 520px) {
  .listing-detail__cta, .listing-detail__research { flex: 1 1 100%; }
}

.listing-detail__disclaimer { margin: 0; }

.listing-detail__description {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid #1f242f;
}
.listing-detail__description h2 { font-size: 1.1rem; margin: 0 0 12px; color: #e8ebf0; }
.listing-detail__description-body {
  color: #c5ccd6;
  font-size: 0.95rem;
  line-height: 1.6;
  max-width: 68ch;
}

.listing-detail__similar {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid #1f242f;
}
.listing-detail__similar h2 { font-size: 1.1rem; margin: 0 0 14px; color: #e8ebf0; }

.breadcrumb__current { color: #e8ebf0; }

/* btn-lg used on CTAs */
.btn--lg { padding: 14px 22px; font-size: 1rem; }

/* ===== Admin Language editor ===== */
.lang-form { max-width: 820px; }
.lang-group {
  margin: 0 0 24px;
  padding: 18px 20px 20px;
  background: #141821;
  border: 1px solid #1f242f;
  border-radius: 10px;
}
.lang-group legend {
  padding: 0 8px;
  color: #e8ebf0;
  font-size: 0.95rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lang-field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.lang-field:last-child { margin-bottom: 0; }
.lang-field label { color: #e8ebf0; font-size: 0.92rem; }
.lang-key {
  display: inline-block;
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.78rem;
  background: #0b0e14;
  border: 1px solid #1f242f;
  border-radius: 4px;
  color: #e8ebf0;
}
.lang-desc { display: block; color: #8a93a3; font-size: 0.82rem; margin-top: 4px; font-weight: 400; }
.lang-field input[type="text"],
.lang-field textarea {
  width: 100%;
  padding: 10px 12px;
  background: #0b0e14;
  border: 1px solid #1f242f;
  border-radius: 6px;
  color: #e8ebf0;
  font-size: 0.92rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
}
.lang-field input:focus,
.lang-field textarea:focus {
  outline: none;
  border-color: #e63946;
}
.lang-updated { margin-top: 2px; }
.lang-actions { display: flex; gap: 10px; margin-top: 10px; }

.flash { padding: 10px 14px; border-radius: 6px; margin-top: 10px; font-size: 0.9rem; }
.flash--ok { background: #143a20; color: #9fe1b6; border: 1px solid #1d5e34; }
.flash--err { background: rgba(220,38,38,0.12); color:#f87171; border:1px solid rgba(220,38,38,0.35); }
.flash--warn { background: rgba(245,158,11,0.12); color:#fbbf24; border:1px solid rgba(245,158,11,0.35); display:flex; flex-wrap:wrap; gap:10px; align-items:center; }
[data-theme="light"] .flash--ok  { background:#dcfce7; color:#15803d; border-color:#86efac; }
[data-theme="light"] .flash--err { background:#fee2e2; color:#b91c1c; border-color:#fca5a5; }
[data-theme="light"] .flash--warn{ background:#fef3c7; color:#b45309; border-color:#fcd34d; }

.temp-pw { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size:14px; padding:3px 8px; background: var(--bg-raised); color: var(--text-strong); border:1px solid var(--border); border-radius:4px; user-select: all; }

.badge--you { display:inline-block; margin-left:6px; padding:1px 6px; font-size:10px; text-transform:uppercase; letter-spacing:.06em; background: var(--accent); color: var(--text-on-accent, #fff); border-radius:3px; vertical-align:middle; }

.admin-users__actions { white-space: nowrap; }
.admin-users__actions .inline-form { margin-right: 10px; }
.admin-users__actions .link-btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.admin-users__actions .link-btn[disabled]:hover { color: inherit; }

/* Admin listings browser + reclassify (theme-aware) */
.admin-filters { display:flex; flex-wrap:wrap; gap:10px; align-items:end; margin-bottom:20px; padding:14px; background: var(--bg-raised); border:1px solid var(--border); border-radius:8px; }
.admin-filters label { display:flex; flex-direction:column; gap:4px; font-size:12px; color: var(--text-muted); }
.admin-filters input, .admin-filters select { background: var(--bg); color: var(--text); border:1px solid var(--border); padding:6px 8px; border-radius:6px; min-width:140px; }
.admin-listings-table { width:100%; border-collapse:collapse; font-size:14px; }
.admin-listings-table th, .admin-listings-table td { padding:10px 8px; border-bottom:1px solid var(--border); vertical-align:top; text-align:left; }
.admin-listings-table th { font-size:11px; text-transform:uppercase; letter-spacing:.05em; color: var(--text-muted); }
.admin-thumb { width:64px; height:48px; object-fit:cover; border-radius:4px; background: var(--bg); display:block; }
.admin-thumb-placeholder { width:64px; height:48px; background: var(--bg-raised); border-radius:4px; }
.admin-listing-title { color: var(--text-strong); text-decoration:none; font-weight:500; }
.admin-listing-title:hover { color: var(--accent); }
.admin-reclass summary { cursor:pointer; list-style:none; display:inline-block; }
.admin-reclass summary::-webkit-details-marker { display:none; }
.admin-reclass[open] summary { margin-bottom:8px; }
.reclass-form { display:flex; flex-direction:column; gap:6px; background: var(--bg); padding:10px; border:1px solid var(--border); border-radius:6px; min-width:220px; }
.reclass-form label { display:flex; flex-direction:column; gap:3px; font-size:11px; color: var(--text-muted); }
.reclass-form select { background: var(--bg-raised); color: var(--text); border:1px solid var(--border); padding:5px 6px; border-radius:4px; font-size:13px; }

/* Match-method badges — saturation tuned for both themes via rgba() */
.badge--method { display:inline-block; padding:2px 7px; border-radius:10px; font-size:11px; font-weight:600; text-transform:capitalize; background: var(--bg-raised); color: var(--text-muted); border:1px solid var(--border); }
.badge--exact     { background: rgba(34,197,94,0.15);  color:#22c55e; border-color: rgba(34,197,94,0.35); }
.badge--fuzzy     { background: rgba(245,158,11,0.15); color:#f59e0b; border-color: rgba(245,158,11,0.35); }
.badge--alias     { background: rgba(139,148,158,0.15); color: var(--text-muted); border-color: rgba(139,148,158,0.35); }
.badge--admin     { background: rgba(232,35,10,0.12);  color: var(--accent); border-color: rgba(232,35,10,0.35); }
.badge--manual    { background: rgba(232,35,10,0.12);  color: var(--accent); border-color: rgba(232,35,10,0.35); }
.badge--unmatched { background: rgba(220,38,38,0.15);  color:#f87171; border-color: rgba(220,38,38,0.35); }
.badge--vinyl     { background: rgba(139,148,158,0.12); color: var(--text-muted); border-color: rgba(139,148,158,0.30); }
.badge--cd        { background: rgba(139,148,158,0.12); color: var(--text-muted); border-color: rgba(139,148,158,0.30); }

/* Light-mode contrast tweaks for badges */
[data-theme="light"] .badge--exact     { color:#15803d; }
[data-theme="light"] .badge--fuzzy     { color:#b45309; }
[data-theme="light"] .badge--unmatched { color:#b91c1c; }

.btn--sm { padding:4px 10px; font-size:12px; }
.btn--danger { color: var(--accent); border-color: var(--accent); }
.btn--danger:hover { background: var(--accent); color:#fff; }
.pagination { display:flex; gap:14px; align-items:center; justify-content:center; margin-top:20px; font-size:14px; }
.pagination a { color: var(--accent); text-decoration:none; }
.pagination a:hover { text-decoration: underline; }
.pagination span { color: var(--text-muted); }

/* Brand page summary */
.brand-summary { max-width: 90ch; color: var(--text); line-height:1.6; font-size:16px; }
.brand-summary p { margin:0 0 12px; }
.brand-summary p:last-child { margin-bottom:0; }
.section--compact { padding-top:12px; padding-bottom:12px; }

/* Admin brand edit form */
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
@media (max-width:640px) { .form-row { grid-template-columns:1fr; } }
.stack label { display:block; margin-bottom:12px; font-size:13px; color: var(--text-muted); }
.stack label input, .stack label textarea { display:block; width:100%; margin-top:4px; background: var(--bg); color: var(--text); border:1px solid var(--border); padding:8px 10px; border-radius:6px; font-size:14px; font-family:inherit; }
.stack label textarea { resize:vertical; min-height:80px; }
.flash { padding:10px 14px; border-radius:6px; margin:10px 0; font-size:14px; }
.flash--ok { background: rgba(34,197,94,0.15); color:#22c55e; border:1px solid rgba(34,197,94,0.35); }
.flash--err { background: rgba(220,38,38,0.15); color:#f87171; border:1px solid rgba(220,38,38,0.35); }
[data-theme="light"] .flash--ok { color:#15803d; }
[data-theme="light"] .flash--err { color:#b91c1c; }

/* Brand links bar — base chip theme-aware; social hovers keep brand colours */
.brand-links { display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 0; padding:0; }
.brand-link { display:inline-flex; align-items:center; gap:6px; padding:5px 12px; font-size:13px; background: var(--bg-raised); border:1px solid var(--border); border-radius:16px; color: var(--text); text-decoration:none; transition:all .15s; }
.brand-link:hover { border-color: var(--accent); color: var(--text-strong); }
.brand-link--web { background: var(--bg-raised); border-color: var(--border); color: var(--text); }
.brand-link--web:hover { background: var(--bg); border-color: var(--accent); color: var(--accent); }
.brand-link--info { background: var(--accent); border-color: var(--accent); color: var(--text-strong); font-weight: 600; }
.brand-link--info:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--text-strong); }
.brand-link--facebook:hover { border-color:#1877f2; color:#1877f2; }
.brand-link--instagram:hover { border-color:#e4405f; color:#e4405f; }
.brand-link--youtube:hover { border-color:#ff0000; color:#ff0000; }
.brand-link--twitter:hover { border-color: var(--text-strong); color: var(--text-strong); }
.brand-link--tiktok:hover { border-color:#25f4ee; color:#25f4ee; }
.brand-link--linkedin:hover { border-color:#0a66c2; color:#0a66c2; }

/* Listing detail: Our Thoughts + Seller Description (theme-aware) */
.listing-detail__thoughts {
  margin: 20px 0;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
}
@media (max-width: 640px) {
  .listing-detail__thoughts { margin: 16px 0; padding: 14px 16px; }
}
.listing-detail__thoughts h2 {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 18px; margin: 0 0 12px;
  color: var(--text-strong, var(--text));
}
.listing-detail__thoughts-body p {
  color: var(--text); line-height: 1.65; font-size: 15px; margin: 0 0 10px;
}
.listing-detail__thoughts-body p:last-child { margin-bottom: 0; }
.listing-detail__thoughts-note { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.ai-badge {
  display: inline-block; padding: 2px 8px; font-size: 10px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--bg-hover); color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
}

/* Animated AI pill — purple/pink travelling-arc border */
.ai-pill {
  position: relative;
  display: inline-block;
  padding: 2px;
  border-radius: 999px;
  vertical-align: middle;
  margin-left: 10px;
  background: #0b0e14;
  box-shadow:
    0 0 10px rgba(236, 72, 153, 0.55),
    0 0 20px rgba(168, 85, 247, 0.35);
  line-height: 0;
  isolation: isolate;
}
/* Knight-Rider scanner: a single bead element travels around the perimeter using offset-path */
.ai-pill::before {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  top: 0;
  left: 0;
  border-radius: 50%;
  background: #ec4899;
  box-shadow:
    0 0 3px #ffd1e8,
    0 0 6px #ec4899,
    0 0 12px #ec4899,
    0 0 22px rgba(236, 72, 153, 0.95),
    0 0 36px rgba(236, 72, 153, 0.7),
    0 0 56px rgba(168, 85, 247, 0.55);
  offset-path: inset(0 round 999px);
  offset-distance: 0%;
  offset-anchor: center;
  animation: ai-pill-bead 2s linear infinite;
  z-index: 2;
  pointer-events: none;
}
/* Soft pulsing halo behind the pill */
.ai-pill::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background: radial-gradient(closest-side, rgba(236, 72, 153, 0.4), transparent 70%);
  z-index: -1;
  animation: ai-pill-pulse 1.8s ease-in-out infinite;
  pointer-events: none;
}
.ai-pill__inner {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: #0b0e14;
  color: #ffffff;
  border-radius: 999px;
  line-height: 1.2;
}
.ai-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #f472b6;
  box-shadow: 0 0 8px #f472b6, 0 0 4px #ec4899;
  animation: ai-pill-dot 1.2s ease-in-out infinite;
}
@keyframes ai-pill-spin {
  to { transform: rotate(360deg); }
}
@keyframes ai-pill-bead {
  to { offset-distance: 100%; }
}
@keyframes ai-pill-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.9;  transform: scale(1.08); }
}
@keyframes ai-pill-dot {
  0%, 100% { opacity: 1;    transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.75); }
}
@media (prefers-reduced-motion: reduce) {
  /* Keep the spinning ring but slow it right down so it's still recognisable as the AI badge.
     Halo + dot fully stop. */
  .ai-pill::before { animation-duration: 6s; }
  .ai-pill::after,
  .ai-pill__dot { animation: none; }
}

/* ===========================================================
   Price-research login gate
   =========================================================== */
.pr-gate {
  padding: 16px 0 8px;
}
.pr-gate__card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  border: 1px solid var(--accent, #d4332f);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212,51,47,0.08), rgba(212,51,47,0.02));
}
.pr-gate__copy { flex: 1 1 320px; }
.pr-gate__copy h2 { margin: 0 0 6px; font-size: 1.25rem; }
.pr-gate__copy p { margin: 0; }
.pr-gate__actions { display: flex; gap: 10px; flex-wrap: wrap; }

.pr-gate-inline {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--accent, #d4332f);
  border-radius: 8px;
  background: rgba(212, 51, 47, 0.08);
  font-size: 0.92rem;
}
.pr-gate-inline strong { color: var(--accent, #d4332f); }

/* Hard gate card shown on cluster detail for anon users */
.pr-gate-card {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  padding: 28px 30px;
  margin: 20px 0 8px;
  border: 1px solid rgba(212,51,47,0.35);
  background: linear-gradient(160deg, rgba(212,51,47,0.10), rgba(212,51,47,0.02));
  border-radius: 12px;
}
.pr-gate-card__body { flex: 2 1 420px; }
.pr-gate-card__body h2 { margin: 0 0 8px; font-size: 1.35rem; }
.pr-gate-card__body p { margin: 0 0 16px; }
.pr-gate-card__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.pr-gate-card__perks {
  flex: 1 1 220px;
  list-style: none;
  padding: 0;
  margin: 0;
  align-self: center;
}
.pr-gate-card__perks li { padding: 4px 0; }
@media (max-width: 640px) {
  .pr-gate-card { padding: 20px; gap: 16px; }
  .pr-gate-card__body h2 { font-size: 1.15rem; }
}

.pr-card--locked { position: relative; filter: blur(4px) grayscale(0.4); opacity: 0.75; pointer-events: auto; }
.pr-card--locked:hover { filter: blur(3px) grayscale(0.2); opacity: 0.9; }
.pr-grid--gated { position: relative; }

.section--gated { position: relative; }
.section--gated::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 30%; bottom: 0;
  background: linear-gradient(to bottom, transparent, var(--bg, #0b0e14) 85%);
  pointer-events: none;
  z-index: 5;
}

/* ===========================================================
   Save-search promo — FREE alerts
   =========================================================== */
.save-search--promo {
  border: 1px solid var(--accent, #d4332f);
  background: linear-gradient(160deg, rgba(212,51,47,0.10), rgba(212,51,47,0.02));
  border-radius: 10px;
  padding: 16px;
}
.save-search--promo h4 {
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 4px;
  font-size: 1rem;
}
.pill--free {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: #16a34a;
  color: #fff;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ===========================================================
   Listing card badges — NEW + price drop
   =========================================================== */
.listing-card__new {
  position: absolute;
  /* Sit below the source pill (top:6 + ~22 height + 4 gap) so the two never overlap. */
  top: 32px; left: 6px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: #16a34a;
  color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
  z-index: 2;
}
.listing-card__drop {
  position: absolute;
  top: 32px; right: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #dc2626;
  color: #fff;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
  z-index: 2;
}
/* When dealer pill takes top-right, drop slides further down */
.listing-card__dealer ~ .listing-card__drop { top: 58px; }
/* When both NEW and drop appear, drop stacks below NEW at top-left */
.listing-card__new + .listing-card__drop {
  top: 58px; right: auto; left: 6px;
}

/* ---------- Hero slideshow ---------- */
.hero { position: relative; overflow: hidden; }
.hero--has-bg { background: var(--bg-ticker); padding: 120px 0 96px; }
.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1.6s ease-in-out;
  will-change: opacity;
}
.hero__slide.is-active { opacity: 1; }
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.65) 100%),
    radial-gradient(ellipse at top left, rgba(230,57,70,0.18), transparent 55%);
}
.hero__inner { position: relative; z-index: 1; }
/* Hero over background image: always light text regardless of theme */
.hero--has-bg .hero__title,
.hero--has-bg .hero__stats strong {
  color: #ffffff;
  text-shadow: 0 2px 14px rgba(0,0,0,0.7);
}
.hero--has-bg .hero__lede {
  color: rgba(255,255,255,0.88);
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);
}
.hero--has-bg .hero__stats span {
  color: rgba(255,255,255,0.75);
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
/* Theme-aware logo swap */
.brand__logo--light { display: none; }
[data-theme="light"] .brand__logo--dark { display: none; }
[data-theme="light"] .brand__logo--light { display: inline-block; }

/* Darker scrim in light mode so white text reads cleanly */
[data-theme="light"] .hero__scrim {
  background:
    linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.75) 100%),
    radial-gradient(ellipse at top left, rgba(212,26,6,0.22), transparent 55%);
}
@media (prefers-reduced-motion: reduce) {
  .hero__slide { transition: none; }
}
@media (max-width: 600px) {
  .hero--has-bg { padding: 64px 0 48px; }
}

/* ---------- Home grid: always even columns (2 or 4, never 3 or 5) ---------- */
.listing-grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px)  { .listing-grid--even { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px)  { .listing-grid--even { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1280px) { .listing-grid--even { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; } }

/* ---------- Admin: hero images manager ---------- */
.hero-admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.hero-admin-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero-admin-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.hero-admin-card__meta {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.hero-admin-card__meta form { margin: 0; }
.stacked-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stacked-form label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.stacked-form input[type="file"],
.stacked-form input[type="text"] {
  padding: 10px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-strong);
  font: inherit;
}
.flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 16px; }
.flash--ok  { background: rgba(45,160,90,0.15); border: 1px solid rgba(45,160,90,0.4); color: #a6e5bd; }
.flash--err { background: rgba(230,57,70,0.15); border: 1px solid rgba(230,57,70,0.4); color: #f5a8ae; }
.btn--sm { padding: 4px 10px; font-size: 12px; }
.btn--danger { background: #7a1f26; color: #fff; border: 1px solid #a12a32; }
.btn--danger:hover { background: #a12a32; }

/* ---------- Admin toolbar on public listing page ---------- */
.admin-toolbar {
  margin: 10px 0 18px;
  padding: 10px 12px;
  background: rgba(230, 57, 70, 0.06);
  border: 1px dashed rgba(230, 57, 70, 0.35);
  border-radius: 8px;
}
.admin-toolbar__head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.admin-toolbar__badge {
  background: var(--accent);
  color: var(--text-on-accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 3px;
}
.admin-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}
.admin-toolbar .inline-form { display: inline-block; }

/* ---------- Latest Entries strip (above Trending) ---------- */
.section--compact { padding-top: 18px; padding-bottom: 8px; }
.section--compact .section__head { margin-bottom: 10px; }
.h2--sm { font-size: 20px; margin: 0; }
.section__sub { font-size: 13px; margin-left: 8px; }

.latest-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 0;
  padding: 0;
}
@media (min-width: 700px)  { .latest-strip { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .latest-strip { grid-template-columns: repeat(8, 1fr); } }

.latest-strip__link {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  height: 100%;
  transition: border-color 0.15s, background 0.15s;
}
.latest-strip__link:hover {
  border-color: rgba(230, 57, 70, 0.5);
  background: rgba(230, 57, 70, 0.04);
}
.latest-strip__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  background-size: cover;
  background-position: center;
  background-color: #1a1d24;
  border-radius: 4px;
}
.latest-strip__thumb--empty {
  background-image: linear-gradient(135deg, #1a1d24, #0b0e14);
}
.latest-strip__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.latest-strip__brand {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #e63946;
}
.latest-strip__title {
  font-size: 12px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.latest-strip__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
}
.latest-strip__price { color: #fff; font-weight: 600; }
.latest-strip__src { text-transform: uppercase; letter-spacing: 0.3px; }

/* ---------- Brand logo (public hero + admin edit) ---------- */
.brand-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 4px 0 6px;
}
.brand-hero__logo {
  width: 96px;
  height: 96px;
  flex: 0 0 auto;
  background: #fff;
  border-radius: 8px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
.brand-hero__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.brand-hero__title { margin: 0; }
@media (max-width: 560px) {
  .brand-hero__logo { width: 64px; height: 64px; padding: 6px; }
}

.brand-logo-admin {
  display: grid;
  gap: 10px;
  max-width: 420px;
}
.brand-logo-admin__preview {
  width: 160px;
  height: 160px;
  background: #fff;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-logo-admin__preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.brand-logo-admin__empty {
  color: #888;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.brand-logo-admin__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* =============================================================
   Async AI content — skeleton placeholders + shimmer
   ============================================================= */
.ai-skeleton {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 8px;
}
.ai-skeleton__line {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    var(--bg-hover) 0%,
    var(--border) 50%,
    var(--bg-hover) 100%
  );
  background-size: 200% 100%;
  animation: ai-shimmer 1.4s ease-in-out infinite;
}
.ai-skeleton__line--head {
  height: 16px;
  width: 45%;
  margin-bottom: 6px;
}
.ai-skeleton__line--short {
  width: 72%;
}
.ai-skeleton__label {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}
@keyframes ai-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ai-skeleton__line { animation: none; opacity: 0.6; }
}

.brand-summary--pending,
.listing-detail__thoughts--pending,
.listing-detail__brand-summary--pending {
  min-height: 80px;
}

/* Fade-in when content swaps in */
.ai-loaded {
  animation: ai-fadein 260ms ease-out;
}
@keyframes ai-fadein {
  from { opacity: 0; transform: translateY(2px); }
  to   { opacity: 1; transform: none; }
}

/* =============================================================
   Global nav progress bar — fires on link click
   ============================================================= */
.ai-nav-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: transparent;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}
.ai-nav-progress.is-active { opacity: 1; }
.ai-nav-progress::before {
  content: "";
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent) 0%, #ff6b7a 60%, var(--accent) 100%);
  box-shadow: 0 0 8px rgba(230, 57, 70, 0.6);
  transition: width 400ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
.ai-nav-progress[data-progress="start"]::before { width: 25%; }
.ai-nav-progress[data-progress="mid"]::before   { width: 65%; }
.ai-nav-progress[data-progress="near"]::before  { width: 88%; }
.ai-nav-progress[data-progress="done"]::before  { width: 100%; transition: width 160ms ease-out; }

/* ---------- Currency picker (header) ---------- */
.currency-picker {
  display: inline-flex;
  align-items: center;
  margin: 0;
  line-height: 1;
}
.currency-picker__label {
  /* Hide visually — the dropdown is self-evidently a currency code */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.currency-picker__select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-strong);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 8px 16px 8px 0;
  cursor: pointer;
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position:
    calc(100% - 7px) 50%,
    calc(100% - 3px) 50%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
  transition: color .15s;
  line-height: 1;
}
.currency-picker__select:hover,
.currency-picker__select:focus {
  color: var(--accent);
  outline: none;
}
.currency-picker__select option {
  background: var(--bg);
  color: var(--text-strong);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
}
.currency-picker__go {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-raised);
  color: var(--text);
  cursor: pointer;
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
  flex-shrink: 0;
}
.theme-toggle:hover {
  color: var(--text-strong);
  border-color: var(--text-muted);
  background: var(--bg-hover);
}
.theme-toggle svg { width: 16px; height: 16px; }
/* Icon reflects user PREFERENCE (auto / light / dark), not the effective theme. */
.theme-toggle__sun,
.theme-toggle__moon,
.theme-toggle__auto { display: none; }
:root[data-theme-pref="auto"]  .theme-toggle__auto { display: block; }
:root[data-theme-pref="light"] .theme-toggle__sun  { display: block; }
:root[data-theme-pref="dark"]  .theme-toggle__moon { display: block; }
/* Fallback when data-theme-pref missing: show moon (matches old behaviour). */
:root:not([data-theme-pref]) .theme-toggle__moon { display: block; }

/* ---------- Live presence pill ("N other audiophiles online") ---------- */
.presence-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 9px;
  border-radius: 999px;
  background: rgba(230, 40, 40, .08);
  border: 1px solid rgba(230, 40, 40, .25);
  color: var(--text-strong, #fff);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background .2s, border-color .2s, opacity .2s;
}
.presence-pill__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent, #e62828);
  box-shadow: 0 0 0 0 rgba(230, 40, 40, .6);
  animation: presence-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
.presence-pill__count {
  font-weight: 700;
  color: var(--text-strong, #fff);
  font-variant-numeric: tabular-nums;
}
.presence-pill__label {
  color: var(--text-muted, #999);
  font-weight: 500;
}
.presence-pill--solo {
  opacity: .55;
}
@keyframes presence-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 40, 40, .55); }
  50%      { box-shadow: 0 0 0 5px rgba(230, 40, 40, 0); }
}
@media (max-width: 960px) {
  /* On mobile, collapse to a compact dot + count only. */
  .presence-pill__label { display: none; }
  .presence-pill { padding: 5px 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .presence-pill__dot { animation: none; }
}
/* When inside the LIVE ticker bar, sit flush at the right edge, no border */
.ticker .presence-pill {
  align-self: center;
  margin-right: 14px;
  flex-shrink: 0;
  background: transparent;
  border-color: transparent;
  padding: 4px 2px;
  font-size: 12px;
}
.ticker .presence-pill__count { font-weight: 700; }

/* ---------- Mobile nav drawer ---------- */
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 40px; height: 40px;
  padding: 0;
  margin-left: auto;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-shrink: 0;
}
.nav-toggle__bar {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-strong);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle.is-open .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(2px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
:root.nav-open .nav-scrim { opacity: 1; pointer-events: auto; }
:root.nav-open { overflow: hidden; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; order: 1; }
  /* Keep logo + hamburger on row 1; searchbar full-width row 2 */
  .site-header__inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
  }
  .brand { order: 0; }
  .searchbar { order: 2; flex-basis: 100%; max-width: none; height: 38px; }
  .brand__logo { height: 52px; }
  .brand__logo--sm { height: 48px; }

  .site-nav {
    position: fixed;
    top: 0; right: 0; bottom: 0;
    width: min(82vw, 320px);
    background: var(--bg-raised);
    border-left: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 72px 20px 32px;
    font-size: 15px;
    transform: translateX(100%);
    transition: transform .25s ease;
    z-index: 95;
    box-shadow: -8px 0 28px rgba(0,0,0,0.5);
    overflow-y: auto;
  }
  .site-nav.is-open { transform: translateX(0); }
  .site-nav a,
  .site-nav .link-btn {
    display: block;
    padding: 14px 4px;
    font-size: 15px;
    border-bottom: 1px solid var(--border);
    text-transform: none;
    letter-spacing: 0.2px;
    min-height: 44px;
    text-align: left;
  }
  .site-nav .btn--primary {
    margin-top: 16px;
    padding: 12px 16px;
    text-align: center;
    border-bottom: 0;
  }
  .site-nav .inline-form { display: block; border-bottom: 1px solid var(--border); }
  .site-nav .inline-form .link-btn { width: 100%; border-bottom: 0; }
  .site-nav .theme-toggle {
    align-self: flex-start;
    margin-top: 16px;
    border-bottom: 0;
  }

  /* User dropdown collapses inline inside mobile drawer */
  .user-menu { display: block; width: 100%; }
  .user-menu__trigger {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--border);
    border-radius: 0;
    background: transparent;
    padding: 14px 0;
    font-size: 15px;
  }
  .user-menu[open] .user-menu__trigger { background: transparent; }
  .user-menu__name { max-width: none; flex: 1; }
  .user-menu__panel {
    position: static;
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 4px 0 8px 12px;
    border-bottom: 1px solid var(--border);
  }
  .user-menu__header { display: none; }
  .user-menu__item { padding: 12px 0; border-radius: 0; }
  .user-menu__sep { display: none; }
}

/* Prevent iOS zoom-on-focus for auth form inputs */
@media (max-width: 720px) {
  .auth-card { padding: 28px 22px; }
  .stack label input,
  .stack label textarea { font-size: 16px; }
  .auth-card h1 { font-size: 24px; }
}
.ticker .presence-pill__label {
  color: rgba(245, 245, 245, .65);
}
.ticker .presence-pill__count {
  color: #f5f5f5;
}

/* ---------- Light mode form input readability ---------- */
:root[data-theme="light"] input[type="text"],
:root[data-theme="light"] input[type="search"],
:root[data-theme="light"] input[type="email"],
:root[data-theme="light"] input[type="password"],
:root[data-theme="light"] input[type="url"],
:root[data-theme="light"] input[type="number"],
:root[data-theme="light"] select,
:root[data-theme="light"] textarea {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--border);
}

/* ---------- Light mode: alerts/flashes tuned for white backgrounds ---------- */
:root[data-theme="light"] .flash--ok  { background: #e7f7ec; border-color: #b7e4c3; color: #155d2d; }
:root[data-theme="light"] .flash--err { background: #fdecee; border-color: #f5b8bf; color: #8a1c26; }
:root[data-theme="light"] .badge--unmatched { background:#fdecee; color:#8a1c26; }
:root[data-theme="light"] .badge--vinyl { background:#e0f2fe; color:#075985; }

/* ---------- Light mode: admin toolbar, ticker items, hero text stay readable ---------- */
:root[data-theme="light"] .ticker__item { color: #e5e7eb; }
:root[data-theme="light"] .ticker__item--muted { color: #9ca3af; }

/* ---------- Match suggestions ---------- */
.suggestion-group { margin-bottom: 40px; }
.suggestion-group__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.suggestion-group__head h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-strong);
}
.suggestion-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.suggestion-card {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: opacity .25s, transform .25s;
}
.suggestion-card.is-approved { opacity: 0; transform: translateX(20px); }
.suggestion-card__media {
  width: 72px; height: 72px;
  background: var(--bg-ticker);
  border-radius: 4px;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.suggestion-card__media img { width: 100%; height: 100%; object-fit: cover; }
.suggestion-card__body { min-width: 0; }
.suggestion-card__title { font-size: 14.5px; font-weight: 600; margin-bottom: 4px; }
.suggestion-card__title a { color: var(--text); }
.suggestion-card__title a:hover { color: var(--accent); }
.suggestion-card__meta { margin-bottom: 6px; }
.suggestion-card__match {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13.5px;
}
.suggestion-card__match strong { color: var(--text-strong); }
.suggestion-card__actions {
  display: flex; gap: 6px; align-items: center;
  flex-shrink: 0;
}

.pill {
  display: inline-flex; align-items: center;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.pill--high   { background: rgba(34,197,94,0.15);  border-color: rgba(34,197,94,0.35);  color: #86efac; }
.pill--medium { background: rgba(245,158,11,0.15); border-color: rgba(245,158,11,0.35); color: #fcd34d; }
.pill--low    { background: rgba(148,163,184,0.15); border-color: rgba(148,163,184,0.35); color: #cbd5e1; }
.pill--method { background: var(--bg-hover); border-color: var(--border); color: var(--text-muted); }

:root[data-theme="light"] .pill--high   { color: #15803d; background: #dcfce7; border-color: #86efac; }
:root[data-theme="light"] .pill--medium { color: #92400e; background: #fef3c7; border-color: #fcd34d; }
:root[data-theme="light"] .pill--low    { color: #475569; background: #f1f5f9; border-color: #cbd5e1; }

@media (max-width: 700px) {
  .suggestion-card { grid-template-columns: 56px 1fr; gap: 10px; padding: 10px; }
  .suggestion-card__actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
  .suggestion-card__media { width: 56px; height: 56px; }
}

/* Datalist must never render as visible block (some resets break the
   user-agent default of display:none on <datalist>). */
datalist { display: none !important; }

/* Custom brand autocomplete (replaces native datalist popup) */
.brand-ac { position: relative; flex: 1 1 200px; min-width: 0; }
.brand-ac .brand-ac__input { width: 100%; }
.brand-ac__list {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  z-index: 50;
  margin: 0;
  padding: 4px 0;
  list-style: none;
  background: var(--surface-1, #1a1a1a);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  max-height: 240px;
  overflow-y: auto;
}
.brand-ac__item {
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
}
.brand-ac__item:hover,
.brand-ac__item.is-active { background: var(--accent-tint-bg, rgba(255,69,69,0.15)); color: var(--accent, #ff4545); }
:root[data-theme="light"] .brand-ac__list { background: #fff; border-color: #cbd5e1; box-shadow: 0 8px 24px rgba(15,23,42,0.15); }
:root[data-theme="light"] .brand-ac__item { color: #0f172a; }

/* Manual-match drawer (inline brand picker on each card) */
.manual-match-drawer {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 6px;
}
.manual-match-drawer__brand {
  flex: 1 1 200px;
  min-width: 0;
  padding: 6px 10px;
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text);
  border-radius: 4px;
  font-size: 14px;
}
:root[data-theme="light"] .manual-match-drawer { background: #f8fafc; border-color: #e2e8f0; }
:root[data-theme="light"] .manual-match-drawer__brand { background: #fff; border-color: #cbd5e1; color: #0f172a; }
.pill--vinyl { background: rgba(168,85,247,0.15); color: #c084fc; border-color: rgba(168,85,247,0.35); }
:root[data-theme="light"] .pill--vinyl { background: #f5e8ff; color: #6b21a8; border-color: #d8b4fe; }
.suggestion-group--vinyl .suggestion-group__head h2 { color: #c084fc; }

/* ---------- Admin: settings / sources / brand danger zone ---------- */
.pill--error  { background: rgba(239,68,68,0.12); color: var(--danger); border-color: rgba(239,68,68,0.30); }
.pill--queued { background: var(--accent-tint-bg); color: var(--accent); border-color: var(--accent-tint-border); }
.pill--ok     { background: rgba(34,197,94,0.15); color: var(--success); border-color: rgba(34,197,94,0.35); }
.pill--env    { background: rgba(59,130,246,0.15); color: #60a5fa; border-color: rgba(59,130,246,0.35); }

:root[data-theme="light"] .pill--error  { background: #fdecee; color: #b91c1c; border-color: #f5b8bf; }
:root[data-theme="light"] .pill--queued { background: rgba(212,26,6,0.08); color: var(--accent); border-color: rgba(212,26,6,0.30); }
:root[data-theme="light"] .pill--ok     { background: #dcfce7; color: #15803d; border-color: #86efac; }
:root[data-theme="light"] .pill--env    { background: #dbeafe; color: #1d4ed8; border-color: #93c5fd; }
:root[data-theme="light"] .pill--off    { background: #eef2f7; color: #475569; border-color: #cbd5e1; }

.flash--err {
  background: rgba(239,68,68,0.10); color: var(--danger);
  border: 1px solid rgba(239,68,68,0.35);
  padding: 12px 16px; border-radius: 6px; margin-top: 12px;
}
:root[data-theme="light"] .flash--err { background: #fdecee; color: #8a1c26; border-color: #f5b8bf; }

.danger-zone {
  max-width: 860px;
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 8px;
  padding: 18px;
  background: rgba(239,68,68,0.05);
}
.danger-zone__title { color: var(--danger); margin-top: 0; }
:root[data-theme="light"] .danger-zone { border-color: #f5b8bf; background: #fdecee; }
:root[data-theme="light"] .danger-zone__title { color: #b91c1c; }

.pill--running { background: var(--accent-tint-bg); color: var(--accent); border-color: var(--accent-tint-border); gap: 5px; }
.pill--warn    { background: rgba(245,158,11,0.15); color: var(--warning); border-color: rgba(245,158,11,0.35); }
:root[data-theme="light"] .pill--warn { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

/* Spinner ring rendered inside .pill--running — a 3/4 circle that rotates */
.pill__spinner {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  vertical-align: -1px;
  animation: radar-spin 0.9s linear infinite;
}
@keyframes radar-spin { to { transform: rotate(360deg); } }
@keyframes radar-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* Accessibility: drop the spin for users who prefer reduced motion,
   fall back to a subtle opacity pulse on the pill itself. */
@media (prefers-reduced-motion: reduce) {
  .pill__spinner { animation: none; border-right-color: currentColor; opacity: 0.5; }
  .pill--running { animation: radar-pulse 2.4s ease-in-out infinite; }
}

/* ============================================================
   Price Research (public cluster pages)
   ============================================================ */
.pr-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
  margin-top: 20px;
}
.pr-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.pr-card__thumb {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--bg-card, #0f0f10);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
}
.pr-card__thumb--empty {
  background-image: linear-gradient(135deg, rgba(255,255,255,0.03), rgba(255,255,255,0) 60%);
}
.pr-card__body {
  padding: 14px 16px 16px;
}
.pr-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 18px rgba(0,0,0,0.15);
}
.pr-card__brand { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.pr-card__model { font-size: 17px; font-weight: 600; color: var(--text-strong); margin: 3px 0 10px; line-height: 1.25; }
.pr-card__headline { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.pr-card__headline-value { font-size: 22px; font-weight: 700; color: var(--text-strong); letter-spacing: -0.01em; }
.pr-card__headline-label { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.pr-card__meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 11.5px; color: var(--text-muted); border-top: 1px solid var(--border-soft, rgba(255,255,255,0.06)); padding-top: 8px; }
.pr-card__meta-item { white-space: nowrap; }
.pr-card__meta-item strong { color: var(--text-strong); font-weight: 600; }
.pr-card__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pr-card__label { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.pr-card__value { font-size: 16px; font-weight: 700; color: var(--text-strong); margin-top: 2px; }
.pr-card__value--sm { font-size: 12px; font-weight: 500; }

.pr-hero { display: flex; align-items: center; gap: 18px; margin-top: 10px; }
.pr-hero__logo { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--bg-raised); border-radius: 8px; border: 1px solid var(--border); padding: 6px; }
.pr-hero__logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.pr-hero__title { margin: 0; font-size: clamp(24px, 3vw, 36px); line-height: 1.15; }

.stat-grid--pr { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 20px 0 30px; }
.stat-card--hero { border-color: var(--accent); }
.stat-card--hero .stat-card__value { color: var(--accent); font-size: 30px; }
.stat-card__value--sm { font-size: 16px; }
.stat-card__sub { margin-top: 4px; }

.pr-section { margin: 36px 0; }
.pr-section__title {
  font-size: 18px; font-weight: 700; margin: 0 0 14px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
  color: var(--text-strong);
}

/* CSS-only histogram */
.pr-histogram {
  display: flex; align-items: flex-end; justify-content: space-between;
  height: 180px; gap: 4px; padding: 8px 0;
  background: linear-gradient(to top, var(--bg-raised) 0%, transparent 100%);
  border-radius: 6px;
}
.pr-histogram__bar {
  flex: 1; min-height: 4px; background: var(--accent); border-radius: 3px 3px 0 0;
  position: relative; transition: opacity .12s ease;
  display: flex; align-items: flex-start; justify-content: center;
}
.pr-histogram__bar:hover { opacity: 0.8; }
.pr-histogram__n {
  font-size: 10px; color: var(--text-on-accent, #fff); padding: 2px 4px;
  font-weight: 600;
}
.pr-histogram__axis {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 11px; color: var(--text-muted);
}

/* Weekly-median sparkline */
.pr-spark {
  display: flex; align-items: flex-end; gap: 3px; height: 80px; padding: 4px 0;
}
.pr-spark__bar {
  flex: 1; min-height: 4px; background: var(--text-muted); border-radius: 2px 2px 0 0;
  opacity: 0.55; transition: opacity .12s ease;
}
.pr-spark__bar:hover { opacity: 1; background: var(--accent); }
.pr-spark__axis {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-size: 11px; color: var(--text-muted);
}

@media (max-width: 600px) {
  .pr-hero { flex-direction: column; align-items: flex-start; gap: 10px; }
  .pr-hero__logo { width: 52px; height: 52px; }
  .pr-card__stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .pr-card__value { font-size: 14px; }
}

.pr-hero { justify-content: space-between; flex-wrap: wrap; }
.pr-hero__main { flex: 1; min-width: 0; }
.pr-currency { display: flex; align-items: center; gap: 8px; }
.pr-currency label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.pr-currency select { background: var(--bg); color: var(--text); border: 1px solid var(--border); padding: 6px 10px; border-radius: 6px; min-width: 90px; font-weight: 600; }
.pr-currency select:hover { border-color: var(--accent); }
@media (max-width: 600px) {
  .pr-currency { width: 100%; }
}

/* Price Research: asking/sold view toggle */
.pr-view-toggle {
  display: inline-flex;
  gap: 2px;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 18px;
}
.pr-view-toggle__btn {
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.pr-view-toggle__btn:hover { color: var(--text); }
.pr-view-toggle__btn.is-active {
  background: var(--accent);
  color: var(--text-on-accent);
}
@media (max-width: 600px) {
  .pr-view-toggle { width: 100%; justify-content: space-between; }
  .pr-view-toggle__btn { flex: 1; text-align: center; padding: 8px 6px; font-size: 12px; }
}

/* Price Research: sold stat card accent */
.stat-card--sold { border-color: var(--accent); }
.stat-card--sold .stat-card__label { color: var(--accent); }
.pr-sold-note {
  margin: -8px 0 20px;
  padding: 10px 14px;
  background: var(--bg-raised);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  line-height: 1.5;
}
.pr-card__sub { margin-top: 3px; font-size: 10.5px; }

/* =========================================
   Market-tier badge (Above/Around/Below Market)
   Shown inline next to listing price.
   ========================================= */
.mkt-tier {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.4;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
  background: var(--bg-raised);
  color: var(--text);
  cursor: help;
  user-select: none;
}
.mkt-tier__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 8px;
  position: relative;
}
.mkt-tier__dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  animation: mktPulse 2.2s cubic-bezier(.4, 0, .6, 1) infinite;
  opacity: .55;
}

/* Below market — green (good deal) */
.mkt-tier--below {
  background: rgba(46, 160, 67, .10);
  border-color: rgba(46, 160, 67, .30);
  color: #4fc26a;
}
.mkt-tier--below .mkt-tier__dot { background: #3fb859; box-shadow: 0 0 6px rgba(63, 184, 89, .55); }
.mkt-tier--below .mkt-tier__dot::after { background: rgba(63, 184, 89, .55); }

/* Around market — amber (fair) */
.mkt-tier--around {
  background: rgba(210, 153, 34, .10);
  border-color: rgba(210, 153, 34, .30);
  color: #e5b45a;
}
.mkt-tier--around .mkt-tier__dot { background: #e0a528; box-shadow: 0 0 6px rgba(224, 165, 40, .55); }
.mkt-tier--around .mkt-tier__dot::after { background: rgba(224, 165, 40, .5); animation-duration: 3s; }

/* Above market — red (expensive) */
.mkt-tier--above {
  background: rgba(220, 60, 62, .10);
  border-color: rgba(220, 60, 62, .30);
  color: #ef6668;
}
.mkt-tier--above .mkt-tier__dot { background: #e34c4e; box-shadow: 0 0 6px rgba(227, 76, 78, .55); }
.mkt-tier--above .mkt-tier__dot::after { background: rgba(227, 76, 78, .55); animation-duration: 1.6s; }

/* Unknown / no data yet — muted grey, no pulse animation */
.mkt-tier--unknown {
  background: transparent;
  border-color: transparent;
  color: rgba(255, 255, 255, .35);
  padding: 0 4px;
  font-size: 12px;
}
.mkt-tier--unknown .mkt-tier__dot {
  background: rgba(255, 255, 255, .35);
  box-shadow: none;
}
.mkt-tier--unknown .mkt-tier__dot::after { display: none; }

/* Brand-scope tier: fainter pulse + dashed border hint that this is a
   wider (less precise) comparison vs a model-specific snapshot. */
.mkt-tier--scope-brand {
  border-style: dashed;
  opacity: .92;
}
.mkt-tier--scope-brand .mkt-tier__dot { box-shadow: none; }
.mkt-tier--scope-brand .mkt-tier__dot::after { animation-duration: 4.5s; opacity: .4; }

@keyframes mktPulse {
  0%   { transform: scale(.55); opacity: .0; }
  40%  { opacity: .55; }
  100% { transform: scale(1.9); opacity: 0; }
}

/* Card variant — smaller, stacks under price on narrow cards */
.listing-card .mkt-tier {
  font-size: 10px;
  padding: 2px 8px 2px 7px;
  margin-top: 4px;
}
.listing-card .mkt-tier__dot { width: 7px; height: 7px; }

/* Detail variant — slightly more prominent */
.listing-detail__price-block .mkt-tier {
  margin-left: 10px;
  font-size: 12px;
  padding: 4px 12px 4px 10px;
  vertical-align: middle;
}

@media (max-width: 600px) {
  .listing-detail__price-block .mkt-tier {
    display: inline-flex;
    margin: 8px 0 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mkt-tier__dot::after { animation: none; }
}

/* ================================================================
   Ad slots — placeholders for 970x250 / 300x250 / 300x600
   Also defines the main+rail page layout.
   ================================================================ */

.site-layout {
  display: block;
}
.site-layout--with-rail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0 32px;
  align-items: start;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-right: var(--gutter);
}
.site-layout__main { min-width: 0; }
.site-layout__rail {
  position: sticky;
  top: 88px;
  display: flex !important; /* override .container's block default */
  flex-direction: column;
  gap: 28px; /* clear visual seam between MREC and HPU */
  align-self: start;
  padding: 0; /* rail provides its own gutter via parent */
  max-width: none;
  align-items: center; /* center 300-wide ads in the 320-wide column */
}

@media (max-width: 1180px) {
  .site-layout--with-rail {
    grid-template-columns: 1fr;
    padding-right: 0;
  }
  .site-layout__rail {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 16px;
  }
}

@media (max-width: 768px) {
  .site-layout__rail .ad-slot--300x600 { display: none; }
  .site-layout--with-rail { padding-right: 0; }
}

/* Ad zone wrappers (top + footer billboards) */
/* Ad zones use the same .container wrapper as page content so the
   billboard ad column ALWAYS aligns with the content column underneath.
   The 970-wide ad sits centered inside that container; pages with a
   right rail extend past the billboard so the rail still has room. */
.ad-zone {
  display: flex;
  justify-content: center;
  margin: 20px auto;
  max-width: var(--max-width);
  padding: 0 var(--gutter);
}
.ad-zone--top    { margin-top: 32px;    margin-bottom: 28px; }

/* Breathing room above the hero on pages that suppress the top billboard
   (e.g. home page — the inline billboard sits further down the page).
   Targets <main> when it is NOT immediately preceded by a top ad zone. */
.site-main {
  padding-top: 0;
}
header.site-header + .site-main,
header + .site-main {
  padding-top: 32px;
}
.ad-zone--top + .site-main {
  padding-top: 0;
}
.ad-zone--footer { margin-top: 40px;    margin-bottom: 16px; }
.ad-zone--inline { margin: 40px auto; }

/* The slot itself */
.ad-slot {
  width: var(--ad-w);
  height: var(--ad-h);
  max-width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.45);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  overflow: hidden;
  position: relative;
}
.ad-slot__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  padding: 8px;
}
.ad-slot__label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}
.ad-slot__size {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.35);
}

/* 970x250 billboards must shrink gracefully on narrow screens */
.ad-slot--970x250 {
  width: 970px;
  height: 250px;
}
@media (max-width: 1024px) {
  .ad-slot--970x250 {
    width: 100%;
    height: auto;
    aspect-ratio: 970 / 250;
    min-height: 90px;
  }
}

.ad-slot--300x250 { width: 300px; height: 250px; }
.ad-slot--300x600 { width: 300px; height: 600px; }

/* In-feed slot inherits whatever size was passed but stays full-width */
.ad-slot--in-feed {
  width: 100%;
  max-width: var(--ad-w);
  margin: 24px auto;
}

/* ================================================================
   Admin — /admin/ads (ad slot management)
   ================================================================ */
.ads-form--loader textarea {
  width: 100%;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  resize: vertical;
}
.ads-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 20px;
}
.ads-card {
  background: var(--bg-card, rgba(255,255,255,0.025));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ads-card.is-enabled {
  border-color: rgba(232, 56, 27, 0.55);
  box-shadow: 0 0 0 1px rgba(232, 56, 27, 0.15) inset;
}
.ads-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.ads-card__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.ads-card__key {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 8px;
}
.ads-card__size {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #E8381B);
  letter-spacing: 0.04em;
}
.ads-card__toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.ads-card textarea {
  width: 100%;
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  resize: vertical;
  min-height: 110px;
}
.ads-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* ================================================================
   RADAR brand mark — animated sweep overlay
   The logo image carries a circular target on the LEFT half of the SVG.
   We position a thin radar-sweep arm over that circle that rotates
   slowly, plus a soft pulse on the center.
   ================================================================ */

.brand__mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  /* Reset any inherited spacing */
  line-height: 0;
}

/* The sweep is an absolutely positioned overlay sized to match the
   circular icon part of the logo. The icon takes up roughly the first
   1.05 × logo-height pixels on the left. */
.brand__sweep {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 1em;       /* sized via parent font-size below */
  height: 1em;
  pointer-events: none;
  z-index: 1;
  border-radius: 50%;
  /* Soft pulsing red glow at the center */
  box-shadow: 0 0 0 0 rgba(232, 56, 27, 0.4);
  animation: brand-pulse 2.8s ease-in-out infinite;
}

/* Rotating sweep arm — a conic-gradient quarter-fade in brand red. */
.brand__sweep::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(232, 56, 27, 0.55) 0deg,
    rgba(232, 56, 27, 0.18) 30deg,
    rgba(232, 56, 27, 0.0)  90deg,
    rgba(232, 56, 27, 0.0)  360deg
  );
  /* Mask out the inner circle so the sweep only shows as a ring,
     leaving the actual logo art visible. */
  -webkit-mask: radial-gradient(circle, transparent 38%, #000 39%, #000 49%, transparent 50%);
          mask: radial-gradient(circle, transparent 38%, #000 39%, #000 49%, transparent 50%);
  animation: brand-sweep 3.6s linear infinite;
}

/* Tiny center dot ping */
.brand__sweep::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #E8381B;
  box-shadow: 0 0 6px rgba(232, 56, 27, 0.8);
  animation: brand-ping 2.8s ease-in-out infinite;
}

/* Size the sweep relative to the logo height by setting font-size
   on the .brand__mark wrapper (1em = sweep diameter). */
.brand__mark             { font-size: 64px; }   /* mobile header default */
@media (min-width: 1024px) {
  .brand__mark           { font-size: 72px; }   /* desktop header */
}
@media (max-width: 768px) {
  .brand__mark           { font-size: 52px; }
}
.brand__mark--lg         { font-size: 56px; }   /* footer + auth pages */

/* Calibrate sweep offset — the icon's circle isn't exactly at left:0.
   Tweak left and width to match the SVG art. */
.brand__sweep {
  left: 4%;
  width: 0.92em;
  height: 0.92em;
}

@keyframes brand-sweep {
  to { transform: rotate(360deg); }
}
@keyframes brand-pulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(232, 56, 27, 0.0); }
  50%      { box-shadow: 0 0 0 6px rgba(232, 56, 27, 0.10); }
}
@keyframes brand-ping {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.4); }
}

@media (prefers-reduced-motion: reduce) {
  .brand__sweep,
  .brand__sweep::before,
  .brand__sweep::after { animation: none; }
}

/* ---------- Home: free saved-search promo ---------- */
.saved-search-promo {
  padding: 24px 0 8px;
}
.saved-search-promo__card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(232,56,27,0.10) 0%, rgba(232,56,27,0.04) 60%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(232,56,27,0.35);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text-strong);
  transition: border-color .15s, transform .15s, background .15s;
}
.saved-search-promo__card:hover {
  border-color: rgba(232,56,27,0.65);
  background: linear-gradient(135deg, rgba(232,56,27,0.16) 0%, rgba(232,56,27,0.06) 60%, rgba(255,255,255,0.03) 100%);
}
.saved-search-promo__icon {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(232,56,27,0.18);
  color: var(--accent);
  flex-shrink: 0;
}
.saved-search-promo__body {
  display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0;
}
.saved-search-promo__eyebrow {
  font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; color: var(--accent);
}
.saved-search-promo__title {
  font-family: 'Playfair Display', serif;
  font-size: 22px; font-weight: 700; line-height: 1.2;
  color: var(--text-strong);
}
.saved-search-promo__lede {
  font-size: 13.5px; color: var(--text); line-height: 1.45; margin-top: 2px;
}
.saved-search-promo__cta {
  flex-shrink: 0;
  padding: 10px 16px;
  background: var(--accent);
  color: #fff;
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.4px; text-transform: uppercase;
  border-radius: 6px;
  white-space: nowrap;
  transition: background .15s;
}
.saved-search-promo__card:hover .saved-search-promo__cta {
  background: var(--accent-hover);
}
@media (max-width: 720px) {
  .saved-search-promo__card {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 18px;
  }
  .saved-search-promo__cta { width: 100%; text-align: center; }
  .saved-search-promo__title { font-size: 19px; }
  .saved-search-promo__lede { font-size: 13px; }
}

/* ============================================================
   Translate description button
   Sits inline next to the "Seller's Description" heading.
   Matches the ai-pill visual language for consistency.
   ============================================================ */
.translate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.02em;
  color: #d0d0d0;
  background: rgba(232, 56, 27, 0.08);
  border: 1px solid rgba(232, 56, 27, 0.35);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  vertical-align: middle;
}
.translate-btn:hover,
.translate-btn:focus-visible {
  background: rgba(232, 56, 27, 0.18);
  border-color: rgba(232, 56, 27, 0.6);
  color: #fff;
  outline: none;
}
.translate-btn.is-translated {
  background: rgba(232, 56, 27, 0.22);
  border-color: rgba(232, 56, 27, 0.7);
  color: #fff;
}
.translate-btn.is-loading {
  opacity: 0.75;
  cursor: progress;
}
.translate-btn.is-loading .translate-btn__icon {
  animation: translate-spin 0.9s linear infinite;
}
.translate-btn__icon {
  display: inline-block;
  font-size: 14px;
  line-height: 1;
  color: #E8381B;
}
.translate-btn__label {
  white-space: nowrap;
}
.translate-credit {
  margin-top: 14px !important;
  font-size: 12px;
  color: #888;
  font-style: italic;
}
@keyframes translate-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 540px) {
  .translate-btn {
    display: inline-flex;
    margin: 6px 0 0 0;
    font-size: 11px;
    padding: 3px 9px;
  }
  .listing-detail__thoughts--seller h2 {
    flex-wrap: wrap;
  }
}

/* Force HTML hidden attribute to win over .manual-match-drawer's display:flex */
.manual-match-drawer[hidden] { display: none !important; }

/* === /admin/matched + /admin/unmatched polish === */
.admin-listings-table td .inline-form { display:inline-block; margin:0; }
.admin-listings-table td.cell-actions,
.admin-listings-table td:last-child {
  white-space: nowrap;
}
.admin-listings-table td:last-child .inline-form,
.admin-listings-table td:last-child .btn { margin-right:4px; margin-bottom:4px; }
.admin-listings-table .row-review { background: rgba(232, 56, 27, 0.04); }
.admin-listings-table .row-review td:first-child { box-shadow: inset 3px 0 0 var(--accent, #E8381B); }
.admin-listings-table .badge { display:inline-block; font-size:11px; padding:2px 6px; border-radius:3px; background: var(--bg-raised); color: var(--text-muted); margin-right:4px; }
.admin-listings-table .badge--method { text-transform:uppercase; letter-spacing:.04em; }
.admin-listings-table .badge--exact { background:#1f3a2a; color:#7fdca0; }
.admin-listings-table .badge--alias { background:#1f2f3a; color:#7fb8dc; }
.admin-listings-table .badge--fuzzy { background:#3a2e1f; color:#dcb47f; }
.admin-listings-table .badge--admin { background:#3a1f3a; color:#dc7fdc; }
.admin-listings-table td:nth-child(5) { white-space:nowrap; }
.admin-listings-table .admin-listing-title { color: var(--text); font-weight:600; text-decoration:none; }
.admin-listings-table .admin-listing-title:hover { color: var(--accent, #E8381B); }
.admin-listings-table .admin-thumb--noimg { background: var(--bg-raised); border:1px dashed var(--border); }
.btn--danger { background:#5a2118; border-color:#5a2118; color:#ffd1ca; }
.btn--danger:hover { background:#7a2c20; border-color:#7a2c20; }

/* === Bulk-select on /admin/matched === */
/* Only re-grid cards that actually contain the checkbox column. */
.suggestion-card:has(.suggestion-card__select) {
  grid-template-columns: 28px 72px 1fr auto;
}
.suggestion-card__select { display:flex; align-items:flex-start; padding-top:6px; }
.suggestion-card__select input { width:18px; height:18px; cursor:pointer; }
.bulk-toolbar {
  position: sticky; top: 56px; z-index: 5;
  display:flex; flex-wrap:wrap; gap:10px; align-items:center;
  background: var(--color-card, #1a1a1a);
  border: 1px solid var(--color-border, #333);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.bulk-toolbar__count { font-weight:600; }
.bulk-toolbar__all { display:flex; align-items:center; gap:6px; margin-left:auto; cursor:pointer; }
.bulk-toolbar__all input { width:16px; height:16px; cursor:pointer; }
@media (max-width: 600px) {
  .suggestion-card:has(.suggestion-card__select) {
    grid-template-columns: 24px 56px 1fr;
  }
  .suggestion-card:has(.suggestion-card__select) .suggestion-card__actions {
    grid-column: 1 / -1;
  }
  .bulk-toolbar { top: 0; }
}

/* RADAR pill: keep inline-sized inside flex-column price stacks (cards). */
.listing-card__price .radar-pill-mount,
.listing-card__price .radar-pill,
.listing-detail__price-block .radar-pill-mount,
.listing-detail__price-block .radar-pill {
  align-self: flex-start;
  width: auto;
  max-width: 100%;
  margin-left: 0;
  margin-top: 4px;
}

/* Allow RADAR pill tooltip to escape card boundaries. */
.listing-card,
.listing-card__price-row,
.listing-card__price {
  overflow: visible;
}
.radar-pill,
.radar-pill .rp-tip { z-index: 50; }

/* ---------- Beta banner (above LIVE ticker, very top of body) ---------- */
.beta-banner {
  background: #2a1d05;
  color: #fde68a;
  border-bottom: 1px solid var(--border);
  min-height: 32px;
  display: flex;
  align-items: stretch;
  overflow: hidden;
  font-size: 13px;
}
.beta-banner__label {
  background: #f59e0b;
  color: #1a1205;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.beta-banner__track {
  flex: 1;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
}
.beta-banner__track::before,
.beta-banner__track::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  width: 30px;
  z-index: 1;
  pointer-events: none;
}
.beta-banner__track::before { left: 0; background: linear-gradient(90deg, #2a1d05, transparent); }
.beta-banner__track::after  { right: 0; background: linear-gradient(270deg, #2a1d05, transparent); }
.beta-banner__scroll {
  display: flex;
  gap: 60px;
  white-space: nowrap;
  animation: beta-scroll 28s linear infinite;
  padding-left: 60px;
}
.beta-banner:hover .beta-banner__scroll { animation-play-state: paused; }
.beta-banner__msg { display: inline-block; padding: 6px 0; line-height: 1.35; }
@keyframes beta-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}
@media (max-width: 640px) {
  .beta-banner { font-size: 12px; }
  .beta-banner__msg { padding: 6px 12px; }
}

/* ====================================================================
   Cookie / consent banner
   Pinned bottom on mobile, bottom-right card on desktop.
   ==================================================================== */
.cookie-banner {
  position: fixed;
  z-index: 9999;
  inset: auto 0 0 0;
  padding: 1rem;
  background: var(--surface-1, #15171a);
  color: var(--text-1, #f4f4f5);
  border-top: 1px solid var(--border, rgba(255,255,255,0.08));
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  animation: cookie-slide-up 0.3s ease-out;
}
.cookie-banner[hidden] { display: none; }

.cookie-banner__inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: stretch;
}
.cookie-banner__title { margin: 0 0 0.25rem; font-size: 1rem; }
.cookie-banner__desc  { margin: 0; font-size: 0.875rem; line-height: 1.45; color: var(--text-2, #b4b4b8); }
.cookie-banner__desc a { color: var(--accent, #E8381B); text-decoration: underline; }

.cookie-banner__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.cookie-banner__actions .btn { flex: 1 1 auto; min-width: 120px; }

@media (min-width: 720px) {
  .cookie-banner {
    inset: auto 1rem 1rem auto;
    max-width: 480px;
    border-radius: 12px;
    border: 1px solid var(--border, rgba(255,255,255,0.08));
  }
  .cookie-banner__actions .btn { flex: 0 1 auto; }
}

@keyframes cookie-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Legal / policy pages — readable prose width */
.legal-page { max-width: 760px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.legal-page h1 { margin-bottom: 0.25rem; }
.legal-page p.muted { margin-top: 0; margin-bottom: 2rem; }
.legal-page h2 { margin-top: 2rem; }
.legal-page table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.legal-page th, .legal-page td { padding: 0.5rem 0.75rem; border: 1px solid var(--border, rgba(255,255,255,0.08)); font-size: 0.875rem; text-align: left; vertical-align: top; }
.legal-page th { background: var(--surface-2, rgba(255,255,255,0.04)); font-weight: 600; }

/* ====================================================================
   Best Buys home section — pulse dot in the section heading
   ==================================================================== */
.section--best-buys .section__head h2 {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
.best-buys__pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #21B36B; /* same green as 'Exceptional' rating bucket */
  box-shadow: 0 0 0 0 rgba(33, 179, 107, 0.7);
  animation: best-buys-pulse 2s infinite;
}
@keyframes best-buys-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(33, 179, 107, 0.55); }
  70%  { box-shadow: 0 0 0 10px rgba(33, 179, 107, 0); }
  100% { box-shadow: 0 0 0 0   rgba(33, 179, 107, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .best-buys__pulse { animation: none; }
}

/* Trending heat chips (PR #80) */
/* Heat-tile grid: equal-width columns, square-ish tiles, wraps cleanly on every breakpoint. */
.chip-grid--heat {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}
.chip--heat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  width: 100%;
  min-width: 0;
  border-radius: 12px;
  padding: 10px 14px;
}
.chip--heat .chip__model {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  font-weight: 600;
}
.chip--heat .chip__brand {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip--heat .chip__meta { width: 100%; }
.chip--heat .chip__name { font-weight: 600; }
.chip__meta { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; font-size: 0.75rem; line-height: 1; }
.chip__heat { display: inline-flex; align-items: center; gap: 0.4rem; }
.chip__heat-bar { display: inline-block; height: 4px; width: 60px; background: rgba(255,255,255,0.08); border-radius: 2px; position: relative; overflow: hidden; }
.chip__heat-bar::after { content: ''; position: absolute; inset: 0; width: var(--w, 0%); background: linear-gradient(90deg, #D8A02D, #E8381B); border-radius: 2px; }
.chip__heat-val { font-weight: 600; color: var(--text-2, #c8c8c8); }
.chip__arrow { font-weight: 700; }
.chip__arrow--up { color: #D03A2A; }
.chip__arrow--down { color: #21B36B; }
.chip__arrow--flat { color: var(--text-3, #888); }
.chip__active { font-size: 0.72rem; color: var(--text-3, #888); }

/* Methodology info pip (next to section headings) — opens /methodology#anchor */
.info-pip {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.6em;
  font-weight: 400;
  color: var(--text-2, #9aa);
  text-decoration: none;
  opacity: 0.7;
  vertical-align: middle;
  transition: opacity 0.15s ease, color 0.15s ease;
}
.info-pip:hover, .info-pip:focus { opacity: 1; color: #D8A02D; }

/* Latest Entries flag emoji */
.latest-strip__flag { font-size: 13px; margin-right: 2px; line-height: 1; vertical-align: -1px; }
/* Listing card flag (inline before country code) */
.listing-card__flag { font-size: 11px; vertical-align: -1px; margin-right: 2px; }

/* StereoNET news strip on home page */
.news-strip {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
}
.news-strip__item { list-style: none; }
.news-strip__link {
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 6px;
  padding: 10px;
  transition: background 0.15s ease, border-color 0.15s ease;
  align-items: flex-start;
}
.news-strip__link:hover { background: rgba(255,255,255,0.04); border-color: rgba(216,160,45,0.4); }
.news-strip__thumb {
  flex: 0 0 72px;
  width: 72px;
  height: 72px;
  background-size: cover;
  background-position: center;
  background-color: rgba(255,255,255,0.04);
  border-radius: 4px;
}
.news-strip__thumb--empty { background-color: rgba(255,255,255,0.03); }
.news-strip__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.news-strip__tag {
  display: inline-block;
  font: 600 10px/1 Inter, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 2px;
  background: rgba(255,255,255,0.06);
  color: var(--text-2, #c8c8c8);
  align-self: flex-start;
}
.news-strip__tag--review  { background: rgba(216,160,45,0.18); color: #e8c97a; }
.news-strip__tag--news    { background: rgba(80,160,220,0.18); color: #9bd0f0; }
.news-strip__tag--opinion { background: rgba(180,120,200,0.18); color: #d6aee0; }
.news-strip__tag--feature { background: rgba(120,200,140,0.18); color: #aedfb8; }
.news-strip__title {
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  color: var(--text-1, #eee);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-strip__meta { display: flex; gap: 8px; font-size: 11px; color: var(--text-3, #888); }
.news-strip__author::after { content: ' · '; color: var(--text-3, #888); }

/* Alerts CTA section between Best Buys and Trending */
.section--alerts-cta { padding: 18px 0; }
.alerts-cta {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 22px;
  background: linear-gradient(135deg, rgba(216,160,45,0.10), rgba(232,56,27,0.06));
  border: 1px solid rgba(216,160,45,0.28);
  border-radius: 8px;
}
.alerts-cta__icon { font-size: 32px; line-height: 1; flex: 0 0 auto; }
.alerts-cta__body { flex: 1 1 auto; min-width: 0; }
.alerts-cta__title { margin: 0 0 4px; font-size: 18px; font-weight: 700; color: var(--text-1, #eee); }
.alerts-cta__lede  { margin: 0; font-size: 13px; color: var(--text-2, #c8c8c8); line-height: 1.4; }
.alerts-cta__actions { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }
@media (max-width: 720px) {
  .alerts-cta { flex-direction: column; align-items: flex-start; }
  .alerts-cta__actions { width: 100%; }
  .alerts-cta__actions .btn { flex: 1 1 auto; }
}

/* SVG flag images (flagcdn.com) — replace flag emoji on Linux/Chrome where emoji don't render */
.cc-flag {
  display: inline-block;
  width: 16px;
  height: 12px;
  vertical-align: -1px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.2);
  object-fit: cover;
}
.listing-card__country .cc-flag { width: 12px; height: 9px; vertical-align: -1px; margin-right: 3px; }
.latest-strip__flag .cc-flag { width: 14px; height: 10px; }

/* Model detail hero — added with EHF promotion (build 324+).
   Renders product image + RRP next to model title; degrades gracefully
   when image_url or msrp_usd are NULL (most rows have at least one). */
.model-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: center;
  margin: 0 0 12px;
}
@media (min-width: 720px) {
  .model-hero:has(.model-hero__media) {
    grid-template-columns: 220px 1fr;
  }
}
.model-hero__media {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 220px;
  background: #11151c;
  border: 1px solid #1d242f;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.model-hero__img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.model-hero__noimg {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.8rem;
  font-weight: 900;
  color: #3a4252;
}
.model-hero__info { min-width: 0; }
.model-hero__info h1 { margin: 0 0 4px; }
.model-hero__msrp {
  margin: 8px 0 0;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.model-hero__msrp strong {
  font-size: 1.15rem;
}

/* ===== Admin users table — row actions dropdown ===== */
.row-actions {
  position: relative;
  display: inline-block;
}
.row-actions[open] > .row-actions__trigger {
  background: #2a2a2a;
}
.row-actions__trigger {
  cursor: pointer;
  list-style: none;
  padding: 4px 10px;
  border: 1px solid #444;
  border-radius: 4px;
  background: #1f1f1f;
  color: #e6e6e6;
  font-size: 0.85rem;
  white-space: nowrap;
  user-select: none;
}
.row-actions__trigger::-webkit-details-marker {
  display: none;
}
.row-actions__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  min-width: 180px;
  background: #1f1f1f;
  border: 1px solid #444;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  z-index: 50;
  padding: 4px 0;
}
.row-actions__item {
  margin: 0;
  padding: 0;
  display: block;
}
.row-actions__btn {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 6px 12px;
  color: #e6e6e6;
  font-size: 0.85rem;
  cursor: pointer;
}
.row-actions__btn:hover {
  background: #2a2a2a;
}
.row-actions__btn--danger {
  color: #ff6b6b;
}
.row-actions__btn--danger:hover {
  background: #3a1f1f;
}
.row-actions__sep {
  border: 0;
  border-top: 1px solid #333;
  margin: 4px 0;
}

/* ===== Media (vinyl + CD) browse-only cards ===== */
.media-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 600px) { .media-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 900px) { .media-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1280px){ .media-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.media-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.media-card:hover {
  transform: translateY(-2px);
  border-color: var(--border);
  box-shadow: 0 12px 28px rgba(0,0,0,0.5);
}
.media-card__media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-ticker);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.media-card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.media-card:hover .media-card__media img { transform: scale(1.03); }
.media-card__noimg {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1px;
}
.media-card__source {
  position: absolute;
  top: 6px; left: 6px;
  background: rgba(0,0,0,0.78);
  color: #fff;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  max-width: calc(100% - 64px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.media-card__type {
  position: absolute;
  top: 6px; right: 6px;
  padding: 3px 7px;
  border-radius: 3px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #fff;
}
.media-card__type--vinyl { background: #6b3f1d; }
.media-card__type--cd    { background: #2d5a8a; }
.media-card__body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.media-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text-strong);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.media-card__title a { color: inherit; }
.media-card__title a:hover { color: var(--accent); }
.media-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}
.media-card__price {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
}
.media-card__where { white-space: nowrap; }

/* Homepage promo strip */
.media-promo {
  background: linear-gradient(135deg, #2a1810 0%, #1a2a3a 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.media-promo__icon {
  font-size: 32px;
  line-height: 1;
}
.media-promo__body { flex: 1; min-width: 220px; }
.media-promo__title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text-strong);
}
.media-promo__sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}
.media-promo__cta { flex-shrink: 0; }
