/* ===========================
   PinPals — Global Styles
   =========================== */

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

/* Skip-to-content link for keyboard/screen reader users */
.skip-link:focus { left: 0; }

/* Keyboard focus indicator (WCAG 2.4.7) — visible only for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
/* Elements with custom focus styles keep their border-color change but still get outline for keyboard */
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 1px;
}

:root {
  --orange: #F97316;
  --amber: #F59E0B;
  --red: #EF4444;
  --purple: #8B5CF6;
  --cyan: #06B6D4;
  --green: #22C55E;
  --bg: #0A0A0F;
  --glass: rgba(255,255,255,0.04);
  --glass-border: rgba(255,255,255,0.08);
  --text-primary: #fff;
  --text-muted: rgba(255,255,255,0.45);
  --text-dim: rgba(255,255,255,0.3);
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'Space Mono', monospace;
  /* Theme-specific tokens (defaults = dark) */
  --nav-scrolled-bg: rgba(10,10,15,0.88);
  --surface-1: rgba(255,255,255,0.03);
  --surface-2: rgba(255,255,255,0.05);
  --surface-border: rgba(255,255,255,0.06);
  --mobile-menu-bg: rgba(10,10,15,0.97);
  --ticker-bg: rgba(255,255,255,0.03);
  --ticker-border: rgba(255,255,255,0.06);
  --input-color: #fff;
  --input-placeholder: rgba(255,255,255,0.3);
  --input-focused-bg: rgba(255,255,255,0.08);
  --btn-secondary-border: rgba(255,255,255,0.12);
  --btn-secondary-color: rgba(255,255,255,0.7);
  --btn-secondary-hover-bg: rgba(255,255,255,0.08);
  --btn-secondary-hover-border: rgba(255,255,255,0.2);
  --scrollbar-thumb: rgba(255,255,255,0.1);
  --theme-toggle-icon: '☀️';
  --transition-theme: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  /* Semantic status colors */
  --success-bg: rgba(20,83,45,0.5);
  --success-text: #bbf7d0;
  --error-bg: rgba(127,29,29,0.5);
  --error-text: #fecaca;
  --warning-bg: rgba(120,53,15,0.5);
  --warning-text: #fde68a;
  --info-bg: rgba(28,25,23,0.7);
  --info-text: #a8a29e;
  --star-empty: #555;
  --link-color: #60a5fa;
  --price-color: var(--green);
  /* Input / card backgrounds */
  --card-bg: rgba(255,255,255,0.04);
  --input-bg: rgba(255,255,255,0.08);
  --input-border: rgba(255,255,255,0.15);
  --modal-card-bg: rgba(10,10,15,0.90);
}

/* ===========================
   LIGHT THEME
   =========================== */
[data-theme="light"] {
  --bg: #F7F2EC;
  --glass: rgba(255,255,255,0.72);
  --glass-border: rgba(0,0,0,0.09);
  --text-primary: #1A1208;
  --text-muted: rgba(26,18,8,0.55);
  --text-dim: rgba(26,18,8,0.38);
  --nav-scrolled-bg: rgba(247,242,236,0.92);
  --surface-1: rgba(255,255,255,0.75);
  --surface-2: rgba(255,255,255,0.85);
  --surface-border: rgba(0,0,0,0.07);
  --mobile-menu-bg: rgba(247,242,236,0.98);
  --ticker-bg: rgba(0,0,0,0.03);
  --ticker-border: rgba(0,0,0,0.07);
  --input-color: #1A1208;
  --input-placeholder: rgba(26,18,8,0.35);
  --input-focused-bg: rgba(0,0,0,0.05);
  --btn-secondary-border: rgba(0,0,0,0.12);
  --btn-secondary-color: rgba(26,18,8,0.7);
  --btn-secondary-hover-bg: rgba(0,0,0,0.05);
  --btn-secondary-hover-border: rgba(0,0,0,0.2);
  --scrollbar-thumb: rgba(0,0,0,0.15);
  --modal-card-bg: rgba(247,242,236,0.90);
  /* Light mode semantic colors */
  --success-bg: rgba(187,247,208,0.6);
  --success-text: #14532d;
  --error-bg: rgba(254,202,202,0.6);
  --error-text: #7f1d1d;
  --warning-bg: rgba(253,230,138,0.6);
  --warning-text: #78350f;
  --info-bg: rgba(168,162,158,0.2);
  --info-text: #44403c;
  --star-empty: #D1D5DB;
  --link-color: #2563EB;
  --card-bg: rgba(255,255,255,0.75);
  --input-bg: rgba(0,0,0,0.05);
  --input-border: rgba(0,0,0,0.15);
}

/* Smooth theme transitions */
body, .navbar, .mobile-menu, .stat-card, .pin-card, .panel,
.step-card, .ticker-wrap, .footer, .site-header,
.inner-navbar, .inner-subnav, .search-bar, .filter-pill,
.hero-pill, .btn-secondary {
  transition: var(--transition-theme), box-shadow 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-display);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: 3px; }

a { text-decoration: none; color: inherit; }
button { font-family: var(--font-display); }

/* ===========================
   Animations
   =========================== */

@keyframes floatPin {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(10deg); }
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

@keyframes heroGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
}

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

.anim-in {
  animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0s) both;
}

/* ===========================
   Floating Background
   =========================== */

.floating-pins {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.floating-pin {
  position: absolute;
  opacity: 0.06;
}

/* ===========================
   Utility
   =========================== */

.gradient-text {
  background: linear-gradient(135deg, var(--orange), var(--amber), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section {
  padding: 64px 48px;
  position: relative;
  z-index: 1;
}

.center { text-align: center; }

/* ===========================
   NAVBAR
   =========================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0 48px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s;
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

.navbar.scrolled {
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
}

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

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), var(--red), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 20px rgba(249,115,22,0.3);
}

.logo-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-badge {
  font-size: 10px;
  background: rgba(249,115,22,0.15);
  color: var(--orange);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-left: -2px;
}
@media (max-width: 768px) {
  .logo-badge { display: none; }
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-item {
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
[data-theme="light"] .nav-item {
  color: var(--text-primary);
}

.nav-item.active, .nav-item:hover {
  background: rgba(249,115,22,0.15);
  color: var(--orange);
  font-weight: 700;
}

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

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
  width: 180px;
}

.search-bar.focused {
  background: var(--input-focused-bg);
  border-color: rgba(249,115,22,0.3);
  width: 240px;
}

.search-icon { font-size: 14px; opacity: 0.4; }

.search-bar input {
  background: none;
  border: none;
  color: var(--input-color);
  font-size: 13px;
  width: 100%;
  font-family: var(--font-display);
}

.search-bar input::placeholder { color: var(--input-placeholder); }

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  font-size: 16px;
}

.notification-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  border: 2px solid var(--bg);
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 2px solid var(--bg);
  pointer-events: none;
}
.notification-badge.msg-badge-color { background: var(--link-color); }

.avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  border: 2px solid rgba(255,255,255,0.1);
}

.burger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 72px;
  left: 0;
  right: 0;
  background: var(--mobile-menu-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 99;
  padding: 16px 24px;
  border-bottom: 1px solid var(--glass-border);
  animation: slideDown 0.3s ease;
  display: none;
}

.mobile-menu.open { display: block; }

.mobile-nav-item {
  display: block;
  width: 100%;
  padding: 14px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-display);
}

.mobile-nav-item.active { color: var(--orange); }

/* ===========================
   HERO
   =========================== */

.hero {
  padding-top: 140px;
  padding-bottom: 100px;
  text-align: center;
  position: relative;
}

.hero-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
}

.hero-glow-1 {
  top: 40px; left: 20%;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(249,115,22,0.12), transparent 70%);
  animation: heroGlow 6s ease-in-out infinite;
}

.hero-glow-2 {
  top: 80px; right: 15%;
  width: 350px; height: 350px;
  background: radial-gradient(circle, rgba(139,92,246,0.1), transparent 70%);
  animation: heroGlow 8s ease-in-out infinite 2s;
}

.hero-glow-3 {
  bottom: 20px; left: 40%;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(6,182,212,0.08), transparent 70%);
  animation: heroGlow 7s ease-in-out infinite 1s;
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px 6px 8px;
  border-radius: 50px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  margin-bottom: 28px;
}

.hero-pill-badge {
  padding: 3px 10px;
  border-radius: 50px;
  background: linear-gradient(135deg, var(--orange), var(--red));
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.hero-pill-text {
  color: var(--text-muted);
  font-size: 13px;
}

.hero-title {
  font-size: 72px;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 700px;
  margin: 0 auto;
}

.hero-sub {
  font-size: 19px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 20px auto 0;
  line-height: 1.6;
  font-weight: 400;
}

.hero-ctas {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

/* Buttons */
.btn-primary {
  padding: 14px 32px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(249,115,22,0.3), inset 0 1px 0 rgba(255,255,255,0.2);
  transition: all 0.3s;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(249,115,22,0.4), inset 0 1px 0 rgba(255,255,255,0.2);
}

.btn-primary.btn-lg {
  padding: 16px 40px;
  font-size: 16px;
  box-shadow: 0 8px 32px rgba(249,115,22,0.35);
}

.btn-secondary {
  padding: 14px 32px;
  border-radius: 14px;
  border: 1px solid var(--btn-secondary-border);
  background: var(--glass);
  color: var(--btn-secondary-color);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover-bg);
  border-color: var(--btn-secondary-hover-border);
}

/* ===========================
   STATS BAR
   =========================== */

.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 0 48px;
  margin-top: -40px;
  position: relative;
  z-index: 2;
}

.stat-card {
  background: var(--surface-2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 16px;
  border: 1px solid var(--glass-border);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ===========================
   TICKER
   =========================== */

.ticker-wrap {
  overflow: hidden;
  background: var(--ticker-bg);
  border-top: 1px solid var(--ticker-border);
  border-bottom: 1px solid var(--ticker-border);
  padding: 12px 0;
  margin-top: 48px;
  position: relative;
  z-index: 1;
}

.ticker {
  display: flex;
  animation: ticker 25s linear infinite;
  white-space: nowrap;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-right: 48px;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
}

.ticker-item .bolt { color: var(--orange); font-weight: 700; }
.ticker-item .user { color: var(--text-primary); font-weight: 600; }
.ticker-item .sep { color: var(--text-dim); }
.ticker-item .pin-a { color: var(--cyan); }
.ticker-item .pin-b { color: var(--purple); }
.ticker-item .time { color: var(--text-dim); font-size: 11px; }

/* ===========================
   SECTION HEADERS
   =========================== */

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 32px;
}

.section-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-title.center {
  text-align: center;
  margin-bottom: 48px;
}

.section-sub {
  color: var(--text-dim);
  font-size: 14px;
  margin-top: 6px;
  font-family: var(--font-mono);
}

.filter-pills { display: flex; gap: 8px; }

.filter-pill {
  padding: 7px 16px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-pill.active, .filter-pill:hover {
  border-color: transparent;
  background: rgba(249,115,22,0.15);
  color: var(--orange);
}

/* ===========================
   PIN CARDS
   =========================== */

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

.pin-card {
  background: var(--surface-1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  animation: cardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) var(--delay, 0s) both;
}

.pin-card:hover {
  transform: translateY(-8px) scale(1.02);
  border-color: var(--pin-color);
  box-shadow: 0 20px 60px color-mix(in srgb, var(--pin-color) 20%, transparent),
              0 0 0 1px color-mix(in srgb, var(--pin-color) 25%, transparent);
}

.pin-card-visual {
  height: 180px;
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--pin-color) 8%, transparent),
    color-mix(in srgb, var(--pin-color) 4%, transparent));
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.pin-card-glow {
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--pin-color) 12%, transparent), transparent 70%);
  filter: blur(30px);
}

.pin-card-emoji {
  font-size: 64px;
  filter: drop-shadow(0 4px 20px color-mix(in srgb, var(--pin-color) 40%, transparent));
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  z-index: 1;
}

.pin-card:hover .pin-card-emoji {
  transform: scale(1.2) rotate(-5deg);
}

.pin-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 1rem;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}
.pin-card:hover .pin-card-img { transform: scale(1.06); }

/* .pin-card-stats removed — stats now shown in card info area */

.pin-card-coll {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-card-name-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
}
.pin-card-name-row .pin-card-name {
  flex: 1;
  min-width: 0;
}
.pin-card-stat-row {
  display: flex;
  flex-direction: row;
  gap: 6px;
  margin-top: 8px;
}
.pin-stat-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 4px 0;
  border-radius: 999px;
  white-space: nowrap;
}
.pin-stat-like { background: rgba(239,68,68,.12); color: var(--red); }
.pin-stat-have { background: rgba(34,197,94,.12);  color: var(--green); }

.rarity-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
}

.swap-count {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 8px;
  border-radius: 10px;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pin-card-info {
  padding: 16px 18px 18px;
}

.pin-card-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pin-card-meta {
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pin-card-owner {
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font-mono);
}

.like-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--font-mono);
  padding: 0;
  transition: all 0.2s;
}

.like-btn.liked { color: var(--red); }

.swap-btn {
  margin-top: 14px;
  width: 100%;
  padding: 10px 0;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--pin-color) 30%, transparent);
  background: transparent;
  color: var(--pin-color);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.03em;
}

.pin-card:hover .swap-btn {
  background: color-mix(in srgb, var(--pin-color) 12%, transparent);
}

/* ===========================
   PANELS (Leaderboard + Feed)
   =========================== */

.bottom-row {
  display: flex;
  gap: 24px;
  padding-top: 16px;
  flex-wrap: wrap;
}

.panel {
  background: var(--surface-1);
  border-radius: 20px;
  border: 1px solid var(--surface-border);
  padding: 28px;
}

.leaderboard-panel { flex: 1; min-width: 320px; }
.feed-panel { flex: 1.2; min-width: 380px; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.panel-title {
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-meta {
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  display: inline-block;
  box-shadow: 0 0 12px rgba(34,197,94,0.5);
  animation: pulse 2s infinite;
}

/* Leaderboard rows */
.lb-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 6px;
  transition: all 0.2s;
}

.lb-row.first {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.15);
}

.lb-rank {
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  width: 24px;
  text-align: center;
}

.lb-rank.gold { color: var(--amber); }
.lb-rank.silver { color: #94A3B8; }
.lb-rank.bronze { color: #CD7F32; }
.lb-rank.default { color: var(--text-dim); }

.lb-avatar { font-size: 24px; }

.lb-info { flex: 1; }

.lb-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 14px;
}

.lb-stats {
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--font-mono);
  margin-top: 2px;
}

/* Feed items */
.feed-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--surface-border);
  animation: cardIn 0.4s ease var(--delay, 0s) both;
}

.feed-item:last-child { border-bottom: none; }

.feed-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), var(--red));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.feed-avatar {
  width: 36px;
  height: 36px;
  max-width: 36px;
  max-height: 36px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  flex-grow: 0;
  border: 1px solid var(--surface-border);
  display: block;
}

.feed-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
}

.feed-text .user { font-weight: 700; }
.feed-text .sep { color: var(--text-muted); }
.feed-text .pin-a { color: var(--cyan); font-weight: 600; }
.feed-text .pin-b { color: var(--purple); font-weight: 600; }

.feed-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ===========================
   HOW IT WORKS
   =========================== */

.how-section {
  background: var(--ticker-bg);
  border-top: 1px solid var(--surface-border);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.step-card {
  text-align: center;
  padding: 32px;
  border-radius: 20px;
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
}

.step-label {
  font-size: 11px;
  color: var(--orange);
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 12px;
}

.step-icon { font-size: 42px; margin-bottom: 16px; }

.step-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 8px;
}

.step-desc {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ===========================
   CTA BANNER
   =========================== */

.cta-banner {
  padding: 56px 48px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(249,115,22,0.12), rgba(139,92,246,0.08));
  border: 1px solid rgba(249,115,22,0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cta-glow {
  position: absolute;
  top: -50px;
  right: -50px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(249,115,22,0.15), transparent 70%);
  filter: blur(60px);
}

.cta-title {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -0.03em;
  position: relative;
}

.cta-desc {
  color: var(--text-muted);
  font-size: 16px;
  margin: 12px auto 0;
  max-width: 400px;
  position: relative;
}

.cta-banner .btn-primary { margin-top: 28px; position: relative; }

/* ===========================
   FOOTER
   =========================== */

.footer {
  padding: 48px 48px 32px;
  border-top: 1px solid var(--surface-border);
  position: relative;
  z-index: 1;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 32px;
  margin-bottom: 40px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 20px;
}

.footer-logo-text {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.footer-tagline {
  color: var(--text-dim);
  font-size: 13px;
  max-width: 260px;
  line-height: 1.6;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.footer-col a {
  color: var(--text-dim);
  font-size: 13px;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--text-muted); }

.footer-bottom {
  border-top: 1px solid var(--surface-border);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom span {
  color: var(--text-dim);
  font-size: 12px;
  font-family: var(--font-mono);
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 1024px) {
  .pins-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .navbar { padding: 0 20px; }
  .nav-links { display: none; }
  .burger-btn { display: flex; }
  .section { padding: 48px 20px; }
  .hero { padding-top: 110px; padding-bottom: 70px; }
  .hero-title { font-size: 42px; }
  .hero-sub { font-size: 16px; }
  .hero-ctas { flex-direction: column; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); padding: 0 20px; gap: 12px; }
  .pins-grid { grid-template-columns: 1fr; padding: 0; }
  .bottom-row { flex-direction: column; }
  .leaderboard-panel, .feed-panel { min-width: unset; }
  .steps-grid { grid-template-columns: 1fr; }
  .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .footer-top { flex-direction: column; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
  .cta-banner { padding: 40px 24px; }
  .cta-title { font-size: 28px; }
  .search-bar { display: none; }
}

@media (max-width: 480px) {
  .stats-bar { grid-template-columns: 1fr; }
  .hero-title { font-size: 34px; }
  .stat-card { padding: 16px 18px; }
}

/* ===========================
   THEME TOGGLE BUTTON
   =========================== */

/* VIP nav button */
.nav-vip-btn {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .35rem .85rem;
  font-size: .82rem;
  font-weight: 700;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), #e05a00);
  color: #fff !important;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(249,115,22,.25);
}
.nav-vip-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(249,115,22,.4);
}
@media (max-width: 768px) {
  .nav-vip-btn { padding: .3rem .65rem; font-size: .75rem; }
}

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
  line-height: 1;
}

.theme-toggle:hover {
  background: rgba(249,115,22,0.15);
  border-color: rgba(249,115,22,0.3);
}

/* ===========================
   INNER PAGES (header.php styles)
   =========================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-scrolled-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  transition: var(--transition-theme);
}

.inner-navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 72px;
  max-width: 1400px;
  margin: 0 auto;
  gap: 12px;
}

.inner-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.inner-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), var(--red), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(249,115,22,0.3);
}

.inner-logo-text {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.inner-logo-badge {
  font-size: 10px;
  background: rgba(249,115,22,0.15);
  color: var(--orange);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-left: -2px;
}
@media (max-width: 900px) {
  .inner-logo-badge { display: none; }
}

.inner-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.inner-nav-links a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  font-family: var(--font-display);
  white-space: nowrap;
}
[data-theme="light"] .inner-nav-links a {
  color: var(--text-primary);
}

.inner-nav-links a:hover,
.inner-nav-links a.active {
  background: rgba(249,115,22,0.15);
  color: var(--orange);
  font-weight: 700;
}

.inner-nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* Search bar inside inner-page nav */
.inner-nav-search {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  transition: all 0.3s;
  width: 160px;
}
.inner-nav-search:focus-within {
  background: var(--input-focused-bg);
  border-color: rgba(249,115,22,0.3);
  width: 220px;
}
.inner-nav-search .search-icon { font-size: 13px; opacity: 0.4; flex-shrink: 0; }
.inner-nav-search input {
  background: none;
  border: none;
  color: var(--input-color);
  font-size: 13px;
  width: 100%;
  font-family: var(--font-display);
}
.inner-nav-search input::placeholder { color: var(--input-placeholder); }
@media (max-width: 1024px) {
  .inner-nav-search { display: none; }
}

.inner-nav-user {
  font-size: 13px;
  color: var(--text-muted);
}

.msg-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 4px;
}

.msg-badge-alert { background: var(--amber); }

.inner-nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 22px;
  cursor: pointer;
  padding: 0;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.site-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
}

.inner-subnav {
  display: none;
  flex-direction: column;
  background: var(--mobile-menu-bg);
  border-top: 1px solid var(--glass-border);
  padding: .5rem 1rem;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: var(--transition-theme);
}

.inner-subnav a {
  padding: .75rem 1rem;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 15px;
  font-family: var(--font-display);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.inner-subnav a:hover,
.inner-subnav a.active {
  color: var(--orange);
}

.inner-subnav.open { display: flex; }

.panel-inner {
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 1.2rem;
}

@media (max-width: 900px) {
  .inner-nav-links { display: none; }
  .inner-nav-toggle { display: flex; }
  /* Hide message/notification icons on mobile — accessible via the menu instead */
  #nav-msg-link, #nav-notif-link { display: none; }
  .inner-navbar { padding: 0 1rem; height: 64px; }
}

/* ===========================
   LIGHT MODE — ADDITIONAL OVERRIDES
   =========================== */

[data-theme="light"] body {
  background: var(--bg);
  color: var(--text-primary);
}

[data-theme="light"] .floating-pin {
  opacity: 0.04;
  filter: saturate(1.5);
}

[data-theme="light"] .hero-glow-1 {
  background: radial-gradient(circle, rgba(249,115,22,0.18), transparent 70%);
}

[data-theme="light"] .hero-glow-2 {
  background: radial-gradient(circle, rgba(139,92,246,0.14), transparent 70%);
}

[data-theme="light"] .hero-glow-3 {
  background: radial-gradient(circle, rgba(6,182,212,0.12), transparent 70%);
}

[data-theme="light"] .hero-pill {
  background: rgba(255,255,255,0.8);
  border-color: rgba(0,0,0,0.08);
}

[data-theme="light"] .lb-row {
  background: transparent;
}

[data-theme="light"] .lb-row:hover {
  background: rgba(249,115,22,0.06);
}

[data-theme="light"] .lb-row.first {
  background: rgba(245,158,11,0.08);
  border-color: rgba(245,158,11,0.2);
}

[data-theme="light"] .swap-count {
  background: rgba(255,255,255,0.85);
  color: #1A1208;
  backdrop-filter: blur(10px);
}

[data-theme="light"] .avatar-btn {
  border-color: rgba(0,0,0,0.1);
}

[data-theme="light"] .notification-dot,
[data-theme="light"] .notification-badge {
  border-color: var(--bg);
}

[data-theme="light"] .cta-banner {
  background: linear-gradient(135deg, rgba(249,115,22,0.08), rgba(139,92,246,0.05));
  border-color: rgba(249,115,22,0.2);
}

/* ===========================
   LINKS
   =========================== */

a.link, .prose a { color: var(--link-color); }

/* ===========================
   ALERTS
   =========================== */

.alert {
  padding: .65rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: .93em;
  line-height: 1.5;
}
.alert ul { margin: .3rem 0 0 1.2rem; }
.alert-success, .alert.success { background: var(--success-bg); color: var(--success-text); border: 1px solid rgba(34,197,94,0.25); }
.alert-error,   .alert.error   { background: var(--error-bg);   color: var(--error-text);   border: 1px solid rgba(239,68,68,0.25); }
.alert-warning, .alert.warning { background: var(--warning-bg); color: var(--warning-text); border: 1px solid rgba(245,158,11,0.25); }
.alert-info,    .alert.info    { background: var(--info-bg);    color: var(--info-text);    border: 1px solid rgba(107,114,128,0.2); }

/* ===========================
   CARDS (generic inner-page)
   =========================== */

.card {
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
}

/* ===========================
   BUTTONS (inner pages)
   =========================== */

.btn-swap {
  display: inline-flex;
  align-items: center;
  padding: .4rem .85rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: var(--surface-2);
  color: var(--text-primary);
  font-size: .88em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  font-family: var(--font-display);
}
.btn-swap:hover { border-color: var(--orange); color: var(--orange); }
.btn-swap.active { border-color: var(--orange); color: var(--orange); background: rgba(249,115,22,0.1); }

.btn-delete {
  display: inline-flex;
  align-items: center;
  padding: .4rem .85rem;
  border-radius: 8px;
  border: 1px solid rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.1);
  color: var(--red);
  font-size: .88em;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all .2s;
  font-family: var(--font-display);
}
.btn-delete:hover { background: rgba(239,68,68,0.2); }

.btn-small { padding: .25rem .55rem; font-size: .82em; }

/* ===========================
   FORMS (inner pages)
   =========================== */

.form, .auth-form {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 480px;
}
.form-label { display: block; font-size: .85em; color: var(--text-muted); margin-bottom: .25rem; }
.form-input, .form-select, .form-textarea,
.auth-form input, .auth-form select, .auth-form textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--input-color);
  padding: .5rem .75rem;
  font: inherit;
  font-size: .95em;
  transition: border-color .2s, background .2s;
  box-sizing: border-box;
}
.form-input::placeholder, .auth-form input::placeholder { color: var(--input-placeholder); }
.form-input:focus, .form-select:focus, .form-textarea:focus,
.auth-form input:focus { border-color: rgba(249,115,22,0.5); background: var(--input-focused-bg); }
.auth-form input:focus:not(:focus-visible) { outline: none; }
.form-textarea { resize: vertical; min-height: 80px; }
.auth-form button[type=submit] {
  padding: .55rem 1.5rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: #fff;
  font-size: .95em;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.auth-form button[type=submit]:hover { opacity: .9; }

/* ===========================
   BADGE CARD (badge_card.php)
   =========================== */

.badge-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--card-bg);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: .75rem;
  position: relative;
  transition: border-color .2s;
}
.badge-card.compact {
  padding: .5rem;
  height: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
}
.badge-card.compact .badge-meta {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.badge-card.compact .badge-title {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.badge-card.compact .badge-actions {
  margin-top: auto;
  padding-top: .3rem;
}
.badge-card:hover { border-color: var(--glass-border); }
.badge-thumb { display: block; align-self: center; }
.badge-thumb img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  background: var(--surface-2);
}
.badge-meta { display: flex; flex-direction: column; gap: .35rem; }
.badge-title { font-weight: 600; color: var(--text-primary); }
.badge-sub { display: flex; gap: .5rem; opacity: .8; font-size: .9em; flex-wrap: wrap; }
.badge-sub span {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: .1rem .4rem;
}
.badge-actions {
  display: flex;
  gap: .35rem;
  margin-top: .25rem;
  flex-wrap: wrap;
}
.badge-actions .act {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  border: none;
  background: var(--surface-2);
  color: var(--text-dim);
  border-radius: 999px;
  padding: .22rem .55rem .22rem .38rem;
  font-size: .78em;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, color .2s;
  line-height: 1;
}
.badge-actions .act svg { flex-shrink: 0; width: 14px; height: 14px; }
.act-count { font-weight: 600; }
.badge-actions .act.heart.active { color: #FFD700; background: rgba(255,215,0,.12); }
.badge-actions .act.heart.active svg { fill: #FFD700; stroke: #D4A800; }
.badge-actions .act.have.active  { color: #22C55E; background: rgba(34,197,94,.12); }
.badge-actions .act.have.active svg { fill: #22C55E; stroke: #16A34A; }
.badge-actions .act.want.active  { color: var(--amber); background: rgba(245,158,11,.12); }
.badge-actions .act.imperfect-toggle { flex: 0 0 auto; font-size: .72em; gap: .2rem; }
.badge-actions .act.imperfect-toggle .act-label { font-weight: 700; letter-spacing: .02em; }
.badge-actions .act.imperfect-toggle.active { color: #a78bfa; background: rgba(167,139,250,.12); }
.badge-actions .act.imperfect-toggle.hidden { display: none; }
.badge-actions .act:hover { opacity: .8; }

/* Detail page — larger buttons that split the full width */
/* Grid cards (explore, search) — full-width 50/50 split buttons */
.badge-card .badge-actions { gap: .4rem; margin-top: .3rem; flex-wrap: nowrap; }
.badge-card .badge-actions .act {
  flex: 1;
  justify-content: center;
  padding: .38rem .5rem;
  font-size: .85em;
  border-radius: 10px;
}
.badge-card .badge-actions .act svg { width: 16px; height: 16px; }

/* Detail page — larger buttons that split the full width */
.badge-detail-card .badge-actions { gap: .5rem; margin-top: .6rem; flex-wrap: nowrap; }
.badge-detail-card .badge-actions .act {
  flex: 1;
  justify-content: center;
  padding: .45rem .75rem;
  font-size: .9em;
  border-radius: 12px;
}
.badge-detail-card .badge-actions .act svg { width: 18px; height: 18px; }
.buy-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; }
.price { opacity: .9; color: var(--price-color); }
.buy-btn {
  display: inline-block;
  border: 1px solid var(--glass-border);
  background: var(--surface-2);
  color: var(--text-primary);
  border-radius: 8px;
  padding: .25rem .55rem;
  font-size: .9em;
  transition: background .15s;
}
.buy-btn:hover { background: var(--surface-1); }
.buy-btn.pi { border-color: rgba(120,53,15,0.4); color: var(--warning-text); }

/* Rainbow spinning border for in-stock Buy button */
@property --rb-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes rainbow-spin {
  to { --rb-angle: 360deg; }
}
.buy-btn.rainbow {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    conic-gradient(from var(--rb-angle),
      #ff0000, #ff8800, #ffee00, #00cc44, #00ccff, #0055ff, #cc00ff, #ff0000
    ) border-box;
  animation: rainbow-spin 3s linear infinite;
  font-weight: 600;
}

/* Badge grid */
.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

/* Skeleton loaders */
@keyframes skeletonPulse {
  0%, 100% { opacity: .45; }
  50% { opacity: .8; }
}
.skeleton {
  background: var(--surface-border);
  border-radius: 8px;
  animation: skeletonPulse 1.4s ease-in-out infinite;
}
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  background: var(--card-bg, var(--surface-1));
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: .75rem;
}
.skeleton-thumb {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
}
.skeleton-line {
  height: .85rem;
  border-radius: 4px;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.tiny  { width: 35%; height: .7rem; }

/* Badge status pills (profile pending) */
.badge-status-pill {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 999px;
  font-size: .8em;
  font-weight: 600;
}
.badge-status-pill.pending  { background: rgba(251,191,36,0.2);  color: var(--amber); }
.badge-status-pill.approved { background: rgba(34,197,94,0.2);   color: var(--green); }
.badge-status-pill.rejected { background: rgba(239,68,68,0.15);  color: var(--red); }

/* ===========================
   SORT / FILTER BAR
   =========================== */

.sort-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem;
  margin-bottom: 1rem;
}
.sort-btn {
  padding: .3rem .75rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-muted);
  font-size: .82em;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-display);
}
.sort-btn:hover, .sort-btn.active {
  background: rgba(249,115,22,0.15);
  border-color: transparent;
  color: var(--orange);
}
.filter-sel {
  font-size: .82em;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--input-color);
  padding: .2rem .5rem;
  font-family: var(--font-display);
}

/* ===========================
   PROFILE PAGE
   =========================== */

.profile-container {
  max-width: 1200px;
  margin: 0 auto;
}
.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}
.profile-section { margin-bottom: 3rem; }
.profile-section h2 {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}
.grid-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.badge-item {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1rem;
  transition: box-shadow .2s, border-color .2s;
  position: relative;
}
.badge-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); border-color: var(--glass-border); }

/* Profile haves grid — uniform card height with buttons pinned to bottom */
.badge-item.bulk-item {
  display: flex;
  flex-direction: column;
}
.badge-item.bulk-item .badge-card {
  flex: 1;
}
.qty-pill {
  position: absolute;
  top: .4rem;
  left: .4rem;
  background: var(--link-color);
  color: #fff;
  font-size: .72em;
  font-weight: 700;
  padding: .1rem .35rem;
  border-radius: 10px;
  z-index: 2;
  line-height: 1.4;
  pointer-events: none;
}
.add-badge-box {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-width: 520px;
}
.match-status { font-size: .9em; color: var(--text-muted); }
.match-results { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.swap-indicator { text-align: center; margin: .5rem 0; }
.badge.green {
  background: rgba(34,197,94,0.2);
  color: var(--green);
  padding: .25rem .5rem;
  border-radius: 12px;
  font-size: .8em;
  font-weight: 700;
}
.action-buttons { display: flex; gap: .5rem; justify-content: center; margin-top: .5rem; flex-wrap: wrap; }
.btn-marketplace {
  display: inline-block;
  padding: .25rem .6rem;
  border-radius: 5px;
  font-size: .78em;
  font-weight: 700;
  text-decoration: none;
  transition: opacity .15s;
}
.btn-marketplace:hover { opacity: .8; }
.btn-ebay        { background: #fff; border: 1px solid #ddd; padding: .18rem .45rem; line-height: 1; display: inline-flex; align-items: center; }
.btn-depop       { background: #ff2300; color: #fff; }
.btn-pinpals-buy { background: var(--accent); color: #fff; border: none; cursor: pointer; font: inherit; }

/* Segmented action buttons */
.btn-seg {
  display: inline-flex;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  overflow: hidden;
  font-size: .8em;
  width: 100%;
}
.btn-seg-item {
  flex: 1;
  padding: .35rem .65rem;
  background: var(--surface-2);
  border: none;
  border-right: 1px solid var(--surface-border);
  color: var(--text-primary);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  font-size: 1em;
  line-height: 1.2;
  text-align: center;
  font-family: var(--font-display);
}
.btn-seg-item:last-child { border-right: none; }
.btn-seg-item:hover { background: var(--glass); }
.btn-seg-item.seg-active { background: rgba(34,197,94,0.15); color: var(--green); }
.btn-seg-item.seg-price { cursor: default; color: var(--price-color); font-weight: 600; }
.btn-seg-item.seg-danger { color: var(--red); }
.btn-seg-item.seg-danger:hover { background: rgba(239,68,68,0.12); }
.sell-inline { display: flex; gap: .4rem; align-items: center; }

/* Avatar */
.profile-avatar {
  width: 80px; height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  background: var(--surface-2);
}
.user-avatar-sm {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--glass-border);
  background: var(--surface-2);
}

/* ===========================
   USER PUBLIC PROFILE (user.php)
   =========================== */

.user-profile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}
.user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}
.user-badge-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  transition: border-color .2s;
}
.user-badge-card:hover { border-color: var(--glass-border); }
.user-badge-card img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  border-radius: 6px;
  background: var(--surface-2);
  margin-bottom: .5rem;
}
.user-badge-card .bc-name { font-size: .9em; font-weight: 600; color: var(--text-primary); }
.user-badge-card .bc-coll { font-size: .8em; color: var(--text-dim); }
.user-badge-card .bc-price { font-size: 1em; font-weight: 700; color: var(--price-color); margin: .35rem 0 .5rem; }
.profile-meta { display: flex; flex-wrap: wrap; gap: 1.5rem; font-size: .9em; color: var(--text-muted); margin-top: .4rem; }

/* ── Rank block ────────────────────────────────────────────────────────────── */
.rank-block {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: .5rem 0 .6rem;
  padding: .55rem .75rem;
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  max-width: 480px;
}
.rank-main {
  display: flex;
  align-items: center;
  gap: .55rem;
}
.rank-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.rank-info { display: flex; flex-direction: column; gap: .05rem; }
.rank-title {
  font-weight: 700;
  font-size: .97em;
  letter-spacing: .01em;
}
.rank-tenure {
  font-size: .75em;
  opacity: .55;
}
.rank-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 20px;
  padding: .15rem .55rem;
  font-size: .78em;
  color: var(--text-dim);
}
.rank-pill-sub { opacity: .65; }
.rank-progress {
  height: 5px;
  background: var(--surface-border);
  border-radius: 99px;
  overflow: hidden;
  margin-top: .1rem;
}
.rank-progress-bar {
  height: 100%;
  border-radius: 99px;
  transition: width .4s ease;
  opacity: .85;
}
.rank-progress-label {
  font-size: .72em;
  opacity: .45;
  margin-top: .1rem;
}

/* Stars */
.star-filled { color: var(--amber); }
.star-empty  { color: var(--star-empty); }

/* ===========================
   ABOUT PAGE
   =========================== */

.about-hero { text-align: center; padding: 2rem 0 1rem; }
.about-hero h1 { font-size: 2.2rem; margin-bottom: .5rem; }
.about-hero p  { font-size: 1.1rem; color: var(--text-muted); max-width: 640px; margin: 0 auto; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}
.stat-num-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1.25rem 1rem;
  text-align: center;
  transition: border-color .2s;
}
.stat-num-card:hover { border-color: var(--glass-border); }
.stat-num-card .stat-num { font-size: 2rem; font-weight: 800; color: var(--green); line-height: 1.1; }
.stat-num-card .stat-label { font-size: .85em; color: var(--text-dim); margin-top: .3rem; }

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin: 2rem 0;
}
.feature-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color .2s;
}
.feature-card:hover { border-color: var(--glass-border); }
.feature-card h3 { margin: 0 0 .5rem; font-size: 1rem; }
.feature-card p  { margin: 0; font-size: .88em; color: var(--text-muted); line-height: 1.5; }
.about-section { margin: 2.5rem 0; }
.about-section h2 { font-size: 1.4rem; margin-bottom: 1rem; }
.about-section ul { line-height: 2; color: var(--text-muted); padding-left: 1.5rem; }

/* ===========================
   MESSAGES (messages.php)
   =========================== */

.conv-list { display: flex; flex-direction: column; gap: .35rem; max-width: 720px; }
.conv-row-wrap {
  position: relative;
  display: flex;
  align-items: stretch;
}
.conv-row-wrap .conv-row { flex: 1; }
.conv-delete-form { position: absolute; top: 0; right: 0; margin: 0; padding: 0; }
.conv-delete-btn {
  position: absolute;
  right: .4rem;
  top: .4rem;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  line-height: 1;
  padding: .15rem .35rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.conv-row-wrap:hover .conv-delete-btn { opacity: 1; }
.conv-delete-btn:hover { background: rgba(239,68,68,.15); color: var(--red); opacity: 1; }
.conv-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all .2s;
}
.conv-row:hover { background: var(--surface-2); border-color: var(--glass-border); }
.cr-meta { flex: 1; min-width: 0; }
.cr-name { font-weight: 600; display: flex; align-items: center; gap: .4rem; }
.cr-preview { font-size: .85em; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .15rem; }
.cr-time { font-size: .8em; color: var(--text-dim); white-space: nowrap; font-family: var(--font-mono); }
.unread-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
}

/* ===========================
   CONVERSATION (conversation.php)
   =========================== */

.conv-thread { display: flex; flex-direction: column; gap: .75rem; margin: 1.25rem 0; }
.msg-bubble {
  max-width: 75%;
  padding: .6rem .9rem;
  border-radius: 14px;
  font-size: .93em;
  line-height: 1.55;
  word-break: break-word;
}
.msg-bubble.mine {
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: #fff;
  border-radius: 14px 14px 4px 14px;
  align-self: flex-end;
}
.msg-bubble.theirs {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  color: var(--text-primary);
  border-radius: 14px 14px 14px 4px;
}
.msg-meta { font-size: .78em; color: var(--text-dim); margin-top: .2rem; font-family: var(--font-mono); }
.reply-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.reply-form textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--input-color);
  padding: .65rem .85rem;
  font: inherit;
  font-size: .93em;
  resize: vertical;
  min-height: 80px;
  transition: border-color .2s;
  box-sizing: border-box;
}
.reply-form textarea:focus { border-color: rgba(249,115,22,0.5); }
.reply-form textarea:focus:not(:focus-visible) { outline: none; }
.listing-context {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: .65rem .85rem;
  margin-bottom: 1rem;
}
.listing-context img { width: 48px; height: 48px; object-fit: contain; border-radius: 6px; background: var(--surface-2); }
.lc-info { flex: 1; min-width: 0; }
.lc-price { font-weight: 700; color: var(--price-color); margin-top: .15rem; }

/* ===========================
   NOTIFICATIONS (notifications.php)
   =========================== */

.notif-list { display: flex; flex-direction: column; gap: .5rem; max-width: 720px; margin: 0 auto; }
.notif-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: .75rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  transition: border-color .2s;
}
.notif-card.notif-unread {
  border-left: 3px solid var(--green);
}
.notif-card a { color: var(--text-primary); }
.notif-card a:hover { color: var(--orange); }
.notif-time { font-size: .8em; color: var(--text-dim); white-space: nowrap; font-family: var(--font-mono); }

/* ===========================
   NEW ARRIVALS (new.php)
   =========================== */

/* ── New-arrivals event feed ── */
.na-events-feed { margin-bottom: 28px; }
.na-events-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.na-event-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-1); border: 1px solid var(--surface-border);
  border-radius: 8px; padding: 8px 12px; font-size: .88rem;
}
.na-event-icon { flex-shrink: 0; font-size: 1rem; }
.na-event-body { flex: 1; min-width: 0; }
.na-event-body a { color: var(--link-color); text-decoration: none; font-weight: 600; }
.na-event-body a:hover { text-decoration: underline; }
.na-event-label { color: var(--text-muted); margin-left: 5px; font-size: .84rem; }
.na-event-time { flex-shrink: 0; color: var(--text-dim); font-size: .8rem; white-space: nowrap; }
.na-event-soldout { border-left: 3px solid var(--red); }
.na-event-new { border-left: 3px solid var(--green); }
.na-event-restocked { border-left: 3px solid var(--blue, #60a5fa); }
.na-event-price_change { border-left: 3px solid var(--orange); }
.na-event-removed { border-left: 3px solid var(--text-dim); opacity: .8; }

.new-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 14px; }
.new-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: 10px;
  transition: border-color .2s, box-shadow .2s;
  cursor: pointer;
}
.new-card:hover { border-color: var(--glass-border); box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.new-card a { color: var(--text-primary); text-decoration: none; display: block; }
.new-thumb {
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface-2);
}
.thumb-wrap { position: relative; }
.sold-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  padding: 7px 11px;
  font-weight: 700;
  font-size: 13px;
  text-transform: uppercase;
  color: #fff;
  background: rgba(0,0,0,0.6);
  border-radius: 6px;
  pointer-events: none;
}
.is-sold-out .new-thumb { filter: grayscale(100%) brightness(85%); }
.new-title { margin-top: 8px; font-weight: 600; font-size: .92rem; color: var(--text-primary); }
.new-price { font-size: .87rem; color: var(--text-muted); }
.pager { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 18px 0; }
.pager-row { display: flex; align-items: center; gap: 6px; }
.pager-link { color: var(--link-color); text-decoration: none; }
.pager-link:hover { text-decoration: underline; }
.pager-link.disabled { opacity: .5; pointer-events: none; }
.pager-meta { font-size: .88rem; color: var(--text-dim); }

/* ===========================
   FOR SALE PAGE (forsale.php)
   =========================== */

.swap-offers-section, .my-listings-section {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
  margin-bottom: 2rem;
}
.swap-offers-section h2, .my-listings-section h2 {
  margin: 0 0 .75rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.swap-offers-section h3 {
  font-size: .85em;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin: .75rem 0 .5rem;
}
.so-card {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: .75rem;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  margin-bottom: .6rem;
  transition: border-color .2s;
}
.so-card:last-child { margin-bottom: 0; }
.so-badge-img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-1);
  flex-shrink: 0;
  border: 1px solid var(--surface-border);
}
.so-offered { display: flex; gap: .35rem; flex-wrap: wrap; margin: .4rem 0; }
.so-offered img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--surface-border);
  background: var(--surface-1);
}
.so-acts { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .5rem; }
.ml-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.ml-card {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  transition: border-color .2s;
}
.ml-card:hover { border-color: var(--glass-border); }
.ml-card img {
  width: 100%;
  height: 130px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-1);
  display: block;
}
.ml-card .ml-name { font-weight: 600; font-size: .9rem; margin-top: .35rem; }
.ml-card .ml-coll { font-size: .78em; color: var(--text-dim); }
.ml-card .ml-price { font-size: 1.05em; font-weight: 700; color: var(--price-color); }
.ml-card .ml-meta  { font-size: .78em; color: var(--text-dim); }
.ml-card .ml-acts  { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .4rem; }
.age-warn { background: var(--warning-bg); color: var(--warning-text); font-size: .75em; padding: .15rem .45rem; border-radius: 5px; }
.count-pill {
  background: var(--surface-2);
  border: 1px solid var(--surface-border);
  color: var(--text-muted);
  font-size: .78em;
  padding: .1rem .45rem;
  border-radius: 999px;
  font-weight: normal;
}
.ml-past { opacity: .65; }
.forsale-filters {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  margin-bottom: 1.25rem;
  padding: .85rem 1rem;
  background: var(--surface-1);
  border-radius: 10px;
  border: 1px solid var(--surface-border);
}
.forsale-filters label { font-size: .82em; color: var(--text-dim); display: block; margin-bottom: .25rem; }
.forsale-filters input,
.forsale-filters select {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 6px;
  color: var(--input-color);
  padding: .35rem .6rem;
  font: inherit;
}
.forsale-filters input[type=number] { width: 90px; }
.forsale-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1.25rem; }
.forsale-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: .9rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  transition: border-color .2s, box-shadow .2s;
}
.forsale-card:hover { border-color: var(--glass-border); box-shadow: 0 4px 16px rgba(0,0,0,0.12); }
.forsale-card .thumb-wrap { position: relative; }
.is-sale-pending img { filter: grayscale(80%) brightness(80%); }
.forsale-card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--surface-2);
  display: block;
  margin-bottom: .25rem;
}
.forsale-price { font-size: 1.2em; font-weight: 700; color: var(--price-color); }
.forsale-seller { font-size: .82em; color: var(--text-dim); }
.forsale-acts { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }
.age-tag { font-size: .75em; color: var(--text-dim); }
.age-old { color: var(--amber); }
.forsale-section { margin-bottom: 2rem; }

/* ===========================
   BADGE DETAIL (badge.php)
   =========================== */

.badge-detail-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  align-items: start;
}
.badge-detail-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1rem;
}
/* Constrain tall images (e.g. necklaces) so they don't break the layout */
.badge-detail-card .badge-thumb img {
  max-height: 260px;
  width: auto;
  max-width: 100%;
  cursor: zoom-in;
}
/* Lightbox overlay */
#img-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#img-lightbox.open { display: flex; }
#img-lightbox img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 8px;
  cursor: default;
}
.badge-gallery {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--surface-border);
}
.gallery-thumb {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border: 2px solid var(--surface-border);
  border-radius: 8px;
  background: var(--surface-1);
  overflow: hidden;
  cursor: pointer;
  padding: 0;
  transition: border-color .15s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.gallery-thumb:hover { border-color: var(--text-muted); }
.gallery-thumb.active { border-color: var(--orange); }
.badge-detail-dl {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: .35rem .85rem;
  margin: 0;
}
.badge-detail-dl dt { color: var(--text-muted); }
.badge-detail-dl dd { color: var(--text-primary); }
.badge-forsale-item {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: .4rem .75rem;
  font-size: .88em;
}
.sim-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.sim-item {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  background: var(--surface-1);
  overflow: hidden;
  display: block;
  transition: border-color .2s;
}
.sim-item:hover { border-color: var(--orange); }
.sim-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.detail-wrap { width: 100%; }

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

/* ===========================
   SWAP OFFER (swap_offer.php)
   =========================== */

.offer-page { max-width: 760px; margin: 0 auto; }
.offer-badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}
.offer-badge-card {
  position: relative;
  border: 2px solid var(--surface-border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface-1);
  transition: border-color .15s;
}
.offer-badge-card:has(input:checked) { border-color: var(--green); background: rgba(34,197,94,0.1); }
.offer-badge-card input[type=checkbox] { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; margin: 0; }
.offer-badge-card img { width: 100%; aspect-ratio: 1/1; object-fit: contain; display: block; }
.offer-badge-card .obc-name { font-size: .76em; padding: .3rem .4rem; text-align: center; line-height: 1.2; color: var(--text-primary); }
.offer-badge-card .obc-check {
  position: absolute;
  top: .3rem;
  right: .3rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--green);
  color: #000;
  font-size: .7em;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .15s;
}
.offer-badge-card:has(input:checked) .obc-check { opacity: 1; }
.requested-badge-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: .75rem 1rem;
  margin-bottom: 1.5rem;
}
.requested-badge-card img { width: 80px; height: 80px; object-fit: contain; border-radius: 8px; background: var(--surface-2); }
.offer-status { display: inline-block; padding: .2rem .6rem; border-radius: 6px; font-size: .82em; font-weight: 600; }
.offer-status.pending  { background: rgba(251,191,36,.2);  color: var(--amber); }
.offer-status.accepted { background: rgba(34,197,94,.2);   color: var(--green); }
.offer-status.declined, .offer-status.withdrawn { background: rgba(239,68,68,.15); color: var(--red); }

/* ===========================
   LOGIN / REGISTER
   =========================== */

.google-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #4285f4;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: background .2s;
  border: none;
  cursor: pointer;
}
.google-login-btn:hover { background: #3367d6; }

/* ===========================
   ADMIN PAGES
   =========================== */

/* Admin nav styles now inline in admin_nav.php */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.dash-stat {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 1.1rem;
  text-align: center;
}
.dash-stat .ds-value { font-size: 2rem; font-weight: 800; color: var(--orange); line-height: 1; }
.dash-stat .ds-label { font-size: .82em; color: var(--text-dim); margin-top: .35rem; font-family: var(--font-mono); }
.dash-stat-alert { border-color: rgba(239,68,68,0.3); }
.dash-stat-alert .ds-value { color: var(--red); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9em; }
.data-table th, .data-table td { padding: .65rem .85rem; text-align: left; border-bottom: 1px solid var(--surface-border); }
.data-table th { font-size: .78em; font-family: var(--font-mono); color: var(--text-dim); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); }
.data-table tr:hover td { background: var(--surface-1); }
.status-pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .78em; font-weight: 600; }
.s-active     { background: rgba(34,197,94,0.15);  color: var(--green); }
.s-restricted { background: rgba(245,158,11,0.15); color: var(--amber); }
.s-banned     { background: rgba(239,68,68,0.15);  color: var(--red); }
.pending-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.pending-card {
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 10px;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.pending-card img { width: 100%; height: 160px; object-fit: contain; border-radius: 8px; background: var(--surface-2); }

/* ===========================
   REPORT PAGE
   =========================== */

.report-form { max-width: 520px; display: flex; flex-direction: column; gap: 1rem; }
.report-form select, .report-form textarea {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--input-color);
  padding: .5rem .75rem;
  font: inherit;
  box-sizing: border-box;
}

/* ===========================
   REVIEW PAGE
   =========================== */

.review-form { max-width: 480px; display: flex; flex-direction: column; gap: 1rem; }
.star-rating { display: flex; gap: .25rem; font-size: 1.5rem; cursor: pointer; }
.star-rating .s { color: var(--star-empty); transition: color .15s; }
.star-rating .s.on { color: var(--amber); }

/* ===========================
   UTILITY
   =========================== */

.text-muted { color: var(--text-muted); }
.text-dim   { color: var(--text-dim); }
.text-success { color: var(--green); }
.text-error   { color: var(--red); }
.text-warning { color: var(--amber); }
.price-tag  { color: var(--price-color); font-weight: 700; }
.section-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 1.25rem; flex-wrap: wrap; gap: .75rem; }

/* Profile badge match / photo recognition */
.match-card {
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  padding: .75rem;
}
.match-card .meta {
  white-space: pre-line;
  color: var(--text-muted);
  font-size: .9em;
  margin: .5rem 0;
}
.match-thumb {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: var(--surface-1);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  margin-bottom: .6rem;
  display: block;
}
.btn-add-have {
  display: block;
  width: 100%;
  padding: .4rem .8rem;
  border: none;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-size: .88em;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
  font-family: var(--font-display);
}
.btn-add-have:hover { opacity: .85; }
.btn-add-have:disabled { opacity: .5; cursor: not-allowed; }
/* Pending badge submit form */
#noneOfThese { margin-top: 1rem; width: 100%; }
.none-form { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.none-form textarea,
.none-form input[type="text"],
.none-form input[type="number"] {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--input-color);
  padding: .5rem;
  font: inherit;
  resize: vertical;
}
#badgeSearch { margin-top: 1.5rem; width: 100%; }
#badgeSearch input[type="text"] {
  width: 100%;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 8px;
  color: var(--input-color);
  padding: .5rem;
  font: inherit;
  box-sizing: border-box;
}
#badgeSearchResults { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: .75rem; }

/* ===========================
   IPHONE / MOBILE FIXES
   =========================== */

/* Prevent text resize on orientation change */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Remove iOS tap flash on all interactive elements */
a, button, [role="button"], input, select, textarea, label {
  -webkit-tap-highlight-color: transparent;
}

/* Prevent horizontal overflow on all screen sizes */
html, body {
  max-width: 100%;
  overflow-x: clip;
}

/* Sticky header safe-area (notch / Dynamic Island) */
.site-header {
  padding-top: env(safe-area-inset-top);
}
.site-header .inner-navbar {
  height: calc(72px - env(safe-area-inset-top, 0px));
  min-height: 64px;
}

/* Home page fixed navbar safe area */
.navbar {
  padding-top: env(safe-area-inset-top);
  height: calc(72px + env(safe-area-inset-top));
}

/* Mobile menu drops below the (now taller) navbar */
.mobile-menu {
  top: calc(72px + env(safe-area-inset-top));
}

/* Hero padding must clear the taller safe-area navbar */
.hero {
  padding-top: calc(140px + env(safe-area-inset-top));
}

/* Bottom safe area for page body so content clears home indicator */
body {
  padding-bottom: env(safe-area-inset-bottom);
}

/* ── iOS input zoom prevention ─────────────────────────────────────────
   iOS Safari auto-zooms the page when a focused input is < 16px.
   Override all inputs to 16px on mobile so this never happens.          */
@media (max-width: 768px) {
  input, select, textarea,
  .form-input, .form-select, .form-textarea,
  .auth-form input, .auth-form select, .auth-form textarea,
  .filter-sel, .forsale-filters input, .forsale-filters select,
  .reply-form textarea, .report-form select, .report-form textarea,
  .none-form textarea, .none-form input, #badgeSearch input {
    font-size: 16px !important;
  }

  /* Remove iOS default select styling to match our design */
  select, .form-select, .filter-sel, .forsale-filters select {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23888' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .6rem center;
    padding-right: 2rem;
  }

  /* Ensure badge grid is readable: 2 columns on medium phones, 1 on tiny */
  .badge-grid,
  .grid-results,
  .user-grid,
  .new-grid,
  .ml-grid,
  .forsale-grid,
  .pending-grid,
  #badgeSearchResults {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  /* Badge detail description list — switch to stacked on small screens */
  .badge-detail-dl {
    grid-template-columns: 1fr;
    gap: .15rem .5rem;
  }
  .badge-detail-dl dt {
    margin-top: .5rem;
    font-size: .9em;
    text-transform: uppercase;
    letter-spacing: .04em;
  }
  .badge-detail-dl dd { margin: 0; }

  /* Make action buttons easier to tap (44px minimum touch target) */
  .badge-actions .act {
    min-height: 44px;
    padding: .4rem .7rem .4rem .55rem;
    font-size: .85em;
  }

  /* Segmented button rows — allow wrapping */
  .btn-seg {
    flex-wrap: wrap;
    border-radius: 8px;
  }
  .btn-seg-item {
    min-height: 44px;
    border-right: none;
    border-bottom: 1px solid var(--surface-border);
  }
  .btn-seg-item:last-child { border-bottom: none; }

  /* Swap-offer and trade action buttons */
  .so-acts > *, .forsale-acts > *, .ml-acts > * {
    min-height: 44px;
  }

  /* Profile header — stack vertically */
  .user-profile-header {
    flex-direction: column;
    align-items: flex-start;
  }

  /* Notification card time — allow wrap */
  .notif-card {
    flex-wrap: wrap;
  }
  .notif-time {
    width: 100%;
    margin-top: .25rem;
  }

  /* Conversation reply textarea easier to use */
  .reply-form textarea {
    min-height: 100px;
  }

  /* Data table horizontal scroll on small screens */
  .data-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Admin nav responsive handled in admin_nav.php */

  /* Feature / stats grids readable at 2 col */
  .features-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Form max-width: full width on mobile */
  .form, .auth-form, .review-form, .report-form, .add-badge-box {
    max-width: 100%;
  }

  /* Inner subnav smooth scroll on iOS */
  .inner-subnav {
    -webkit-overflow-scrolling: touch;
  }

  /* Site main — tighter horizontal padding on phones */
  .site-main {
    padding: 1rem;
  }
}

/* ===========================
   NAV USER DROPDOWN
   =========================== */

.nav-icon-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 17px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.nav-icon-btn:hover {
  background: rgba(249,115,22,0.12);
  color: var(--orange);
  border-color: rgba(249,115,22,0.25);
}
.nav-icon-btn .nav-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--orange);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  border: 2px solid var(--bg);
  line-height: 1;
}
.nav-icon-btn .nav-badge-alert { background: var(--amber); }

.nav-avatar-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.nav-avatar-btn:hover {
  background: rgba(249,115,22,0.1);
  border-color: rgba(249,115,22,0.25);
  color: var(--text-primary);
}
.nav-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.nav-avatar-initials {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--orange), var(--red));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.nav-avatar-name {
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 768px) {
  .nav-avatar-name { display: none; }
}
.nav-avatar-chevron {
  font-size: 10px;
  opacity: .5;
  margin-left: 1px;
  transition: transform 0.2s;
}
.nav-user-wrap {
  position: relative;
}
.nav-user-wrap.open .nav-avatar-chevron { transform: rotate(180deg); }

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: var(--mobile-menu-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.35);
  padding: .45rem;
  z-index: 200;
  display: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: slideDown .15s ease;
}
.nav-user-wrap.open .nav-dropdown { display: block; }

.nav-dropdown-header {
  padding: .55rem .75rem .45rem;
  font-size: .8rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: .35rem;
}
.nav-dropdown-header strong {
  display: block;
  font-size: .95rem;
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 1px;
}

.nav-dropdown a,
.nav-dropdown button.nav-dd-item {
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .52rem .75rem;
  border-radius: 9px;
  font-size: .9rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-weight: 500;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  transition: background .15s, color .15s;
  text-decoration: none;
}
.nav-dropdown a:hover,
.nav-dropdown button.nav-dd-item:hover {
  background: rgba(249,115,22,0.1);
  color: var(--orange);
}
.nav-dropdown a.danger,
.nav-dropdown button.nav-dd-item.danger {
  color: var(--red);
}
.nav-dropdown a.danger:hover { background: rgba(239,68,68,.1); color: var(--red); }

.nav-dd-divider {
  height: 1px;
  background: var(--glass-border);
  margin: .35rem .45rem;
}
.nav-dd-icon { font-size: 1em; width: 18px; text-align: center; flex-shrink: 0; }
.nav-dd-badge {
  margin-left: auto;
  background: var(--orange);
  color: #fff;
  font-size: .7rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.nav-dd-badge.alert { background: var(--amber); }

/* ===========================
   NAV v2 — teal/light redesign
   =========================== */

:root {
  --teal: #0d9488;
  --teal-50: rgba(20,184,166,0.08);
  --teal-100: rgba(20,184,166,0.15);
}

/* White header in light mode */
[data-theme="light"] .site-header {
  background: #ffffff;
  border-bottom: 1px solid #e4e4e7;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Teal logo icon in light mode */
[data-theme="light"] .inner-logo-icon {
  background: #14b8a6;
  box-shadow: 0 4px 12px rgba(20,184,166,0.2);
}

/* Logo two-line stack */
.inner-logo-words {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.inner-logo-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.1;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
[data-theme="light"] .inner-logo-name {
  background: none;
  -webkit-text-fill-color: #09090b;
  color: #09090b;
}
.inner-logo-tld {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal);
  line-height: 1;
}

/* Nav links: dark zinc text + teal hover in light mode */
[data-theme="light"] .inner-nav-links a { color: #3f3f46; }
[data-theme="light"] .inner-nav-links a:hover,
[data-theme="light"] .inner-nav-links a.active {
  background: var(--teal-100);
  color: var(--teal);
}

/* Search bar light mode */
[data-theme="light"] .inner-nav-search {
  background: #f4f4f5;
  border-color: #d4d4d8;
}
[data-theme="light"] .inner-nav-search:focus-within {
  background: #fff;
  border-color: #14b8a6;
}
[data-theme="light"] .inner-nav-search input { color: #09090b; }

/* Login button */
.nav-login-btn {
  display: inline-flex;
  align-items: center;
  padding: 7px 18px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-display);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
}
[data-theme="light"] .nav-login-btn {
  border-color: #d4d4d8;
  color: #27272a;
}
.nav-login-btn:hover {
  background: var(--teal-50);
  border-color: var(--teal);
  color: var(--teal);
}
@media (max-width: 900px) {
  .nav-login-btn { display: none; }
}

/* Homepage full-bleed wrapper */
.hp-main { max-width: none; padding: 0; margin: 0; }

/* ===========================
   SITE FOOTER
   =========================== */

.site-footer {
  background: var(--surface-1);
  border-top: 1px solid var(--glass-border);
  margin-top: 4rem;
}

.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.5rem;
}

.footer-brand p {
  font-size: .85rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-top: .6rem;
  max-width: 220px;
}
.footer-brand .footer-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--orange), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  width: fit-content;
}
.footer-brand .footer-logo-icon {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--orange), var(--red), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  -webkit-text-fill-color: initial;
}
.footer-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: .9rem;
  padding: .3rem .7rem;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  font-size: .75rem;
  color: var(--text-dim);
  width: fit-content;
}

.footer-col h4 {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-dim);
  margin-bottom: .9rem;
}
.footer-col a {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .88rem;
  color: var(--text-muted);
  padding: .22rem 0;
  transition: color .15s;
  text-decoration: none;
}
.footer-col a:hover { color: var(--orange); }

.footer-bottom {
  border-top: 1px solid var(--glass-border);
  padding: 1.1rem 1.5rem;
}
.footer-bottom-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
  font-size: .8rem;
  color: var(--text-dim);
}
.footer-bottom-inner a {
  color: var(--text-dim);
  transition: color .15s;
}
.footer-bottom-inner a:hover { color: var(--text-muted); }
.footer-bottom-right {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

@media (max-width: 900px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 2rem 1.5rem;
  }
  .footer-brand { grid-column: 1 / -1; }
  .footer-brand p { max-width: 100%; }
}
@media (max-width: 600px) {
  .site-footer-inner { grid-template-columns: 1fr 1fr; padding: 2rem 1rem 1.5rem; gap: 1.5rem 1rem; }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; gap: .35rem; }
  .footer-bottom-right { flex-wrap: wrap; gap: .75rem; }
}

/* Extra small phones (iPhone SE, etc.) */
@media (max-width: 390px) {
  .badge-grid,
  .grid-results,
  .user-grid,
  .new-grid,
  .ml-grid,
  .forsale-grid,
  .pending-grid {
    grid-template-columns: 1fr;
  }

  /* Swap-offer badge picker — 3 cols on tiny screens */
  .offer-badge-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── Mobile Scan FAB ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #scan-fab { display: flex !important; }
  #scan-fab:active { transform: scale(0.92); }
}
