/* Responsive content polish. Images, image sources and shared chrome are unchanged. */
main :is(.seo-product-copy, .seo-brand-copy, .seo-family-copy, .collection-hero-copy,
  .article-content, .article-hero-copy, .blog-index-copy, .local-card,
  .local-contact-panel > div, .ft-card, .ft-trim-card) { min-width: 0; }
main :is(h1, h2, h3, p, li, dd, figcaption, .seo-source, .source-list) {
  overflow-wrap: anywhere;
}
main :is(.btn, .article-btn, .local-btn, .ft-download) {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}
main :is(.seo-gallery-section, .seo-detail-section, .article-section, .local-box, .ft-hub)[id] {
  scroll-margin-block-start: calc(var(--topbar-height, 76px) + 24px);
}
main :is(.seo-breadcrumb, .blog-breadcrumb, .local-crumb) {
  overflow-wrap: anywhere;
  line-height: 1.65;
}
main :is(.seo-breadcrumb, .blog-breadcrumb, .local-crumb) a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}
main :is(.local-jump-links, .vehicle-page-nav) a { min-height: 44px; }
main :is(.ft-table-wrap, .doblo-specs-table-wrap, .cars-price-table-wrap) {
  max-width: 100%;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}
main :is(.ft-table, .doblo-table) :is(th, td) { overflow-wrap: anywhere; }
[dir="rtl"] main :is(h1, h2, h3, .local-eyebrow, .local-section-label) {
  letter-spacing: 0;
}
[dir="rtl"] main :is(.local-city-hero, .local-hero, .seo-brand-copy, .seo-family-copy) h1 {
  line-height: 1.45;
}
[dir="rtl"] main :is(.local-steps, .article-section ul, .article-section ol) {
  padding-inline-start: 1.6em;
  padding-inline-end: 0;
}

/* Fixed light backgrounds formerly conflicted with body.dark's light text. */
body.dark.seo-static-body {
  background: radial-gradient(circle at 90% 0, #e21f3610, transparent 30rem), var(--bg);
}
body.dark.seo-static-body .seo-breadcrumb {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface);
}
body.dark.seo-static-body .cars-section-heading > a {
  background: var(--surface-2);
  color: var(--ink);
}
body.dark.seo-static-body .cars-price-table-wrap {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: none;
}
body.dark.seo-static-body .cars-price-table td {
  color: var(--ink-soft);
  border-color: var(--line) !important;
}
body.dark.seo-static-body .cars-price-table td:first-child,
body.dark.seo-static-body .cars-price-table td:nth-child(5) { color: var(--ink); }
body.dark.seo-static-body .cars-price-table td:last-child { color: #78d4a5 !important; }
body.dark.seo-static-body .cars-price-table tbody tr:hover { background: var(--surface-2); }
body.dark.seo-static-body .cars-price-note {
  background: var(--surface-2);
  color: var(--ink-soft) !important;
}
body.dark.local-site :is(.local-steps, .pro-images figure, .local-tag) {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}
body.dark.local-site .pro-images figcaption { color: var(--ink-soft); }
body.dark.local-site :is(.local-card, .local-related, .local-steps, .local-box) a:not(.local-btn),
body.dark.local-site .local-section-label { color: #ff8b9d; }
body.dark.local-site .local-contact-panel .local-eyebrow { color: #ff8b9d; }
body.dark .ft-hub {
  --ft-ink: #eef2f7;
  --ft-muted: #b8c2d0;
  --ft-line: #2e3948;
  --ft-soft: #1b2533;
  --ft-red: #ff8b9d;
  --ft-red-dark: #ffa4b2;
}
body.dark .ft-hub :is(.ft-intro, .ft-stat, .ft-card, .ft-trim-card) {
  color: var(--ft-ink);
  background: var(--surface);
  border-color: var(--ft-line);
}
body.dark .ft-table :is(th, td) { border-color: var(--ft-line); }
body.dark .ft-table thead th { background: var(--ft-soft); }
body.dark .ft-verified { color: #8ee2b3; }
body.dark .ft-download,
body.dark .ft-trim-card.is-featured .ft-trim-head {
  background: #a91c39;
  color: #fff;
}

/* The archived worksheet calculator uses fixed light panels throughout. */
body.dark.site-inner-page:has(.credit-archive-toolbar) #top {
  --ink: #132f35;
  --muted: #63777b;
  --line: #dce7e6;
  --surface: #fff;
  color: var(--ink);
  background: #f7f9f7;
}
body.site-inner-page #liveSummaryBar {
  inset-block-start: var(--topbar-height, 76px);
  z-index: 40;
}

@media (max-width: 1280px) and (min-width: 861px) {
  /* With a 276px sidebar these pages have tablet-sized content at this width. */
  body.seo-static-body .seo-brand-hero,
  body.seo-static-body .seo-family-hero,
  body.seo-static-body .seo-collection-hero.has-collection-image {
    grid-template-columns: minmax(0, 1fr);
  }
  body.seo-static-body .seo-brand-visual,
  body.seo-static-body .seo-family-visual { min-height: 300px; }
  body.seo-static-body .ft-trim-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.seo-static-body .ft-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  main :is(input:not([type="range"]):not([type="checkbox"]):not([type="radio"]), select, textarea) {
    min-width: 0;
    max-width: 100%;
    font-size: 16px;
  }
  main :is(.local-actions, .article-actions, .seo-product-actions) { min-width: 0; }
  main :is(.local-btn, .article-btn, .seo-product-actions .btn) {
    min-height: 46px;
    line-height: 1.5;
  }
  body.dark.seo-static-body .cars-price-table tr {
    color: var(--ink);
    background: var(--surface);
    border-color: var(--line) !important;
  }
  body.dark.seo-static-body .cars-price-table td::before { color: var(--muted); }
  body.blog-body .article-verified { flex-wrap: wrap; }
  body.blog-body .article-verified span { flex: 0 0 19px; }
  body.local-site .local-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  /* Avoid nesting a two-column card inside a two-column catalogue grid. */
  body.seo-static-body .cars-catalog-section .seo-list-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  body.seo-static-body .cars-catalog-section .seo-list-card {
    display: grid;
    grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
    align-items: stretch;
  }
  body.seo-static-body .cars-catalog-section .seo-list-copy { padding: 15px; gap: 8px; }
  body.seo-static-body .cars-catalog-section .seo-list-copy strong {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    font-size: 14px;
    line-height: 1.55;
  }
  body.seo-static-body .cars-catalog-section .seo-list-copy small {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    font-size: 12px;
    line-height: 1.5;
  }
  body.seo-static-body .cars-catalog-section .seo-list-copy b { font-size: 15px; line-height: 1.5; }
  body.local-site .local-grid { grid-template-columns: minmax(0, 1fr); }
  body.local-site .local-city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.local-site :is(.local-city-grid a, .local-card, .local-btn) { overflow-wrap: anywhere; }
  body.local-site .local-actions > a { flex: 1 1 100%; }
  body.local-site .local-city-hero h1 { font-size: 1.8rem; }
  body.seo-static-body .seo-spec-grid { grid-template-columns: minmax(0, 1fr); }
  body.blog-body .article-section > p,
  body.blog-body .article-section li { font-size: 15px; line-height: 1.9; }
  body.blog-body .fact-grid { gap: 0 12px; }
  body.blog-body .fact dd { font-size: 14px; }
}

@media (max-width: 480px) {
  #homeView .featured-grid,
  #carsView .car-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #homeView .featured-grid .car-card,
  #carsView .car-grid .car-card {
    display: grid;
    grid-template-columns: minmax(108px, .85fr) minmax(0, 1.15fr);
    align-items: stretch;
  }
  #homeView .featured-grid .car-image,
  #carsView .car-grid .car-image { height: 100%; min-height: 210px; aspect-ratio: auto; }
  #homeView .featured-grid .car-body,
  #carsView .car-grid .car-body { padding: 14px; }
  #homeView .featured-grid .car-heading,
  #carsView .car-grid .car-heading { min-height: 0; }
  #homeView .featured-grid .car-heading small,
  #carsView .car-grid .car-heading small { font-size: 11px; }
  #homeView .featured-grid .car-heading h4,
  #carsView .car-grid .car-heading h4 {
    display: block;
    overflow: visible;
    -webkit-line-clamp: unset;
    font-size: 14px;
    line-height: 1.5;
  }
  #homeView .featured-grid .car-price-row > span,
  #carsView .car-grid .car-price-row > span { display: block; font-size: 10px; line-height: 1.5; }
  #homeView .featured-grid .car-price-row strong,
  #carsView .car-grid .car-price-row strong { font-size: 16px; overflow-wrap: anywhere; white-space: normal; }
  #homeView .featured-grid .car-actions,
  #carsView .car-grid .car-actions { gap: 7px; }
  #homeView .featured-grid .car-detail-link,
  #carsView .car-grid .car-detail-link { display: inline-flex; min-height: 44px; font-size: 12px; }
  #homeView .featured-grid .primary-mini,
  #carsView .car-grid .primary-mini { font-size: 12px; line-height: 1.4; }
  body.blog-body .fact-grid { grid-template-columns: minmax(0, 1fr); }
  main .ft-stat { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  main .ft-verified { max-width: 100%; white-space: normal; line-height: 1.5; }
  .cars-price-table td {
    grid-template-columns: minmax(80px, .75fr) minmax(0, 1.25fr);
    gap: 10px;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  main *, main *::before, main *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
