/* The Cars area: ui/components/CarCards.kt, PriceRuler.kt and the Cars, car and quick sort pages. Colours come from app.css
   tokens; the badges on a photo keep Android's fixed Brand colours (the deal colours and navy), as they sit on a photo. */

/* Car tiles are retained for secondary views; the main Cars feed always has one car per row. */
.cars-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(160px, calc(50% - 3px)), 1fr)); gap: 6px; padding: 6px 6px 12px; }
.cars-rows { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 10px 20px; container: car-feed / inline-size; }
@media (min-width: 900px) { .cars-grid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 8px; } }
.cars-body { max-width: 1180px; width: 100%; margin: 0 auto; }
.with-dock .cars-body { padding-bottom: calc(var(--dock-h) + 20px + var(--safe-bottom)); }
@media (min-width: 900px) { .with-dock.rail-mode .cars-body { padding-bottom: 24px; } }

/* A car photo: the car icon until the photo is in, and when the link is dead. */
.cf-photo { position: relative; background: var(--line-soft); overflow: hidden; }
.cf-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.18s; }
.cf-photo img.in { opacity: 1; }
.cf-photo .ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--faint); }
.cf-photo .ph .ms { font-size: 26px; }
.cf-photo.greyed img { filter: saturate(0.15); }

.super-steal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; min-width: 0; }
.super-steal-label { display: inline-flex; align-items: center; gap: 1px; }
.super-steal-info { display: inline-grid; place-items: center; width: 32px; height: 36px; padding: 0; background: transparent; border: 0; color: var(--ink); }
.super-steal-info span { display: grid; place-items: center; border: 1.5px solid currentColor; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; font-weight: 750; line-height: 1; }
.super-steal-ask { background: var(--primary-soft); color: var(--primary-ink); border: 0; border-radius: 8px; font-size: 13px; font-weight: 650; line-height: 1.25; padding: 6px 10px; min-height: 36px; max-width: 100%; }
.super-steal-ask:hover, .super-steal-info:hover { text-decoration: underline; }
@media (pointer: coarse) { .super-steal-info, .super-steal-ask { min-height: 44px; } .super-steal-info { width: 44px; } }
.super-steal-listing { min-width: 0; }
.super-steal-listing > .super-steal-actions { padding: 0 8px 8px; }
.car-line > .super-steal-listing { flex: 1 1 auto; }
:where(.today-hot-item) .super-steal-listing { background: var(--card); border-radius: 12px; box-shadow: var(--card-shadow); border: var(--card-border); }
.today-hot-item .super-steal-listing .priority-card { box-shadow: none; border: 0; }
.triage-card + .super-steal-actions { background: var(--card); color: var(--ink); margin: 5px 8px 0; padding: 4px 10px; border-radius: 10px; }
.super-steal-report { padding: 4px 8px 8px; color: var(--ink); overflow-wrap: anywhere; }
.super-steal-report p, .super-steal-report h3 { margin: 0; }
.super-steal-sources { padding: 0; margin: 4px 0 0; list-style: none; }
.super-steal-evidence { display: grid; gap: 2px; padding: 7px 0; }
.super-steal-evidence + .super-steal-evidence { border-top: 1px solid var(--line); }
.super-steal-evidence a { color: var(--primary-ink); font-weight: 650; text-decoration: underline; }

/* Tiles */
.car-tile { position: relative; background: var(--card); border-radius: 12px; box-shadow: var(--card-shadow); border: var(--card-border); overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 230px; transition: transform 0.12s cubic-bezier(0.3, 1.4, 0.5, 1); }
.car-tile:active { transform: scale(0.97); }
.car-tile .tile-link { display: block; color: inherit; text-decoration: none; }
.car-tile .tile-link:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: -2px; border-radius: 12px; }
.tile-photo { position: relative; width: 100%; aspect-ratio: 4 / 3; }
.tile-photo > .cf-photo { position: absolute; inset: 0; }
.tile-facts { padding: 4px 7px 6px; display: flex; flex-direction: column; min-width: 0; }
.cf-price-line { display: flex; align-items: center; min-width: 0; gap: 4px; }
.cf-price { font-size: 15.5px; line-height: 20px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.cf-active { font-size: 10.5px; line-height: 14px; color: var(--muted); white-space: nowrap; }
.cf-est { margin-left: auto; font-size: 10.5px; line-height: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; padding-left: 4px; }
.cf-title { font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-title.struck { text-decoration: line-through; }
.cf-facts { font-size: 11px; line-height: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-mileage { display: inline-block; padding: 4px 8px; border-radius: 4px; background-color: #ffdf20; color: #000; font-weight: 700; white-space: nowrap; }
.cf-finder-estimates { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-block: 2px; }
.cf-finder-est { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px 6px; padding: 3px 7px; border-radius: 5px; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; }

/* Badges on a photo, all on the same dark scrim; only the deal keeps a colour. */
.ov { position: absolute; inset: 0; pointer-events: none; }
.ov-top { position: absolute; top: 5px; left: 5px; right: 5px; display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.ov-top.room { right: 36px; }
.ov-bottom { position: absolute; left: 5px; right: 5px; bottom: 5px; display: flex; align-items: center; gap: 4px; min-width: 0; }
.src-dot { width: 18px; height: 18px; border-radius: 9px; background: var(--scrim); color: #fff; font-size: 10px; line-height: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pbadge { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px; border-radius: 5px; background: var(--scrim); color: #fff; font-size: 10.5px; line-height: 13px; font-weight: 600; min-width: 0; max-width: 100%; }
.pbadge > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pbadge.wrap > span { white-space: normal; }
.pbadge.shrink { flex: 0 1 auto; }
.pbadge.keep { flex-shrink: 0; }
.pbadge .ms { font-size: 11px; }
.pbadge.new { background: var(--primary); color: var(--on-primary); }
.pbadge.navy { background: #0C2340; }
.pbadge.steal { background: var(--deal-steal); } .pbadge.good { background: var(--deal-good); }
.pbadge.potential { background: var(--deal-potential); } .pbadge.entertain { background: var(--deal-entertain); }
.pbadge.neutral { background: var(--deal-neutral); }
.tile-more { position: absolute; top: 3px; right: 3px; width: 30px; height: 30px; border: 0; padding: 0; border-radius: 15px; background: transparent; display: flex; align-items: center; justify-content: center; z-index: 1; }
.tile-more > span { width: 22px; height: 22px; border-radius: 11px; background: var(--scrim); color: #fff; display: flex; align-items: center; justify-content: center; }
.tile-more .ms { font-size: 16px; }
.tile-more:focus-visible { outline: 2px solid var(--primary-bright); }

/* List mode: one car per row. */
.car-line { position: relative; display: flex; align-items: center; background: var(--card); border-radius: 14px; box-shadow: var(--card-shadow); border: var(--card-border); overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 180px; }
.car-line .tile-link { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; color: inherit; text-decoration: none; min-height: 156px; }
.car-line .tile-link:focus-visible { outline: 3px solid var(--primary-ink); outline-offset: -3px; border-radius: 14px; }
.car-line .line-photo { position: relative; width: 172px; height: 132px; flex-shrink: 0; margin-left: 12px; border-radius: 9px; overflow: hidden; }
.car-line .line-photo > .cf-photo { position: absolute; inset: 0; }
.car-line .line-facts { flex: 1 1 0; min-width: 0; padding: 14px; display: flex; flex-direction: column; gap: 5px; }
.car-line .line-more { min-width: 88px; height: 44px; padding: 0 10px; border: 0; margin: 0 12px 0 0; border-radius: 10px; background: var(--raised); color: var(--ink2); display: flex; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0; font-size: 12px; font-weight: 600; }
.car-line .line-more:hover { background: var(--primary-soft); color: var(--primary-ink); }
.line-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 0 0 310px; gap: 4px; padding: 8px; }
.line-actions .cf-row { min-width: 0; min-height: 44px; padding: 5px 6px; gap: 6px; border-radius: 8px; }
.line-actions .cf-row .title { font-size: 13px; line-height: 1.25; }
@container car-feed (min-width: 560px) and (max-width: 840px) {
  .line-actions { flex-basis: 155px; grid-template-columns: 1fr; }
}
@container car-feed (max-width: 559px) {
  .car-line:has(.line-actions) { flex-direction: column; align-items: stretch; }
  .car-line:has(.line-actions) .tile-link { min-height: 0; }
  .car-line .line-photo { width: 104px; height: 100px; margin-block: 12px; }
  .line-actions { flex: none; border-top: 1px solid var(--line); }
}
.car-line .cf-price { font-size: 21px; line-height: 26px; }
.car-line .cf-title { font-size: 16px; line-height: 22px; font-weight: 650; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; }
.car-line .cf-facts { font-size: 13px; line-height: 19px; white-space: normal; overflow-wrap: anywhere; }
.car-line .cf-est { font-size: 12px; line-height: 18px; white-space: normal; margin-left: 12px; }
.line-meta { display: flex; align-items: center; gap: 5px 8px; flex-wrap: wrap; color: var(--muted); font-size: 11px; line-height: 15px; }
.line-source { font-weight: 650; }
.line-meta .pbadge { padding: 0; background: transparent; color: var(--muted); font-size: 11px; line-height: 15px; }
.line-new { background: var(--primary-soft); color: var(--primary-ink); border-radius: 4px; padding: 1px 5px; font-weight: 700; }
.line-status { display: flex; gap: 5px; flex-wrap: wrap; }
.line-status:empty { display: none; }
.line-status .pbadge { font-size: 11px; line-height: 16px; padding: 2px 6px; }
.line-skel { min-height: 156px; }
@media (max-width: 599px) {
  .car-line:has(.line-actions) { flex-direction: column; align-items: stretch; }
  .car-line:has(.line-actions) .tile-link { min-height: 0; }
  .line-actions { flex: none; border-top: 1px solid var(--line); }
  .cars-rows { padding: 8px 8px 16px; gap: 8px; }
  .car-line .tile-link { align-items: flex-start; min-height: 174px; }
  .car-line .line-photo { width: 104px; height: 100px; margin: 12px 0 12px 10px; }
  .car-line .line-facts { padding: 11px 10px; gap: 5px; }
  .car-line .line-more { position: absolute; left: 10px; top: 118px; margin: 0; width: 104px; height: 44px; }
  .car-line .cf-price-line { flex-wrap: wrap; gap: 2px 5px; }
  .car-line .cf-price { font-size: 19px; line-height: 24px; }
  .car-line .cf-est { flex-basis: 100%; margin-left: 0; padding-left: 0; }
  .car-line .cf-title { font-size: 14px; line-height: 20px; }
  .car-line .cf-facts { font-size: 12px; line-height: 17px; }
  .line-skel { min-height: 170px; }
}

/* Skeleton tile */
.tile-skel { background: var(--card); border-radius: 12px; box-shadow: var(--card-shadow); border: var(--card-border); overflow: hidden; }
.tile-skel .sk-photo { aspect-ratio: 4 / 3; border-radius: 0; }

/* The compact row on Search, Saved and the mark pages. */
.car-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; width: 100%; background: transparent; border: 0; text-align: left; color: var(--ink); text-decoration: none; }
button.car-row:hover, a.car-row:hover { background: rgba(127, 127, 127, 0.06); }
.car-row .row-photo { width: 76px; height: 57px; border-radius: 7px; flex-shrink: 0; }
.car-row .cf-price { font-size: 15px; }

/* Today's wide top-deal card. */
.priority-card { display: flex; align-items: center; gap: 8px; padding: 6px; background: var(--card); border-radius: 12px; box-shadow: var(--card-shadow); border: var(--card-border); text-align: left; color: var(--ink); width: 100%; text-decoration: none; }
.priority-card .pc-photo { position: relative; width: 112px; height: 92px; border-radius: 8px; flex-shrink: 0; }
.priority-card .pc-photo > .cf-photo { position: absolute; inset: 0; border-radius: 8px; }
.priority-card .pc-photo .ov-top { top: 4px; left: 4px; gap: 3px; align-items: center; }
.priority-card .pc-price { font-size: 18px; line-height: 22px; font-weight: 700; }
.priority-card .pc-gap { font-size: 11px; line-height: 14px; font-weight: 600; color: var(--primary-ink); white-space: nowrap; }

/* The new cars pill, the error banner and back to the top float over the list so the cars never move. */
.cars-float { position: absolute; left: 0; right: 0; top: calc(100% + 8px); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 2; padding: 0 8px; }
.cars-float > * { pointer-events: auto; }
.cars-float .banner { box-shadow: 0 4px 12px rgba(12, 35, 64, 0.22); width: 100%; max-width: 640px; }
.new-pill { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 16px; border: 0; background: var(--header); color: var(--on-primary); font-size: 12.5px; line-height: 16px; font-weight: 600; box-shadow: 0 6px 14px rgba(12, 35, 64, 0.35); animation: pillIn 0.2s ease-out; }
:root[data-theme="dark"] .new-pill, :root[data-theme="system-dark"] .new-pill { background: var(--primary); color: var(--on-primary); }
.new-pill .ms { font-size: 14px; }
@keyframes pillIn { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.to-top { position: fixed; right: 12px; bottom: calc(var(--dock-h) + 22px + var(--safe-bottom)); width: 46px; height: 46px; border-radius: 23px; border: 0; background: var(--header); color: var(--on-header); display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(12, 35, 64, 0.4); z-index: 15; animation: fadeIn 0.15s; }
.to-top .ms { font-size: 28px; }
@media (min-width: 900px) { .to-top { bottom: 24px; right: 24px; } }

/* The sticky head of Cars: the bar, the loading line, the filter panel. */
.cars-head { position: sticky; top: 0; z-index: 20; }
.cars-head .topbar { position: relative; }
.load-line { height: 2px; background: transparent; position: relative; overflow: hidden; }
.load-line.on { background: var(--line-soft); }
.load-line.on::after { content: ''; position: absolute; top: 0; bottom: 0; left: -40%; width: 40%; background: var(--primary); animation: lineSweep 1.1s ease-in-out infinite; }
@keyframes lineSweep { to { left: 100%; } }
.filters-btn { display: inline-flex; align-items: center; gap: 4px; height: 44px; padding: 0 9px 0 12px; margin: 0 4px; border-radius: 10px; border: 1px solid var(--line); background: var(--raised); color: var(--ink2); font-size: 13px; font-weight: 600; flex-shrink: 0; }
.filters-btn.lit { background: var(--primary-soft); color: var(--primary-ink); border-color: var(--primary-band); }
.filters-btn .count { min-width: 16px; height: 16px; border-radius: 8px; background: var(--primary); color: var(--on-primary); font-size: 11px; line-height: 16px; text-align: center; margin-left: 2px; padding: 0 3px; }
.filters-btn .ms { font-size: 20px; transition: transform 0.16s; }
.filters-btn.open .ms { transform: rotate(180deg); }
.filter-scrim { position: fixed; inset: 0; z-index: 19; background: rgba(11, 20, 27, 0.24); animation: fadeIn 0.16s; }
.filter-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-radius: 0 0 16px 16px; box-shadow: 0 10px 18px rgba(12, 35, 64, 0.3); padding-bottom: 6px; max-height: calc(100vh - 120px - var(--dock-h)); max-height: calc(100dvh - 120px - var(--dock-h)); overflow-y: auto; overscroll-behavior-y: contain; animation: panelDown 0.16s ease-out; transform-origin: top; }
/* Leave room for the sticky bars when the browser scrolls a focused control into view. */
.filter-panel { scroll-padding-block: 54px 66px; }
:root[data-theme="dark"] .filter-panel, :root[data-theme="system-dark"] .filter-panel { box-shadow: none; border: 1px solid var(--line); border-top: 0; }
.filter-panel-inner { max-width: 1180px; margin: 0 auto; }
.filter-panel:focus { outline: none; }
.filter-panel-heading { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; background: var(--card); padding: 4px 10px 4px 14px; border-bottom: 1px solid var(--line-soft); }
.filter-panel-heading h2 { font-size: 18px; line-height: 24px; margin: 0; }
.filter-panel .chip { height: 44px; }
.filter-panel-footer { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card); border-top: 1px solid var(--line); }
.filter-panel-footer .panel-clear { width: auto; margin-right: auto; min-height: 44px; }
@media (max-height: 400px) {
  .filter-panel { scroll-padding-block: 0; }
  .filter-panel-heading, .filter-panel-footer { position: static; }
}
@media (min-width: 900px) {
  .filter-panel { left: auto; right: max(16px, calc((100% - 1180px) / 2)); top: calc(100% + 8px); width: min(760px, calc(100% - 32px)); border-radius: 16px; border: 1px solid var(--line); padding-bottom: 0; box-shadow: 0 12px 30px rgba(12, 35, 64, 0.16); }
}
@keyframes panelDown { from { transform: scaleY(0.85); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-saved { display: flex; align-items: center; gap: 6px; padding: 5px 12px; width: 100%; border: 0; background: transparent; text-align: left; color: var(--ink); min-height: 44px; }
.panel-saved:hover { background: rgba(127, 127, 127, 0.06); }
.panel-label { font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); padding: 10px 12px 2px; }
.panel-age { font-size: 12px; line-height: 16px; color: var(--muted); padding: 1px 12px; }
.panel-actions { display: flex; align-items: center; gap: 6px; padding: 6px 10px 0; flex-wrap: wrap; }
.panel-action { min-height: 44px; border-radius: 9px; border: 0; padding: 0 12px; display: inline-flex; align-items: center; gap: 4px; background: var(--line-soft); color: var(--ink2); font-size: 13px; font-weight: 600; white-space: nowrap; }
.panel-action .ms { font-size: 15px; }
.panel-action.on { background: var(--selected); color: var(--on-selected); }
.panel-clear { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--primary-ink); }

.cars-center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 60px 16px; }
.search-count { padding: 2px 4px; color: var(--muted); font-size: 13px; line-height: 20px; }
.more-spin { display: flex; justify-content: center; padding: 10px; grid-column: 1 / -1; }

/* The car page */
.car-gallery { min-width: 0; }
.car-hero { position: relative; width: 100%; aspect-ratio: 16 / 11; max-height: 62vh; background: var(--line-soft); overflow: hidden; }
.car-thumbs { position: relative; display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; padding: 10px 4px 6px; }
.car-thumb { position: relative; flex: 0 0 86px; height: 66px; padding: 2px; border: 3px solid transparent; border-radius: 10px; background: var(--card); overflow: hidden; }
.car-thumb > .cf-photo { width: 100%; height: 100%; border-radius: 5px; overflow: hidden; }
.car-thumb.selected { border-color: var(--primary); background: var(--selected); }
.car-thumb:hover { border-color: var(--primary-ink); }
.car-thumb:focus-visible { outline-offset: -3px; }
.thumb-number { position: absolute; right: 3px; bottom: 3px; padding: 1px 4px; border-radius: 4px; background: var(--scrim); color: #fff; font-size: 11px; line-height: 16px; font-weight: 700; }
@media (max-width: 599px) { .car-thumbs { padding: 8px; gap: 6px; } .car-thumb { flex-basis: 74px; height: 58px; } }
.car-pager { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.car-pager::-webkit-scrollbar { display: none; }
.car-pager > button { flex: 0 0 100%; height: 100%; scroll-snap-align: start; border: 0; padding: 0; background: transparent; position: relative; cursor: zoom-in; }
.car-pager > button > .cf-photo { position: absolute; inset: 0; }
.car-hero .shade { position: absolute; left: 0; right: 0; top: 0; height: calc(24px + var(--safe-top)); background: linear-gradient(180deg, var(--scrim), transparent); pointer-events: none; }
.car-hero .hero-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(8px + var(--safe-top)) 8px 8px; display: flex; justify-content: space-between; pointer-events: none; }
.car-hero .hero-bottom { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
.round-icon { pointer-events: auto; width: 44px; height: 44px; border-radius: 12px; background: var(--scrim); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; }
.round-icon .ms { font-size: 20px; }
.pager-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 22px; background: var(--scrim); color: #fff; border: 0; display: flex; align-items: center; justify-content: center; }
.pager-arrow.left { left: 8px; } .pager-arrow.right { right: 8px; }
.photo-count { height: 20px; padding: 0 6px; border-radius: 5px; background: var(--scrim); color: #fff; font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; font-variant-numeric: tabular-nums; }
.car-data { min-width: 0; }
.car-info { background: var(--card); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.car-info h1 { font-size: 21px; line-height: 28px; overflow-wrap: anywhere; }
.car-info .big-price { font-size: 28px; line-height: 34px; font-weight: 700; color: var(--ink); }
.car-price-line { flex-wrap: wrap; }
.car-body { padding: 10px 8px; display: flex; flex-direction: column; gap: 10px; }
.car-page { max-width: 760px; margin: 0 auto; width: 100%; padding-bottom: calc(96px + var(--safe-bottom)); }
.car-hero .cf-photo img { object-fit: contain; }
@media (min-width: 900px) {
  .car-page { max-width: 1280px; padding: 16px 18px calc(96px + var(--safe-bottom)); display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; gap: 20px; }
  .car-gallery { position: sticky; top: 16px; }
  .car-hero { aspect-ratio: 4 / 3; max-height: calc(100dvh - 216px); border-radius: 16px; }
  .car-info { border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
  .car-info h1 { font-size: 24px; line-height: 32px; }
  .car-info .big-price { font-size: 32px; line-height: 38px; }
  .car-body { padding: 12px 0; }
}
.fact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; }
.fact .l { font-size: 12px; line-height: 18px; color: var(--muted); }
.fact .v { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.est-box { flex: 1 1 0; min-width: 0; border: 0; border-radius: 9px; background: var(--raised); padding: 5px 8px; text-align: left; color: var(--ink); display: flex; flex-direction: column; gap: 1px; }
.est-box .l { font-size: 11px; line-height: 14px; color: var(--muted); }
.est-box .v { font-size: 14px; line-height: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dealer-note .link { border: 0; background: transparent; padding: 4px 0; color: var(--primary); font-weight: 600; font-size: 12.5px; text-align: left; }
.desc { white-space: pre-line; }
.desc.short { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }

/* The three car actions and the note that floats over them. */
.car-bar .bar-btn { min-height: 52px; height: auto; }
.car-bar .bar-btn .ms { font-size: 18px; }
.car-bar .bar-btn .lbl { margin-top: 3px; }
.car-bar .bar-btn.detail .lbl { margin-top: 1px; }
.car-bar .bar-btn.detail .ms { font-size: 18px; }
.car-bar .btn-yellowsoft.edge { border-color: var(--warning-solid); }
.car-bar .bar-btn.soft { border-color: transparent; }
.car-bar .bar-btn .spinner { width: 18px; height: 18px; }
@media (max-width: 360px) { .car-bar .bar-btn .lbl { font-size: 11.5px; } }
.note-float { position: fixed; left: 0; right: 0; bottom: calc(76px + var(--safe-bottom)); z-index: 26; display: flex; justify-content: center; pointer-events: none; padding: 0 10px; }
.note-float .banner { max-width: 740px; width: 100%; box-shadow: 0 6px 16px rgba(12, 35, 64, 0.25); animation: fadeIn 0.18s; }
.note-float.out .banner { opacity: 0; transition: opacity 0.25s; }
.shell.has-rail .note-float, .shell.has-rail .car-bar-wrap .bottom-bar { left: var(--rail-w); }
@media (max-width: 899px) { .shell.has-rail .note-float, .shell.has-rail .car-bar-wrap .bottom-bar { left: 0; } }

/* Price ruler */
.ruler { position: relative; }
.ruler .track { position: relative; height: 38px; }
.ruler .ask { font-size: 12.5px; line-height: 16px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.ruler .bar { position: absolute; left: 0; right: 0; top: 23px; height: 6px; border-radius: 4px; background: var(--line); }
.ruler .band { position: absolute; top: 23px; height: 6px; border-radius: 4px; background: var(--primary-band); min-width: 4px; }
.ruler .tick { position: absolute; top: 19px; width: 2px; height: 16px; margin-left: -1px; background: var(--ink); }
.ruler .ring { position: absolute; top: 19px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--ink); box-shadow: 0 0 0 2.5px var(--card); }
.ruler .sub { font-size: 12px; line-height: 16px; color: var(--muted); }

/* Quick sort */
.triage { min-height: 100vh; min-height: 100dvh; background: var(--navy); color: var(--on-navy); display: flex; flex-direction: column; }
.triage-head { display: flex; align-items: center; padding: calc(6px + var(--safe-top)) 6px 6px; max-width: 760px; width: 100%; margin: 0 auto; }
.triage-card { margin: 0 8px; background: var(--card); border-radius: 22px; overflow: hidden; color: var(--ink); text-align: left; border: 0; padding: 0; display: block; width: calc(100% - 16px); }
.triage-card .tc-photo { position: relative; height: 236px; }
.triage-card .tc-photo > .cf-photo { position: absolute; inset: 0; }
.triage-card .found { position: absolute; top: 10px; left: 10px; background: var(--navy); color: var(--on-navy); border-radius: 8px; padding: 4px 8px; display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 600; }
.triage-card .src { position: absolute; top: 10px; right: 10px; background: var(--card); color: var(--ink); border-radius: 8px; padding: 4px 8px; font-size: 12.5px; font-weight: 600; }
.triage-actions { display: flex; gap: 6px; padding: 10px; max-width: 760px; width: 100%; margin: 0 auto; }
.triage-action { flex: 1 1 0; height: 54px; border-radius: 10px; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600; }
.triage-action .ms { font-size: 24px; }
.triage-action.skip { background: var(--navy-raised); color: var(--on-navy); }
.triage-action.save { background: var(--card); color: var(--ink); }
.triage-action.mark { background: var(--warning-solid); color: var(--on-warning-solid); }

/* Tile the carved rails along the perimeter without stretching the corners on wide cards. */
.super-steal-frame {
  box-sizing: border-box;
  border: clamp(10px, 1.25vw, 15px) solid #bd8e37;
  border-image: url('/img/super-steal-frame.webp') 147 150 172 150 / 1 / 0 round;
  background-color: var(--card);
  background-clip: padding-box;
}
.super-steal-frame .cf-photo img { object-fit: contain; }
.triage-listing.super-steal-frame { margin-inline: 8px; }
.triage-listing.super-steal-frame .triage-card { margin: 0; width: 100%; border-radius: 0; }

/* The photo viewer */
.viewer { min-height: 100vh; min-height: 100dvh; background: var(--viewer); color: #fff; display: flex; flex-direction: column; }
.viewer-head { display: flex; align-items: center; gap: 4px; padding: calc(6px + var(--safe-top)) 6px 6px; }
.viewer-pager { flex: 1 1 auto; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; position: relative; }
.viewer-pager::-webkit-scrollbar { display: none; }
.viewer-pager > div { flex: 0 0 100%; scroll-snap-align: start; display: flex; align-items: center; justify-content: center; }
.viewer-wrap { position: relative; flex: 1 1 auto; display: flex; }

/* Search band under the bar */
.search-band { background: var(--card); padding: 4px 16px 16px; border-bottom: 1px solid var(--line); }
.search-band > * { max-width: 1180px; margin: 0 auto; }
.search-band .input { border-color: var(--field); }
.search-band .field > label { color: var(--muted); }
.search-band .icon-btn { color: var(--ink2); }
.search-band input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
.sheet-page-head { display: flex; align-items: center; gap: 4px; padding: 0 4px 6px; }
.copy-preview { background: var(--raised); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.copy-preview .line { font-size: 13px; line-height: 18px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mine-box { background: var(--primary); color: var(--on-primary); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.action-btn-blue { background: var(--info-solid); color: var(--on-info-solid); }
.dealer-card { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.dealer-card .links { display: flex; gap: 14px; flex-wrap: wrap; }
.dealer-card .links button, .dealer-card .links span { border: 0; background: transparent; padding: 4px 0; font-size: 12.5px; font-weight: 600; }
.dealer-card .links button { color: var(--primary); }
.dealer-card .links span { color: var(--muted); }
.viewer-photo { position: relative; }
.viewer-photo img { object-fit: contain; }
.viewer-photo .ph { color: var(--on-navy-muted); }
