.ranking-page {
  min-width: 320px;
}

.ranking-hero {
  padding: 24px 0 34px;
}

.site-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 800;
}

.site-switch a,
.site-switch span {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
}

.site-switch a {
  color: var(--muted);
  background: rgba(255, 253, 248, .72);
  border: 1px solid var(--line);
}

.site-switch a:hover {
  color: var(--ink);
}

.site-switch span {
  color: #f8fff5;
  background: var(--green);
}

.ranking-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(260px, .55fr);
  overflow: hidden;
  color: #f8fff5;
  border-radius: 38px;
  background:
    radial-gradient(circle at 92% 16%, rgba(205, 232, 107, .2), transparent 22rem),
    linear-gradient(145deg, #142820, #1a3b2e);
  box-shadow: var(--shadow);
}

.ranking-hero-copy {
  padding: clamp(30px, 5vw, 58px);
}

.ranking-hero .eyebrow {
  color: var(--lime);
}

.ranking-hero h1 {
  max-width: 930px;
  margin: 18px 0;
  font-size: clamp(42px, 6.5vw, 82px);
  line-height: .94;
  letter-spacing: -.06em;
}

.ranking-hero-copy > p {
  max-width: 800px;
  margin: 0;
  color: #c9d8d1;
  font-size: 17px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-actions a {
  padding: 12px 17px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 850;
}

.primary-action {
  color: var(--dark);
  background: var(--lime);
}

.secondary-action {
  color: #f8fff5;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .06);
}

.ranking-rule {
  display: flex;
  flex-direction: column;
  justify-content: end;
  min-height: 310px;
  padding: 32px;
  border-left: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .045);
}

.rule-number {
  margin-bottom: auto;
  color: var(--lime);
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  opacity: .55;
}

.ranking-rule strong {
  font-size: 24px;
  line-height: 1.05;
}

.ranking-rule p {
  margin: 10px 0 18px;
  color: #c9d8d1;
  font-size: 14px;
}

.ranking-rule small {
  color: #95aaa0;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.metric-grid article {
  min-width: 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 253, 248, .86);
}

.metric-grid strong {
  display: block;
  font-size: 30px;
  line-height: 1;
}

.metric-grid span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.method-strip {
  padding: 20px 0;
  color: #eaf4ef;
  background: var(--dark);
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.method-grid div {
  display: grid;
  gap: 3px;
}

.method-grid span {
  color: var(--lime);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.method-grid strong {
  font-size: 14px;
}

.listings-section {
  padding-top: 58px;
}

.ranking-section-head p {
  max-width: 610px;
}

.filters {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) minmax(150px, .65fr) minmax(150px, .65fr) auto auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: 0 10px 30px rgba(32, 48, 41, .05);
}

.filters label:not(.check-field) {
  display: grid;
  gap: 6px;
}

.filters label > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.filters input[type="search"],
.filters select {
  width: 100%;
  min-height: 44px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 13px;
  outline: none;
  background: #fff;
}

.filters input[type="search"]:focus,
.filters select:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31, 122, 86, .12);
}

.check-field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.check-field input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.check-field span {
  color: var(--ink) !important;
  font-size: 12px !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
}

#resetFilters {
  min-height: 44px;
  padding: 0 16px;
  color: var(--green);
  border: 0;
  border-radius: 13px;
  background: #e7f0e9;
  font-weight: 850;
}

.results-line {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin: 18px 2px 12px;
  color: var(--muted);
  font-size: 12px;
}

.results-line strong {
  color: var(--ink);
  font-size: 14px;
}

.ranking-table-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.ranking-table {
  min-width: 1260px;
}

.ranking-table th,
.ranking-table td {
  padding: 14px 13px;
}

.ranking-table th:first-child,
.ranking-table td:first-child {
  padding-left: 18px;
}

.ranking-table tbody tr {
  transition: background .16s ease;
}

.ranking-table tbody tr:hover {
  background: #f7f4eb;
}

.rank-badge {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--dark);
  border-radius: 11px;
  background: #e8eddf;
  font-weight: 900;
}

.ranking-table tr:nth-child(-n+10) .rank-badge {
  background: var(--lime);
}

.car-link {
  display: inline-block;
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.15;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.car-subtitle {
  display: block;
  max-width: 260px;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 7px;
}

.badge {
  padding: 3px 6px;
  border-radius: 999px;
  color: #355247;
  background: #e7f0e9;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .03em;
  text-transform: uppercase;
}

.price {
  font-size: 16px;
  font-weight: 900;
  white-space: nowrap;
}

.mileage,
.city,
.powertrain {
  color: #415049;
  font-size: 12px;
}

.powertrain strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
}

.score {
  display: block;
  font-size: 18px;
  font-weight: 900;
}

.confidence {
  display: inline-block;
  margin-top: 3px;
  padding: 3px 7px;
  border-radius: 999px;
  color: #4a5b53;
  background: #eeeae0;
  font-size: 9px;
  font-weight: 850;
}

.confidence-high {
  color: #245b43;
  background: #dff1e5;
}

.assessment {
  min-width: 360px;
}

.assessment-block + .assessment-block {
  margin-top: 7px;
}

.assessment-label {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.assessment ul {
  margin: 0;
  padding-left: 15px;
  color: #415049;
  font-size: 11px;
  line-height: 1.4;
}

.risks ul {
  color: #7b5330;
}

.empty-state,
.noscript-note {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}

.call-plan {
  padding-top: 18px;
}

.call-plan-grid {
  display: grid;
  grid-template-columns: minmax(250px, .6fr) minmax(0, 1.4fr);
  gap: 40px;
  padding: 34px;
  border-radius: 28px;
  color: #eff8f3;
  background: var(--dark);
}

.call-plan h2 {
  margin: 9px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1;
  letter-spacing: -.04em;
}

.call-plan ol {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-left: 24px;
  color: #c7d5ce;
}

.call-plan li::marker {
  color: var(--lime);
  font-weight: 900;
}

.ranking-footer {
  padding: 28px 0 40px;
}

.ranking-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.ranking-footer strong {
  color: var(--ink);
}

.ranking-footer a {
  margin-left: auto;
  color: var(--green);
  font-weight: 850;
}

@media (max-width: 1040px) {
  .ranking-hero-card {
    grid-template-columns: 1fr;
  }

  .ranking-rule {
    min-height: auto;
    border-top: 1px solid rgba(255, 255, 255, .1);
    border-left: 0;
  }

  .rule-number {
    display: none;
  }

  .metric-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .ranking-hero {
    padding-top: 12px;
  }

  .ranking-hero-card {
    border-radius: 28px;
  }

  .ranking-hero h1 {
    font-size: clamp(40px, 13vw, 62px);
  }

  .ranking-hero-copy,
  .ranking-rule {
    padding: 26px 22px;
  }

  .metric-grid,
  .method-grid,
  .call-plan-grid {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .method-grid {
    gap: 13px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .results-line {
    align-items: start;
    flex-direction: column;
    gap: 4px;
  }

  .ranking-table-wrap {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .ranking-table,
  .ranking-table tbody,
  .ranking-table tr,
  .ranking-table td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .ranking-table thead {
    display: none;
  }

  .ranking-table tbody {
    display: grid;
    gap: 12px;
  }

  .ranking-table tbody tr {
    display: grid;
    grid-template-columns: 54px 1fr 1fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--card);
    box-shadow: 0 8px 24px rgba(32, 48, 41, .04);
  }

  .ranking-table td {
    padding: 12px !important;
    border-bottom: 1px solid var(--line);
  }

  .ranking-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
  }

  .ranking-table td:nth-child(1) {
    grid-row: 1 / 3;
  }

  .ranking-table td:nth-child(1)::before,
  .ranking-table td:nth-child(2)::before {
    display: none;
  }

  .ranking-table td:nth-child(2) {
    grid-column: 2 / 4;
  }

  .ranking-table td:nth-child(7) {
    grid-column: span 1;
  }

  .ranking-table td:nth-child(8) {
    grid-column: 1 / 4;
    border-bottom: 0;
  }

  .assessment {
    min-width: 0;
  }

  .ranking-footer .container {
    align-items: start;
    flex-direction: column;
  }

  .ranking-footer a {
    margin-left: 0;
  }
}

@media (max-width: 460px) {
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-actions a {
    text-align: center;
  }

  .ranking-table tbody tr {
    grid-template-columns: 50px 1fr;
  }

  .ranking-table td:nth-child(2),
  .ranking-table td:nth-child(8) {
    grid-column: 2;
  }

  .ranking-table td:nth-child(n+3):nth-child(-n+7) {
    grid-column: 1 / 3;
  }

  .ranking-table td:nth-child(8) {
    grid-column: 1 / 3;
  }
}

@media print {
  .site-switch,
  .hero-actions,
  .filters,
  .call-plan,
  .ranking-footer {
    display: none !important;
  }

  .ranking-hero-card,
  .method-strip {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
}
