/* ============================================================
   Beseyat Cars — design system.
   RTL-safe: logical properties (inline-start/end) everywhere
   direction matters. Dark mode via prefers-color-scheme.
   ============================================================ */

:root {
  --navy: #0F4C81;
  --navy-dark: #072A4C;
  --amber: #FFB300;
  --bg: #F6F8FA;
  --surface: #ffffff;
  --text: #1a2330;
  --muted: #5b6b7c;
  --border: #dde4ec;
  --radius: 16px;
  --best-bg: rgba(46, 164, 79, 0.16);
  --best-border: rgba(46, 164, 79, 0.55);
  --warn: #b54708;
  --good: #0f6e2d;
  --bad: #c0392b;
  --shadow: 0 1px 3px rgba(7, 42, 76, 0.08), 0 4px 14px rgba(7, 42, 76, 0.06);
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d141d;
    --surface: #16202c;
    --text: #e8eef5;
    --muted: #93a3b5;
    --border: #2a3646;
    --best-bg: rgba(63, 185, 100, 0.18);
    --best-border: rgba(63, 185, 100, 0.5);
    --good: #4cc26c;
    --bad: #e5695a;
    --warn: #e8924a;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  }
}

* { box-sizing: border-box; }

html { scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', Tahoma, system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  text-align: start;
}

img { max-width: 100%; height: auto; }

a { color: var(--navy); text-decoration: none; }
a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) {
  a { color: #7db3e0; }
}

h1, h2, h3 { line-height: 1.3; margin: 0 0 0.5em; }
.page-title { font-size: 1.7rem; margin-block: 0.2em 0.4em; }
.section-title { font-size: 1.25rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

.container {
  max-width: 1140px;
  margin-inline: auto;
  padding-inline: 16px;
}

.section { padding-block: 28px 8px; }
.section-block { margin-block: 32px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.section-link { font-weight: 600; white-space: nowrap; }

/* ---------------- header / nav ---------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--navy-dark), #0a3560);
  color: #fff;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand img { border-radius: 8px; display: block; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-inline-start: auto;
  flex-wrap: wrap;
}

.nav-link {
  color: rgba(255, 255, 255, 0.85);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); text-decoration: none; }
.nav-link.active { color: var(--amber); }

.lang-switch {
  border: 1px solid rgba(255, 255, 255, 0.35);
  margin-inline-start: 8px;
}

.nav-toggle {
  display: none;
  margin-inline-start: auto;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  padding: 9px 10px;
  cursor: pointer;
}
.nav-toggle-bar {
  display: block;
  width: 20px;
  height: 2px;
  background: #fff;
  margin-block: 4px;
  border-radius: 2px;
}

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    background: var(--navy-dark);
    padding: 10px 16px 16px;
    box-shadow: var(--shadow);
  }
  .site-nav.open { display: flex; }
  .site-header { position: sticky; }
  .header-inner { position: relative; }
  .lang-switch { margin-inline-start: 0; margin-block-start: 6px; text-align: center; }
}

/* ---------------- hero ---------------- */

.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #fff;
  padding-block: 56px 48px;
}
.hero-title { font-size: clamp(1.6rem, 4vw, 2.4rem); margin: 0 0 8px; }
.hero-sub {
  color: rgba(255, 255, 255, 0.85);
  max-width: 640px;
  margin: 0 0 20px;
}
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-block-end: 20px; }
.hero-search {
  display: flex;
  gap: 8px;
  max-width: 560px;
  flex-wrap: wrap;
}
.hero-search input[type="search"] {
  flex: 1 1 260px;
  padding: 12px 14px;
  border-radius: 12px;
  border: none;
  font-size: 1rem;
  background: #fff;
  color: #1a2330;
}

/* ---------------- buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px; /* comfortable, accessible tap target everywhere */
  padding: 10px 20px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; filter: brightness(1.07); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-accent { background: var(--amber); color: #072A4C; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-ghost { background: rgba(255, 255, 255, 0.12); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
.btn-sm { padding: 6px 12px; font-size: 0.85rem; border-radius: 10px; }
@media (prefers-color-scheme: dark) {
  .btn-outline { color: #7db3e0; border-color: #7db3e0; }
}

/* ---------------- chips ---------------- */

.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
a.chip:hover, .chip-btn:hover { border-color: var(--navy); text-decoration: none; }
.chip.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip-static { cursor: default; }
.chip-sm { padding: 3px 10px; font-size: 0.8rem; }
.chip-warn { color: var(--warn); border-color: var(--warn); }
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
}
.tabs { margin-block-end: 20px; }

/* ---------------- cards ---------------- */

.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  color: var(--text);
  display: block;
  padding: 0;
}
a.card { transition: transform 0.15s ease, box-shadow 0.15s ease; }
a.card:hover {
  transform: translateY(-2px);
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(7, 42, 76, 0.14);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}
.card-ph {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.9);
}
.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--surface);
}
.card-body { padding: 14px 16px 16px; }
.card-title { font-size: 1.02rem; margin: 0 0 4px; }
.card-meta { color: var(--muted); font-size: 0.85rem; margin-block-end: 8px; }
.card-price { font-size: 0.98rem; }
.est { color: var(--warn); font-weight: 700; cursor: help; }

/* dealer & news cards need inner padding on their own markup */
.dealer-card { padding: 16px; }
.dealer-card .actions { margin-block-start: 10px; }
.dealer-group { margin-block: 24px; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  vertical-align: middle;
  margin-inline-start: 6px;
}
.badge-verified { background: var(--best-bg); color: var(--good); border: 1px solid var(--best-border); }

.social-links { display: flex; flex-wrap: wrap; gap: 12px; margin-block-start: 10px; font-size: 0.85rem; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-block: 12px; }

/* ---------------- forms / filter bar ---------------- */

.filter-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-block-end: 16px;
  align-items: end;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.field-wide { grid-column: 1 / -1; }
.field-actions {
  grid-column: 1 / -1; /* the buttons span the whole form width, not one narrow cell */
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}
.field-actions .btn { min-height: 50px; font-size: 1.05rem; padding: 12px 26px; }
.field-actions .btn-primary { flex: 1 1 240px; } /* primary action grows to fill */

input[type="text"], input[type="search"], input[type="number"], select {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--navy); outline-offset: 1px; }

.results-count { margin-block: 12px; }

/* ---------------- pagination ---------------- */

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-block: 24px;
}
.page-link {
  padding: 7px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-weight: 600;
}
.page-link:hover { border-color: var(--navy); text-decoration: none; }
.page-link.current { background: var(--navy); color: #fff; border-color: var(--navy); }
.page-info { margin-inline-start: 8px; }

/* ---------------- empty states ---------------- */

.empty-state {
  text-align: center;
  padding: 48px 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin-block: 16px;
}
.empty-icon { color: var(--muted); margin-block-end: 8px; }
.notfound-code {
  font-size: 3.4rem;
  font-weight: 800;
  color: var(--navy);
  margin: 0;
  line-height: 1.1;
}

/* ---------------- car detail ---------------- */

.breadcrumb { font-size: 0.87rem; color: var(--muted); margin-block-end: 14px; }

.car-hero {
  display: grid;
  grid-template-columns: minmax(280px, 460px) 1fr;
  gap: 24px;
  margin-block-end: 28px;
}
@media (max-width: 760px) {
  .car-hero { grid-template-columns: 1fr; }
}
.car-hero-media {
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.car-price-big {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--navy);
  margin-block: 12px;
}
@media (prefers-color-scheme: dark) {
  .car-price-big { color: #7db3e0; }
}

.spec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 16px;
  margin-block: 20px;
}
.spec-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-block: 8px;
}
.spec-card h2 { font-size: 1.05rem; border-block-end: 2px solid var(--amber); padding-block-end: 6px; display: inline-block; }
.spec-subtitle { font-size: 0.92rem; margin-block: 14px 8px; color: var(--muted); }

.spec-table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
.spec-table th, .spec-table td {
  text-align: start;
  padding: 8px 10px;
  border-block-end: 1px solid var(--border);
  vertical-align: top;
}
.spec-table th { color: var(--muted); font-weight: 600; width: 46%; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-block-end: none; }
.striped tbody tr:nth-child(even) { background: rgba(15, 76, 129, 0.05); }
@media (prefers-color-scheme: dark) {
  .striped tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.04); }
}

.feature-list {
  columns: 2;
  column-gap: 24px;
  padding-inline-start: 20px;
  margin: 0;
}
.feature-list li { margin-block-end: 6px; break-inside: avoid; }
@media (max-width: 560px) { .feature-list { columns: 1; } }

.pros-cons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 16px;
  margin-block: 20px;
}
.pros-card, .cons-card {
  border-radius: var(--radius);
  padding: 18px;
  border: 1px solid;
}
.pros-card { background: rgba(46, 164, 79, 0.08); border-color: var(--best-border); }
.cons-card { background: rgba(192, 57, 43, 0.07); border-color: rgba(192, 57, 43, 0.4); }
.pros-card h2 { color: var(--good); font-size: 1.05rem; }
.cons-card h2 { color: var(--bad); font-size: 1.05rem; }
.pros-card ul, .cons-card ul { margin: 0; padding-inline-start: 20px; }
.pros-card li, .cons-card li { margin-block-end: 6px; }

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: min(75%, 260px);
  gap: 14px;
  overflow-x: auto;
  padding-block-end: 10px;
  -webkit-overflow-scrolling: touch;
}

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-block: 14px;
}

.disclaimer {
  font-size: 0.83rem;
  color: var(--muted);
  border-inline-start: 3px solid var(--amber);
  padding-inline-start: 12px;
  margin-block: 22px;
}

.stars { color: var(--amber); letter-spacing: 2px; }

/* ---------------- tables (generic scroll wrapper) ---------------- */

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* ---------------- compare ---------------- */

.compare-pickers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr));
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-block: 16px;
}
.picker { display: flex; flex-direction: column; gap: 4px; }
.picker-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }

.compare-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-block: 14px;
}
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.legend { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.85rem; }
.legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--best-bg);
  border: 1px solid var(--best-border);
  display: inline-block;
}

.compare-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 640px;
  background: var(--surface);
  font-size: 0.92rem;
  /* Fixed layout so every car column is the exact same width (equal split of
     the space after the label column) — otherwise long spec text would make
     one car's column, and its header image, wider than the other. */
  table-layout: fixed;
}
.compare-table th, .compare-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: start;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.compare-table .row-head {
  background: var(--bg);
  color: var(--muted);
  font-weight: 700;
  width: 128px;
  position: sticky;
  inset-inline-start: 0;
  z-index: 2;
}
.compare-table thead th {
  background: var(--surface);
  z-index: 3;
  vertical-align: bottom;
}
.compare-table thead .row-head { z-index: 4; }
@media (min-width: 900px) {
  .compare-scroll { overflow-x: visible; }
}
.compare-table tbody tr:nth-child(even):not(.group-row) { background: rgba(15, 76, 129, 0.04); }
@media (prefers-color-scheme: dark) {
  .compare-table tbody tr:nth-child(even):not(.group-row) { background: rgba(255, 255, 255, 0.03); }
}
.group-row th {
  background: var(--navy) !important;
  color: #fff !important;
  font-size: 0.88rem;
  letter-spacing: 0.4px;
  position: static !important;
}
.compare-table td.best {
  background: var(--best-bg);
  box-shadow: inset 0 0 0 1px var(--best-border);
  font-weight: 700;
}
.compare-head { display: flex; flex-direction: column; gap: 5px; min-width: 150px; }
/* Fixed, compact height so both cars are the exact same size and the header
   stays small on wide desktop columns (object-fit: cover from .card-media img). */
.compare-media { aspect-ratio: auto; height: 96px; width: 100%; border-radius: 10px; }
@media (min-width: 900px) { .compare-media { height: 120px; } }
.compare-name { font-weight: 700; }
.compare-price { font-weight: 700; color: var(--navy); }
@media (prefers-color-scheme: dark) { .compare-price { color: #7db3e0; } }
.remove-link { color: var(--bad); font-size: 0.8rem; }
.mini-list {
  margin: 6px 0 0;
  padding-inline-start: 18px;
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 400;
}
.mini-list li { margin-block-end: 3px; }

/* ---------------- Beseyat pick (deterministic recommendation) ---------------- */

.beseyat-pick {
  background: var(--surface);
  border: 1px solid var(--best-border);
  border-radius: var(--radius);
  padding: 18px;
  margin-block: 20px;
  box-shadow: var(--shadow);
}
.pick-main { display: flex; gap: 16px; align-items: center; }
.pick-media {
  flex: none;
  inline-size: 132px;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
}
.pick-body { min-inline-size: 0; }
.pick-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--best-bg);
  color: var(--good);
  border: 1px solid var(--best-border);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.2px;
}
.pick-name {
  display: block;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text);
  margin-block: 6px 2px;
}
.pick-name:hover { color: var(--navy); }
@media (prefers-color-scheme: dark) { .pick-name:hover { color: #7db3e0; } }
.pick-score { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.pick-score-num { font-size: 1.5rem; font-weight: 800; color: var(--good); line-height: 1; }
.pick-score-max { font-size: 0.9rem; color: var(--muted); font-weight: 700; }
.pick-score-label { font-size: 0.82rem; color: var(--muted); font-weight: 600; }
.pick-why { margin-block: 8px 0; color: var(--text); font-weight: 500; }

.pick-bars {
  display: grid;
  gap: 8px;
  margin-block-start: 16px;
}
.pick-bar {
  display: grid;
  grid-template-columns: minmax(90px, 26%) 1fr auto;
  align-items: center;
  gap: 10px;
}
.pick-bar-name {
  font-size: 0.86rem;
  color: var(--muted);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pick-bar.is-winner .pick-bar-name { color: var(--text); font-weight: 800; }
.pick-bar-track {
  block-size: 10px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}
.pick-bar-fill {
  display: block;
  block-size: 100%;
  border-radius: 999px;
  background: var(--muted);
  transition: inline-size 0.3s ease;
}
.pick-bar.is-winner .pick-bar-fill { background: var(--good); }
.pick-bar-val { font-size: 0.9rem; font-weight: 800; color: var(--muted); min-inline-size: 2ch; text-align: end; }
.pick-bar.is-winner .pick-bar-val { color: var(--good); }

.pick-cats { margin-block-start: 14px; }
.pick-cat { cursor: default; }
.pick-cat-label { color: var(--muted); font-weight: 600; }

.compare-table td.best .score-cell { color: var(--good); }
.compare-table .score-row td { font-size: 1.05rem; text-align: center; }

@media (max-width: 560px) {
  .pick-main { flex-direction: column; align-items: flex-start; }
  .pick-media { inline-size: 100%; }
}

/* ---------------- news ---------------- */

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list-item {
  padding-block: 10px;
  border-block-end: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.news-list-item:last-child { border-block-end: none; }
.news-list-item .muted { font-size: 0.82rem; }

.news-grid { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.news-card .card-title a { color: inherit; }
.news-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  background: var(--bg);
}
.news-summary { font-size: 0.88rem; margin: 8px 0 0; }

/* ---------------- tools ---------------- */

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: 16px;
  margin-block: 16px;
}
.tool-card { padding: 20px; }
.tool-card form { display: grid; gap: 12px; margin-block: 14px; }
.tool-promo { padding: 20px; }
.tool-promo .btn { margin-block-start: 8px; }

.calc-results { margin: 16px 0 0; border-block-start: 1px solid var(--border); padding-block-start: 8px; }
.calc-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-block: 7px;
}
.calc-row dt { color: var(--muted); font-size: 0.9rem; }
.calc-row dd { margin: 0; font-weight: 700; }
.calc-main dd { font-size: 1.35rem; color: var(--navy); }
@media (prefers-color-scheme: dark) { .calc-main dd { color: #7db3e0; } }

/* ---------------- lease vs finance vs cash ---------------- */
.finc-group { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; margin: 0; }
.finc-group legend { font-weight: 800; padding-inline: 6px; color: var(--navy); }
@media (prefers-color-scheme: dark) { .finc-group legend { color: #7db3e0; } }
.finc-results { margin-block-start: 18px; }
.finc-cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 12px;
}
.finc-col { border: 1px solid var(--border); border-radius: 12px; padding: 14px; background: var(--bg); }
.finc-col h3 { margin: 0 0 8px; font-size: 1rem; }
.finc-monthly { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
@media (prefers-color-scheme: dark) { .finc-monthly { color: #7db3e0; } }
.finc-monthly small { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.finc-col dl { margin: 10px 0 0; display: grid; gap: 6px; }
.finc-col dl div { display: flex; justify-content: space-between; gap: 10px; font-size: 0.88rem; }
.finc-col dt { color: var(--muted); }
.finc-col dd { margin: 0; font-weight: 700; }
.finc-col.finc-best { border-color: var(--best-border); background: var(--best-bg); }
.finc-verdict { margin-block-start: 14px; font-weight: 700; }

/* ---------------- inspection checklist ---------------- */
.insp-bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; margin-block: 14px 8px; }
.insp-bar-fill { display: block; height: 100%; width: 0; background: var(--best-border); transition: width 0.2s ease; }
.insp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-block-end: 16px; }
.insp-count { font-weight: 800; }
.insp-cat { padding: 16px 18px; margin-block-end: 14px; }
.insp-cat-title { margin: 0 0 10px; font-size: 1.05rem; }
.insp-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.insp-item label { display: flex; align-items: flex-start; gap: 10px; padding: 8px 4px; cursor: pointer; min-height: 44px; }
.insp-check { inline-size: 20px; block-size: 20px; margin-block-start: 2px; flex-shrink: 0; accent-color: var(--navy); }
.insp-check:checked + span { color: var(--muted); text-decoration: line-through; }
@media print {
  .site-header, .site-footer, .insp-toolbar .actions, .newsletter, .disclaimer { display: none !important; }
  .insp-bar { display: none; }
  .insp-cat { break-inside: avoid; border: 1px solid #999; }
  body { background: #fff; color: #000; }
}

/* ---------------- recent price drops ---------------- */
.drop-wrap { position: relative; display: flex; flex-direction: column; }
.drop-badge {
  position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 2;
  background: var(--best-border); color: #fff; font-weight: 800; font-size: 0.82rem;
  padding: 3px 9px; border-radius: 999px; box-shadow: 0 1px 4px rgba(16,40,60,.25);
}
.drop-prices { display: flex; align-items: center; gap: 8px; padding: 6px 4px 0; font-weight: 700; }
.drop-old { color: var(--muted); text-decoration: line-through; }
.drop-arrow { color: var(--muted); }
.drop-new { color: var(--navy); }
@media (prefers-color-scheme: dark) { .drop-new { color: #7db3e0; } }
.drops-empty { padding-block: 24px; }

/* ---------------- guides ---------------- */

.guides-list { display: grid; gap: 12px; }
.guide-card { padding: 0; }
.guide-card summary {
  cursor: pointer;
  padding: 16px 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}
.guide-card summary::-webkit-details-marker { display: none; }
.guide-card summary::after {
  content: '▾';
  color: var(--muted);
  transition: transform 0.15s ease;
  flex: none;
}
.guide-card[open] summary::after { transform: rotate(180deg); }
.guide-body { padding: 0 18px 18px; }
.guide-body p { margin-block-start: 0; white-space: normal; }

/* ---------------- footer ---------------- */

.site-footer {
  margin-block-start: 48px;
  background: var(--navy-dark);
  color: rgba(255, 255, 255, 0.85);
  padding-block: 36px 20px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 24px;
}
.footer-col h3 { color: #fff; font-size: 1rem; }
.brand-footer { color: #fff; font-weight: 700; display: inline-flex; align-items: center; gap: 10px; }
.footer-about, .footer-disclaimer { font-size: 0.86rem; line-height: 1.7; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-block-end: 6px; }
.footer-links a, .site-footer a { color: rgba(255, 255, 255, 0.85); }
.footer-links a:hover { color: var(--amber); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  margin-block-start: 26px;
  padding-block-start: 14px;
  border-block-start: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 0.84rem;
}

/* ============================================================
   Design polish + SEO components (breadcrumbs, VS links).
   Extends the system above — no existing class is renamed.
   ============================================================ */

:root {
  --amber-dark: #E09A00;
  --ring: rgba(15, 76, 129, 0.5);
}
@media (prefers-color-scheme: dark) {
  :root { --ring: rgba(125, 179, 224, 0.6); }
}

html { -webkit-text-size-adjust: 100%; }
body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }

/* Accessible, visible focus for keyboard users (both themes). */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: 6px;
}
.site-header :where(a, button):focus-visible,
.hero :where(a, button, input):focus-visible {
  outline-color: var(--amber);
}

/* Sticky header refinement. */
.site-header { border-block-end: 1px solid rgba(255, 255, 255, 0.08); backdrop-filter: saturate(1.1); }

/* Hero: subtle depth + tighter rhythm. */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0, rgba(255, 179, 0, 0.16), transparent 55%),
    linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
}
.hero > .container { position: relative; z-index: 1; }
.hero-search input[type="search"]:focus { outline: 2px solid var(--amber); outline-offset: 2px; }

/* Card hover elevation (reinforces the shared token). */
a.card:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }

/* ---------------- breadcrumbs (schema-friendly) ---------------- */

.breadcrumb { margin-block-end: 16px; }
.breadcrumb-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb-item { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  color: var(--muted);
  opacity: 0.55;
}
.breadcrumb-item a { color: var(--muted); font-weight: 600; }
.breadcrumb-item a:hover { color: var(--navy); }
@media (prefers-color-scheme: dark) { .breadcrumb-item a:hover { color: #7db3e0; } }
.breadcrumb-item [aria-current="page"] { color: var(--text); font-weight: 700; }

/* ---------------- popular comparisons (internal linking) ---------------- */

.popular-comparisons .muted { margin-block: 2px 0; }
.comparison-links {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 10px;
}
.comparison-link {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.comparison-link:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--navy);
  box-shadow: 0 6px 20px rgba(7, 42, 76, 0.14);
}
.comparison-link > span { flex: 1 1 0; min-width: 0; }
.comparison-link .vs {
  flex: none;
  margin-inline: 0.45em;
  font-style: normal;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.3px;
  color: var(--navy-dark);
  background: var(--amber);
  padding: 2px 9px;
  border-radius: 999px;
}

/* ---------------- compare table: horizontal-scroll shadow ---------------- */

.compare-scroll {
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(127, 127, 127, 0)) left center,
    linear-gradient(to left, var(--surface) 30%, rgba(127, 127, 127, 0)) right center,
    radial-gradient(farthest-side at 0 50%, rgba(7, 42, 76, 0.16), rgba(7, 42, 76, 0)) left center,
    radial-gradient(farthest-side at 100% 50%, rgba(7, 42, 76, 0.16), rgba(7, 42, 76, 0)) right center;
  background-repeat: no-repeat;
  background-size: 44px 100%, 44px 100%, 16px 100%, 16px 100%;
  background-attachment: local, local, scroll, scroll;
  border-radius: var(--radius);
}
@media (min-width: 900px) {
  .compare-scroll { background: none; }
}
.compare-table td.best { position: relative; }
.compare-table td.best::after {
  content: '';
  position: absolute;
  inset-block-start: 4px;
  inset-inline-end: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--good);
}

/* ---------------- print (compare-friendly) ---------------- */

@media print {
  .site-header, .site-footer, .compare-pickers, .compare-controls,
  .share-buttons, .hero, .filter-bar, .pagination, .nav-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .table-scroll, .compare-scroll { overflow: visible; }
  .compare-table th, .compare-table td { border-color: #999; }
  a { color: #000; }
}

/* ---------------- news article page ---------------- */

.news-source-link { color: inherit; }

.news-article {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-block-end: 8px;
}
.news-article-hero {
  margin-block-end: 16px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
}
.news-article-hero img {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  display: block;
}
.news-article-meta {
  font-size: 0.9rem;
  margin-block-end: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: baseline;
}
.news-article-source { font-weight: 700; }
.news-article-summary {
  font-size: 1.08rem;
  line-height: 1.75;
  font-weight: 600;
  color: var(--text);
  margin-block: 8px 18px;
  padding-inline-start: 14px;
  border-inline-start: 3px solid var(--amber);
}

/* Full original article body */
.news-article-body { margin-block: 4px 20px; }
.news-article-body > p {
  font-size: 1.04rem;
  line-height: 1.9;
  margin-block: 0 16px;
  color: var(--text);
}
.news-article-body > p:last-child { margin-block-end: 0; }
.news-article-figure {
  margin: 8px 0 20px;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg);
  border: 1px solid var(--border);
}
.news-article-figure img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}
.news-article-figure figcaption {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 8px 12px;
  text-align: center;
}
.news-article-editnote {
  font-size: 0.85rem;
  font-style: italic;
  margin-block: 4px 16px;
  padding-block-start: 12px;
  border-block-start: 1px solid var(--border);
}

/* ---------------- comments ---------------- */

.comments-count { color: var(--muted); font-weight: 400; font-size: 0.95rem; }
.comments-empty { margin-block: 8px 20px; }

.comments-list { list-style: none; margin: 12px 0 24px; padding: 0; display: grid; gap: 12px; }
.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}
.comment-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  justify-content: space-between;
  margin-block-end: 4px;
}
.comment-author { font-weight: 700; }
.comment-date { font-size: 0.8rem; }
.comment-body { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  max-width: 640px;
  display: grid;
  gap: 12px;
}
.comment-form-title { margin: 0; font-size: 1.1rem; }
.comment-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  width: 100%;
  resize: vertical;
  min-height: 96px;
}
.comment-form textarea:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.comment-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}
.comment-form-note { font-size: 0.82rem; }
.comment-form-msg {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--best-bg);
  border: 1px solid var(--best-border);
  color: var(--good);
  font-size: 0.9rem;
}
.comment-form-msg.is-error {
  background: rgba(192, 57, 43, 0.12);
  border-color: var(--bad);
  color: var(--bad);
}
.comment-form-terms { font-size: 0.8rem; margin: 0; }
.comment-report-btn {
  font: inherit;
  font-size: 0.78rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--muted, inherit);
  text-decoration: underline;
}
.comment-report-btn:hover { color: var(--bad); }
.comment-report-btn.is-reported { text-decoration: none; cursor: default; color: var(--good); }

/* ---------------- legal pages (privacy / terms) ---------------- */

.legal-page { max-width: 760px; }
.legal-page h2 { margin-block: 24px 8px; font-size: 1.15rem; }
.legal-page p, .legal-page li { line-height: 1.7; }
.legal-page ul { padding-inline-start: 20px; display: grid; gap: 6px; }

/* ---------------- AI widgets ---------------- */

.ai-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
.tools-grid .ai-widget { margin: 0; }
.ai-ask-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-block: 12px;
}
.ai-ask-input { flex: 1 1 240px; }
.ai-answer {
  margin-block-start: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--navy);
  line-height: 1.7;
  white-space: normal;
  overflow-wrap: anywhere;
}
.ai-answer p { margin: 0 0 0.7em; }
.ai-answer p:last-child { margin-bottom: 0; }
.ai-answer.is-error {
  border-inline-start-color: var(--bad);
  color: var(--bad);
}
@media (prefers-color-scheme: dark) {
  .ai-answer { border-inline-start-color: #7db3e0; }
}

/* News image placeholder (shown when an article has no image, or its image 404s) */
.news-ph{display:flex;align-items:center;justify-content:center;gap:.5rem;
  background:linear-gradient(135deg,#0f4c81,#072a4c);color:rgba(255,255,255,.85)}
.news-ph .news-ph-initial{font-weight:800;font-size:1.1rem;letter-spacing:.02em}
img.news-thumb.news-ph,.news-ph.news-thumb{min-height:80px}
.news-article-hero .news-ph{width:100%;aspect-ratio:16/9;min-height:180px}

/* ============================================================
   New landing pages, rankings, tools & hubs
   ============================================================ */
.section-intro {
  max-width: none;
  color: var(--text);
  margin: 6px 0 18px;
  font-size: 1.08rem;
  line-height: 1.8;
}
.badge-est {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--warn);
  background: rgba(181, 71, 8, 0.12);
  border-radius: 999px;
  padding: 1px 8px;
  vertical-align: middle;
  margin-inline-start: 6px;
}

/* Brand hub */
.brand-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}
.brand-card:hover { text-decoration: none; transform: translateY(-2px); }
.brand-swatch {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 10px;
}
/* Brand logo tile — real logo (on a white chip) with a coloured-monogram fallback. */
.brand-logo {
  position: relative;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.5px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.brand-logo-mono { position: relative; z-index: 0; }
.brand-logo-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  z-index: 1;
}
.brand-logo.brand-logo-lg { width: 64px; height: 64px; font-size: 1.35rem; border-radius: 16px; }
.brand-logo.brand-logo-lg .brand-logo-img { padding: 10px; }
.brand-card-body { display: flex; flex-direction: column; min-width: 0; }

/* Insurance directory */
.insurer-meta { margin: 2px 0 16px; font-size: 0.92rem; }
.insurance-calc-link { margin: -6px 0 16px; }
.insurance-calc-link a { font-weight: 700; color: var(--navy); text-decoration: none; }
.insurance-calc-link a:hover { text-decoration: underline; }
@media (prefers-color-scheme: dark) { .insurance-calc-link a { color: #7db3e0; } }
.najm-callout {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px 20px;
  margin: 4px 0 22px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(176, 28, 46, 0.10), rgba(176, 28, 46, 0.04));
  border: 1px solid rgba(176, 28, 46, 0.30);
}
.najm-icon { font-size: 2rem; line-height: 1; flex: none; }
.najm-body { min-width: 0; }
.najm-title { margin: 0 0 4px; font-size: 1.2rem; color: #a3172e; }
.najm-text { margin: 0 0 12px; color: var(--text); line-height: 1.7; }
.btn-najm {
  background: #b01c2e;
  color: #fff;
  border-color: #b01c2e;
  font-weight: 700;
}
.btn-najm:hover { background: #8f1626; border-color: #8f1626; color: #fff; text-decoration: none; }
@media (prefers-color-scheme: dark) {
  .najm-title { color: #ff8ea0; }
  .najm-callout { background: linear-gradient(135deg, rgba(176, 28, 46, 0.22), rgba(176, 28, 46, 0.08)); }
}
.insurer-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.insurer-card { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.insurer-head { display: flex; align-items: center; gap: 12px; }
.insurer-mono {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  letter-spacing: 0.5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}
.insurer-names { min-width: 0; }
.insurer-card .card-title { margin: 0; font-size: 1.02rem; line-height: 1.3; }
.insurer-card .card-meta { font-size: 0.82rem; color: var(--muted); }
.chip-motor {
  background: rgba(15, 76, 129, 0.10);
  color: var(--navy);
  border: 1px solid rgba(15, 76, 129, 0.20);
}
@media (prefers-color-scheme: dark) {
  .chip-motor { color: #7db3e0; background: rgba(125, 179, 224, 0.12); border-color: rgba(125, 179, 224, 0.25); }
}
.insurer-card .actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.disclaimer-note { margin-top: 22px; font-size: 0.85rem; line-height: 1.7; }

/* Brand page hero */
.brand-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 6px solid var(--brand-color, var(--navy));
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.brand-hero-swatch { flex: none; width: 56px; height: 56px; border-radius: 14px; }
.brand-hero .page-title { margin: 0; }
.highlight-card { min-width: 220px; }
.highlight-card > .chip { margin-bottom: 8px; }
.price-table td a { font-weight: 600; }

/* Rankings hub */
.rank-hub-grid { grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.rank-hub-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.rank-hub-card:hover { text-decoration: none; transform: translateY(-2px); }
.rank-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 12px; }
.rank-item { display: flex; align-items: flex-start; gap: 12px; }
.rank-num {
  flex: none;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 800;
  margin-top: 8px;
}
.rank-card { flex: 1 1 0; min-width: 0; }
.rank-metric {
  margin-top: 6px;
  font-weight: 700;
  color: var(--good);
  font-size: 0.95rem;
}

/* Budget cards */
.budget-monthly {
  margin-top: 6px;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Cost of ownership block (car page) + tool results */
.cost-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.cost-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cost-tile.cost-main { border-color: var(--navy); }
.cost-value { font-size: 1.3rem; font-weight: 800; }
.tco-results .calc-main dd { font-weight: 800; }

/* Depreciation verdict */
.dep-verdict { font-weight: 700; }
.dep-verdict.is-good { color: var(--good); }
.dep-verdict.is-warn { color: var(--warn); }

/* Fuel-price tiles */
.price-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.price-tile { padding: 16px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.price-tile-value { font-size: 1.6rem; font-weight: 800; color: var(--navy); }
@media (prefers-color-scheme: dark) { .price-tile-value { color: #7db3e0; } }

/* Discover section (home) */
.discover-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.discover-card { padding: 16px; }
.discover-card:hover { text-decoration: none; transform: translateY(-2px); }

/* Finder */
.finder-form .filter-bar { margin-top: 6px; }
.finder-result { display: flex; flex-direction: column; gap: 8px; }
.finder-why .chips { margin-top: 4px; }

/* Car picker form */
.picker-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 14px; }
.picker-form .field-wide { flex: 1 1 260px; }

/* Visually-hidden (honeypot fields, a11y labels) — off-screen but focusable. */
.visually-hidden {
  position: absolute !important;
  /* !important so an input[type=…]{width:100%} rule can't re-inflate the
     honeypot field and push a horizontal scrollbar onto every page. */
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Newsletter subscribe block (footer + standalone section) */
.newsletter-title { margin: 0 0 4px; font-size: 1.2rem; font-weight: 800; }
.newsletter-sub { margin: 0; color: var(--muted); font-size: 0.9rem; }
.newsletter-form { margin-top: 12px; }
.newsletter-row { display: flex; gap: 8px; align-items: stretch; }
.newsletter-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}
.newsletter-input:focus { outline: 2px solid var(--navy); outline-offset: 1px; }
.newsletter-btn { flex: 0 0 auto; white-space: nowrap; }
.newsletter-msg {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--best-bg);
  border: 1px solid var(--best-border);
  color: var(--good);
  font-size: 0.9rem;
}
.newsletter-msg.is-error {
  background: rgba(192, 57, 43, 0.12);
  border-color: var(--bad);
  color: var(--bad);
}
/* Premium standalone newsletter card (home + news pages) */
.newsletter-section {
  background: linear-gradient(135deg, #0F4C81, #072a4c);
  color: #fff;
  border: 0;
  border-radius: 20px;
  padding: 30px 22px;
  margin-block: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.newsletter-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: #fff;
  margin-bottom: 8px;
}
.newsletter-section .newsletter-title { color: #fff; font-size: 1.35rem; }
.newsletter-section .newsletter-sub { color: rgba(255, 255, 255, 0.85); max-width: 520px; font-size: 0.95rem; }
.newsletter-section .newsletter-form { width: 100%; max-width: 440px; margin-top: 16px; }
.newsletter-section .newsletter-input { border: 0; background: #fff; color: #12212f; }
.newsletter-section .newsletter-input:focus { outline-color: var(--amber, #FFB300); }
.newsletter-section .newsletter-btn { background: var(--amber, #FFB300); color: #1a1200; border: 0; }
.newsletter-section .newsletter-msg { background: rgba(255, 255, 255, 0.15); border-color: rgba(255, 255, 255, 0.35); color: #fff; }
@media (max-width: 440px) {
  .newsletter-row { flex-wrap: wrap; }
  .newsletter-btn { width: 100%; }
}
.footer-newsletter-wrap {
  padding-block: 8px 20px;
  margin-block-end: 12px;
  border-block-end: 1px solid rgba(255, 255, 255, 0.14);
}
/* On the dark navy footer, lighten the newsletter copy + field. */
.newsletter-footer .newsletter-sub { color: rgba(255, 255, 255, 0.72); }
.newsletter-footer .newsletter-input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}
.newsletter-footer .newsletter-input::placeholder { color: rgba(255, 255, 255, 0.6); }

/* ---------------- star ratings & reviews ---------------- */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.95rem;
  margin-block: 6px 8px;
}
.star-rating .stars { font-size: 1rem; }
.star-rating-sm { font-size: 0.85rem; margin-block: 4px 6px; }
.star-rating-sm .stars { font-size: 0.9rem; }
.star-rating .rating-num { font-weight: 800; }
.star-rating .rating-count { font-weight: 600; }
.car-rating-line { text-decoration: none; color: inherit; display: inline-block; }
.comment-stars { margin-inline-start: 6px; font-size: 0.95rem; }

/* Accessible 1–5 star input (radios visually hidden; glyphs fill up to selection). */
.rating-field { display: flex; flex-direction: column; gap: 4px; }
.rating-field-label { font-size: 0.82rem; font-weight: 700; color: var(--muted); }
.star-input { display: inline-flex; gap: 2px; }
.star-input-star {
  cursor: pointer;
  line-height: 1;
  padding: 2px;
  border-radius: 6px;
}
.star-input-star .star-glyph {
  font-size: 1.6rem;
  color: var(--border);
  transition: color 0.12s ease;
}
.star-input-star.is-on .star-glyph,
.star-input-star:hover .star-glyph { color: var(--amber); }
.star-input-star input:focus-visible ~ .star-glyph { outline: 2px solid var(--navy); outline-offset: 2px; }

/* ---------------- trims comparison table ---------------- */
.trims-compare th:last-child, .trims-compare td:last-child { text-align: end; }
.trims-compare .trim-base td { font-weight: 700; }
.trim-delta { color: var(--warn); font-weight: 700; white-space: nowrap; }
.trims-note { font-size: 0.83rem; margin-block-start: 8px; }

/* ---------------- misc (budget toggle, insurance field hint) ---------------- */
.budget-toggle { margin-block: 4px 16px; }
#ins-value-field.is-muted { opacity: 0.5; }
.newsletter-footer .newsletter-input:focus { outline-color: var(--amber); }

/* Photo credit overlay on the car hero (CC BY images require visible
   attribution; also labels AI-illustrated cars honestly). */
.car-img-credit {
  position: absolute;
  bottom: 6px;
  inset-inline-end: 8px;
  z-index: 2;
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.4;
  color: #fff;
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 9px;
  border-radius: 999px;
  pointer-events: none;
}

/* ---------------- Beseyat Score (pill on car hero + breakdown card) */
.score-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  margin: 6px 0 2px;
  padding: 5px 14px;
  border-radius: 999px;
  border: 1px solid var(--border, rgba(0, 0, 0, 0.12));
  text-decoration: none;
  color: inherit;
  font-size: 14px;
  line-height: 1.5;
}
.score-pill strong { font-size: 19px; font-weight: 800; }
/* Secondary pill text uses a fixed AA-contrast muted colour instead of an
   opacity dilution of the tinted colour (which failed WCAG 4.5:1). */
.score-pill-max { color: var(--muted); font-size: 12px; }
.score-pill-band { font-weight: 700; }
.score-pill-name { color: var(--muted); font-size: 12px; }
/* Darkened greens so the small band labels keep >=4.5:1 on light card surfaces. */
.score-excellent strong, .score-excellent .score-pill-band, .score-total.score-excellent { color: #0f6e2d; }
.score-verygood strong, .score-verygood .score-pill-band, .score-total.score-verygood { color: #147233; }
.score-good strong, .score-good .score-pill-band, .score-total.score-good { color: #9a6700; }
.score-fair strong, .score-fair .score-pill-band, .score-total.score-fair { color: #bc4c00; }
.score-low strong, .score-low .score-pill-band, .score-total.score-low { color: #cf222e; }
/* Brightened band colors for dark mode so the small band labels keep >=4.5:1
   contrast on the dark card surface (WCAG AA). */
@media (prefers-color-scheme: dark) {
  .score-excellent strong, .score-excellent .score-pill-band, .score-total.score-excellent { color: #4cc26c; }
  .score-verygood strong, .score-verygood .score-pill-band, .score-total.score-verygood { color: #57c46f; }
  .score-good strong, .score-good .score-pill-band, .score-total.score-good { color: #e0b341; }
  .score-fair strong, .score-fair .score-pill-band, .score-total.score-fair { color: #f0873f; }
  .score-low strong, .score-low .score-pill-band, .score-total.score-low { color: #e5695a; }
}

.score-card { display: grid; grid-template-columns: auto 1fr; gap: 18px 26px; align-items: center; padding: 18px; }
.score-total { text-align: center; min-width: 110px; }
.score-total-num { font-size: 44px; font-weight: 800; line-height: 1.1; }
.score-total-num span { font-size: 16px; color: var(--muted); font-weight: 600; }
/* Links inside body text need a non-colour cue (underline) — WCAG "use of
   colour". Applies to any link within a paragraph except button/chip-styled
   ones, plus the article body/editnote. */
p a:not([class*="btn"]):not([class*="chip"]), .news-article-body a, .news-article-editnote a { text-decoration: underline; }
.score-total-band { font-weight: 700; margin-top: 2px; }
.score-bars { display: grid; gap: 8px; }
.score-bar-row { display: grid; grid-template-columns: 150px 1fr 34px; gap: 10px; align-items: center; font-size: 13px; }
.score-bar { display: block; height: 8px; border-radius: 999px; background: rgba(127, 127, 127, 0.18); overflow: hidden; }
.score-bar-fill { display: block; height: 100%; border-radius: 999px; background: var(--accent, #0F4C81); }
.score-bar-val { text-align: end; font-weight: 700; }
.score-note { grid-column: 1 / -1; margin: 0; font-size: 12.5px; }
@media (max-width: 560px) {
  .score-card { grid-template-columns: 1fr; }
  .score-bar-row { grid-template-columns: 110px 1fr 30px; }
}
