:root {
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #172d34;
  background: #f3f4ee;
  color-scheme: light;
  scrollbar-gutter: stable;
  --surface: #fcfdf9;
  --ink: #172d34;
  --muted: #4e6263;
  --line: #cbd6ce;
  --teal: #1f5450;
  --teal-dark: #17433f;
  --sage: #e4eee6;
  --warning: #735317;
  --warning-bg: #fcf0d4;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
::selection { background: #cfe5d6; color: var(--ink); }
button, select, input, textarea { font: inherit; color: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: default; opacity: .62; }
a { color: var(--teal); text-underline-offset: .19em; }
:focus-visible { outline: 3px solid #007268; outline-offset: 3px; }
.frame { width: min(1260px, calc(100% - 48px)); margin-inline: auto; }
.skip-link { position: fixed; inset: 10px auto auto 10px; z-index: 4; background: var(--surface); padding: 10px; }
.skip-link:not(:focus) { clip-path: inset(50%); }

.masthead { background: #1b3842; color: #f5f7ed; }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding-block: 21px 23px; }
.masthead h1 { margin: 0 0 3px; font-size: 2.55rem; line-height: 1.05; letter-spacing: -.038em; font-weight: 760; }
.masthead p { margin: 0; color: #d5e5dd; font-size: .93rem; line-height: 1.45; }
.masthead :focus-visible { outline-color: #d0eade; }
.site-nav { display: flex; flex-wrap: wrap; gap: 5px; }
.site-nav a { padding: 8px 12px; border: 1px solid transparent; border-radius: 8px; color: #d5e5dd; text-decoration: none; font-size: .92rem; font-weight: 620; }
.site-nav a:hover { background: #284851; color: #fff; }
.site-nav [aria-current="page"] { border-color: #789690; background: #2d514f; color: #fff; }
.scan-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.scan-button {
  display: grid;
  gap: 2px;
  flex-shrink: 0;
  padding: 8px 12px;
  border: 1px solid #627d80;
  border-radius: 8px;
  background: transparent;
  color: #f5f7ed;
  text-align: left;
  font-size: .83rem;
}
.scan-button:hover:enabled { background: #284851; border-color: #a6c7bd; }
.scan-button time { font-weight: 650; font-variant-numeric: tabular-nums; }
.masthead .button.refresh-button { border-color: #93b9a7; background: #dcece0; color: #193831; }
.masthead .button.refresh-button:hover:enabled { border-color: #edf8ef; background: #edf8ef; }
.refresh-notice { padding-top: 12px; color: var(--muted); font-size: .9rem; }
.refresh-notice p { margin: 0; overflow-wrap: anywhere; }
.refresh-notice[data-state="failed"] { color: var(--warning); }

.filters { margin-top: 22px; }
.price-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 14px; margin-bottom: 16px; }
.price-filter { flex: 0 1 25rem; min-width: min(100%, 17rem); }
.price-control { display: grid; grid-template-columns: 3.8rem minmax(0, 1fr) 3.8rem; align-items: center; gap: 6px; }
.price-limit { font-size: .88rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.price-limit:last-child { text-align: end; }
.price-slider { --price-thumb: 26px; position: relative; height: 40px; cursor: pointer; touch-action: pan-y; }
.price-track {
  position: absolute;
  inset: calc(50% - 3px) calc(var(--price-thumb) / 2) auto;
  height: 6px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--line) var(--price-start, 0%), var(--teal) var(--price-start, 0%) var(--price-end, 100%), var(--line) var(--price-end, 100%));
  pointer-events: none;
}
.price-slider input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; appearance: none; background: transparent; pointer-events: none; }
.price-slider input::-webkit-slider-runnable-track { height: var(--price-thumb); background: transparent; }
.price-slider input::-moz-range-track { background: transparent; }
.price-slider input::-webkit-slider-thumb {
  appearance: none;
  box-sizing: border-box;
  width: var(--price-thumb);
  height: var(--price-thumb);
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--surface);
  cursor: ew-resize;
  pointer-events: auto;
}
.price-slider input::-moz-range-thumb {
  box-sizing: border-box;
  width: var(--price-thumb);
  height: var(--price-thumb);
  border: 2px solid var(--teal);
  border-radius: 50%;
  background: var(--surface);
  cursor: ew-resize;
  pointer-events: auto;
}
.price-slider input:focus-visible { z-index: 1; outline: none; }
.price-slider input:focus-visible::-webkit-slider-thumb { outline: 2px solid #007268; outline-offset: 2px; }
.price-slider input:focus-visible::-moz-range-thumb { outline: 2px solid #007268; outline-offset: 2px; }
.price-presets { display: flex; flex-wrap: wrap; gap: 7px; }
.button, .reaction, .close-button, .gallery-button {
  min-height: 40px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: .89rem;
  font-weight: 620;
}
.price-filters button { white-space: nowrap; }
.button:hover:enabled, .reaction:hover:enabled, .close-button:hover, .gallery-button:hover {
  border-color: var(--teal);
  background: var(--sage);
}
.price-filters button[aria-pressed="true"], .button.primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.price-filters button[aria-pressed="true"]:hover, .button.primary:hover { background: var(--teal-dark); }
#marked-filter { margin-inline-start: auto; }
#marked-filter span:not(:empty) { margin-inline-start: 3px; font-size: .8em; font-variant-numeric: tabular-nums; }
.controls { display: grid; grid-template-columns: minmax(14rem, 1fr) minmax(8rem, .31fr) minmax(9rem, .32fr) minmax(11rem, .43fr); gap: 10px; }
.controls label { display: grid; min-width: 0; gap: 4px; }
.controls label > span, .filter-label { color: var(--muted); font-size: .8rem; font-weight: 650; }
.controls input, .controls select, .detail-form textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 8px 10px;
}
::placeholder { color: var(--muted); opacity: 1; }
.results-bar { min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.results-bar p { margin: 0; color: var(--muted); font-size: .88rem; font-weight: 600; }
.text-button { min-height: 36px; padding: 3px 0; border: 0; background: none; color: var(--teal); font-size: .87rem; font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: .19em; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 268px), 1fr)); gap: 16px; margin-bottom: 34px; }
.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card:has(.photo-link:hover, .title-link:hover) { border-color: #789c90; }
.photo-link, .gallery-photo {
  display: block;
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #e2eae0;
}
.photo-link { border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0; }
.photo-link img, .gallery-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-count, .photo-badge { position: absolute; inset: auto 8px 8px auto; }
.photo-count { border-radius: 5px; background: #1b3842; color: #fff; padding: 3px 6px; font-size: .76rem; font-weight: 650; }
.photo-badge { right: auto; left: 8px; max-width: calc(100% - 70px); }
.image-fallback { position: absolute; inset: 0; display: grid; place-items: center; padding: 10px; color: var(--muted); font-size: .88rem; }
.card-body { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 13px 14px 11px; }
.card-heading { display: flex; gap: 9px; justify-content: space-between; align-items: baseline; }
.card-heading h2 { min-width: 0; margin: 0; font-size: 1.12rem; line-height: 1.22; letter-spacing: -.017em; overflow-wrap: anywhere; }
.title-link { color: var(--ink); text-decoration: none; }
.title-link:hover { color: var(--teal); text-decoration: underline; }
.price { flex-shrink: 0; font-weight: 760; font-size: 1.16rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.car-meta, .pti-line { margin: 6px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.42; }
.listing-dates { display: grid; gap: 3px; margin: 8px 0 0; padding-top: 7px; border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; line-height: 1.35; }
.listing-dates div { display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: 8px; }
.listing-dates dd { margin: 0; font-variant-numeric: tabular-nums; }
.model-rank-link {
  align-self: flex-start;
  color: var(--teal-dark);
  font-size: .8rem;
  font-weight: 650;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  text-underline-offset: 2px;
}
.card .model-rank-link { margin-top: 6px; }
.pti-line.ok, .pti-verified { color: #265b43; }
.pti-line.warning, .pti-expired { color: var(--warning); }
.tag {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--sage);
  color: #294d42;
  font-size: .77rem;
  font-weight: 670;
}
.tag.warning { color: var(--warning); background: var(--warning-bg); }
.tag.archived { color: #394e52; background: #e7edec; }
.short-review, .user-note {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow-wrap: anywhere;
}
.short-review { margin: 10px 0 12px; font-size: .91rem; line-height: 1.46; }
.user-note { margin: 0 0 10px; -webkit-line-clamp: 2; color: var(--muted); font-size: .83rem; line-height: 1.38; white-space: pre-wrap; }
.card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); }
.reaction { min-height: 36px; padding-inline: 8px; font-size: .8rem; }
.reaction[aria-pressed="true"] { color: #1f4e36; background: #dceee0; border-color: #70977b; }
.reaction[data-reaction="dislike"][aria-pressed="true"] { color: var(--warning); background: var(--warning-bg); border-color: #a68a4e; }
.original-link { margin-left: auto; padding: 8px 0; white-space: nowrap; font-size: .81rem; font-weight: 650; }
.empty, .load-error { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; background: var(--surface); color: var(--muted); line-height: 1.5; }
.empty { grid-column: 1 / -1; }
.empty h2 { margin: 0 0 4px; color: var(--ink); font-size: 1.12rem; }
.empty p, .load-error p { margin: 0; }
.empty .button { margin-top: 11px; }
.load-error { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 16px auto; }

dialog { width: min(1090px, calc(100% - 36px)); max-height: calc(100dvh - 36px); padding: 0; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overscroll-behavior: contain; }
dialog::backdrop { background: #12282dcc; }
body:has(dialog[open]) { overflow: hidden; }
.single-page { width: min(1160px, calc(100% - 48px)); margin-block: 20px 34px; }
.single-page #vehicle-content { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.single-page .detail-heading { position: static; }
.single-page .empty { border: 0; }
.detail-heading { position: sticky; z-index: 1; top: 0; padding: 15px 22px 12px; background: var(--surface); border-bottom: 1px solid var(--line); }
.detail-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.detail-top h2 { margin: 0; font-size: 1.57rem; letter-spacing: -.025em; line-height: 1.15; overflow-wrap: anywhere; }
.detail-top h2:focus { outline: none; }
.detail-title-meta { margin: 5px 0 0; color: var(--muted); font-size: .84rem; }
.close-button { flex: 0 0 auto; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px 12px; margin-top: 10px; }
.detail-actions .price { font-size: 1.38rem; }
.detail-actions .source-link { margin-left: auto; line-height: 1.25; }
a.button { display: inline-flex; align-items: center; text-decoration: none; }
.detail-body { padding: 17px 22px 23px; }
.vehicle-overview { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.gallery { min-width: 0; }
.gallery-photo { border-radius: 8px; background: #e7ede8; }
.gallery-photo img { object-fit: contain; background: #243b40; }
.gallery-photo[data-view-photos] { border: 0; padding: 0; cursor: zoom-in; }
.gallery-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: .84rem; color: var(--muted); }
.gallery-controls [data-view-photos] { margin-left: auto; }
.gallery-controls .photo-position { min-width: 39px; text-align: center; font-variant-numeric: tabular-nums; }
.gallery-button { min-height: 36px; font-size: .82rem; }
.thumbnails { display: flex; gap: 5px; overflow-x: auto; padding: 4px; margin: 5px -4px 0; scrollbar-color: #9eb4ab transparent; }
.thumb { flex: 0 0 62px; padding: 2px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); }
.thumb[aria-pressed="true"] { border-color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 3px; object-fit: cover; background: #e2eae0; }

#photo-dialog {
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #111b1e;
  color: #f2f7f4;
}
.photo-viewer {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  background: #111b1e;
}
.photo-viewer:focus-visible, .photo-viewer :focus-visible { outline-color: #a9dfc1; }
.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  border-bottom: 1px solid #35464b;
}
.viewer-heading { min-width: 0; }
.viewer-heading h2 { margin: 0; font-size: 1rem; line-height: 1.25; overflow-wrap: anywhere; }
.viewer-heading p { margin: 3px 0 0; color: #b9cecb; font-size: .84rem; font-variant-numeric: tabular-nums; }
.viewer-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.viewer-actions a { color: #d0e9dc; font-size: .87rem; padding-block: 8px; }
.viewer-close, .viewer-arrow {
  min-height: 44px;
  border: 1px solid #60777a;
  border-radius: 8px;
  background: #25383c;
  color: inherit;
}
.viewer-close { padding: 6px 11px; font-size: .87rem; font-weight: 650; }
.viewer-close:hover, .viewer-arrow:hover { background: #385256; }
.viewer-stage {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
}
.viewer-image {
  position: relative;
  grid-area: 1 / 2;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  touch-action: pan-y pinch-zoom;
}
.viewer-image img { display: block; width: 100%; height: 100%; object-fit: contain; }
.viewer-image .viewer-pending { visibility: hidden; }
.viewer-image .image-fallback { color: #d0e9dc; }
.viewer-arrow { display: grid; width: 46px; place-items: center; }
.viewer-prev { grid-area: 1 / 1; }
.viewer-next { grid-area: 1 / 3; }
.viewer-arrow::before {
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg);
  content: "";
}
.viewer-prev::before { transform: rotate(-135deg); }
.viewer-thumbnails {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 6px max(7px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(7px, env(safe-area-inset-left));
  scrollbar-color: #6a8788 transparent;
}
.viewer-thumbnails .thumb { border-color: #60777a; background: #25383c; }
.viewer-thumbnails .thumb[aria-pressed="true"] {
  border-color: #a9dfc1;
  box-shadow: inset 0 0 0 1px #a9dfc1;
}
.viewer-thumbnails .thumb img { background: #25383c; }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px 12px; margin: 0; }
.specs div { border-top: 1px solid var(--line); padding-top: 5px; }
.specs dt { color: var(--muted); font-size: .78rem; }
.specs dd { margin: 2px 0 0; font-size: .89rem; font-weight: 620; line-height: 1.4; overflow-wrap: anywhere; }
.small { color: var(--muted); font-size: .82rem; }
.detail-copy { max-width: 72ch; }
.detail-copy h3 { margin: 20px 0 4px; font-size: 1.06rem; }
.detail-copy p, .detail-copy li, .scan-content li { line-height: 1.5; overflow-wrap: anywhere; }
.detail-copy p { margin: 6px 0; }
.detail-copy .muted { color: var(--muted); }
.detail-copy ul, .scan-content ul { margin: 7px 0; padding-left: 20px; }
.detail-copy li + li, .scan-content li + li { margin-top: 5px; }
.driving-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 245px), 1fr)); gap: 8px 16px; margin: 8px 0 0; }
.driving-notes > div { border-top: 1px solid var(--line); padding-top: 7px; }
.driving-notes dt { color: var(--muted); font-size: .84rem; font-weight: 650; }
.driving-notes dd { margin: 4px 0 0; line-height: 1.5; overflow-wrap: anywhere; }
.seller-text { white-space: pre-wrap; }
.seller-original { margin: 7px 0 0; }
.seller-original summary { width: fit-content; color: var(--teal); cursor: pointer; font-size: .85rem; }
.detail-form { display: grid; gap: 7px; margin-top: 10px; }
.detail-form label { color: var(--muted); font-size: .86rem; }
.detail-form textarea { resize: vertical; min-height: 80px; }
.detail-form .button { justify-self: start; }
.detail-form .form-status { min-height: 1.2em; margin: 0; color: var(--muted); font-size: .82rem; }
.detail-form .form-status.error { color: var(--warning); }
.history { margin-top: 17px; border-top: 1px solid var(--line); padding-top: 10px; }
.history summary { width: fit-content; padding: 5px 0; color: var(--teal); font-weight: 650; cursor: pointer; }
#scan-dialog { width: min(680px, calc(100% - 36px)); }
.scan-content { padding: 19px 22px; }
.toast { position: fixed; z-index: 2; inset: auto 16px 10px auto; padding: 10px 13px; max-width: calc(100% - 32px); border-radius: 8px; background: var(--ink); color: #fff; font-size: .91rem; }

.directory { margin-block: 24px 34px; }
.directory-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.directory-heading h2 { margin: 0 0 5px; font-size: 2rem; line-height: 1.12; letter-spacing: -.027em; }
.directory-heading p { margin: 0; max-width: 66ch; color: var(--muted); line-height: 1.5; }
.directory-heading time { flex-shrink: 0; margin-top: 4px; color: var(--muted); font-size: .82rem; }
.directory-controls { grid-template-columns: minmax(12rem, 1fr) minmax(9rem, .35fr) minmax(12rem, .45fr); }
.directory-result { margin: 13px 0 10px; color: var(--muted); font-size: .89rem; font-weight: 620; }
.directory-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 314px), 1fr)); align-items: start; }
.directory-photo {
  display: block;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 0 0;
  background: #e2eae0;
}
.directory-photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 66%; }
.directory-photo:hover { outline: 2px solid #789c90; outline-offset: -2px; }
.directory-card-body { display: flex; flex: 1; flex-direction: column; gap: 11px; padding: 15px 16px; }
.directory-card h3 { margin: 0; font-size: 1.18rem; line-height: 1.2; letter-spacing: -.017em; overflow-wrap: anywhere; }
.directory-card p { margin: 0; line-height: 1.45; }
.directory-card .car-meta { margin-top: 4px; }
.directory-card .directory-price { display: grid; gap: 3px; }
.directory-price strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.directory-card .directory-summary { font-size: .9rem; }
.directory-rules { margin: 0; display: grid; gap: 8px; }
.directory-rules > div { padding-top: 7px; border-top: 1px solid var(--line); }
.directory-rules dt { color: var(--muted); font-size: .8rem; font-weight: 650; }
.directory-rules dd { margin: 2px 0 0; font-size: .89rem; line-height: 1.45; overflow-wrap: anywhere; }
.directory-links { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: auto; padding-top: 9px; border-top: 1px solid var(--line); }
.directory-links > a { padding-block: 6px; font-size: .85rem; }
.directory-links > .button { padding-block: 7px; }
.directory-contact { font-variant-numeric: tabular-nums; }
.directory-terms { font-size: .88rem; }
.directory-terms summary { width: fit-content; padding-block: 5px; color: var(--teal); cursor: pointer; font-weight: 620; }
.directory-terms > p { margin: 6px 0; color: var(--muted); }
.directory-references { display: flex; flex-wrap: wrap; gap: 5px 12px; }

.model-rating { width: min(1130px, calc(100% - 48px)); margin-block: 25px 38px; }
.rating-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.rating-heading h2 { margin: 0 0 5px; font-size: 2rem; line-height: 1.12; letter-spacing: -.027em; }
.rating-heading p { max-width: 58ch; margin: 0; color: var(--muted); line-height: 1.48; }
.rating-search { flex: 0 1 17rem; min-width: 12rem; }
.rating-search span { display: block; margin-bottom: 5px; color: var(--muted); font-size: .83rem; font-weight: 650; }
.rating-search input { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.rating-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; }
.rating-modes { display: flex; flex-shrink: 0; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--sage); }
.rating-modes button { min-height: 37px; padding: 6px 12px; border: 0; border-radius: 7px; background: transparent; font-size: .91rem; font-weight: 680; white-space: nowrap; }
.rating-modes button:hover { background: #d7e5dc; }
.rating-modes button[aria-pressed="true"] { color: #fff; background: var(--teal-dark); }
.rating-count, .rating-context { color: var(--muted); font-size: .86rem; }
.rating-count { margin: 0; text-align: right; }
.rating-context { max-width: 78ch; min-height: 2.65em; margin: 9px 0 8px; line-height: 1.44; }
.rating-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rating-list > li + li { border-top: 1px solid var(--line); }
.rating-model { --edge: #a4b6b0; --rank-color: #415c5a; }
.rating-model[data-emphasis="high"] { --edge: #3d7e6a; --rank-color: #17433f; }
.rating-model[data-emphasis="middle"] { --edge: #9c8a62; --rank-color: #63502c; }
.rating-row {
  display: grid;
  grid-template-columns: 3.1rem minmax(0, 1fr) minmax(7.8rem, .47fr) minmax(5.8rem, .32fr) minmax(7rem, .39fr) minmax(7.1rem, .33fr) .85rem;
  align-items: center;
  gap: 12px;
  padding-inline: 15px;
}
.rating-columns { padding-block: 8px; padding-left: 19px; color: var(--muted); font-size: .79rem; font-weight: 670; }
.rating-model summary { min-height: 63px; padding-block: 9px; border-inline-start: 3px solid var(--edge); list-style: none; cursor: pointer; }
.rating-model summary::-webkit-details-marker { display: none; }
.rating-model summary:hover, .rating-model[open] summary { background: #edf3eb; }
.rating-model summary:focus-visible { position: relative; z-index: 1; outline-offset: -3px; }
.rating-list li:first-child summary { border-start-start-radius: 11px; border-start-end-radius: 11px; }
.rating-list li:last-child .rating-model:not([open]) summary { border-end-start-radius: 11px; border-end-end-radius: 11px; }
.rating-position { color: var(--rank-color); font-size: 1.45rem; font-weight: 760; font-variant-numeric: tabular-nums; }
.rating-name { display: grid; gap: 2px; min-width: 0; }
.rating-name strong { font-size: 1.03rem; line-height: 1.16; overflow-wrap: anywhere; }
.rating-name small { color: var(--muted); font-size: .8rem; line-height: 1.23; }
.rating-price { min-width: 0; font-size: .94rem; font-variant-numeric: tabular-nums; }
.rating-price strong { white-space: nowrap; }
.rating-price small { display: block; margin-top: 2px; color: var(--muted); font-size: .73rem; line-height: 1.2; }
.rating-clearance, .rating-low, .rating-alternate { font-size: .87rem; }
.rating-clearance, .rating-alternate { font-variant-numeric: tabular-nums; }
.rating-alternate { color: var(--teal-dark); font-weight: 700; }
.rating-field { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.rating-chevron { justify-self: center; width: 8px; height: 8px; margin: -4px 1px 0 0; border: solid var(--teal); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.rating-model[open] .rating-chevron { margin-top: 4px; transform: rotate(225deg); }
.rating-description { padding: 12px 20px 15px 68px; border-top: 1px solid var(--line); }
.rating-notes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.rating-notes h3 { margin: 0 0 3px; font-size: .9rem; }
.rating-notes p { max-width: 60ch; margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.rating-description .directory-references { margin-top: 8px; }
.rating-description a { padding-block: 4px; font-size: .84rem; }
.rating-price-detail { margin-top: 12px; padding-top: 9px; border-top: 1px solid var(--line); }
.rating-price-detail p { margin: 0; color: var(--muted); font-size: .86rem; }
.rating-price-detail .directory-references { margin-top: 2px; }
.rating-unrated { margin: 16px 0 0; padding: 10px 13px; border: 1px solid var(--line); border-radius: 8px; }
.rating-unrated summary { cursor: pointer; color: var(--teal); }

@media (max-width: 900px) {
  .price-filter { flex-basis: 100%; }
}

@media (max-width: 810px) {
  .controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .search { grid-column: 1 / -1; }
  .vehicle-overview { grid-template-columns: 1fr; gap: 14px; }
  .site-nav { order: 1; flex-basis: 100%; }
  .masthead-inner { flex-wrap: wrap; }
  .directory-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .directory-controls .directory-search { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .rating-heading { display: grid; gap: 12px; }
  .rating-heading h2 { font-size: 1.68rem; }
  .rating-search { min-width: 0; width: min(100%, 25rem); }
  .rating-search input { min-height: 44px; font-size: 1rem; }
  .rating-context { min-height: 0; margin-bottom: 12px; }
  .rating-columns { display: none; }
  .rating-model summary {
    grid-template: "place name name arrow" "place price alternate arrow" "place clearance low arrow" / 1.9rem minmax(0, 1.25fr) minmax(0, 1fr) .65rem;
    gap: 7px 8px;
    align-items: start;
    padding: 10px 10px 11px;
  }
  .rating-position { grid-area: place; font-size: 1.26rem; line-height: 1.1; }
  .rating-name { grid-area: name; }
  .rating-price { grid-area: price; }
  .rating-clearance { grid-area: clearance; }
  .rating-low { grid-area: low; }
  .rating-alternate { grid-area: alternate; }
  .rating-clearance, .rating-low, .rating-alternate { font-size: .81rem; line-height: 1.26; overflow-wrap: anywhere; }
  .rating-row :is(.rating-price, .rating-clearance, .rating-low, .rating-alternate) .rating-field {
    position: static;
    display: block;
    width: auto;
    height: auto;
    margin-bottom: 1px;
    clip-path: none;
    color: var(--muted);
    font-size: .68rem;
    font-weight: 600;
    white-space: normal;
  }
  .rating-chevron { grid-area: arrow; align-self: center; }
  .rating-description { padding: 11px 13px 12px; }
  .rating-notes { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  :root { scrollbar-gutter: auto; }
  .frame { width: calc(100% - 28px); }
  .masthead-inner { gap: 10px; padding-block: 15px; align-items: flex-start; flex-wrap: wrap; }
  .masthead h1 { font-size: 1.9rem; }
  .masthead p { font-size: .83rem; }
  .site-nav { gap: 4px; }
  .site-nav a { padding: 8px; }
  .scan-button { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 3px 9px; min-height: 35px; padding: 5px 8px; font-size: .76rem; }
  .masthead .button.refresh-button { min-height: 36px; padding: 6px 9px; font-size: .8rem; }
  .filters { margin-top: 14px; }
  .price-filters { gap: 6px 10px; margin-bottom: 12px; }
  .price-presets { gap: 5px; }
  .price-filters .button { min-height: 38px; padding-inline: 8px; font-size: .8rem; }
  #marked-filter { margin-inline-start: 0; }
  .controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .controls .sort { grid-column: span 2; }
  .controls input, .controls select { min-height: 44px; font-size: 1rem; }
  .grid { gap: 12px; }
  .single-page { width: calc(100% - 22px); margin-block: 11px 24px; }
  .reaction, .gallery-button { min-height: 42px; }
  dialog, #scan-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); }
  .detail-heading, .detail-body, .scan-content { padding-inline: 12px; }
  .detail-top h2 { font-size: 1.3rem; }
  .detail-top { gap: 7px; }
  .close-button { padding-inline: 7px; font-size: .81rem; }
  .viewer-bar { padding-inline: 9px; }
  .viewer-actions { gap: 8px; }
  .viewer-stage { grid-template-columns: minmax(0, 1fr); gap: 0; padding-inline: 3px; }
  .viewer-image { grid-area: 1 / 1; }
  .viewer-arrow { position: absolute; z-index: 1; grid-area: auto; top: 50%; width: 44px; transform: translateY(-50%); }
  .viewer-prev { left: 7px; }
  .viewer-next { right: 7px; }
  .directory { margin-top: 17px; }
  .directory-heading { display: grid; gap: 6px; }
  .directory-heading h2 { font-size: 1.63rem; }
  .directory-heading p { font-size: .9rem; }
  .directory-heading time { margin-top: 0; }
  .directory-controls select { font-size: .9rem; }
  .model-rating { width: calc(100% - 28px); margin-top: 17px; }
  .rating-heading p { font-size: .9rem; }
  .rating-modes button { padding-inline: 8px; font-size: .81rem; }
  .rating-count { font-size: .78rem; }
}

@media (max-width: 345px) {
  .gallery-controls [data-view-photos] { margin-left: 0; }
}
