/* Design tokens. Colours: the validated dataviz palette, light and dark.
 * Type scale 12/14/16/18/22/28, spacing on a 4px grid, touch targets ≥ 44px
 * (the ui-ux-pro-max checklist; see AGENTS.md). */
@font-face {
  font-family: "Noto Sans Hebrew";
  src: url(/noto-sans-hebrew-hebrew.woff2) format("woff2");
  font-weight: 400 700; font-display: swap;
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Noto Sans Hebrew";
  src: url(/noto-sans-hebrew-latin.woff2) format("woff2");
  font-weight: 400 700; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  color-scheme: light;
  --page: #f7f7f4;
  --surface: #ffffff;
  --surface-2: #f0efea;
  --ink: #0b0b0b;
  --ink-2: #4a4946;
  --muted: #64625d;
  --grid: #e3e2db;
  --axis: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --accent: #2a78d6;
  --accent-ink: #1c5cab;
  --accent-wash: rgba(42, 120, 214, 0.10);
  --accent-track: #cde2fb;
  --deemph: #c9c8c0;
  --good: #0ca30c;
  --good-text: #006300;
  --good-wash: rgba(12, 163, 12, 0.12);
  --warning: #fab219;
  --serious: #ec835a;
  --serious-wash: rgba(236, 131, 90, 0.20);
  --orange-text: #9a3f12;
  --amber-wash: rgba(250, 178, 25, 0.22);
  --amber-text: #7a5000;
  --violet-wash: rgba(110, 80, 200, 0.12);
  --violet-text: #5b3fa8;
  --critical: #d03b3b;
  --critical-text: #b42f2f;
  --critical-wash: rgba(208, 59, 59, 0.10);
  --shadow: 0 1px 2px rgba(11, 11, 11, 0.05), 0 4px 12px rgba(11, 11, 11, 0.04);
  --radius: 16px;
  --radius-sm: 12px;
  --font: "Noto Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --fast: 120ms;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0f0f0e;
    --surface: #1a1a19;
    --surface-2: #252523;
    --ink: #ffffff;
    --ink-2: #cfcec6;
    --muted: #a3a198;
    --grid: #2e2e2b;
    --axis: #3d3d39;
    --border: rgba(255, 255, 255, 0.12);
    --accent: #3987e5;
    --accent-ink: #8bbaf0;
    --accent-wash: rgba(57, 135, 229, 0.16);
    --accent-track: #184f95;
    --deemph: #4b4a46;
    --good-text: #3ec43e;
    --good-wash: rgba(12, 163, 12, 0.18);
    --critical-text: #ee7b7b;
    --critical-wash: rgba(208, 59, 59, 0.18);
    --serious-wash: rgba(236, 131, 90, 0.24);
    --orange-text: #f3a37f;
    --amber-wash: rgba(250, 178, 25, 0.18);
    --amber-text: #f5c35a;
    --violet-wash: rgba(140, 110, 230, 0.22);
    --violet-text: #c2b2f7;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f0f0e;
  --surface: #1a1a19;
  --surface-2: #252523;
  --ink: #ffffff;
  --ink-2: #cfcec6;
  --muted: #a3a198;
  --grid: #2e2e2b;
  --axis: #3d3d39;
  --border: rgba(255, 255, 255, 0.12);
  --accent: #3987e5;
  --accent-ink: #8bbaf0;
  --accent-wash: rgba(57, 135, 229, 0.16);
  --accent-track: #184f95;
  --deemph: #4b4a46;
  --good-text: #3ec43e;
  --good-wash: rgba(12, 163, 12, 0.18);
  --critical-text: #ee7b7b;
  --critical-wash: rgba(208, 59, 59, 0.18);
  --serious-wash: rgba(236, 131, 90, 0.24);
  --orange-text: #f3a37f;
  --amber-wash: rgba(250, 178, 25, 0.18);
  --amber-text: #f5c35a;
  --violet-wash: rgba(140, 110, 230, 0.22);
  --violet-text: #c2b2f7;
  --shadow: none;
}

/* Base */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 var(--font);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
[hidden] { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.25; }
h1 { font-size: 22px; }
p { margin: 0 0 8px; }
a { color: var(--accent-ink); }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon { width: 20px; height: 20px; flex: none; }
.loading { opacity: .55; transition: opacity var(--fast); }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(8px + env(safe-area-inset-top)) 16px 8px;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 17px; }
.brand-mark { width: 24px; height: 24px; color: var(--accent); }
.banner {
  margin: 0; padding: 8px 16px; font-size: 14px; text-align: center;
  background: color-mix(in srgb, var(--warning) 22%, var(--page)); color: var(--ink);
}

main { max-width: 720px; margin: 0 auto; padding: 12px 16px 24px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 0 0 12px;
}
.card-title { font-size: 18px; font-weight: 700; margin: 0 0 4px; }
.sub-title { font-size: 15px; font-weight: 700; color: var(--ink-2); margin: 16px 0 4px; }
.section-title { font-size: 20px; font-weight: 700; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center-note { text-align: center; color: var(--muted); padding: 32px 12px; }
.warn-text { color: var(--critical-text); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface-2);
  font-weight: 600; text-decoration: none; color: var(--ink); cursor: pointer;
  transition: background var(--fast), transform var(--fast);
}
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:active { background: var(--accent-ink); }
.btn.wide { width: 100%; margin-top: 8px; }
.btn .icon { width: 18px; height: 18px; }
.small-btn { min-height: 40px; padding: 6px 12px; font-size: 14px; white-space: nowrap; }
.icon-btn { display: grid; place-items: center; border: 0; background: transparent; width: 44px; height: 44px; cursor: pointer; color: var(--ink-2); border-radius: 50%; }
.icon-btn svg { width: 22px; height: 22px; }
.link-btn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 4px 0;
  border: 0; background: none; cursor: pointer; color: var(--accent-ink); font-size: 15px; font-weight: 600;
}
.link-btn svg { width: 20px; height: 20px; }

/* Fields */
.field { margin: 12px 0 0; }
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-label { display: block; font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
select, input[type="search"] {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--axis); background: var(--surface); color: var(--ink);
}
input[type="search"] { font-size: 17px; }
.slider-field { margin-top: 12px; }
.slider-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.slider-head output { font-weight: 700; }
input[type="range"] { width: 100%; height: 44px; accent-color: var(--accent); margin: 0; cursor: pointer; }

.segmented {
  display: flex; gap: 4px; padding: 3px; margin-top: 4px;
  background: var(--surface-2); border-radius: var(--radius-sm); border: 1px solid var(--border);
}
.segmented button {
  flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent;
  font-size: 14px; color: var(--ink-2); cursor: pointer; padding: 6px 4px;
}
.segmented button[aria-checked="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: var(--shadow); }
.segmented.compact button { min-height: 36px; font-size: 13px; padding: 4px 8px; }

details.more { margin-top: 12px; }
details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before {
  content: ""; width: 8px; height: 8px; flex: none; border: solid currentColor; border-width: 0 0 2px 2px;
  transform: rotate(45deg); margin-inline-end: 4px; transition: transform var(--fast);
}
details[open] > summary::before { transform: rotate(-45deg); }
details.more > summary { color: var(--accent-ink); font-size: 15px; font-weight: 600; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 15px; color: var(--ink); cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

/* לקנות: the budget */
.ask { padding: 16px 16px 12px; }
.ask-q { display: block; text-align: center; font-size: 17px; font-weight: 700; }
.money-row { display: flex; align-items: baseline; justify-content: center; gap: 2px; margin: 4px 0 0; }
.money-cur { font-size: 30px; font-weight: 700; color: var(--ink-2); }
.money {
  width: 6.4ch; padding: 0 2px; border: 0; border-bottom: 2px dashed var(--axis); border-radius: 0;
  background: transparent; color: var(--ink); text-align: center;
  font-size: 44px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums;
}
.money:focus { outline: none; border-bottom-color: var(--accent); border-bottom-style: solid; }
.money-slider { margin-top: 4px; }
.ticks { position: relative; height: 18px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; top: 0; transform: translateX(50%); white-space: nowrap; }
/* RTL: inline-start is the right edge. The ends sit flush with the track's ends. */
.ticks span.start { transform: translateX(11px); }
.ticks span.end { transform: translateX(calc(100% - 11px)); }
.ticks span::before {
  content: ""; position: absolute; top: -6px; left: 50%; width: 1px; height: 4px; background: var(--axis);
}
.ticks span.start::before, .ticks span.end::before { display: none; }
.kinds { margin-top: 12px; }

.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 4px 4px; }
.list-head p { margin: 0; }
.empty { text-align: center; }

/* Model cards on the list */
.pk-list, .ads, .model-cards { list-style: none; margin: 0; padding: 0; }
.pk-card { padding: 0; overflow: hidden; }
.pk-btn {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; padding: 12px;
  border: 0; background: transparent; text-align: start; cursor: pointer; border-radius: var(--radius);
  transition: background var(--fast);
}
.pk-btn:active { background: var(--accent-wash); }
.pk-photo, .mp-photo { position: relative; flex: none; overflow: hidden; background: var(--surface-2); }
.pk-photo { width: 104px; height: 78px; border-radius: 10px; }
.thumb { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.noimg { position: absolute; inset: 0; margin: auto; width: 44px; height: 44px; color: var(--deemph); }
.rank {
  position: absolute; top: 4px; inset-inline-start: 4px; min-width: 22px; height: 22px; padding: 0 6px;
  display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: #fff;
  font-size: 12px; font-weight: 700;
}
.pk-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pk-name { font-size: 17px; font-weight: 700; line-height: 1.3; }
.pk-years { font-size: 16px; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.pk-rest { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--good-wash); color: var(--good-text); }
.badge.warn { background: var(--amber-wash); color: var(--amber-text); }
.badge.info { background: var(--surface-2); color: var(--ink-2); }
.badge-icon { width: 13px; height: 13px; flex: none; }

/* The model page */
.mp-nav { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0 0 4px; }
.mp-hero { display: flex; gap: 12px; align-items: center; padding: 12px; }
.mp-photo { width: 120px; height: 90px; border-radius: 12px; }
.mp-hero-text { flex: 1; min-width: 0; }
.mp-name { font-size: 22px; font-weight: 700; margin: 0 0 2px; }
.mp-hero-text p { margin: 0; }
.credit { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.credit a { color: inherit; }

.mp-range { display: flex; flex-direction: column; margin: 2px 0 6px; font-size: 15px; font-variant-numeric: tabular-nums; }
.mp-range strong { font-size: 16px; }

.need { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--grid); }
.need-main { font-size: 17px; margin: 0 0 4px; }
.need-main strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.need-status { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.need-status .icon { width: 16px; height: 16px; }
.need-status.ok { background: var(--good-wash); color: var(--good-text); }
.need-status.over { background: var(--critical-wash); color: var(--critical-text); }

.action-list { list-style: none; margin: 0; padding: 0; }
.action-list li + li { border-top: 1px solid var(--grid); }
.action-list button {
  width: 100%; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center;
  padding: 12px 2px; border: 0; background: transparent; text-align: start; cursor: pointer; min-height: 52px;
}
.action-list button:active { background: var(--accent-wash); }
.action-list .what { font-weight: 600; }
.action-list .why { color: var(--muted); font-size: 14px; grid-column: 1; }
.action-list .amount { grid-row: 1 / span 2; grid-column: 2; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.amount.save { color: var(--good-text); }
.amount.cost { color: var(--ink-2); }
.chart-more { margin-top: 8px; }

.ads-section { margin: 20px 0 12px; }
.ads-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin: 0 4px 4px; }
.ads-head .segmented { margin: 0; flex: 1 1 100%; }
.ads-section > .muted { margin: 0 4px 8px; }

/* One ad card for the whole site */
.ad { padding: 0; overflow: hidden; }
.ad-photo { position: relative; display: block; width: 100%; aspect-ratio: 16 / 10; max-height: 280px; overflow: hidden; background: var(--surface-2); }
.ad-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* The verdict sits on the photo, in the reading corner. */
.verdict {
  position: absolute; top: 10px; inset-inline-start: 10px; display: inline-flex; align-items: center; gap: 8px;
  padding-block: 4px; padding-inline: 4px 14px; border-radius: 999px; font-size: 15px; font-weight: 700;
  background: color-mix(in srgb, var(--surface) 94%, transparent); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
}
.verdict .ring {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  color: #fff; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums;
}
.v-good { color: var(--good-text); } .v-good .ring { background: #0f7f0f; }
.v-fair { color: var(--ink-2); } .v-fair .ring { background: #5d5c57; }
.v-weak { color: var(--amber-text); } .v-weak .ring { background: #9a6400; }
.v-bad { color: var(--critical-text); } .v-bad .ring { background: var(--critical); }
.ad-body { padding: 12px 16px 16px; }
.ad-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.price { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.tag .icon { width: 16px; height: 16px; }
.tag.good { background: var(--good-wash); color: var(--good-text); }
.tag.fair { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }
.tag.dear { background: var(--serious-wash); color: var(--ink); }
.tag.alarm { background: var(--critical); color: #fff; }
.ad-meta { margin-top: 2px; font-size: 16px; font-variant-numeric: tabular-nums; }
/* Chips: colour and an icon, never colour alone; one line each. */
.ad-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ad-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  font-size: 14px; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.ad-chip .icon { width: 15px; height: 15px; flex: none; }
.ad-chip.good { background: var(--good-wash); color: var(--good-text); }
.ad-chip.bad { background: var(--critical-wash); color: var(--critical-text); }
.ad-chip.amber { background: var(--amber-wash); color: var(--amber-text); }
.ad-chip.orange { background: var(--serious-wash); color: var(--orange-text); }
.ad-chip.dealer { background: var(--violet-wash); color: var(--violet-text); }
.ad-chip.gray { background: var(--surface-2); color: var(--ink-2); }
.ad-who, .ad-trim { margin: 8px 0 0; font-size: 15px; color: var(--ink-2); }
.ad-trim { margin-top: 2px; }
.ad-more .ad-text { margin-top: 8px; }
.flags { list-style: none; margin: 8px 0 0; padding: 0; }
.flag { display: flex; gap: 8px; align-items: flex-start; font-size: 15px; margin-top: 4px; }
.flag-icon { width: 18px; height: 18px; margin-top: 2px; }
.flag.warn .flag-icon { color: var(--critical-text); }
.flag.good .flag-icon { color: var(--good-text); }
.flag.info .flag-icon { color: var(--muted); }
.ad-more { margin-top: 10px; }
.seller-text { margin: 4px 0 8px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 15px; white-space: pre-line; overflow-wrap: anywhere; }
.seller-text mark { background: color-mix(in srgb, var(--warning) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.ad-more > summary { color: var(--accent-ink); font-size: 15px; font-weight: 600; }
.score-line { margin: 8px 0 0; font-size: 15px; }
.parts { display: grid; grid-template-columns: auto 1fr 28px; gap: 4px 8px; align-items: center; font-size: 13px; margin: 4px 0 8px; }
.parts .num { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ad .btn.wide { margin-top: 12px; }

/* Meters */
.meter { height: 8px; border-radius: 4px; background: var(--accent-track); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.empty { background: var(--surface-2); }

/* Facts, notes, tables */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 4px 0 8px; font-size: 15px; }
.facts dt { color: var(--ink-2); }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.note { border-inline-start: 3px solid var(--accent); padding: 4px 12px; margin: 8px 0; font-size: 15px; }
.note .kind { font-size: 12px; color: var(--ink-2); display: block; }
.about > summary { margin: 0; }
.data-table { width: 100%; border-collapse: collapse; margin-top: 4px; font-size: 14px; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { text-align: start; padding: 4px 6px; border-bottom: 1px solid var(--grid); }
.recalls { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.recalls li { padding: 8px 0; border-top: 1px solid var(--grid); }
.explain { margin: 0 0 8px; padding-inline-start: 20px; font-size: 15px; }
.explain li + li { margin-top: 4px; }
.lead { margin: 12px 0 8px; font-size: 16px; }
.questions { list-style: none; margin: 0 0 12px; padding: 0; }
.question { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.question + .question { margin-top: 8px; }
.question p { margin: 4px 0 0; font-size: 15px; color: var(--ink-2); }
.q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 16px; }
.q-weight { flex: none; font-weight: 700; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* Charts */
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .value-label { fill: var(--ink); font-size: 12px; font-weight: 700; }
.chart .bar { fill: var(--accent-track); cursor: pointer; transition: fill var(--fast); }
.chart .bar.over { fill: var(--deemph); }
.chart .bar.selected { fill: var(--accent); }
.chart .bar:hover, .chart .bar:focus { fill: var(--accent-ink); outline: none; }
.chart .ref-line { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .ref-label { fill: var(--ink-2); font-weight: 600; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--accent-wash); stroke: none; }
.chart .line2 { stroke: var(--serious); stroke-dasharray: 6 4; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .crosshair { stroke: var(--axis); stroke-width: 1; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--ink-2); margin: 2px 0 6px; }
.legend .key::before { content: ""; display: inline-block; width: 18px; margin-inline-end: 6px; vertical-align: middle; border-top: 3px solid var(--accent); }
.legend .key.book::before { border-top: 3px dashed var(--serious); }
.tooltip {
  position: fixed; z-index: 20; pointer-events: none; max-width: 240px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--border);
  border-radius: 10px; padding: 6px 10px; font-size: 13px; box-shadow: 0 6px 18px rgba(0,0,0,.16);
}
.tooltip strong { display: block; font-size: 15px; }

/* למכור */
.plate-row { display: flex; gap: 8px; align-items: stretch; }
.plate-input {
  flex: 1; min-width: 0; min-height: 48px; padding: 6px 12px; border-radius: var(--radius-sm);
  border: 2px solid #1a1a1a; background: #f7c600; color: #111; font-size: 22px; font-weight: 700;
  letter-spacing: 1px; text-align: center; font-variant-numeric: tabular-nums;
}
.plate-input::placeholder { color: rgba(0, 0, 0, .35); }
.plate-result { margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.plate-result p { margin: 0; }
.plate-title { font-size: 16px; }
.plate-lines { margin: 6px 0 0; padding-inline-start: 18px; font-size: 15px; }
.plate-lines li + li { margin-top: 2px; }
.picker {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; min-height: 48px;
  padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--axis); background: var(--surface);
  font-size: 17px; font-weight: 700; text-align: start; cursor: pointer;
}
.picker .icon { color: var(--muted); }
.text-input {
  width: 100%; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--axis); background: var(--surface); color: var(--ink); font-size: 17px;
  font-variant-numeric: tabular-nums;
}
.hint { margin: 4px 0 0; }
.value-hero { text-align: center; padding: 20px 16px; }
.hero-label { color: var(--ink-2); font-size: 15px; font-weight: 600; }
.ask-range { font-size: 32px; font-weight: 700; line-height: 1.2; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.plain-list { list-style: none; margin: 4px 0 8px; padding: 0; }
.plain-list li { padding: 8px 0; border-top: 1px solid var(--grid); }
.plain-list li:first-child { border-top: 0; }
.band { position: relative; height: 52px; margin: 12px 4px 0; }
.band-track { position: absolute; left: 0; right: 0; top: 14px; height: 8px; border-radius: 4px; background: var(--surface-2); }
.band-mid { position: absolute; top: 14px; height: 8px; border-radius: 4px; background: var(--accent-track); }
.band-zero { position: absolute; top: 6px; width: 2px; height: 24px; margin-left: -1px; background: var(--ink-2); }
.band-med { position: absolute; top: 10px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--accent); }
.band-mine { position: absolute; top: 12px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--good); border: 2px solid var(--surface); }
.band-labels { position: absolute; left: 0; right: 0; top: 32px; display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }

/* Models tab: a ranking, not a stack of cards */
.page-head { margin: 4px 4px 12px; }
.page-title { font-size: 24px; font-weight: 700; margin: 0 0 2px; }
.filters .field-label { margin-top: 8px; }
.filters .field-label:first-child { margin-top: 0; }
/* One scrolling line of chips each, so the ranking starts on the first screen. */
.filters .chips { margin: 4px -16px 0; padding: 0 16px 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.filters .chips::-webkit-scrollbar { display: none; }
.filters .chip { flex: none; }
.list-count { margin: 4px 4px 8px; }
.rank-list { list-style: none; margin: 0; padding: 0; }
.rank-row { padding: 0; margin-bottom: 8px; overflow: hidden; }
.rank-row.over .rank-name, .rank-row.over .rank-photo { opacity: .7; }
.rank-line { display: flex; align-items: stretch; }
.rank-main {
  flex: 1; min-width: 0; display: grid; grid-template-columns: 72px 1fr 44px; gap: 12px; align-items: center;
  padding: 10px 0 10px 4px; padding-inline-start: 10px; border: 0; background: transparent; text-align: start; cursor: pointer;
}
.rank-main:active { background: var(--accent-wash); }
.rank-photo { position: relative; overflow: hidden; width: 72px; height: 54px; border-radius: 8px; background: var(--surface-2); }
.rank-photo .rank { top: 3px; inset-inline-start: 3px; min-width: 20px; height: 20px; font-size: 11px; }
.rank-photo .noimg { width: 28px; height: 28px; }
.rank-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rank-name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.rank-price { font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rank-price.over { color: var(--muted); }
.rank-row .badges { margin-top: 2px; }
.badge.weak { background: var(--critical-wash); color: var(--critical-text); }
.rank-score {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums;
  background: var(--accent-wash); color: var(--accent-ink); border: 2px solid var(--accent);
}
.rank-score.none { border-color: var(--deemph); background: var(--surface-2); color: var(--muted); }
.cmp-toggle {
  flex: none; width: 48px; display: grid; place-items: center; border: 0; border-inline-start: 1px solid var(--grid);
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.cmp-toggle[aria-pressed="true"] { background: var(--accent); color: #fff; }
.cmp-toggle .icon { width: 22px; height: 22px; }
.rank-more { padding: 4px 16px 16px; border-top: 1px solid var(--grid); }
.rank-more .dims { display: grid; grid-template-columns: auto 1fr 28px; gap: 6px 10px; align-items: center; margin: 8px 0; font-size: 14px; }
.rank-more .dims .num { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.rank-more .actions { display: flex; gap: 8px; margin-top: 8px; }
.rank-more .actions .btn { flex: 1; }
.compare-bar {
  position: fixed; inset-inline: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); z-index: 9;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 8px; padding-inline-start: 16px;
  max-width: 696px; margin: 0 auto; border-radius: var(--radius); background: var(--surface);
  border: 1px solid var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, .14); font-size: 15px; font-weight: 600;
}
.compare-bar #compare-count { flex: 1; }
.compare-bar .btn:disabled { opacity: .5; cursor: default; }
#tab-models { padding-bottom: 72px; }
.compare-wrap { overflow-x: auto; margin: 8px 0; }
.compare { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.compare th, .compare td { padding: 8px 6px; border-bottom: 1px solid var(--grid); text-align: center; vertical-align: middle; }
.compare tbody th { text-align: start; font-weight: 500; color: var(--ink-2); }
.compare thead th { vertical-align: bottom; }
.compare td.best { font-weight: 700; color: var(--good-text); background: var(--good-wash); }
.cmp-photo { position: relative; display: block; overflow: hidden; width: 72px; height: 54px; margin: 0 auto 4px; border-radius: 8px; background: var(--surface-2); }
.cmp-photo .noimg { width: 28px; height: 28px; }
.cmp-name { display: block; font-size: 14px; font-weight: 700; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-actions .btn { flex: 1 1 140px; }
.score {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  font-weight: 700; font-size: 16px; background: var(--accent-wash); color: var(--accent-ink);
  border: 2px solid var(--accent);
}

/* נתוני שימוש (/admin): a period, then funnels and tables */
.usage-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.usage-controls .segmented { flex: 1 1 220px; margin: 0; }
.usage .dims { display: grid; grid-template-columns: auto 1fr 40px; gap: 6px 10px; align-items: center; margin: 4px 0 8px; font-size: 14px; }
.usage .dims .num { text-align: end; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.table-wrap { overflow-x: auto; }

/* Sheet */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-panel { background: var(--page); width: 100%; max-width: 720px; max-height: 92vh; overflow: auto; border-radius: 20px 20px 0 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; z-index: 1; background: var(--page); padding-top: 8px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.pick-list { margin-top: 8px; }
.pick-list > p { margin: 8px 4px 4px; }
.pick-list button {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 48px;
  padding: 10px 8px; border: 0; border-bottom: 1px solid var(--grid); background: transparent; text-align: start; cursor: pointer;
}
.pick-list button:active { background: var(--accent-wash); }
.pick-list .count { color: var(--muted); font-size: 14px; }

/* Tab bar */
.tabbar {
  position: fixed; bottom: 0; inset-inline: 0; z-index: 10;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 60px; border: 0; background: transparent; color: var(--muted); font-size: 13px; cursor: pointer; }
.tabbar svg { width: 26px; height: 26px; }
.tabbar button[aria-current="page"] { color: var(--accent-ink); font-weight: 700; }

@media (min-width: 900px) {
  main { padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .chart .bar.selected { fill: Highlight; }
  .meter > span { background: Highlight; }
}
