/* ── Reset & base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  background: #f0f4f8;
  color: #1a1a2e;
  min-height: 100vh;
  display: flex; flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── Colours ──────────────────────────────────────────────────────────────── */
:root {
  --navy:   #1F3864;
  --blue:   #2E75B6;
  --green:  #375623;
  --amber:  #FFF8E7;
  --lt-blue:#EBF3FB;
  --mid-blue:#D6E4F0;
  --border: #B8CCE4;
  --text:   #1a1a2e;
  --muted:  #595959;
  --bg:     #f0f4f8;
  --white:  #ffffff;
  --card-r: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,.10);
  --shadow-hover: 0 6px 20px rgba(0,0,0,.16);
}

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.nav { background: var(--navy); color: white; position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.nav-inner { max-width: 1400px; margin: 0 auto; padding: 0 1.25rem;
  display: flex; align-items: center; gap: 2rem; height: 52px; }
.nav-logo { font-size: 1.05rem; font-weight: 700; color: white; display: flex;
  align-items: center; gap: .5rem; }
.nav-links { display: flex; gap: 1rem; margin-left: auto; }
.nav-link { color: rgba(255,255,255,.8); font-size: .9rem; padding: .3rem .6rem;
  border-radius: 6px; transition: background .15s; }
.nav-link:hover, .nav-link.active { background: rgba(255,255,255,.15); color: white; }

/* ── Main + footer ────────────────────────────────────────────────────────── */
.main { flex: 1; max-width: 1400px; margin: 0 auto; width: 100%; padding: 1.5rem 1.25rem; }
.footer { background: var(--navy); color: rgba(255,255,255,.65); font-size: .78rem; }
.footer-inner { max-width: 1400px; margin: 0 auto; padding: .75rem 1.25rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }

/* ── Page header ──────────────────────────────────────────────────────────── */
.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 1.6rem; color: var(--navy); font-weight: 700; }
.page-subtitle { color: var(--muted); font-size: .9rem; margin-top: .25rem; }

/* ── Layout: sidebar + grid ───────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 260px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } }

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar { position: sticky; top: 68px; }
.sidebar-card { background: var(--white); border-radius: var(--card-r);
  box-shadow: var(--shadow); padding: 1.1rem; margin-bottom: 1rem; }
.sidebar-title { font-size: .95rem; font-weight: 700; color: var(--navy);
  margin-bottom: .75rem; }
.sidebar-hint { font-size: .8rem; color: var(--muted); margin-bottom: .9rem; }

.weight-group { margin-bottom: .8rem; }
.weight-group-label { font-size: .75rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .05em; margin-bottom: .4rem; }
.weight-row { display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; margin-bottom: .3rem; }
.weight-row label { font-size: .82rem; color: var(--text); flex: 1; }
.weight-input { width: 58px; padding: .25rem .4rem; border: 1.5px solid var(--border);
  border-radius: 5px; font-size: .85rem; text-align: center;
  background: #FFF2CC; color: #0000cc; font-weight: 600; }
.weight-input:focus { outline: none; border-color: var(--blue); }

.weight-actions { display: flex; align-items: center; gap: .6rem; margin-top: .9rem;
  flex-wrap: wrap; }

.legend-card { font-size: .83rem; }
.legend-row { display: flex; align-items: center; gap: .6rem; margin-bottom: .5rem;
  color: var(--text); }
.legend-note { font-size: .78rem; color: var(--muted); margin-top: .5rem; }
.badge-new  { background: var(--lt-blue); color: var(--blue); border-radius: 4px;
  padding: 2px 7px; font-size: .75rem; font-weight: 600; }
.badge-used { background: var(--amber); color: #7B5E00; border-radius: 4px;
  padding: 2px 7px; font-size: .75rem; font-weight: 600; }
.score-bar-demo { display: inline-block; width: 60px; height: 8px;
  background: linear-gradient(90deg, #63BE7B 60%, #e0e0e0 60%);
  border-radius: 4px; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary { background: var(--navy); color: white; border: none; border-radius: 6px;
  padding: .45rem .9rem; font-size: .85rem; font-weight: 600; transition: background .15s; }
.btn-primary:hover { background: var(--blue); }
.btn-ghost { background: transparent; border: 1.5px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: .4rem .8rem; font-size: .82rem; }
.btn-ghost:hover { border-color: var(--navy); color: var(--navy); }
.btn-ghost-sm { font-size: .8rem; color: var(--blue); border: 1px solid var(--border);
  border-radius: 5px; padding: .3rem .65rem; }
.btn-ghost-sm:hover { background: var(--lt-blue); }

.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline; }
.spinner-text { color: var(--blue); font-size: .82rem; font-style: italic; }

/* ── Vehicle grid ─────────────────────────────────────────────────────────── */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.1rem;
}

/* ── Vehicle card ─────────────────────────────────────────────────────────── */
.vehicle-card {
  background: var(--white); border-radius: var(--card-r); box-shadow: var(--shadow);
  overflow: hidden; cursor: pointer; transition: transform .18s, box-shadow .18s;
  border: 2px solid transparent; display: flex; flex-direction: column;
}
.vehicle-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.vehicle-card.is-favourite { border-color: #f5c842; }

.card-top-row { display: flex; align-items: center; gap: .4rem; padding: .55rem .7rem .35rem; }
.rank-badge {
  font-weight: 800; font-size: .95rem; min-width: 34px; height: 34px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0;
}
.rank-1  { background: #C9952A; }
.rank-2  { background: #8C8C8C; }
.rank-3  { background: #8B5E3C; }
.rank-4,.rank-5,.rank-6  { background: var(--navy); }
.rank-7,.rank-8,.rank-9  { background: var(--blue); }
.rank-10,.rank-11,.rank-12,
.rank-13,.rank-14,.rank-15,
.rank-16,.rank-17,.rank-18 { background: #666; }

.card-badges { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1; }
.pt-badge { color: white; border-radius: 4px; padding: 2px 7px;
  font-size: .72rem; font-weight: 700; }
.nu-badge { border-radius: 4px; padding: 2px 7px; font-size: .72rem; font-weight: 600; }
.nu-new  { background: var(--lt-blue); color: var(--blue); }
.nu-used { background: var(--amber); color: #7B5E00; }

.fav-btn { background: none; border: none; font-size: 1.2rem; color: #ccc;
  padding: 0 .2rem; line-height: 1; transition: color .15s; }
.fav-btn:hover, .fav-btn.fav-active { color: #f5c842; }

.archive-btn { background: none; border: none; font-size: 1.1rem; color: #ccc;
  padding: 0 .2rem; line-height: 1; cursor: pointer; transition: color .15s, opacity .15s;
  opacity: .55; }
.archive-btn:hover { color: var(--blue); opacity: 1; }

.archive-toggle { font-size: .85rem; margin-top: .35rem; opacity: .85; }
.archive-toggle a { color: var(--blue); text-decoration: none; margin-left: .5rem; font-weight: 500; }
.archive-toggle a:hover { text-decoration: underline; }
.icon-key { display: inline-block; padding: 0 .15rem; }

.btn-ghost-sm.archive-restore { background: #fff3cd; border-color: #f5c842; color: #856404; }

.card-image-wrap { position: relative; height: 165px; overflow: hidden; background: #14181e; }
.card-image { width: 100%; height: 100%; object-fit: contain; }
.card-image-placeholder { height: 100%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: .4rem;
  background: var(--mid-blue); color: var(--navy); }
.placeholder-icon { font-size: 2rem; }
.placeholder-text { font-size: .8rem; font-weight: 600; text-align: center; padding: 0 .5rem; }
.card-image-overlay { position: absolute; inset: 0; background: rgba(31,56,100,.75);
  display: flex; align-items: center; justify-content: center; color: white;
  font-size: .9rem; font-weight: 600; opacity: 0; transition: opacity .2s; }
.vehicle-card:hover .card-image-overlay { opacity: 1; }

.card-body { padding: .7rem .85rem .85rem; display: flex; flex-direction: column; gap: .45rem; flex: 1; }
.card-name { font-size: .97rem; font-weight: 700; color: var(--navy); line-height: 1.3; }
.card-meta { display: flex; flex-wrap: wrap; gap: .4rem; }
.card-years { font-size: .78rem; color: var(--muted); font-weight: 600; }
.card-pt    { font-size: .75rem; color: var(--muted); font-style: italic; }

.card-tco-row { display: flex; justify-content: space-between; align-items: baseline; }
.card-tco { display: flex; flex-direction: column; }
.tco-label, .score-label { font-size: .7rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; }
.tco-value { font-size: 1.05rem; font-weight: 800; color: var(--navy); }
.upfront-line { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.upfront-label { font-size: .65rem; text-transform: uppercase; letter-spacing: .04em;
  margin-right: .35rem; }
.card-score-wrap { display: flex; flex-direction: column; align-items: flex-end; }

/* Horizon slider (sidebar) */
.horizon-row { display: flex; align-items: center; gap: .6rem; margin: .3rem 0 .2rem; }
.horizon-row input[type=range] { flex: 1; accent-color: var(--blue); }
.horizon-val { font-size: .95rem; font-weight: 700; color: var(--navy);
  min-width: 3.2em; text-align: right; }
.horizon-hint { font-size: .7rem; color: var(--muted); margin: 0 0 .2rem; line-height: 1.35; }
.score-value { font-size: 1.15rem; font-weight: 800; color: var(--blue); }

/* Score bars */
.score-bars { display: flex; flex-direction: column; gap: .28rem; }
.score-bar-row { display: grid; grid-template-columns: 70px 1fr 18px; align-items: center; gap: .3rem; }
.bar-label { font-size: .72rem; color: var(--muted); white-space: nowrap; }
.bar-track { height: 7px; background: #e8edf2; border-radius: 4px; overflow: hidden; }
.bar-fill  { height: 100%; border-radius: 4px; transition: width .4s; }
.bar-val   { font-size: .7rem; font-weight: 700; color: var(--navy); text-align: right; }

/* Score colours 1-5 */
.score-1 { background: #e05c5c; }
.score-2 { background: #e08c3c; }
.score-3 { background: #d4b84a; }
.score-4 { background: #7ab54e; }
.score-5 { background: #2d9e5f; }

.spec-pills { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .1rem; }
.spec-pill  { font-size: .7rem; padding: 2px 8px; background: var(--lt-blue);
  color: var(--navy); border-radius: 12px; font-weight: 500; }
.caution-pill { background: #fff3cd; color: #856404; }

/* ── Detail page ──────────────────────────────────────────────────────────── */
.detail-layout { display: grid; grid-template-columns: 1fr 360px; gap: 1.5rem;
  align-items: start; }
@media (max-width: 1000px) { .detail-layout { grid-template-columns: 1fr; } }

.detail-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; }
.detail-rank-badge { font-weight: 800; font-size: 1.4rem; min-width: 52px; height: 52px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: white; flex-shrink: 0; background: var(--navy); }
.detail-title-block { flex: 1; }
.detail-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.years-badge { background: #eef; color: var(--navy); border-radius: 4px;
  padding: 2px 7px; font-size: .72rem; font-weight: 600; }
.caution-badge { background: #fff3cd; color: #856404; border-radius: 4px;
  padding: 2px 7px; font-size: .72rem; font-weight: 600; }
.detail-name { font-size: 1.5rem; font-weight: 800; color: var(--navy); line-height: 1.2; }
.detail-pt   { color: var(--muted); font-size: .9rem; margin-top: .2rem; }
.detail-header-actions { display: flex; flex-direction: column; gap: .5rem; align-items: flex-end;
  flex-shrink: 0; }

.fav-btn-large { background: none; border: 1.5px solid var(--border); border-radius: 6px;
  padding: .4rem .8rem; font-size: .85rem; color: var(--muted); }
.fav-btn-large.fav-active { color: #856404; background: #fff3cd; border-color: #f5c842; }

.caution-banner { background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px;
  padding: .7rem 1rem; display: flex; gap: .6rem; margin-bottom: 1rem;
  font-size: .88rem; color: #664d03; }
.caution-icon { font-size: 1.1rem; flex-shrink: 0; }

/* Gallery */
.gallery { margin-bottom: 1.2rem; }
.gallery-main-wrap { border-radius: var(--card-r); overflow: hidden; height: 320px;
  background: #14181e; margin-bottom: .6rem; }
.gallery-main { width: 100%; height: 100%; object-fit: contain; transition: opacity .2s; }
.gallery-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.gallery-thumb { width: 80px; height: 54px; object-fit: contain; background: #14181e; border-radius: 6px;
  cursor: pointer; opacity: .65; border: 2px solid transparent; transition: opacity .15s; }
.gallery-thumb:hover, .gallery-thumb.thumb-active { opacity: 1; border-color: var(--navy); }
.gallery-placeholder { background: var(--lt-blue); border-radius: var(--card-r);
  height: 200px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: .5rem; color: var(--muted); font-size: .9rem;
  margin-bottom: 1.2rem; }
.gallery-placeholder code { font-size: .8rem; background: rgba(0,0,0,.08); padding: 2px 8px;
  border-radius: 4px; }

/* Specs bar */
.specs-bar { display: flex; flex-wrap: wrap; gap: .6rem; background: var(--white);
  border-radius: var(--card-r); padding: .9rem 1rem; box-shadow: var(--shadow);
  margin-bottom: 1.2rem; }
.spec-item { display: flex; flex-direction: column; min-width: 100px; }
.spec-label { font-size: .68rem; color: var(--muted); text-transform: uppercase;
  letter-spacing: .04em; }
.spec-val { font-size: .9rem; font-weight: 700; color: var(--navy); }

/* Tabs */
.tabs { display: flex; gap: .3rem; margin-bottom: 0; border-bottom: 2px solid var(--border); }
.tab-btn { background: none; border: none; padding: .6rem 1rem; font-size: .88rem;
  color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tab-btn:hover { color: var(--navy); }
.tab-btn.tab-active { color: var(--navy); font-weight: 700;
  border-bottom-color: var(--navy); }
.tab-panel { background: var(--white); border-radius: 0 0 var(--card-r) var(--card-r);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); margin-bottom: 1.2rem; }
.tab-panel.hidden { display: none; }
.profile-text { font-size: .9rem; line-height: 1.65; color: var(--text); }

/* Notes */
.notes-hint { font-size: .82rem; color: var(--muted); margin-bottom: .7rem; }
.notes-textarea { width: 100%; min-height: 120px; border: 1.5px solid var(--border);
  border-radius: 6px; padding: .7rem; font-size: .88rem; resize: vertical; }
.notes-textarea:focus { outline: none; border-color: var(--blue); }
.notes-actions { display: flex; align-items: center; gap: .75rem; margin-top: .6rem; }
.save-confirm { color: var(--green); font-size: .85rem; font-weight: 600; }
.save-confirm.hidden { display: none; }

/* TCO breakdown */
.tco-breakdown { background: var(--white); border-radius: var(--card-r);
  padding: 1.1rem 1.2rem; box-shadow: var(--shadow); }
.section-title { font-size: 1rem; font-weight: 700; color: var(--navy); margin-bottom: .8rem; }
.tco-table { width: 100%; }
.tco-row { display: flex; justify-content: space-between; padding: .4rem 0;
  border-bottom: 1px solid #f0f4f8; font-size: .88rem; }
.tco-item-label { color: var(--muted); }
.tco-item-hint  { display: block; color: var(--muted); font-size: .72rem;
                  font-weight: 400; margin-top: .15rem; opacity: .85; }
.tco-item-val   { font-weight: 600; color: var(--navy); }
.tco-credit .tco-item-val { color: var(--green); }
.tco-total { border-top: 2px solid var(--navy); border-bottom: none !important;
  margin-top: .2rem; padding-top: .6rem !important; }
.tco-total .tco-item-label { font-weight: 700; color: var(--navy); }
.tco-total .tco-item-val   { font-size: 1.05rem; color: var(--navy); }
.tco-note { font-size: .75rem; color: var(--muted); margin-top: .7rem;
  line-height: 1.4; font-style: italic; }

/* Detail sidebar */
.detail-sidebar { display: flex; flex-direction: column; gap: 1rem;
  position: sticky; top: 68px; }
.score-card { background: var(--white); border-radius: var(--card-r);
  box-shadow: var(--shadow); padding: 1.1rem; }
.score-card-top { display: flex; justify-content: space-between; align-items: baseline; }
.score-card-label { font-size: .75rem; color: var(--muted); text-transform: uppercase; }
.score-card-val { font-size: 2rem; font-weight: 800; color: var(--navy); }
.score-card-rank { font-size: .82rem; color: var(--muted); margin-bottom: .9rem; }

.score-breakdown { display: flex; flex-direction: column; gap: .25rem; }
.score-row { display: grid; grid-template-columns: 80px 1fr 30px 30px 38px;
  align-items: center; gap: .25rem; }
.sr-label  { font-size: .73rem; color: var(--muted); white-space: nowrap; }
.sr-bar-wrap { height: 8px; background: #e8edf2; border-radius: 4px; overflow: hidden; }
.sr-bar    { height: 100%; border-radius: 4px; }
.sr-score  { font-size: .72rem; font-weight: 700; text-align: right; color: var(--navy); }
.sr-weight { font-size: .68rem; color: var(--muted); text-align: center; }
.sr-nr     { font-size: .72rem; font-weight: 600; color: var(--blue); text-align: right; }
.score-total-row { display: flex; justify-content: space-between; border-top: 1.5px solid var(--border);
  margin-top: .3rem; padding-top: .4rem; font-size: .82rem; font-weight: 700; color: var(--navy); }
.score-total { font-size: 1rem; }

.compare-card { background: var(--white); border-radius: var(--card-r);
  box-shadow: var(--shadow); padding: 1.1rem; }
.compare-select { width: 100%; padding: .5rem; border: 1.5px solid var(--border);
  border-radius: 6px; font-size: .85rem; }

.listings-card { background: var(--white); border-radius: var(--card-r);
  box-shadow: var(--shadow); padding: 1.1rem; }

/* Listings */
.listings-header { margin-bottom: .7rem; }
.listings-meta { display: flex; justify-content: space-between; align-items: baseline;
  font-size: .8rem; color: var(--muted); margin-bottom: .5rem; }
.listings-count { font-weight: 600; color: var(--navy); }
.listings-scope-controls { display: flex; flex-wrap: wrap; gap: .3rem; }
.scope-btn { background: #f0f4f8; border: 1.5px solid var(--border); border-radius: 5px;
  padding: .25rem .55rem; font-size: .74rem; color: var(--muted); }
.scope-btn:hover { border-color: var(--navy); color: var(--navy); }
.scope-btn.scope-active { background: var(--navy); color: white; border-color: var(--navy); }
.refresh-btn { margin-left: auto; }

.source-row { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted);
  margin-bottom: .7rem; }
.source-count { font-weight: 600; }

.listing-grid { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1rem; }
.listing-card { display: flex; gap: .7rem; background: #f8fafc; border-radius: 8px;
  border: 1px solid var(--border); overflow: hidden; padding: .6rem;
  transition: border-color .15s; }
.listing-card:hover { border-color: var(--blue); background: var(--lt-blue); }
.listing-thumb-wrap { width: 80px; flex-shrink: 0; }
.listing-thumb { width: 80px; height: 56px; object-fit: cover; border-radius: 5px; }
.listing-body { flex: 1; min-width: 0; }
.listing-top-row { display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: .2rem; }
.listing-price { font-size: 1rem; font-weight: 800; color: var(--navy); }
.listing-source { font-size: .7rem; color: var(--muted); }
.listing-title { font-size: .8rem; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .2rem; }
.listing-meta { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .73rem;
  color: var(--muted); }
.listing-seller { font-size: .72rem; color: var(--muted); margin-top: .1rem; }
.listings-empty { color: var(--muted); font-size: .85rem; text-align: center;
  padding: 1rem; }

.listings-load-prompt { text-align: center; padding: .8rem;
  font-size: .85rem; color: var(--muted); }
.listings-load-prompt p { margin-bottom: .7rem; }

.deep-links-section { margin-top: 1rem; border-top: 1px solid var(--border); padding-top: .8rem; }
.deep-links-title { font-size: .8rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: .04em; margin-bottom: .5rem; }
.deep-links-grid { display: flex; flex-direction: column; gap: .4rem; }
.deep-link-card { display: flex; align-items: center; gap: .6rem; background: #f8fafc;
  border: 1px solid var(--border); border-radius: 7px; padding: .55rem .7rem;
  transition: background .15s; }
.deep-link-card:hover { background: var(--lt-blue); border-color: var(--blue); }
.deep-link-icon { font-size: 1.1rem; flex-shrink: 0; }
.deep-link-info { flex: 1; display: flex; flex-direction: column; gap: .05rem; }
.deep-link-name { font-size: .82rem; font-weight: 700; color: var(--navy); }
.deep-link-desc { font-size: .72rem; color: var(--muted); }
.deep-link-arrow { color: var(--blue); font-size: .9rem; }

/* ── Compare page ─────────────────────────────────────────────────────────── */
.compare-page { max-width: 100%; }
.compare-header { margin-bottom: 1.5rem; }
.compare-header h1 { font-size: 1.5rem; font-weight: 800; color: var(--navy); }
.compare-selectors { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }
.compare-sel { padding: .45rem .65rem; border: 1.5px solid var(--border); border-radius: 7px;
  font-size: .84rem; min-width: 200px; flex: 1; }

.compare-grid { display: grid; gap: 1rem; align-items: start; }
.compare-grid.cols-1 { grid-template-columns: 1fr; }
.compare-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.compare-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.compare-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .compare-grid.cols-3, .compare-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .compare-grid { grid-template-columns: 1fr !important; }
}

.compare-col { background: var(--white); border-radius: var(--card-r);
  box-shadow: var(--shadow); overflow: hidden; }
.cmp-header { padding: .9rem; }
.cmp-rank { font-weight: 800; font-size: 1.1rem; color: white; width: 36px; height: 36px;
  border-radius: 50%; background: var(--navy); display: flex; align-items: center;
  justify-content: center; margin-bottom: .5rem; }
.cmp-badges { display: flex; gap: .3rem; flex-wrap: wrap; margin-bottom: .4rem; }
.cmp-name  { font-size: .97rem; font-weight: 800; color: var(--navy); line-height: 1.3; }
.cmp-years { font-size: .78rem; color: var(--muted); margin: .15rem 0 .4rem; }
.cmp-detail-link { font-size: .78rem; color: var(--blue); }

.cmp-image-wrap { height: 160px; overflow: hidden; background: #14181e; }
.cmp-image { width: 100%; height: 100%; object-fit: contain; }
.cmp-no-image { height: 100%; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: .85rem; background: var(--mid-blue); }

.cmp-score-banner { background: var(--navy); color: white; padding: .55rem .9rem;
  display: flex; align-items: baseline; gap: .5rem; }
.cmp-score-val   { font-size: 1.5rem; font-weight: 800; }
.cmp-score-label { font-size: .78rem; opacity: .8; }

.cmp-section { padding: .8rem .9rem; border-top: 1px solid #f0f4f8; }
.cmp-section-title { font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .04em; color: var(--muted); margin-bottom: .55rem; }
.cmp-table { width: 100%; border-collapse: collapse; }
.cmp-table tr:not(:last-child) td { border-bottom: 1px solid #f0f4f8; }
.cmp-td-label { font-size: .78rem; color: var(--muted); padding: .3rem .1rem; width: 55%; }
.cmp-td-val   { font-size: .82rem; font-weight: 600; color: var(--navy);
  padding: .3rem .1rem; text-align: right; }
.cmp-td-val.credit { color: var(--green); }
.cmp-total-row td { border-top: 2px solid var(--navy) !important; }

.cmp-td-score { display: flex; align-items: center; gap: .4rem; padding: .3rem .1rem; }
.cmp-bar-wrap { flex: 1; height: 7px; background: #e8edf2; border-radius: 4px; overflow: hidden; }
.cmp-bar      { height: 100%; border-radius: 4px; }
.cmp-bar-num  { font-size: .75rem; font-weight: 700; color: var(--navy); width: 26px;
  text-align: right; }

.cmp-details { margin-bottom: .4rem; }
.cmp-details summary { font-size: .82rem; font-weight: 600; color: var(--blue);
  cursor: pointer; padding: .25rem 0; }
.cmp-profile-text { font-size: .8rem; line-height: 1.55; color: var(--text);
  margin-top: .4rem; }
.cmp-caution { font-size: .78rem; color: #856404; background: #fff3cd;
  border-radius: 5px; padding: .4rem .6rem; margin-top: .5rem; }

.compare-empty { text-align: center; padding: 3rem; color: var(--muted); }

/* ── Utilities ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

.listings-blocked {
  display: flex; gap: .7rem; align-items: flex-start;
  background: #fff3cd; border: 1px solid #ffc107; border-radius: 8px;
  padding: .8rem 1rem; font-size: .85rem; color: #664d03; margin-bottom: .8rem;
}
.blocked-icon { font-size: 1.2rem; flex-shrink: 0; }

.copy-link-btn {
  background: none; border: 1.5px solid var(--border); border-radius: 6px;
  padding: .35rem .7rem; font-size: .78rem; color: var(--muted); cursor: pointer;
  transition: all .15s;
}
.copy-link-btn:hover { border-color: var(--blue); color: var(--blue); }
.copy-link-btn.copied { color: var(--green); border-color: var(--green); }
