:root {
  --page-background: #fff;
  --surface: #fff;
  --text: #182330;
  --muted-text: #546174;
  --secondary-text: #546174;
  --border: #dbe2e8;
  --field-border: #c8d3dd;
  --accent: #345d83;
  --accent-strong: #263745;
  --accent-soft: #eaf2f9;
  --accent-soft-border: #dbe2e8;
  --link: #345d83;
  --focus: #345d83;
  --surface-muted: #f3f6f8;
  --hover: #f3f6f8;
  --hover-border: #c8d3dd;
  --row-border: #dbe2e8;
  --model-background: #f3f6f8;
  --model-text: #546174;
  --new-text: #345d83;
  --new-background: #eaf2f9;
  --shadow: #18233008;
  --shadow-strong: #18233026;
  --backdrop: #18233099;
  --navigation-width: 170px;
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-background);
  color: var(--text);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.5; font-size: 14px; }
a { color: var(--link); font-weight: 650; text-decoration: none; }
a:hover, a:focus-visible { text-decoration: underline; }
input, select, button { font: inherit; }
input, select { background: var(--surface); color: var(--text); border: 1px solid var(--field-border); border-radius: 8px; min-width: 0; max-width: 100%; }
button { cursor: pointer; color: var(--link); border: 1px solid var(--field-border); border-radius: 8px; background: var(--surface); }
button:hover { background: var(--hover); }
button[aria-pressed=true] { color: var(--surface); background: var(--accent); border-color: var(--accent); }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
small { display: block; color: var(--muted-text); font-size: 12px; margin-top: 3px; }
header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 20px 28px; }
.header-inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.brand { display: flex; align-items: center; font-weight: 750; }
.brand-mark { display: grid; place-items: center; flex-shrink: 0; }
.header-status, .monitoring-badge { display: inline-flex; align-items: center; gap: 8px; color: var(--muted-text); }
.header-status::before, .monitoring-badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.header-status[data-status=failed]::before, .header-status[data-status=outdated]::before { background: #a66a05; }
.header-status[data-status=unknown]::before { background: var(--muted-text); }
.brand { gap: 12px; font-size: 24px; letter-spacing: -.05em; }
.brand-mark { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 9px; color: var(--accent); background: var(--accent-soft); }
.brand-mark svg { width: 20px; height: 20px; }
.brand-wordmark { display: flex; align-items: center; gap: 12px; }
.brand-wordmark span { color: var(--muted-text); font-size: 12px; font-weight: 400; letter-spacing: .05em; margin: 0; }
.header-status { font-size: 12px; }
.header-status::before { width: 5px; height: 5px; }
.app-shell { display: grid; grid-template-columns: var(--navigation-width) minmax(0, 1fr); width: 100%; min-height: calc(100vh - 75px); }
.collection-nav { padding: 30px 12px; background: #f7f9fb; border-right: 1px solid var(--border); }
.collection-eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .13em; font-weight: 650; color: var(--muted-text); margin: 0 10px 16px; }
.summary { display: flex; flex-direction: column; gap: 6px; }
.metric { display: flex; flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 8px; padding: 10px; border: 0; border-radius: 8px; box-shadow: none; }
.metric strong { font-size: 12px; font-weight: 500; color: var(--muted-text); }
.metric span { font-size: 13px; color: inherit; }
.metric[aria-current=page] { color: var(--accent); background: var(--accent-soft); }
.collection-note { border-top: 1px solid var(--border); padding-top: 22px; margin: 26px 10px 0; color: var(--muted-text); font-size: 12px; }
main { min-width: 0; width: 100%; padding: 26px 32px 36px; margin: 0; max-width: none; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; background: transparent; padding: 0; border-radius: 0; margin-bottom: 20px; gap: 12px; }
.hero-eyebrow { font-size: 11px; color: var(--muted-text); margin: 0 0 8px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
h1 { font-size: 34px; line-height: 1.12; letter-spacing: -.045em; margin: 0 0 8px; }
.hero-subtitle { font-size: 13px; margin: 0; color: var(--muted-text); }
.monitoring-badge { font-size: 11px; border-radius: 0; background: transparent; padding: 0; }
.monitoring-badge::before { width: 5px; height: 5px; }
.last-check { font-size: 11px; margin: 0 0 16px; }
.notice { background: #fff6df; border: 1px solid #e8c66a; padding: 12px 16px; margin-bottom: 20px; font-size: 13px; border-radius: 8px; }
.updates { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 18px; background: transparent; border: 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); border-radius: 0; padding: 12px 0; gap: 8px; }
.updates strong { font-size: 13px; }
.updates small { font-size: 11px; }
.updates.is-seen, .updates.is-empty { background: transparent; }
.updates.is-active { border: 0; border-top: 1px solid var(--accent); border-bottom: 1px solid var(--accent); background: var(--accent-soft); padding: 12px; border-radius: 8px; }
.updates-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.updates-actions button { border: 0; font-size: 12px; }
.updates-read-status { display: inline-block; padding: 2px 7px; margin-top: 5px; border-radius: 5px; color: var(--accent); background: var(--surface-muted); font-size: 11px; }
.controls { border: 0; padding: 0; border-radius: 0; }
.control-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.control-line + .control-line { margin-top: 10px; }
input, select { font-size: 13px; padding: 9px 10px; }
button { min-height: 36px; font-size: 12px; padding: 6px 9px; }
.filter-group { display: flex; flex-wrap: wrap; gap: 4px; }
input[type=search] { flex: 1; width: 100%; min-width: 160px; }
label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted-text); }
.limits { margin-top: 10px; }
.limits input { width: 150px; }
.reset { margin-left: auto; }
.filter-group button { border: 0; }
.filter-group button[aria-pressed=true] { color: var(--surface); background: var(--accent-strong); }
.feature-filter[data-feature=allWheelDrive][aria-pressed=true] { background: var(--accent); }
.feature-filter[data-feature=bowersWilkins][aria-pressed=true] { background: #735215; }
.reset { border: 0; font-size: 11px; }
#more-filters { margin-top: 8px; }
#more-filters summary { font-size: 12px; }
.updates-mode { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin: 14px 0; color: var(--surface); background: var(--accent); font-size: 12px; border-radius: 8px; }
.mode-badge { color: var(--accent); background: var(--accent-soft); border-radius: 5px; padding: 3px 7px; font-size: 11px; }
.offer-layout { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 24px; }
.enhanced .offer-layout:has(.selected-offer:not([hidden])) { grid-template-columns: minmax(0, 1fr) clamp(310px, 18vw, 420px); }
.offer-sections { min-width: 0; }
[data-offer-section] { margin-top: 16px; }
summary { cursor: pointer; font-weight: 650; margin-bottom: 12px; }
.available-summary { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.available-summary::before { content: '▸'; }
.available-summary::-webkit-details-marker { display: none; }
details[open] > .available-summary::before { content: '▾'; }
.available-summary .result-count { margin-left: auto; font-weight: 400; }
[data-offer-section] > summary { font-size: 15px; }
.section-description { font-size: 12px; color: var(--muted-text); }
.result-count { font-size: 11px; }
.table-wrap { overflow: visible; border: 0; border-radius: 0; box-shadow: none; }
thead { display: none; }
table, tbody { display: block; width: 100%; }
tr { display: grid; grid-template-columns: minmax(0, 1fr) 142px; align-items: center; gap: 12px; border-top: 1px solid var(--border); padding: 14px 8px; }
td { display: block; padding: 0; border: 0; font-size: 13px; }
td[data-label=City], td[data-label="Year / mileage"], .detail-cell { display: none; }
tr.featured, tr.all-wheel-drive { background: transparent; }
tr:hover { background: var(--hover); }
tr.is-selected { background: var(--accent-soft); border-radius: 10px; border-top-color: transparent; box-shadow: inset 3px 0 var(--accent); }
.offer-primary { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; }
.offer-content { min-width: 0; }
.offer-photo { display: flex; align-items: center; justify-content: center; align-self: start; overflow: hidden; background: var(--surface-muted); border: 1px solid var(--border); width: 64px; aspect-ratio: 4 / 3; border-radius: 6px; }
.offer-photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.photo-fallback { font-size: 11px; padding: 4px; }
.model { display: none; }
.offer-link, .select-offer { font-size: 13px; font-weight: 650; line-height: 1.4; }
.enhanced .offer-link { display: none; }
button.select-offer { text-align: left; border: 0; background: transparent; color: var(--text); border-radius: 4px; padding: 2px 0; min-height: 28px; }
button.select-offer[aria-pressed=true] { color: var(--text); background: transparent; }
.row-metadata { display: block; font-size: 12px; color: var(--muted-text); margin-top: 2px; }
.badges { display: flex; flex-wrap: wrap; margin-top: 5px; gap: 4px; }
.audio, .drivetrain, .badge { font-size: 11px; font-weight: 650; padding: 1px 5px; border-radius: 4px; }
.audio { color: #735215; background: #faf0d9; }
.drivetrain { color: var(--accent); background: var(--accent-soft); }
.new-offer { color: var(--new-text); background: var(--new-background); }
.price-down { color: #145d35; background: #d4f0df; }
.price-up { color: #8b3330; background: #ffe0db; }
.price-updated, .status-badge { color: var(--muted-text); background: var(--surface-muted); }
.change-date { font-size: 11px; }
.price { text-align: right; }
.price-button { border: 0; background: transparent; padding: 0; text-align: right; color: var(--text); font-size: 14px; min-height: 36px; font-weight: 650; }
.price-button:hover { background: transparent; text-decoration: underline; }
.price-button small { font-size: 11px; }
.enhanced .offer-actions { display: none; }
.selected-offer { min-width: 0; position: sticky; top: 20px; border: 1px solid var(--border); border-radius: 16px; padding: 16px; background: var(--surface); }
.detail-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.detail-heading span { color: var(--muted-text); text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.detail-close { display: none; }
.detail-photo .offer-photo { width: 100%; border-radius: 10px; aspect-ratio: 16 / 9; }
.detail-photo .photo-fallback { font-size: 12px; }
.detail-model { font-size: 32px; letter-spacing: -.05em; line-height: 1.15; margin: 18px 0 4px; }
.detail-variant, .detail-location { font-size: 12px; color: var(--muted-text); margin: 4px 0; overflow-wrap: anywhere; }
.detail-amount { font-size: 28px; font-weight: 650; letter-spacing: -.04em; font-variant-numeric: tabular-nums; margin: 18px 0 12px; }
.detail-amount small { display: inline; margin-left: 6px; font-size: 11px; font-weight: 400; letter-spacing: 0; }
.detail-specs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 16px; }
.detail-specs dt { color: var(--muted-text); font-size: 11px; margin-bottom: 3px; }
.detail-specs dd { margin: 0; font-size: 12px; font-weight: 600; }
.detail-history { border-top: 1px solid var(--border); padding-top: 12px; }
.detail-history button { border: 0; padding: 0; color: var(--text); font-weight: 600; }
.detail-chart { display: block; width: 100%; height: 70px; margin: 8px 0; }
.detail-range { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted-text); }
.detail-range span { display: flex; flex-direction: column; }
.detail-range strong { color: var(--text); font-size: 12px; font-variant-numeric: tabular-nums; }
.detail-link { display: flex; justify-content: space-between; align-items: center; background: var(--accent-strong); color: var(--surface); padding: 11px 12px; border-radius: 8px; margin-top: 18px; font-size: 13px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.detail-actions button { flex: 1; }
.detail-observations { font-size: 11px; color: var(--muted-text); margin: 14px 0 0; }
.detail-status { margin: 10px 0 0; }
.offer-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.favorite-button[aria-pressed=true] { color: #735215; background: #faf0d9; border-color: #e4d0a7; }
.empty { border: 1px solid var(--border); color: var(--muted-text); font-size: 13px; padding: 18px; border-radius: 8px; }
footer { padding: 20px 32px 30px calc(var(--navigation-width) + 32px); font-size: 11px; }
dialog { border: 1px solid var(--field-border); border-radius: 16px; color: var(--text); background: var(--surface); width: min(720px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 22px; }
dialog::backdrop { background: var(--backdrop); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { font-size: 20px; margin: 0; }
.history-offer { margin: 10px 0 3px; font-weight: 650; }
.history-note { font-size: 12px; color: var(--muted-text); margin: 0 0 16px; }
.history-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.history-prices div { background: var(--surface-muted); padding: 10px; border-radius: 8px; }
.history-prices small { font-size: 11px; }
.history-prices strong { font-size: 14px; }
.history-chart { margin: 0 0 20px; }
.chart-layout { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
.chart-axis { display: flex; flex-direction: column; justify-content: space-between; font-size: 11px; color: var(--muted-text); padding: 3px 0; }
.chart-plot { width: 100%; height: 150px; background: var(--surface-muted); border-radius: 8px; }
.chart-dates { display: flex; justify-content: space-between; color: var(--muted-text); font-size: 11px; margin-top: 5px; }
.history-list { list-style: none; padding: 0; margin: 0; }
.history-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); padding: 10px 0; }
.history-list time { flex: 1; min-width: 0; font-size: 12px; color: var(--muted-text); }
.history-value { flex: 1; min-width: 0; text-align: right; }
.history-value strong { display: block; }
.history-value .badge { margin-top: 4px; }
.toast { position: fixed; z-index: 3; bottom: 14px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--accent-strong); color: var(--surface); border-radius: 12px; box-shadow: 0 4px 20px var(--shadow-strong); max-width: calc(100vw - 24px); font-size: 12px; }
.back-to-top { position: fixed; bottom: 18px; right: 18px; z-index: 3; min-height: 44px; padding: 9px 13px; background: var(--accent); color: var(--surface); border-color: var(--accent); box-shadow: 0 3px 12px var(--shadow-strong); }
.back-to-top:hover { background: var(--accent-strong); }
.toast:not([hidden]) ~ .back-to-top { bottom: 76px; }
.inline-detail-cell { grid-column: 1 / -1; padding: 16px 0 0; margin-top: 12px; border-top: 1px solid var(--border); text-align: left; }
.inline-detail-cell .selected-offer { position: static; border: 0; padding: 0; border-radius: 0; }
.inline-detail-cell .detail-close { display: block; }
.inline-history { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 18px; }
@media (min-width: 1800px) {
  :root { --navigation-width: clamp(170px, 9vw, 220px); }
  .metric span { font-size: 14px; }
  .metric strong { font-size: 13px; }
  .offer-primary { grid-template-columns: 80px minmax(0, 1fr); }
  .offer-photo { width: 80px; }
  .offer-link, button.select-offer { font-size: 15px; }
  .row-metadata { font-size: 13px; }
  .price-button { font-size: 16px; }
}
@media (min-width: 901px) {
  .change-date { display: none; }
  .offer-content .status-badges { display: none; }
}
@media (max-width: 1150px) and (min-width: 901px) {
  .app-shell { grid-template-columns: 146px minmax(0, 1fr); }
  main { padding: 24px; }
  .enhanced .offer-layout:has(.selected-offer:not([hidden])) { grid-template-columns: minmax(0, 1fr) 270px; gap: 18px; }
  tr { grid-template-columns: minmax(0, 1fr) 115px; gap: 8px; padding: 12px 8px; }
  .offer-primary { grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
  .offer-photo { width: 48px; }
  .price-button { font-size: 13px; }
  footer { padding-left: 170px; }
}
@media (max-width: 900px) {
  .app-shell { grid-template-columns: 146px minmax(0, 1fr); }
  main { padding: 24px; }
  .enhanced .offer-layout:has(.selected-offer:not([hidden])) { grid-template-columns: minmax(0, 1fr); }
  footer { padding-left: 170px; }
  .detail-actions button { min-height: 44px; }
}
@media (max-width: 720px) {
  header { padding: 16px; }
  .brand { font-size: 22px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-mark svg { width: 20px; height: 20px; }
  .brand-wordmark span { font-size: 11px; }
  .app-shell { display: block; }
  .collection-nav { padding: 12px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .collection-eyebrow, .collection-note { display: none; }
  .summary { flex-direction: row; flex-wrap: wrap; gap: 4px; margin: 0; }
  .metric { flex-direction: row; gap: 6px; padding: 8px; text-align: left; }
  .metric span, .metric strong { font-size: 12px; margin: 0; display: inline; }
  main { padding: 22px 16px 30px; }
  .hero { padding: 0; gap: 12px; margin-bottom: 14px; border-radius: 0; }
  .hero-eyebrow { font-size: 11px; }
  h1 { font-size: 30px; }
  .hero-subtitle { font-size: 12px; }
  .monitoring-badge { font-size: 11px; padding: 0; }
  .last-check { font-size: 11px; }
  .updates { padding: 12px 0; }
  .updates strong { font-size: 13px; }
  .controls { padding: 0; }
  .control-line:first-child { flex-wrap: wrap; }
  input[type=search] { min-width: 0; font-size: 16px; }
  .sort-control select { width: 154px; font-size: 13px; }
  .sort-label { display: none; }
  .limits label { flex: 1; min-width: 135px; flex-direction: column; align-items: stretch; }
  .limits input { width: 100%; }
  .reset { margin: 0; }
  tr { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px; margin-bottom: 10px; box-shadow: none; }
  tr.featured, tr.all-wheel-drive { border-color: var(--border); }
  tr.is-selected { border-color: var(--accent); }
  td { display: flex; gap: 12px; justify-content: space-between; text-align: right; padding: 8px 0; border-top: 1px solid var(--border); }
  td:first-child { display: block; padding-top: 0; text-align: left; border: 0; }
  td:not(:first-child)::before { content: attr(data-label); flex-shrink: 0; color: var(--muted-text); font-size: 12px; text-align: left; }
  td.inline-detail-cell { display: block; text-align: left; }
  td.inline-detail-cell::before { display: none; }
  td[data-label=City], td[data-label="Year / mileage"] { display: flex; }
  .detail-cell { display: none; }
  .offer-primary { grid-template-columns: 88px minmax(0, 1fr); gap: 10px; }
  .offer-photo { width: 88px; }
  .row-metadata { display: none; }
  .select-offer, .offer-link { font-size: 14px; }
  .price-button { text-align: right; }
  .enhanced .offer-actions { display: flex; }
  .offer-actions button { min-height: 36px; font-size: 12px; }
  .selected-offer .offer-photo { width: 100%; }
  .audio, .drivetrain, .badge { font-size: 11px; }
  .toast { flex-wrap: wrap; width: max-content; }
  dialog { padding: 16px; }
  .history-prices { gap: 5px; }
  .history-prices div { padding: 8px 5px; }
  .history-prices strong { font-size: 12px; }
  footer { padding: 12px 16px 30px; }
}
@media (pointer: coarse) {
  button, select, .metric, button.select-offer { min-height: 44px; }
  input { font-size: 16px; }
}
