/* ==========================================================================
   TopBetSitesFA — design system
   A light, high-contrast ranked-directory UI. Data first, chrome last.
   Everything is logical-property based so RTL is the native direction
   rather than a mirrored afterthought.
   ========================================================================== */

/* ---------- Typography: one variable font, three unicode subsets ---------- */
@font-face {
  font-family: Vazirmatn;
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/vazirmatn-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB8A,
    U+FBFC-FBFD, U+FD3E-FD3F, U+FDF2, U+FDFC, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: Vazirmatn;
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/vazirmatn-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}
@font-face {
  font-family: Vazirmatn;
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/vazirmatn-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB,
    U+20AD-20CF, U+2C60-2C7F, U+A720-A7FF;
}

/* Metric-matched fallback so the webfont swap costs ~no layout shift. */
@font-face {
  font-family: "Vazirmatn-fallback";
  src: local("Tahoma"), local("Arial");
  size-adjust: 97%;
  ascent-override: 92%;
  descent-override: 28%;
  line-gap-override: 0%;
}

:root {
  --ink-900: #0F172A;
  --ink-700: #334155;
  /* Muted text sits on --bg (#F4F6FA) as often as on white, and slate-500
     lands at 4.41:1 there — just under AA. This is the darkest value that
     still reads as "muted" while clearing 4.5:1 on both surfaces. */
  --ink-500: #556070;

  --bg: #F4F6FA;
  --surface: #FFFFFF;
  --surface-2: #F8FAFC;
  --line: #E2E8F0;
  --line-2: #CBD5E1;

  --brand-800: #2A2478;
  --brand-700: #372FA0;
  --brand-600: #4338CA;
  --brand-100: #E0E7FF;
  --brand-50: #EEF2FF;

  --yes: #0F766E;
  --yes-bg: #ECFDF5;
  --no: #B91C1C;
  --na: #64748B;
  --na-bg: #F1F5F9;

  /* Brand logos are baked onto this exact colour by the asset pipeline. */
  --plate: #10141B;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;

  --shadow-sm: 0 1px 2px rgb(15 23 42 / .06);
  --shadow: 0 1px 3px rgb(15 23 42 / .07), 0 8px 24px rgb(15 23 42 / .06);

  --maxw: 1180px;
  --gutter: clamp(16px, 4vw, 28px);

  --font: Vazirmatn, "Vazirmatn-fallback", Tahoma, system-ui, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Reserve the scrollbar gutter so opening a modal-ish panel cannot shift
     the page sideways. */
  scrollbar-gutter: stable;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink-700);
  background: var(--bg);
  /* Nothing on this site may cause a sideways scroll. */
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--brand-600); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-700); }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { padding-inline-start: 1.3em; }

h1, h2, h3, h4 { color: var(--ink-900); line-height: 1.5; font-weight: 800; text-wrap: balance; }
h1 { font-size: clamp(1.55rem, 1.15rem + 1.7vw, 2.3rem); }
h2 { font-size: clamp(1.25rem, 1.05rem + .85vw, 1.65rem); }
h3 { font-size: clamp(1.08rem, .98rem + .45vw, 1.28rem); font-weight: 700; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 3px solid var(--brand-600);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  inset-block-start: -100px;
  inset-inline-start: var(--gutter);
  z-index: 100;
  padding: .7rem 1.2rem;
  background: var(--brand-600);
  color: #fff;
  border-radius: 0 0 var(--r) var(--r);
  font-weight: 700;
}
.skip-link:focus { inset-block-start: 0; color: #fff; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Layout ---------- */
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: clamp(2.2rem, 1.4rem + 3vw, 3.6rem); }
.section--tight { padding-block: clamp(1.6rem, 1.1rem + 2vw, 2.4rem); }
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem 1.2rem;
  margin-block-end: 1.3rem;
}
.section-head p { color: var(--ink-500); font-size: .94rem; flex-basis: 100%; }
.section-more { font-weight: 700; font-size: .94rem; white-space: nowrap; }

/* ---------- Header ---------- */
.site-header {
  background: var(--surface);
  border-block-end: 1px solid var(--line);
  position: sticky;
  inset-block-start: 0;
  z-index: 40;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  color: var(--ink-900);
  text-decoration: none;
  flex-shrink: 0;
}
.brand-lockup img { width: 32px; height: 32px; border-radius: 9px; }
.brand-lockup span { font-size: 1.06rem; letter-spacing: -.01em; }
.brand-lockup small {
  display: block;
  font-size: .68rem;
  font-weight: 500;
  color: var(--ink-500);
  letter-spacing: .02em;
  direction: ltr;
  text-align: start;
}

.nav { margin-inline-start: auto; }
.nav ul {
  display: flex;
  gap: .25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav a {
  display: block;
  padding: .5rem .8rem;
  border-radius: var(--r-sm);
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.nav a:hover { background: var(--brand-50); color: var(--brand-700); }
.nav a[aria-current="page"] { color: var(--brand-700); background: var(--brand-50); }

.nav-toggle {
  display: none;
  margin-inline-start: auto;
  padding: .5rem .8rem;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  gap: .45rem;
}
.nav-toggle svg { width: 18px; height: 18px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute;
    inset-inline: 0;
    inset-block-start: 100%;
    background: var(--surface);
    border-block-end: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: .6rem var(--gutter) 1rem;
    /* Collapsed with height, not with off-screen positioning: an element
       parked at inset-inline-start:-9999px in RTL widens the page. */
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows .22s ease;
    overflow: hidden;
  }
  .nav > ul { min-height: 0; flex-direction: column; gap: 0; }
  .site-header.is-open .nav { grid-template-rows: 1fr; }
  .nav a { padding: .75rem .6rem; border-radius: var(--r-sm); }
  /* Keyboard users must not be able to tab into a collapsed menu. */
  .nav:not(.is-open) a { visibility: hidden; }
  .site-header.is-open .nav a { visibility: visible; }
  .header-inner { position: relative; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .68rem 1.25rem;
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  font-weight: 700;
  font-size: .95rem;
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn--primary { background: var(--brand-600); color: #fff; }
.btn--primary:hover { background: var(--brand-700); color: #fff; }
.btn--ghost {
  background: var(--surface);
  border-color: var(--line-2);
  color: var(--ink-900);
}
.btn--ghost:hover { border-color: var(--brand-600); color: var(--brand-700); background: var(--brand-50); }
.btn--sm { padding: .45rem .85rem; font-size: .88rem; }
.btn--block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- The ranked row — the signature component ---------- */
.rank-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }

.rank-row {
  display: grid;
  gap: 0 1.1rem;
  align-items: center;
  grid-template-columns: 46px 168px minmax(0, 1fr) auto;
  grid-template-areas: "pos logo main side";
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.rank-row:hover { border-color: var(--line-2); box-shadow: var(--shadow); }

.rank-pos {
  grid-area: pos;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--ink-900);
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.rank-pos small { display: block; font-size: .58rem; font-weight: 600; color: var(--ink-500); margin-block-start: .25rem; }

.rank-logo {
  grid-area: logo;
  background: var(--plate);
  border-radius: var(--r-sm);
  overflow: hidden;
  /* Fixed ratio matching the 440x150 plates: no CLS while images load. */
  aspect-ratio: 440 / 150;
}
.rank-logo img { width: 100%; height: 100%; object-fit: contain; }

.rank-main { grid-area: main; min-width: 0; }
.rank-name {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink-900);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  flex-wrap: wrap;
}
.rank-name:hover { color: var(--brand-700); }
.rank-name em { font-style: normal; font-size: .82rem; font-weight: 600; color: var(--ink-500); direction: ltr; }
.rank-tagline { font-size: .9rem; color: var(--ink-500); margin-block-start: .1rem; }

.rank-side {
  grid-area: side;
  display: grid;
  gap: .5rem;
  justify-items: stretch;
  text-align: center;
  min-width: 132px;
}

/* ---------- Chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-block-start: .6rem; list-style: none; padding: 0; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .2rem .55rem;
  border-radius: 999px;
  background: var(--brand-50);
  color: var(--brand-700);
  font-size: .8rem;
  font-weight: 600;
  border: 1px solid var(--brand-100);
  text-decoration: none;
  white-space: nowrap;
}
a.chip:hover { background: var(--brand-100); color: var(--brand-800); }
.chip--muted { background: var(--na-bg); color: var(--ink-500); border-color: var(--line); }
/* A count inside a chip, de-emphasised with a real colour rather than
   opacity — fading the text drops it below the contrast floor. */
.chip-n { color: var(--brand-600); font-weight: 500; }
.chip--count { background: transparent; border-color: var(--line-2); color: var(--ink-500); }

/* ---------- Score / rating display ---------- */
.score {
  display: grid;
  gap: .1rem;
  padding: .45rem .5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.score b {
  font-size: 1.22rem;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}
.score span { font-size: .72rem; color: var(--ink-500); font-weight: 600; }
.score--empty b { font-size: .84rem; font-weight: 700; color: var(--ink-500); line-height: 1.5; }

.coverage-pill {
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  padding: .3rem .6rem;
  border-radius: 999px;
  background: var(--brand-600);
  color: #fff;
  font-weight: 700;
  font-size: .84rem;
}
.coverage-pill b { font-size: 1rem; font-variant-numeric: tabular-nums; }

/* Stars are decorative; the numeric value next to them is the real content. */
.stars { display: inline-flex; gap: 1px; color: #D97706; line-height: 1; }
.stars svg { width: 13px; height: 13px; }
.stars .off { color: var(--line-2); }

@media (max-width: 860px) {
  .rank-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "pos  logo"
      "main main"
      "side side";
    gap: .8rem 1rem;
  }
  .rank-logo { max-width: 180px; }
  .rank-side {
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    align-items: stretch;
  }
}
@media (max-width: 420px) {
  .rank-side { grid-auto-flow: row; }
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-block-end: 1px solid var(--line);
  padding-block: clamp(1.8rem, 1.2rem + 2.6vw, 3rem);
}
.hero h1 { margin-block-end: .7rem; }
.hero-lead { font-size: clamp(1rem, .95rem + .25vw, 1.1rem); color: var(--ink-700); max-width: 62ch; }
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-block: 1.1rem;
  list-style: none;
  padding: 0;
}
.hero-stats li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: .45rem .8rem;
  font-size: .87rem;
  color: var(--ink-500);
  font-weight: 600;
}
.hero-stats b { color: var(--ink-900); font-variant-numeric: tabular-nums; }
.hero-cta { display: flex; flex-wrap: wrap; gap: .6rem; margin-block-start: 1.1rem; }

/* ---------- Brand finder ---------- */
.finder { position: relative; margin-block-start: 1.4rem; max-width: 560px; }
.finder label { display: block; font-weight: 700; color: var(--ink-900); margin-block-end: .4rem; font-size: .95rem; }
.finder-field { display: flex; gap: .5rem; }
.finder input {
  flex: 1 1 auto;
  min-width: 0;
  padding: .72rem .9rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.finder input:focus-visible { border-color: var(--brand-600); }

.finder-results {
  position: absolute;
  inset-inline: 0;
  inset-block-start: calc(100% + .4rem);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: .3rem;
  z-index: 30;
  max-height: 340px;
  overflow-y: auto;
}
.finder-results:empty, .finder-results[hidden] { display: none; }
.finder-results a {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: .7rem;
  align-items: center;
  padding: .45rem .5rem;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: inherit;
}
.finder-results a:hover, .finder-results a:focus-visible, .finder-results .is-active a {
  background: var(--brand-50);
}
.finder-results .thumb { background: var(--plate); border-radius: 6px; aspect-ratio: 440/150; overflow: hidden; }
.finder-results .thumb img { width: 100%; height: 100%; object-fit: contain; }
.finder-results b { display: block; color: var(--ink-900); font-size: .95rem; }
.finder-results small { color: var(--ink-500); font-size: .8rem; }
.finder-empty { padding: .8rem .6rem; color: var(--ink-500); font-size: .9rem; }

/* ---------- Sort / filter bar ---------- */
.toolbar {
  position: sticky;
  inset-block-start: 66px;
  z-index: 20;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-block: 1px solid var(--line);
  padding-block: .7rem;
  margin-block-end: 1.2rem;
}
.toolbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .9rem;
}
.toolbar-label { font-size: .88rem; color: var(--ink-500); font-weight: 600; }
.toolbar-group { display: flex; flex-wrap: wrap; gap: .3rem; }
.toolbar-group a {
  padding: .35rem .75rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-700);
  font-size: .87rem;
  font-weight: 600;
  text-decoration: none;
}
.toolbar-group a:hover { border-color: var(--brand-600); color: var(--brand-700); }
.toolbar-group a[aria-current="true"] {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.toolbar-count { margin-inline-start: auto; font-size: .87rem; color: var(--ink-500); }

/* ---------- Cards & panels ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, .9rem + .8vw, 1.6rem);
  box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-block-start: 1rem; }
.panel > h2, .panel > h3 { margin-block-end: .8rem; }
.panel p + p { margin-block-start: .9rem; }

.note {
  display: flex;
  gap: .6rem;
  padding: .85rem 1rem;
  border-radius: var(--r);
  background: var(--brand-50);
  border: 1px solid var(--brand-100);
  color: var(--brand-800);
  font-size: .92rem;
}
.note--plain { background: var(--surface-2); border-color: var(--line); color: var(--ink-700); }
.note svg { width: 18px; height: 18px; flex-shrink: 0; margin-block-start: .3rem; }

/* ---------- Scorecard ---------- */
.scorecard { display: grid; gap: 1.1rem; }
.scorecard-group > h3 {
  font-size: .8rem;
  text-transform: none;
  letter-spacing: .01em;
  color: var(--ink-500);
  font-weight: 700;
  margin-block-end: .5rem;
}
.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: .4rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.sc-item {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .7rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-size: .9rem;
}
.sc-item .mark {
  inline-size: 20px;
  block-size: 20px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.sc-item .mark svg { width: 11px; height: 11px; }
.sc-on { background: var(--yes-bg); border-color: #A7F3D0; color: var(--ink-900); font-weight: 600; }
.sc-on .mark { background: var(--yes); color: #fff; }
.sc-off { color: var(--ink-500); }
.sc-off .mark { background: var(--na-bg); color: var(--na); border: 1px solid var(--line-2); }
.sc-item a { color: inherit; text-decoration: none; }
.sc-item a:hover { text-decoration: underline; }

/* ---------- Brand header (review page) ---------- */
.brand-head {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}
.brand-plate {
  background: var(--plate);
  border-radius: var(--r);
  aspect-ratio: 440/150;
  overflow: hidden;
}
.brand-plate img { width: 100%; height: 100%; object-fit: contain; }
.brand-head h1 { margin-block-end: .35rem; }
.brand-head .latin { font-size: .95rem; color: var(--ink-500); direction: ltr; text-align: start; font-weight: 600; }
.brand-summary { margin-block-start: .8rem; font-size: 1.02rem; }

.brand-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-block-start: 1rem;
}
.metric {
  flex: 1 1 150px;
  padding: .7rem .85rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.metric b { display: block; font-size: 1.25rem; color: var(--ink-900); font-variant-numeric: tabular-nums; line-height: 1.3; }
.metric b.small { font-size: .92rem; line-height: 1.6; }
.metric span { font-size: .8rem; color: var(--ink-500); font-weight: 600; }

@media (max-width: 720px) {
  .brand-head { grid-template-columns: 1fr; }
  .brand-plate { max-width: 260px; }
}

/* ---------- Pros & cons ---------- */
/* min() on the track floor, otherwise a 260px minimum overflows a 253px
   column at 320px wide — the narrowest viewport this site supports. */
.proscons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 1rem; }
.proscons ul { list-style: none; padding: 0; display: grid; gap: .55rem; }
.proscons li { display: flex; gap: .55rem; font-size: .95rem; }
.proscons .icon {
  inline-size: 20px; block-size: 20px; border-radius: 999px;
  display: grid; place-items: center; flex-shrink: 0; margin-block-start: .38rem;
}
.proscons .icon svg { width: 11px; height: 11px; }
.pros .icon { background: var(--yes); color: #fff; }
.cons .icon { background: var(--no); color: #fff; }
.proscons h3 { margin-block-end: .7rem; }

/* ---------- Comparison table ---------- */
.cmp-scroll {
  overflow-x: auto;
  /* Wide content scrolls inside its own box; the page body never does. */
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.cmp-table {
  border-collapse: collapse;
  inline-size: 100%;
  min-inline-size: 560px;
}
.cmp-legend {
  margin-block-end: .7rem;
  font-size: .92rem;
  color: var(--ink-700);
}
.cmp-table th, .cmp-table td {
  padding: .6rem .85rem;
  border-block-end: 1px solid var(--line);
  text-align: center;
  font-size: .92rem;
}
.cmp-table thead th { background: var(--surface-2); vertical-align: bottom; }
.cmp-table tbody th {
  text-align: start;
  font-weight: 600;
  color: var(--ink-700);
  background: var(--surface);
  position: sticky;
  inset-inline-start: 0;
  z-index: 1;
  min-inline-size: 150px;
  /* The sticky row header sits above scrolled cells, so it needs its own
     edge or values slide underneath it with no separation. */
  box-shadow: 1px 0 0 var(--line) inset;
}
.cmp-table tbody tr:nth-child(even) th,
.cmp-table tbody tr:nth-child(even) td { background: var(--surface-2); }
.cmp-table .group-row th {
  background: var(--brand-50);
  color: var(--brand-800);
  font-weight: 700;
  font-size: .85rem;
  box-shadow: none;
}
.cmp-head-cell { display: grid; gap: .5rem; justify-items: center; min-inline-size: 130px; }
.cmp-head-cell .thumb { inline-size: 120px; background: var(--plate); border-radius: var(--r-sm); aspect-ratio: 440/150; overflow: hidden; }
.cmp-head-cell .thumb img { width: 100%; height: 100%; object-fit: contain; }
.cmp-head-cell a { font-weight: 700; color: var(--ink-900); text-decoration: none; font-size: .95rem; }

.tick { color: var(--yes); font-weight: 800; }
.dash { color: var(--ink-500); }

/* ---------- Comparison picker ---------- */
.cmp-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}
.cmp-picker label {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .55rem .7rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: .93rem;
  font-weight: 600;
}
.cmp-picker label:hover { border-color: var(--brand-600); }
.cmp-picker input { accent-color: var(--brand-600); inline-size: 17px; block-size: 17px; }
.cmp-picker input:disabled + span { color: var(--ink-500); }
.cmp-picker li:has(input:checked) label { border-color: var(--brand-600); background: var(--brand-50); }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 1rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.field label { display: block; font-weight: 700; color: var(--ink-900); margin-block-end: .35rem; font-size: .93rem; }
.field .hint { display: block; font-weight: 500; color: var(--ink-500); font-size: .82rem; margin-block-end: .35rem; }
.field input, .field textarea, .field select {
  inline-size: 100%;
  padding: .7rem .85rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
}
.field textarea { min-block-size: 130px; resize: vertical; line-height: 1.8; }
.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible { border-color: var(--brand-600); }
.field-error { color: var(--no); font-size: .85rem; font-weight: 600; margin-block-start: .3rem; }
.field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--no); }

/* A honeypot must be hidden from sight AND from assistive tech, without
   using a negative inline offset that would widen an RTL page. */
.hp-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.rating-input { display: flex; flex-wrap: wrap; gap: .4rem; }
/* The radios sit inside .field, so they would inherit its inline-size:100%.
   Absolutely positioned, that 100% resolves against the viewport and drags a
   390px-wide invisible input off the edge of the page. Pin the size. */
.rating-input input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}
.rating-input label {
  padding: .45rem .9rem;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  margin: 0;
  font-size: .92rem;
}
.rating-input input:checked + label { background: var(--brand-600); border-color: var(--brand-600); color: #fff; }
.rating-input input:focus-visible + label { outline: 3px solid var(--brand-600); outline-offset: 2px; }

.alert { padding: .9rem 1.1rem; border-radius: var(--r); font-weight: 600; font-size: .94rem; }
.alert--success { background: var(--yes-bg); border: 1px solid #A7F3D0; color: #065F46; }
.alert--error { background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B; }

/* ---------- Reviews ---------- */
.review-list { list-style: none; padding: 0; display: grid; gap: .8rem; }
.review-item {
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.review-top { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .9rem; margin-block-end: .5rem; }
.review-top b { color: var(--ink-900); }
.review-top time { color: var(--ink-500); font-size: .82rem; margin-inline-start: auto; }

.rating-bars { display: grid; gap: .3rem; margin-block-start: .9rem; }
.rating-bars .row { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center; font-size: .85rem; }
.rating-bars .track { block-size: 8px; background: var(--na-bg); border-radius: 999px; overflow: hidden; }
.rating-bars .fill { block-size: 100%; background: var(--brand-600); border-radius: 999px; }
.rating-bars .n { color: var(--ink-500); font-variant-numeric: tabular-nums; min-inline-size: 2ch; text-align: end; }

/* ---------- Breadcrumb ---------- */
.crumbs { padding-block: .9rem; font-size: .87rem; color: var(--ink-500); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; list-style: none; padding: 0; margin: 0; }
.crumbs li { display: inline-flex; align-items: center; }
.crumbs li::after { content: "‹"; margin-inline-start: .3rem; color: var(--line-2); }
.crumbs li:last-child::after { content: none; }
/* Padded to clear the 24px tap-target floor on touch screens. */
.crumbs a, .crumbs [aria-current="page"] { display: inline-block; padding-block: .18rem; }
.crumbs a { color: var(--ink-500); text-decoration: none; }
.crumbs a:hover { color: var(--brand-700); text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--ink-700); font-weight: 600; }

/* ---------- Prose (legal & editorial pages) ---------- */
.prose { max-width: 74ch; }
.prose h2 { margin-block: 2rem .7rem; }
.prose h3 { margin-block: 1.4rem .5rem; }
.prose p + p, .prose ul, .prose ol { margin-block-start: .9rem; }
.prose li + li { margin-block-start: .35rem; }
.prose h2:first-child { margin-block-start: 0; }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: .6rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: .3rem .2rem;
}
.faq summary {
  cursor: pointer;
  padding: .7rem .9rem;
  font-weight: 700;
  color: var(--ink-900);
  list-style: none;
  display: flex;
  gap: .6rem;
  align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  margin-inline-start: auto;
  color: var(--brand-600);
  font-size: 1.2rem;
  line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq .answer { padding: 0 .9rem .9rem; color: var(--ink-700); }

/* ---------- Similar brands ---------- */
.mini-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .7rem; list-style: none; padding: 0; margin: 0; }
.mini-card {
  display: grid;
  gap: .55rem;
  padding: .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  color: inherit;
}
.mini-card:hover { border-color: var(--brand-600); }
.mini-card .thumb { background: var(--plate); border-radius: var(--r-sm); aspect-ratio: 440/150; overflow: hidden; }
.mini-card .thumb img { width: 100%; height: 100%; object-fit: contain; }
.mini-card b { color: var(--ink-900); font-size: .97rem; }
.mini-card small { color: var(--ink-500); font-size: .82rem; display: block; }

/* ---------- Shortlist strip on the homepage ---------- */
.shortlist-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; }
.shortlist-card {
  display: grid;
  gap: .7rem;
  align-content: start;
  padding: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.shortlist-card h3 a { color: var(--ink-900); text-decoration: none; }
.shortlist-card h3 a:hover { color: var(--brand-700); }
.shortlist-card ol { margin: 0; padding-inline-start: 1.25em; display: grid; gap: .15rem; font-size: .93rem; }
.shortlist-card ol a {
  color: var(--ink-700);
  text-decoration: none;
  font-weight: 600;
  display: inline-block;
  padding-block: .16rem;
}
.shortlist-card ol a:hover { color: var(--brand-700); text-decoration: underline; }
.shortlist-card .more { font-size: .88rem; font-weight: 700; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink-900);
  color: #CBD5E1;
  margin-block-start: 3rem;
  padding-block: 2.4rem 1.6rem;
  font-size: .92rem;
}
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 1.6rem; }
.site-footer h2 { color: #fff; font-size: .95rem; margin-block-end: .7rem; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .25rem; }
.site-footer a {
  color: #CBD5E1;
  text-decoration: none;
  /* inline-block + padding so each link clears the 24px minimum tap target */
  display: inline-block;
  padding-block: .22rem;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-brand { display: flex; align-items: center; gap: .6rem; margin-block-end: .7rem; }
.footer-brand img { width: 34px; height: 34px; border-radius: 9px; }
.footer-brand b { color: #fff; font-size: 1.02rem; }
.footer-note { color: #94A3B8; line-height: 1.9; font-size: .87rem; }
.footer-bar {
  margin-block-start: 1.8rem;
  padding-block-start: 1.2rem;
  border-block-start: 1px solid #1E293B;
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 1.2rem;
  color: #94A3B8;
  font-size: .85rem;
}
.age-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 30px;
  block-size: 30px;
  border-radius: 999px;
  border: 2px solid #F87171;
  color: #FCA5A5;
  font-weight: 800;
  font-size: .78rem;
  flex-shrink: 0;
}

/* ---------- 404 ---------- */
.error-page { text-align: center; padding-block: clamp(2.5rem, 2rem + 4vw, 5rem); }
.error-page .code {
  font-size: clamp(3.5rem, 2rem + 8vw, 6rem);
  font-weight: 900;
  color: var(--brand-600);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.error-page .finder { margin-inline: auto; text-align: start; }
.error-page .hero-cta { justify-content: center; }

/* ==========================================================================
   Utilities
   These exist so no template needs a style="" attribute, which in turn lets
   the Content-Security-Policy drop 'unsafe-inline' from style-src.
   ========================================================================== */
.mt-1 { margin-block-start: .6rem }
.mt-2 { margin-block-start: .8rem }
.mt-3 { margin-block-start: 1rem }
.mt-4 { margin-block-start: 1.15rem }
.mt-5 { margin-block-start: 1.4rem }
.mt-6 { margin-block-start: 1.6rem }
.mt-7 { margin-block-start: 2rem }
.mb-1 { margin-block-end: .6rem }
.mb-2 { margin-block-end: .9rem }
.mb-3 { margin-block-end: 1rem }
.mb-4 { margin-block-end: 1.15rem }
.mb-6 { margin-block-end: 1.6rem }
.my-1 { margin-block: .7rem }
.my-2 { margin-block: .8rem }
.my-3 { margin-block: 1rem }
.my-4 { margin-block: 1.3rem }
.my-5 { margin-block: 1.4rem }
.my-6 { margin-block: 1.6rem }
.pb-7 { padding-block-end: 2.5rem }
.pt-3 { padding-block-start: 1rem }
.p-0  { padding: 0 }
.u-m-0 { margin: 0 }
.u-noborder { border: 0 }

.u-center    { text-align: center }
.u-mi-auto   { margin-inline: auto }
.u-push      { margin-inline-start: auto }
.u-w-full    { max-width: none }
.u-w-narrow  { max-width: 560px }
.u-grow      { flex: 1 1 240px }
.u-flex      { display: flex }
.u-grid      { display: grid }
.u-wrap      { flex-wrap: wrap }
.u-ai-center { align-items: center }
.u-gap-1     { gap: .4rem }
.u-gap-2     { gap: .5rem }
.u-gap-3     { gap: .6rem }
.u-gap-5     { gap: 1.4rem }

.u-muted  { color: var(--ink-500) }
.u-brand  { color: var(--brand-700) }
.u-ink    { color: var(--ink-900) }
.u-fs-2xs { font-size: .7rem }
.u-fs-xs  { font-size: .84rem }
.u-fs-sm  { font-size: .92rem }
.u-fs-lg  { font-size: 1.1rem }
.u-fs-2xl { font-size: 2.2rem }
.u-fw-500 { font-weight: 500 }
.u-fw-700 { font-weight: 700 }
.u-tnum   { font-variant-numeric: tabular-nums }

.u-static    { position: static }
.u-bg-none   { background: transparent }
.u-blur-none { backdrop-filter: none }
.u-not-0     { border-block-start: 0 }

/* Rating-bar widths in 5% steps: a dynamic inline width would have forced
   'unsafe-inline' back into the CSP for one decorative bar. */
.fill-0 { inline-size: 0% }
.fill-5 { inline-size: 5% }
.fill-10 { inline-size: 10% }
.fill-15 { inline-size: 15% }
.fill-20 { inline-size: 20% }
.fill-25 { inline-size: 25% }
.fill-30 { inline-size: 30% }
.fill-35 { inline-size: 35% }
.fill-40 { inline-size: 40% }
.fill-45 { inline-size: 45% }
.fill-50 { inline-size: 50% }
.fill-55 { inline-size: 55% }
.fill-60 { inline-size: 60% }
.fill-65 { inline-size: 65% }
.fill-70 { inline-size: 70% }
.fill-75 { inline-size: 75% }
.fill-80 { inline-size: 80% }
.fill-85 { inline-size: 85% }
.fill-90 { inline-size: 90% }
.fill-95 { inline-size: 95% }
.fill-100 { inline-size: 100% }

/* A <legend> cannot inherit .field's label styling, so it gets its own rule
   rather than an inline style. */
.field-legend {
  font-weight: 700;
  color: var(--ink-900);
  margin-block-end: .4rem;
  font-size: .93rem;
}
