/*
  Tomo List V1 shared styles.
  Keep page-specific layouts inline or in their own files, but put repeated theme,
  dark-mode, nav, card, form, scrollbar, and geometric background rules here.
*/

:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --nav-bg: #4f46e5;
  --nav-hover: #6366f1;
  --nav-pill-bg: rgba(255, 255, 255, 0.12);
  --nav-pill-border: rgba(255, 255, 255, 0.22);
  --nav-pill-shadow: rgba(30, 27, 75, 0.18);
  --card-outline: rgba(0, 0, 0, 0.06);
  --shape: rgba(0, 0, 0, 0.04);
}

.dark-mode {
  --bg: #0f172a;
  --card: #111827;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --nav-bg: #4f46e5;
  --nav-hover: #6366f1;
  --nav-pill-bg: rgba(255, 255, 255, 0.13);
  --nav-pill-border: rgba(255, 255, 255, 0.2);
  --nav-pill-shadow: rgba(2, 6, 23, 0.28);
  --card-outline: rgba(255, 255, 255, 0.12);
  --shape: rgba(255, 255, 255, 0.03);
}

html {
  font-size: 18px;
}

body {
  font-size: 1rem;
}

h1,
h2,
h3,
h4 {
  font-weight: 700;
}

h2 {
  font-size: 1.6rem;
}

h3 {
  font-size: 1.3rem;
}

.text-xs {
  font-size: 0.85rem !important;
}

.text-sm,
nav a {
  font-size: 0.95rem !important;
}

.rating-large {
  font-size: 1.4rem;
  font-weight: 700;
}

.card-center {
  text-align: center;
}

body,
.bg-gray-50,
.bg-white,
.bg-gray-100 {
  background-color: var(--bg) !important;
}

.bg-white {
  background-color: var(--card) !important;
}

.bg-indigo-600 {
  background-color: var(--nav-bg) !important;
}

.text-gray-900,
.text-gray-800,
main,
main h1,
main h2,
main h3,
main p {
  color: var(--text) !important;
}

.text-gray-500,
.text-gray-600 {
  color: var(--muted) !important;
}

body,
.bg-white,
.bg-gray-50,
.bg-gray-100,
.bg-indigo-600,
.text-gray-900,
.text-gray-800,
.text-gray-500 {
  transition: background-color 320ms ease, color 320ms ease;
}

.no-transitions *,
.no-transitions {
  transition: none !important;
}

.home-card,
.card-outline {
  border: 1px solid var(--card-outline) !important;
}

html.dark-mode body,
html.dark-mode body * {
  color: var(--text) !important;
}

html.dark-mode nav,
html.dark-mode nav *,
html:not(.dark-mode) nav,
html:not(.dark-mode) nav *,
html:not(.dark-mode) .bg-indigo-600,
html:not(.dark-mode) .bg-indigo-600 *,
html:not(.dark-mode) .text-white {
  color: white !important;
}

html.dark-mode .text-indigo-600,
html.dark-mode .text-indigo-500,
html.dark-mode a.text-indigo-600 {
  color: var(--nav-bg) !important;
}

html.dark-mode .bg-gradient-to-br,
html.dark-mode .from-gray-50,
html.dark-mode .to-gray-100,
html.dark-mode .from-white,
html.dark-mode .to-white,
html.dark-mode .from-gray-100,
html.dark-mode .to-gray-50 {
  background-image: none !important;
  background-color: var(--card) !important;
}

html.dark-mode input,
html.dark-mode input[type="text"],
html.dark-mode input[type="search"],
html.dark-mode input[type="email"],
html.dark-mode input[type="password"],
html.dark-mode input[type="number"],
html.dark-mode textarea,
html.dark-mode select,
html.dark-mode .rating-slider,
html.dark-mode .search-result,
html.dark-mode .home-card,
html.dark-mode .bg-white {
  background-color: var(--card) !important;
  color: var(--text) !important;
  border-color: #374151 !important;
  caret-color: var(--text) !important;
}

html.dark-mode ::placeholder {
  color: #9ca3af !important;
}

html.dark-mode ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

html.dark-mode ::-webkit-scrollbar-track {
  background: #0f172a;
}

html.dark-mode ::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
  border: 3px solid #0f172a;
}

html.dark-mode ::-webkit-scrollbar-thumb:hover {
  background: #475569;
}

html.dark-mode body {
  scrollbar-color: #334155 #0f172a;
  scrollbar-width: auto;
}

.geobg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  mix-blend-mode: normal;
  opacity: 1;
}

.geobg svg {
  width: 100%;
  height: 100%;
  display: block;
}

.geobg .soft-blur {
  filter: blur(6px);
  transform-origin: center;
}

.geobg svg * {
  will-change: transform;
  transform-box: fill-box;
  transform-origin: center;
}

nav {
  position: relative;
  z-index: 80;
  overflow: visible !important;
}

.afh-nav-inner {
  min-height: 4.35rem;
  overflow: visible !important;
}

.afh-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: white !important;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-decoration: none;
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--nav-pill-border);
  box-shadow: 0 10px 24px var(--nav-pill-shadow);
}

.afh-nav-links {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.afh-nav-link,
.afh-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: white !important;
  border: 1px solid var(--nav-pill-border);
  border-radius: 999px;
  background: var(--nav-pill-bg);
  padding: 0.58rem 0.95rem;
  font-size: 0.95rem !important;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px var(--nav-pill-shadow);
  backdrop-filter: blur(8px);
  transition: background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.afh-nav-link svg,
.afh-nav-button svg {
  width: 1.05rem;
  height: 1.05rem;
  flex: 0 0 auto;
}

.afh-nav-link:hover,
.afh-nav-button:hover,
.afh-nav-link.bg-indigo-700,
.afh-nav-menu:hover > .afh-nav-button,
.afh-nav-menu:focus-within > .afh-nav-button {
  background: rgba(255, 255, 255, 0.24);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 14px 30px rgba(30, 27, 75, 0.26);
  transform: translateY(-1px);
}

.afh-nav-menu {
  position: relative;
  padding-block: 0.35rem;
}

.afh-nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 14rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1.25rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.07)),
    var(--nav-bg);
  box-shadow: 0 22px 56px rgba(2, 6, 23, 0.34);
  padding: 0.65rem;
  display: block;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transform: translateY(0.35rem) scale(0.98);
  transform-origin: top right;
  transition: opacity 160ms ease, transform 160ms ease;
  backdrop-filter: blur(12px);
}

.afh-nav-dropdown::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -0.55rem;
  height: 0.65rem;
}

.afh-user-menu .afh-nav-dropdown {
  right: 0;
}

.afh-nav-menu:hover .afh-nav-dropdown,
.afh-nav-menu:focus-within .afh-nav-dropdown,
.afh-nav-menu.open .afh-nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0.15rem) scale(1);
}

.afh-nav-dropdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 999px;
  padding: 0.68rem 0.9rem;
  margin: 0.18rem 0;
  color: white !important;
  text-decoration: none;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 22px rgba(30, 27, 75, 0.16);
}

.afh-nav-dropdown a:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.38);
}

.afh-nav-user {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: white !important;
  font-weight: 800;
  white-space: nowrap;
  min-width: 0;
}

.afh-user-menu .afh-nav-user span:not([aria-hidden]):not(.afh-avatar):not(.afh-equipped-symbol) {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.afh-nav-user .afh-equipped-symbol {
  flex: 0 0 auto;
  max-width: none;
  overflow: visible !important;
}

.afh-mobile-panel {
  position: relative;
  z-index: 55;
}

.afh-mobile-panel a {
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  margin-bottom: 0.45rem;
}

.afh-mobile-panel a:hover,
.afh-mobile-panel a.bg-indigo-700 {
  background: rgba(255, 255, 255, 0.2) !important;
}

.max-w-7xl,
main,
body > .max-w-md {
  position: relative;
  z-index: 1;
}

.rank-gold,
.rank-silver,
.rank-bronze {
  color: inherit !important;
}

.search-result.bg-gray-100 {
  background-color: rgba(79, 70, 229, 0.16) !important;
}

.search-result:hover {
  background-color: #f3f4f6;
}

html.dark-mode .search-result.bg-gray-100 {
  background-color: rgba(96, 165, 250, 0.18) !important;
  border-color: rgba(96, 165, 250, 0.7) !important;
}

html.dark-mode .search-result.bg-gray-100 img {
  opacity: 0.95;
}

.rating-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #e5e7eb;
  outline: none;
}

.rating-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
}

html.dark-mode .rating-slider {
  background: #374151 !important;
}

html.dark-mode .rating-slider::-webkit-slider-thumb {
  background: #60a5fa !important;
}

#toast-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

#toast-container .toast {
  pointer-events: auto;
  min-width: 220px;
  max-width: 320px;
  padding: 0.6rem 0.8rem;
  border-radius: 0.5rem;
  box-shadow: 0 6px 18px rgba(2, 6, 23, 0.12);
  background: var(--card);
  color: var(--text);
  border-left: 4px solid #34d399;
  transform: translateY(-8px);
  opacity: 0;
  transition: opacity 260ms ease, transform 260ms ease;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#toast-container .toast.error {
  border-left-color: #f87171;
}

html.dark-mode #toast-container .toast {
  background: #0b1220;
  color: var(--text);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}

.auth-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(6px);
}

body.auth-page-locked main,
body.auth-page-locked > .max-w-7xl,
body.auth-page-locked > .max-w-4xl,
body.auth-page-locked > .max-w-md {
  filter: blur(5px);
  pointer-events: none;
  user-select: none;
}

.auth-modal {
  width: min(100%, 440px);
  border: 1px solid var(--card-outline);
  border-radius: 1rem;
  background: var(--card);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.38);
  padding: 1.25rem;
}

.auth-modal h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.auth-modal p {
  margin: 0.65rem 0 1rem;
  color: var(--muted) !important;
}

.auth-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: flex-end;
}

.auth-modal-actions a,
.auth-modal-actions button {
  border: 0;
  border-radius: 0.6rem;
  padding: 0.65rem 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

.auth-modal-primary {
  background: var(--nav-bg);
  color: white !important;
}

.auth-modal-secondary {
  background: rgba(79, 70, 229, 0.12);
  color: var(--text) !important;
}

.auth-modal-cancel {
  background: transparent;
  color: var(--muted) !important;
}

@media (max-width: 640px) {
  .geobg {
    opacity: 0.7;
  }

  .geobg .soft-blur {
    filter: blur(4px);
  }
}

/* ── Contrast & readability fixes ────────────────────────────────────────────
   These rules are ordered from broad → narrow. !important overrides are
   intentional — they correct specific WCAG AA failures and dark-mode
   colour-wash issues caused by the broad `body *` dark-mode rule above.
   ────────────────────────────────────────────────────────────────────────── */

/* 1. text-gray-400 (#9ca3af on white = 2.85:1, fails WCAG AA for normal text)
      → upgrade to var(--muted) which is #6b7280 in light (4.6:1 ✓) and
        #9ca3af in dark (4.7:1 on dark card ✓) */
.text-gray-400 { color: var(--muted) !important; }

/* 2. text-indigo-600 in dark mode:  #4f46e5 on #111827 ≈ 3:1 — fails AA
      → lighten to #818cf8 ≈ 9:1 ✓ */
html.dark-mode .text-indigo-600,
html.dark-mode .text-indigo-500,
html.dark-mode a.text-indigo-600,
html.dark-mode a.text-indigo-500 { color: #818cf8 !important; }

/* 3. Progress / bar tracks — rgba(0,0,0,0.08) is invisible on dark backgrounds */
html.dark-mode .ach-progress-track { background: rgba(255,255,255,0.12) !important; }
html.dark-mode .score-bar-track    { background: rgba(255,255,255,0.10) !important; }

/* 4. Search result hover in dark mode — hardcoded light hover colour */
html.dark-mode .search-result:hover { background-color: rgba(96,165,250,0.12) !important; }

/* 5. Score / rating accent colours in dark mode → lighter indigo for legibility */
html.dark-mode .rv-score      { color: #818cf8 !important; }
html.dark-mode .score-bar-val { color: #818cf8 !important; }
html.dark-mode .top-score     { color: #818cf8 !important; }

/* 6. Feed tab active in dark mode */
html.dark-mode .feed-tab.active { color: #818cf8 !important; }

/* 7. Like button filled state in dark mode */
html.dark-mode .action-btn.liked {
  color: #f9a8d4 !important;
  border-color: rgba(249,168,212,0.4) !important;
}

/* 8. Tier-list vis popover — hardcoded #fff bg with forced white text = invisible */
html.dark-mode .tl-vis-popover {
  background: var(--card) !important;
  border-color: var(--card-outline) !important;
}
html.dark-mode .tl-vis-option { color: var(--text) !important; }

/* ── Vis chips — dark mode
      Pale bg (e.g. #d1fae5) + forced white text = 1:1 contrast → FAIL.
      Replace with tinted dark bg + readable light-toned text. ────────────── */
html.dark-mode .vis-chip.vis-public,
html.dark-mode .vis-badge.vis-public {
  background: rgba(16,185,129,0.18) !important;
  color: #6ee7b7 !important;
}
html.dark-mode .vis-chip.vis-friends,
html.dark-mode .vis-badge.vis-friends {
  background: rgba(59,130,246,0.18) !important;
  color: #93c5fd !important;
}
html.dark-mode .vis-chip.vis-private,
html.dark-mode .vis-badge.vis-private {
  background: rgba(156,163,175,0.12) !important;
  color: #9ca3af !important;
}

/* Tier list vis chips */
html.dark-mode .tl-vis-chip.tl-vis-public  { background: rgba(16,185,129,0.18) !important; color: #6ee7b7 !important; }
html.dark-mode .tl-vis-chip.tl-vis-friends { background: rgba(59,130,246,0.18) !important; color: #93c5fd !important; }
html.dark-mode .tl-vis-chip.tl-vis-private { background: rgba(156,163,175,0.12) !important; color: #9ca3af !important; }

/* rate-review vis chip row (active selected state) */
html.dark-mode .rr-vis-chip.rr-vis-public.active {
  background: rgba(16,185,129,0.18) !important;
  color: #6ee7b7 !important;
  border-color: rgba(110,231,183,0.4) !important;
}
html.dark-mode .rr-vis-chip.rr-vis-friends.active {
  background: rgba(59,130,246,0.18) !important;
  color: #93c5fd !important;
  border-color: rgba(147,197,253,0.4) !important;
}
html.dark-mode .rr-vis-chip.rr-vis-private.active {
  background: rgba(156,163,175,0.12) !important;
  color: #9ca3af !important;
  border-color: rgba(156,163,175,0.3) !important;
}

/* watchlists new-list modal vis chip row */
html.dark-mode .vis-opt-chip.vis-opt-public.active {
  background: rgba(16,185,129,0.18) !important;
  color: #6ee7b7 !important;
  border-color: rgba(110,231,183,0.4) !important;
}
html.dark-mode .vis-opt-chip.vis-opt-friends.active {
  background: rgba(59,130,246,0.18) !important;
  color: #93c5fd !important;
  border-color: rgba(147,197,253,0.4) !important;
}
html.dark-mode .vis-opt-chip.vis-opt-private.active {
  background: rgba(156,163,175,0.12) !important;
  color: #9ca3af !important;
  border-color: rgba(156,163,175,0.3) !important;
}

/* inactive vis opt chips in dark mode */
html.dark-mode .vis-opt-chip:not(.active) {
  background: rgba(255,255,255,0.06) !important;
  color: var(--muted) !important;
}

/* ── Sentiment pills (review.html) — dark mode ───────────────────────────── */
html.dark-mode .sentiment-pill.sentiment-up {
  background: rgba(16,185,129,0.18) !important;
  color: #6ee7b7 !important;
}
html.dark-mode .sentiment-pill.sentiment-neutral {
  background: rgba(245,158,11,0.18) !important;
  color: #fcd34d !important;
}
html.dark-mode .sentiment-pill.sentiment-down {
  background: rgba(239,68,68,0.18) !important;
  color: #fca5a5 !important;
}

/* Sentiment bare text colours in home.html (no background pill) */
html.dark-mode .sentiment-up      { color: #6ee7b7 !important; }
html.dark-mode .sentiment-neutral  { color: #fcd34d !important; }
html.dark-mode .sentiment-down    { color: #fca5a5 !important; }

/* ── Avatar initials — keep white on coloured backgrounds ────────────────── */
html.dark-mode .c-avatar,
html.dark-mode .rv-avatar,
html.dark-mode .afh-avatar { color: #fff !important; }

/* ── Redesigned nav (v2) ──────────────────────────────────────────────────── */

.afh-nav-root {
  position: relative;
  z-index: 80;
  overflow: visible !important;
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 50%, #6366f1 100%);
  box-shadow: 0 4px 24px rgba(67, 56, 202, 0.35), 0 1px 0 rgba(255,255,255,0.08) inset;
}

/* subtle animated shimmer on the bottom edge */
.afh-nav-root::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.25), transparent);
}

.afh-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 4.2rem;
  overflow: visible !important;
  gap: 0.75rem;
}

.afh-nav-center {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  justify-content: center;
}

.afh-nav-end {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

/* caret triangle */
.afh-caret {
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255,255,255,0.7);
  margin-left: 0.1rem;
  transition: transform 180ms ease;
  flex-shrink: 0;
}

.afh-nav-menu:hover > .afh-nav-button .afh-caret,
.afh-nav-menu:focus-within > .afh-nav-button .afh-caret {
  transform: rotate(180deg);
}

/* active link */
.afh-nav-active,
.afh-nav-link.afh-nav-active {
  background: rgba(255, 255, 255, 0.28) !important;
  border-color: rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.2), 0 8px 20px rgba(30,27,75,0.22) !important;
}

/* CTA Sign Up button */
.afh-nav-cta {
  background: white !important;
  color: #4338ca !important;
  border-color: white !important;
  font-weight: 900;
}

.afh-nav-cta:hover {
  background: #e0e7ff !important;
  border-color: #e0e7ff !important;
  transform: translateY(-1px);
}

html.dark-mode nav .afh-nav-cta,
html:not(.dark-mode) nav .afh-nav-cta {
  color: #4338ca !important;
}

/* Admin badge */
.afh-nav-admin {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.4) !important;
}

.afh-nav-admin:hover {
  background: rgba(239, 68, 68, 0.30) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
}

/* avatar initials circle */
.afh-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 900;
  color: white !important;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.afh-avatar img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.rv-avatar img,
.c-avatar img,
.profile-avatar-lg img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

.afh-equipped-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.35);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  overflow: hidden;
}

.afh-equipped-symbol svg {
  width: 0.78rem;
  height: 0.78rem;
  stroke-width: 2.6;
}

.afh-equipped-symbol.afh-equipped-standalone svg {
  width: calc(1rem * var(--badge-standalone-size, 1)) !important;
  height: calc(1rem * var(--badge-standalone-size, 1)) !important;
}

.afh-equipped-symbol.afh-equipped-standalone {
  width: 2.65rem !important;
  height: 2.65rem !important;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  overflow: visible;
  background: transparent !important;
}

.afh-equipped-symbol.afh-equipped-standalone.afh-equipped-standalone-bg {
  border-radius: 0.65rem;
  background: var(--badge-standalone-bg, #6366f1) !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.16);
}

.afh-equipped-symbol.afh-equipped-standalone .badge-custom-image {
  width: calc(2.25rem * var(--badge-standalone-size, 1)) !important;
  height: calc(2.25rem * var(--badge-standalone-size, 1)) !important;
  max-width: none;
  max-height: none;
  border-radius: 0 !important;
  clip-path: none;
  object-fit: contain !important;
}

.badge-custom-image {
  width: 1em;
  height: 1em;
  border-radius: inherit;
  object-fit: cover;
  display: inline-block;
  flex-shrink: 0;
  transform-origin: center;
}

.role-badge,
.equipped-badge-pill,
.badge-pill {
  overflow: hidden;
}

.afh-nav-username-label {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* user dropdown specifics */
.afh-user-dropdown {
  min-width: 13rem;
}

.afh-dropdown-divider {
  height: 1px;
  background: rgba(255,255,255,0.15);
  margin: 0.3rem 0;
}

.afh-logout-link {
  color: rgba(255,200,200,0.9) !important;
}

.afh-logout-link:hover {
  background: rgba(239,68,68,0.18) !important;
  border-color: rgba(239,68,68,0.3) !important;
  color: #fca5a5 !important;
}

/* hamburger */
.afh-hamburger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.6rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white !important;
  cursor: pointer;
  transition: background 180ms ease;
}

.afh-hamburger:hover {
  background: rgba(255,255,255,0.2);
}

.afh-hamburger svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* mobile panel */
.afh-mobile-panel {
  position: relative;
  z-index: 55;
  background: linear-gradient(180deg, #4338ca, #3730a3);
  padding: 0.75rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.afh-mobile-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: white !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.6rem 0.9rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  transition: background 160ms ease;
}

.afh-mobile-link:hover {
  background: rgba(255,255,255,0.18);
}

.afh-mobile-link svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

/* ── Average chip on review cards ─────────────────────────────────────────── */
.rv-avg-chip {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.2);
  color: #4f46e5;
  font-weight: 600;
}

html.dark-mode .rv-avg-chip {
  background: rgba(99, 102, 241, 0.25);
  color: #818cf8;
}

/* ── Review cover placeholder icon visibility ───────────────────────────────── */
.rv-cover-placeholder i {
  opacity: 0.7 !important;
}

html.dark-mode .rv-cover-placeholder i {
  opacity: 0.8 !important;
}

/* ── Admin page light backgrounds ───────────────────────────────────────────── */
.admin-icon-bg {
  background: rgba(99, 102, 241, 0.25) !important;
}
.admin-icon-bg i {
  color: #4f46e5 !important;
}

.admin-count-badge {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #4f46e5 !important;
}

.admin-ach-icon-bg {
  background: rgba(245, 158, 11, 0.25) !important;
}
.admin-ach-icon-bg i {
  color: #d97706 !important;
}

.admin-ach-count-badge {
  background: rgba(245, 158, 11, 0.2) !important;
  color: #d97706 !important;
}

.admin-theme-icon-bg {
  background: rgba(16, 185, 129, 0.25) !important;
}
.admin-theme-icon-bg i {
  color: #059669 !important;
}

.admin-theme-count-badge {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #059669 !important;
}

html.dark-mode .admin-icon-bg {
  background: rgba(99, 102, 241, 0.3) !important;
}
html.dark-mode .admin-icon-bg i {
  color: #818cf8 !important;
}
html.dark-mode .admin-count-badge {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #818cf8 !important;
}
html.dark-mode .admin-ach-icon-bg {
  background: rgba(245, 158, 11, 0.3) !important;
}
html.dark-mode .admin-ach-icon-bg i {
  color: #fbbf24 !important;
}
html.dark-mode .admin-ach-count-badge {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}
html.dark-mode .admin-theme-icon-bg {
  background: rgba(16, 185, 129, 0.3) !important;
}
html.dark-mode .admin-theme-icon-bg i {
  color: #34d399 !important;
}
html.dark-mode .admin-theme-count-badge {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
}

/* ── Groups page light backgrounds ─────────────────────────────────────────── */
.group-code-chip {
  background: rgba(79, 70, 229, 0.2) !important;
  color: #4f46e5 !important;
}

.group-delete-btn {
  background: rgba(239, 68, 68, 0.2) !important;
  color: #dc2626 !important;
}

.group-row-active {
  background: rgba(79, 70, 229, 0.2) !important;
  border-color: rgba(79, 70, 229, 0.4) !important;
}

.role-owner-badge {
  background: rgba(245, 158, 11, 0.25) !important;
  color: #d97706 !important;
}

.role-admin-badge {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #dc2626 !important;
}

.role-member-badge {
  background: rgba(79, 70, 229, 0.2) !important;
  color: #4f46e5 !important;
}

.group-public-chip {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #059669 !important;
}

.group-private-chip {
  background: rgba(100, 116, 139, 0.2) !important;
  color: #64748b !important;
}

.group-joined-chip {
  background: rgba(79, 70, 229, 0.2) !important;
  color: #4f46e5 !important;
}

html.dark-mode .group-code-chip {
  background: rgba(79, 70, 229, 0.25) !important;
  color: #818cf8 !important;
}
html.dark-mode .group-delete-btn {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
}
html.dark-mode .group-row-active {
  background: rgba(79, 70, 229, 0.25) !important;
  border-color: rgba(79, 70, 229, 0.5) !important;
}
html.dark-mode .role-owner-badge {
  background: rgba(245, 158, 11, 0.3) !important;
  color: #fbbf24 !important;
}
html.dark-mode .role-admin-badge {
  background: rgba(239, 68, 68, 0.3) !important;
  color: #f87171 !important;
}
html.dark-mode .role-member-badge {
  background: rgba(79, 70, 229, 0.25) !important;
  color: #818cf8 !important;
}
html.dark-mode .group-public-chip {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
}
html.dark-mode .group-private-chip {
  background: rgba(100, 116, 139, 0.25) !important;
  color: #94a3b8 !important;
}
html.dark-mode .group-joined-chip {
  background: rgba(79, 70, 229, 0.25) !important;
  color: #818cf8 !important;
}

/* ── Home page light backgrounds ───────────────────────────────────────────── */
.guest-cta-box {
  background: rgba(79, 70, 229, 0.15) !important;
  border-color: rgba(79, 70, 229, 0.3) !important;
}

.feed-tab-active {
  background: rgba(79, 70, 229, 0.2) !important;
  border-color: rgba(79, 70, 229, 0.4) !important;
  color: #4f46e5 !important;
}

.review-cover-placeholder {
  background: rgba(99, 102, 241, 0.2) !important;
}

.watchlist-btn-selected {
  background: rgba(99, 102, 241, 0.2) !important;
  border-color: #4f46e5 !important;
  color: #4f46e5 !important;
}

html.dark-mode .guest-cta-box {
  background: rgba(79, 70, 229, 0.2) !important;
  border-color: rgba(79, 70, 229, 0.4) !important;
}
html.dark-mode .feed-tab-active {
  background: rgba(79, 70, 229, 0.25) !important;
  border-color: rgba(79, 70, 229, 0.5) !important;
  color: #818cf8 !important;
}
html.dark-mode .review-cover-placeholder {
  background: rgba(99, 102, 241, 0.25) !important;
}
html.dark-mode .watchlist-btn-selected {
  background: rgba(99, 102, 241, 0.25) !important;
  border-color: #818cf8 !important;
  color: #818cf8 !important;
}

/* ── Review page light backgrounds ─────────────────────────────────────────── */
.score-bar-track {
  background: rgba(99, 102, 241, 0.2) !important;
}

.review-site-avg-chip {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #4f46e5 !important;
}

html.dark-mode .score-bar-track {
  background: rgba(99, 102, 241, 0.25) !important;
}
html.dark-mode .review-site-avg-chip {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #818cf8 !important;
}

/* ── Sentiment buttons (rate-review) ───────────────────────────────────────── */
.sentiment-btn.active-up {
  border-color: #059669 !important;
  background: rgba(16, 185, 129, 0.2) !important;
  color: #059669 !important;
}
.sentiment-btn.active-neutral {
  border-color: #d97706 !important;
  background: rgba(245, 158, 11, 0.2) !important;
  color: #d97706 !important;
}
.sentiment-btn.active-down {
  border-color: #dc2626 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  color: #dc2626 !important;
}

html.dark-mode .sentiment-btn.active-up {
  border-color: #34d399 !important;
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
}
html.dark-mode .sentiment-btn.active-neutral {
  border-color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.25) !important;
  color: #fbbf24 !important;
}
html.dark-mode .sentiment-btn.active-down {
  border-color: #f87171 !important;
  background: rgba(239, 68, 68, 0.25) !important;
  color: #f87171 !important;
}

/* ── Landing page feature icons ───────────────────────────────────────────── */
.feature-icon-indigo {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #4f46e5 !important;
}
.feature-icon-purple {
  background: rgba(147, 51, 234, 0.2) !important;
  color: #9333ea !important;
}
.feature-icon-pink {
  background: rgba(236, 72, 153, 0.2) !important;
  color: #db2777 !important;
}
.feature-icon-cyan {
  background: rgba(8, 145, 178, 0.2) !important;
  color: #0891b2 !important;
}
.feature-icon-emerald {
  background: rgba(16, 185, 129, 0.2) !important;
  color: #059669 !important;
}
.feature-icon-orange {
  background: rgba(249, 115, 22, 0.2) !important;
  color: #ea580c !important;
}

html.dark-mode .feature-icon-indigo {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #818cf8 !important;
}
html.dark-mode .feature-icon-purple {
  background: rgba(147, 51, 234, 0.25) !important;
  color: #a855f7 !important;
}
html.dark-mode .feature-icon-pink {
  background: rgba(236, 72, 153, 0.25) !important;
  color: #f472b6 !important;
}
html.dark-mode .feature-icon-cyan {
  background: rgba(8, 145, 178, 0.25) !important;
  color: #22d3ee !important;
}
html.dark-mode .feature-icon-emerald {
  background: rgba(16, 185, 129, 0.25) !important;
  color: #34d399 !important;
}
html.dark-mode .feature-icon-orange {
  background: rgba(249, 115, 22, 0.25) !important;
  color: #fb923c !important;
}

/* ── Landing page hero bubble ───────────────────────────────────────────────── */
.hero-social-hub-bubble {
  background: rgba(99, 102, 241, 0.2) !important;
  color: #4f46e5 !important;
}

html.dark-mode .hero-social-hub-bubble {
  background: rgba(99, 102, 241, 0.25) !important;
  color: #818cf8 !important;
}
