/* AutoPilot V25.42 — mobile compare: fixed viewport, sticky metrics, horizontally scrolling cars */
@media (max-width: 680px){
  html,body{
    width:100%!important;
    max-width:100%!important;
    overflow-x:hidden!important;
  }
  body .page-main,
  body .compare-section,
  body .compare-section>.container,
  body .compare-result{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    overflow-x:hidden!important;
  }

  body .compare-section{
    padding:14px 0 26px!important;
  }
  body .compare-section>.container{
    padding-left:12px!important;
    padding-right:12px!important;
  }
  body .compare-section .section-head{
    display:flex!important;
    align-items:flex-start!important;
    justify-content:space-between!important;
    gap:10px!important;
    margin:0 0 12px!important;
  }
  body .compare-section .section-head .eyebrow{display:none!important}
  body .compare-section .section-head h2{
    margin:0!important;
    font-size:25px!important;
    line-height:1.08!important;
  }
  body .compare-section .section-head>p{
    display:none!important;
  }

  /* Keep the picker compact above the comparison. */
  body .compare-builder{
    padding:10px!important;
    margin:0 0 12px!important;
    border-radius:14px!important;
  }
  body .compare-picker{
    grid-template-columns:1fr 1fr!important;
    gap:8px!important;
  }
  body .compare-picker select{
    grid-column:1/-1!important;
    min-width:0!important;
  }
  body .compare-picker .compare-add,
  body .compare-picker .compare-clear{
    min-height:42px!important;
    padding:0 10px!important;
  }
  body .compare-selection-meta,
  body .compare-hint{display:none!important}

  /* Mobile uses one comparison surface, not duplicated summary cards. */
  body .compare-verdict,
  body .compare-score-grid,
  body .compare-mobile-grid{
    display:none!important;
  }

  body .compare-table-wrap{
    display:block!important;
    position:relative!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    overflow-x:auto!important;
    overflow-y:visible!important;
    -webkit-overflow-scrolling:touch!important;
    overscroll-behavior-x:contain!important;
    scrollbar-width:thin!important;
    scrollbar-color:#56616a #10161a!important;
    border:1px solid #273138!important;
    border-radius:14px!important;
    background:#0a0f12!important;
    box-sizing:border-box!important;
    scroll-snap-type:x proximity!important;
  }
  body .compare-table-wrap::-webkit-scrollbar{height:6px!important}
  body .compare-table-wrap::-webkit-scrollbar-track{background:#10161a!important}
  body .compare-table-wrap::-webkit-scrollbar-thumb{background:#56616a!important;border-radius:99px!important}

  body .compare-table-v241{
    display:table!important;
    width:max-content!important;
    min-width:100%!important;
    max-width:none!important;
    table-layout:fixed!important;
    border-collapse:separate!important;
    border-spacing:0!important;
  }
  body .compare-table-v241 th,
  body .compare-table-v241 td{
    box-sizing:border-box!important;
  }

  /* Fixed metric rail + car cards that slide horizontally. */
  body .compare-table-v241 .metric-head,
  body .compare-table-v241 tbody>tr:not(.compare-group-row)>th{
    position:sticky!important;
    left:0!important;
    z-index:8!important;
    width:138px!important;
    min-width:138px!important;
    max-width:138px!important;
    background:#0a1013!important;
    border-right:1px solid #2b353c!important;
  }
  body .compare-table-v241 .metric-head{
    top:0!important;
    z-index:12!important;
    padding:0!important;
    color:transparent!important;
  }
  body .compare-table-v241 thead th:not(.metric-head),
  body .compare-table-v241 tbody td{
    width:232px!important;
    min-width:232px!important;
    max-width:232px!important;
    scroll-snap-align:start!important;
  }
  body .compare-table-v241 thead th{
    position:static!important;
    top:auto!important;
    padding:0!important;
    vertical-align:top!important;
    background:#0d1418!important;
    border-right:1px solid #293239!important;
  }

  body .compare-car-head{
    position:relative!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    min-width:0!important;
    gap:4px!important;
    padding:0 12px 13px!important;
    text-align:center!important;
    overflow:hidden!important;
    background:#0d1418!important;
  }
  body .compare-car-head img,
  body .compare-car-head .compare-photo-placeholder{
    width:calc(100% + 24px)!important;
    height:128px!important;
    margin:0 -12px 8px!important;
    border-radius:0!important;
    object-fit:cover!important;
  }
  body .compare-car-head strong{
    display:block!important;
    width:100%!important;
    font-size:17px!important;
    line-height:1.2!important;
    color:#f5f7f8!important;
  }
  body .compare-car-head small{
    font-size:12px!important;
    line-height:1.25!important;
    color:#9aa5ac!important;
  }
  body .compare-car-head>a{
    margin-top:4px!important;
    color:#dfff35!important;
    font-size:12px!important;
    font-weight:850!important;
  }
  body .compare-head-remove{
    position:absolute!important;
    top:8px!important;
    right:8px!important;
    z-index:4!important;
    display:grid!important;
    place-items:center!important;
    width:34px!important;
    height:34px!important;
    padding:0!important;
    border:1px solid rgba(255,255,255,.18)!important;
    border-radius:50%!important;
    background:rgba(8,13,16,.90)!important;
    color:#f4f7f8!important;
    font-size:22px!important;
    line-height:1!important;
  }
  body .compare-head-winner{
    position:absolute!important;
    top:9px!important;
    left:9px!important;
    z-index:4!important;
    max-width:126px!important;
    padding:5px 8px!important;
    border:1px solid rgba(223,255,53,.65)!important;
    background:rgba(24,31,10,.84)!important;
    color:#dfff35!important;
    font-size:9px!important;
    line-height:1!important;
    white-space:nowrap!important;
  }

  body .compare-table-v241 tbody>tr:not(.compare-group-row)>th{
    padding:11px 10px!important;
    color:#e0e6e9!important;
    font-size:11px!important;
    font-weight:800!important;
    line-height:1.2!important;
    white-space:normal!important;
  }
  body .compare-table-v241 tbody td{
    padding:11px 8px!important;
    background:#0d1418!important;
    color:#f2f5f6!important;
    font-size:12px!important;
    font-weight:700!important;
    line-height:1.25!important;
    text-align:center!important;
    overflow-wrap:anywhere!important;
    border-right:1px solid #293239!important;
  }
  body .compare-table-v241 .metric-winner{
    background:linear-gradient(90deg,rgba(110,154,25,.22),rgba(223,255,53,.08))!important;
    color:#e8ff5a!important;
  }
  body .compare-table-v241 .mini-win{
    display:inline-grid!important;
    place-items:center!important;
    width:18px!important;
    height:18px!important;
    margin-left:5px!important;
    border-radius:50%!important;
    background:#dfff35!important;
    color:#081012!important;
    font-size:10px!important;
  }

  /* Group title spans only the fixed metric rail visually, while cars remain aligned. */
  body .compare-group-row th{
    position:sticky!important;
    left:0!important;
    z-index:9!important;
    width:138px!important;
    max-width:138px!important;
    padding:9px 10px!important;
    overflow:hidden!important;
    background:#090e11!important;
    color:#dfff35!important;
    font-size:9px!important;
    line-height:1.1!important;
    letter-spacing:.07em!important;
    white-space:nowrap!important;
    text-overflow:ellipsis!important;
    border-right:1px solid #2b353c!important;
  }

  /* Four cars remain the same card width; only the internal car rail gets longer. */
  body .compare-table-wrap.compare-car-count-2 .compare-table-v241{min-width:602px!important}
  body .compare-table-wrap.compare-car-count-3 .compare-table-v241{min-width:834px!important}
  body .compare-table-wrap.compare-car-count-4 .compare-table-v241{min-width:1066px!important}

  body .compare-result{
    margin-top:0!important;
  }
}
