/* מאתר הרכבים: AM x JFP. Dark, RTL, no framework. */

:root {
  --bg: #0b0d10;
  --s1: #101317;
  --s2: #161a1f;
  --s3: #1d2228;
  --s4: #272d35;
  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .15);

  --gold: #d4af37;
  --gold-hi: #f1d27a;
  --gold-deep: #9a7a1e;
  --gold-soft: #e2cb85;
  --steel: #8fb0c4;
  --steel-deep: #42677f;

  --text: #f3f1ec;
  --muted: #8d929a;
  --muted-2: #b3b7bd;
  --ok: #7cc79b;
  --no: #ea8a80;
  --warn: #e2b25a;

  --r: 12px;
  --r-sm: 8px;
  --tap: 38px;
  --chip-h: 32px;
  --topbar-h: 64px;
  --tabbar-h: 0px;
  --foot-h: 36px;               /* fixed credit bar, always on screen */
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* everything fixed at the bottom of the screen (credit bar + phone tab bar + iPhone home bar).
     Anything sticky/fixed to the bottom sits above this. */
  --bottom-ui: calc(var(--foot-h) + var(--tabbar-h) + var(--safe-b));
  --pad: 24px;

  --font: "Inter", "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --display: "Inter", "Frank Ruhl Libre", "Heebo", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (pointer: coarse), (max-width: 767px) {
  :root { --tap: 44px; --chip-h: 44px; }
}
@media (max-width: 767px) {
  :root { --topbar-h: 56px; --tabbar-h: 58px; --foot-h: 30px; --pad: 16px; }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 12px); scroll-padding-bottom: calc(var(--bottom-ui) + 12px); }
html.lock { overflow: hidden; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--bottom-ui);
}
h1, h2, h3, p, ul, dl, dd, fieldset, legend { margin: 0; padding: 0; }
ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
a { color: var(--steel); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; max-width: 100%; }
bdi, .ltr { unicode-bidi: isolate; }
.num, .price, .mono { font-variant-numeric: tabular-nums; }

:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; border-radius: 4px; }
::selection { background: rgba(212, 175, 55, .35); }

.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--gold); color: #14110a; padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 8px; }

.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ico-sm { width: 14px; height: 14px; }
.ico-lg { width: 40px; height: 40px; stroke-width: 1.2; }

/* ───────────── top bar ───────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--pad) 0;
  display: flex; align-items: center; gap: 44px;
  background: rgba(11, 13, 16, .96);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-am { height: 34px; width: auto; }
.brand-jfp { height: 30px; width: auto; opacity: .95; }
.brand-x { color: var(--muted); font-size: 15px; font-weight: 300; }
.brand-rule { width: 1px; height: 28px; background: var(--line-2); margin-inline: 4px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-name strong { font: 700 19px/1.15 var(--display); letter-spacing: .01em; white-space: nowrap; }
.brand-name small { font-size: 12px; color: var(--muted); white-space: nowrap; margin-top: 2px; }

.tabs { display: flex; align-self: stretch; gap: 4px; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  padding: 0 14px; color: var(--muted-2); font-weight: 500; font-size: 14.5px;
  transition: color .15s var(--ease);
}
.tab:hover { color: var(--text); }
.tab::after {
  content: ""; position: absolute; inset-inline: 10px; bottom: -1px; height: 2px;
  background: var(--gold); transform: scaleX(0); transition: transform .2s var(--ease);
}
.tab[aria-selected="true"] { color: var(--gold-hi); }
.tab[aria-selected="true"]::after { transform: scaleX(1); }
.tab:focus-visible { outline-offset: -4px; }
.tab-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 11.5px; font-weight: 600;
  display: inline-grid; place-items: center; background: var(--s3); color: var(--muted-2);
}

/* ───────────── layout ───────────── */
main { flex: 1; padding: var(--pad); min-width: 0; }
.view { min-width: 0; }
.view-search { display: grid; grid-template-columns: 376px minmax(0, 1fr); gap: var(--pad); align-items: start; }
.results-col { min-width: 0; }

/* fixed credit bar: on desktop it is the bottom edge, on phones it sits right above the tab bar */
.foot {
  position: fixed; z-index: 45; inset-inline: 0; bottom: calc(var(--tabbar-h) + var(--safe-b));
  height: var(--foot-h); padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: center; gap: 6px 22px; min-width: 0;
  background: #0b0d10; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 12.5px; white-space: nowrap;
}
.foot::before {
  content: ""; position: absolute; inset-inline: 0; top: -1px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .45) 30%, rgba(212, 175, 55, .45) 70%, transparent);
}
.foot-credit { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--muted-2); }
.foot-credit strong { color: var(--gold-soft); font-weight: 600; }
.foot-credit bdi { color: var(--gold-soft); font-weight: 600; letter-spacing: .04em; }
.foot-am { height: 18px; width: auto; }
.foot-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-2); min-height: 28px; }
.foot-link:hover { color: var(--gold-hi); text-decoration: none; }
.foot-link .ico { width: 14px; height: 14px; color: var(--gold-soft); }
.foot-link bdi { font-variant-numeric: tabular-nums; }

/* ───────────── buttons ───────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); padding: 0 16px; border-radius: var(--r-sm);
  font-weight: 600; font-size: 14.5px; white-space: nowrap; text-decoration: none;
  border: 1px solid transparent; transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { text-decoration: none; }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-primary { background: var(--gold); color: #14110a; }
.btn-primary:hover:not([disabled]) { background: var(--gold-hi); }
.btn-primary:active:not([disabled]) { background: var(--gold-soft); }
.btn-outline { border-color: rgba(212, 175, 55, .55); color: var(--gold-soft); }
.btn-outline:hover:not([disabled]) { background: rgba(212, 175, 55, .1); border-color: var(--gold); }
.btn-ghost { border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover:not([disabled]) { background: var(--s3); }
.btn-danger { border-color: rgba(234, 138, 128, .45); color: var(--no); }
.btn-danger:hover:not([disabled]) { background: rgba(234, 138, 128, .1); }
.btn-sm { font-size: 13.5px; padding: 0 12px; min-height: calc(var(--tap) - 4px); }
.btn[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-hi); background: rgba(212, 175, 55, .1); }
.icon-btn {
  display: inline-grid; place-items: center; width: var(--tap); height: var(--tap); flex: none;
  border-radius: var(--r-sm); color: var(--muted-2); transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--s3); color: var(--text); }
.icon-btn[aria-pressed="true"] { background: var(--s3); color: var(--gold-hi); }
.link-btn { color: var(--steel); font-size: 13.5px; min-height: 28px; }
.link-btn:hover { text-decoration: underline; }

/* ───────────── search panel / form ───────────── */
.panel {
  position: sticky; top: calc(var(--topbar-h) + var(--pad));
  max-height: calc(100dvh - var(--topbar-h) - var(--pad) * 2 - var(--bottom-ui));
  display: flex; flex-direction: column; min-height: 0;
  background: var(--s1); border: 1px solid var(--line); border-radius: 14px;
}
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 4px; }
.panel-head h2 { font: 700 20px/1.2 var(--display); }
.sheet-close { display: none; }
.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 18px 18px; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--s4) transparent; }
.panel-foot { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.panel-foot .btn-primary { flex: 1; }

#search-form { display: flex; flex-direction: column; gap: 16px; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { min-width: 0; }
.field-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%;
  margin-bottom: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted-2);
}
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.kbd { font: 500 11px var(--mono); color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 0 5px; }
@media (pointer: coarse) { .kbd { display: none; } }
.field-error { color: var(--no); font-size: 13px; margin-top: -8px; }
fieldset .field-error { margin-top: 8px; }
.field-warn { color: var(--warn); font-size: 12.5px; margin-top: 8px; }

.input {
  width: 100%; height: var(--tap); padding: 0 12px;
  background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 14.5px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea.input { height: auto; padding: 10px 12px; resize: vertical; min-height: 72px; line-height: 1.5; display: block; }
.input::placeholder, .tags input::placeholder { color: #6f747c; }
.input:hover { border-color: rgba(255, 255, 255, .24); }
.input:focus { outline: none; border-color: var(--steel); box-shadow: 0 0 0 3px rgba(143, 176, 196, .22); }
.input.invalid { border-color: var(--no); }
input.ltr, input.num { direction: ltr; text-align: right; }
select.input {
  appearance: none; -webkit-appearance: none; padding-inline-end: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3b7bd' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-size: 16px; background-position: left 10px center;
}
select.input option { background: var(--s2); color: var(--text); }
.input-sm { height: calc(var(--tap) - 4px); font-size: 13.5px; width: auto; }

.combo { position: relative; }
.combo-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); inset-inline: 0;
  max-height: 232px; overflow-y: auto; padding: 4px;
  background: var(--s3); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
}
.combo-list li { padding: 8px 10px; border-radius: 6px; font-size: 14.5px; cursor: pointer; direction: ltr; text-align: right; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--s4); color: var(--gold-hi); }
@media (pointer: coarse) { .combo-list li { padding: 12px 10px; } }

.seg { display: flex; padding: 3px; gap: 3px; background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.seg label { flex: 1 1 auto; position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: grid; place-items: center; min-height: calc(var(--tap) - 8px); padding: 0 10px; border-radius: 6px;
  font-size: 13.5px; font-weight: 500; color: var(--muted-2); white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.seg label:hover span { color: var(--text); }
.seg input:checked + span { background: rgba(212, 175, 55, .14); color: var(--gold-hi); box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .5); }
.seg input:focus-visible + span { outline: 2px solid var(--steel); outline-offset: 1px; }
.radius { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: 13.5px; color: var(--muted-2); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
@media (pointer: coarse), (max-width: 767px) { .chips { gap: 8px; } }
.chip {
  display: inline-flex; align-items: center; gap: 7px; max-width: 100%;
  min-height: var(--chip-h); padding: 0 11px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--muted-2); font-size: 13.5px; white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.chip:hover:not([disabled]) { border-color: rgba(255, 255, 255, .3); color: var(--text); }
.chip[aria-pressed="true"] { border-color: var(--gold); background: rgba(212, 175, 55, .13); color: var(--text); }
.chip[disabled] { opacity: .45; border-style: dashed; cursor: not-allowed; }
.chip-src[aria-pressed="true"] { border-color: var(--steel); background: rgba(143, 176, 196, .15); }
.chip-src .mark { width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--muted); display: inline-grid; place-items: center; flex: none; }
.chip-src[aria-pressed="true"] .mark { background: var(--steel); border-color: var(--steel); color: #0b0d10; }
.chip-src .mark .ico { width: 10px; height: 10px; stroke-width: 3; visibility: hidden; }
.chip-src[aria-pressed="true"] .mark .ico { visibility: visible; }
.chip-more { border-style: dashed; }
.passthrough { margin-top: -6px; }
.chip-x { border-style: dashed; font-size: 12.5px; }

.dot { width: 12px; height: 12px; flex: none; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .28); background: transparent; }
.dot-unknown { border-style: dashed; border-color: var(--muted); }

.tags {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: var(--tap); padding: 4px 6px;
  background: var(--s2); border: 1px solid var(--line-2); border-radius: var(--r-sm); cursor: text; direction: ltr;
}
.tags:focus-within { border-color: var(--steel); box-shadow: 0 0 0 3px rgba(143, 176, 196, .22); }
.tags input { flex: 1; min-width: 96px; height: 28px; padding: 0 6px; background: none; border: 0; outline: none; font-size: 14.5px; direction: ltr; text-align: right; order: 2; }
.tag { display: inline-flex; align-items: center; gap: 2px; padding-inline-start: 9px; background: var(--s4); border-radius: 6px; font-size: 13px; min-height: 28px; }
.tag button { display: inline-grid; place-items: center; width: 26px; height: 28px; color: var(--muted-2); border-radius: 6px; }
.tag button:hover { color: var(--text); }
@media (pointer: coarse) { .tag { min-height: 36px; } .tag button { width: 36px; height: 36px; } }

/* ───────────── query bar, sources ───────────── */
.query-bar { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.query-main { min-width: 0; }
.query-title { font: 700 26px/1.25 var(--display); letter-spacing: .005em; overflow-wrap: anywhere; }
.query-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--muted-2); font-size: 13px; }
.query-meta .running { color: var(--steel); display: inline-flex; align-items: center; gap: 6px; }
.open-sheet { display: none; }

.sources { margin-bottom: 18px; }
.src-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.src-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 12px;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; color: var(--muted-2);
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.src-chip:hover { border-color: var(--line-2); }
.src-chip[aria-expanded="true"] { border-color: var(--steel); }
.src-chip .name { font-weight: 600; color: var(--text); }
.src-chip .st { white-space: nowrap; }
.src-chip .st bdi { font-variant-numeric: tabular-nums; }
.src-chip[data-state="ok"] .ico { color: var(--ok); }
.src-chip[data-state="partial"] { border-color: rgba(226, 178, 90, .45); }
.src-chip[data-state="partial"] .ico, .src-chip[data-state="partial"] .st { color: var(--warn); }
.src-chip[data-state="blocked"], .src-chip[data-state="error"] { border-color: rgba(234, 138, 128, .55); background: rgba(234, 138, 128, .08); }
.src-chip[data-state="blocked"] .ico, .src-chip[data-state="error"] .ico,
.src-chip[data-state="blocked"] .st, .src-chip[data-state="error"] .st { color: var(--no); font-weight: 600; }
.src-chip[data-state="running"] .st { color: var(--steel); }
.pending-dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px dashed var(--muted); flex: none; margin: 0 2px; }
.spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid rgba(143, 176, 196, .25); border-top-color: var(--steel); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.src-notes { margin-top: 8px; display: grid; gap: 4px; }
.src-notes li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 13px; color: var(--muted-2); padding: 6px 10px; border-radius: 6px; background: var(--s1); border-inline-start: 2px solid var(--line-2); }
.src-notes li[data-state="blocked"], .src-notes li[data-state="error"] { border-inline-start-color: var(--no); }
.src-notes li[data-state="partial"] { border-inline-start-color: var(--warn); }
.src-notes li[data-state="ok"] { border-inline-start-color: var(--ok); }
.src-notes .name { font-weight: 600; color: var(--text); }
.src-notes .note { color: var(--muted-2); overflow-wrap: anywhere; }
.src-notes a { margin-inline-start: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }

/* ───────────── toolbar ───────────── */
.toolbar { padding: 12px 0 14px; border-top: 1px solid var(--line); }
.toolbar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.toolbar-tools { display: flex; align-items: center; gap: 10px; }
.count { color: var(--muted-2); font-size: 14px; }
.count strong { color: var(--text); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; margin-inline-end: 3px; }
.select-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 12px; }
.filters-toggle { display: none; }
.dot-count { min-width: 18px; height: 18px; border-radius: 9px; background: var(--gold); color: #14110a; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted-2); cursor: pointer; min-height: calc(var(--tap) - 4px); }
.check input { width: 17px; height: 17px; accent-color: var(--gold); margin: 0; cursor: pointer; }
.view-toggle { display: inline-flex; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.view-toggle .icon-btn { width: 32px; height: 32px; border-radius: 6px; }
.hidden-note { font-size: 13px; color: var(--muted); margin: -4px 0 14px; }

/* ───────────── cards ───────────── */
.results { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); }
.card {
  display: flex; flex-direction: column; min-width: 0;
  background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.card:hover { border-color: var(--line-2); box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
.card.is-gone { opacity: .72; }
.card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: #0d1014; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-content: center; justify-items: center; gap: 6px; color: #5d636b; font-size: 12.5px;
  background: repeating-linear-gradient(135deg, #0f1216 0 14px, #11151a 14px 28px); }
.badges { position: absolute; top: 10px; inset-inline: 10px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
.badges > span { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.badges > span:last-child { align-items: flex-end; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; max-width: 100%;
  padding: 3px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  background: rgba(11, 13, 16, .84); border: 1px solid var(--line-2); color: var(--text);
}
.badge-src { color: var(--steel); }
.badge-also { color: var(--muted-2); font-weight: 500; }
.badge-new { color: var(--gold-hi); border-color: rgba(212, 175, 55, .5); }
.badge-demo { color: var(--steel); }
.badge-fresh { color: var(--muted-2); font-weight: 500; }
.photo-count { position: absolute; bottom: 10px; inset-inline-end: 10px; pointer-events: none; }

.card-body { display: flex; flex-direction: column; gap: 10px; padding: 14px; flex: 1; min-width: 0; }
.card-title {
  color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.card-title:hover { color: var(--gold-hi); text-decoration: none; }
.card-price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price { font-size: 21px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; }
.price .cur { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: .02em; }
.price-none { font-size: 15px; font-weight: 500; color: var(--muted-2); }
.price-note { font-size: 12px; color: var(--muted); display: block; }
.km { font-size: 14px; color: var(--muted-2); white-space: nowrap; }
.unknown { color: var(--muted); font-weight: 400; }

.card-colors { display: grid; gap: 4px; font-size: 13.5px; }
.color-line { display: flex; align-items: center; gap: 7px; min-width: 0; }
.color-line .lbl { color: var(--muted); font-size: 12px; width: 30px; flex: none; }
.color-line bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-dealer { font-size: 13px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-dealer .sep { color: var(--muted); margin-inline: 5px; }

.vin {
  display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; max-width: 100%;
  min-height: 28px; padding: 0 8px; border-radius: 6px; background: var(--s2); border: 1px solid var(--line);
  font: 500 12px var(--mono); color: var(--muted-2); direction: ltr;
}
.vin:hover { border-color: var(--line-2); color: var(--text); }
.vin .k { color: var(--muted); font-family: var(--font); font-size: 11px; font-weight: 600; letter-spacing: .04em; }
.vin .v { overflow: hidden; text-overflow: ellipsis; }
@media (pointer: coarse) { .vin { min-height: 44px; padding: 0 12px; } }

.match { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.score {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600;
  border: 1px solid var(--line-2); color: var(--muted-2);
}
.score b { font-variant-numeric: tabular-nums; font-size: 13px; }
.score[data-level="high"] { color: var(--gold-hi); border-color: rgba(212, 175, 55, .55); background: rgba(212, 175, 55, .1); }
.score[data-level="mid"] { color: var(--steel); border-color: rgba(143, 176, 196, .45); }
.chk { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 2px 7px; border-radius: 6px; font-size: 12px; border: 1px solid transparent; }
.chk bdi { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk .ico { width: 12px; height: 12px; stroke-width: 2.4; }
.chk-ok { color: var(--ok); background: rgba(124, 199, 155, .1); }
.chk-no { color: var(--no); background: rgba(234, 138, 128, .1); border-color: rgba(234, 138, 128, .35); }
.chk-unknown { color: var(--muted-2); border: 1px dashed rgba(255, 255, 255, .28); }

.card-actions { display: flex; gap: 8px; margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); }
.card-actions .btn { flex: 1; }
.saved-chip { justify-content: flex-start; border-color: rgba(212, 175, 55, .55); color: var(--gold-soft); background: rgba(212, 175, 55, .08); min-width: 0; }
.saved-chip .ico { fill: currentColor; }
.saved-chip span { overflow: hidden; text-overflow: ellipsis; }

.card-saved { display: grid; gap: 7px; font-size: 13px; color: var(--muted-2); padding-top: 10px; border-top: 1px solid var(--line); }
.card-saved .line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.state-badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.state-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.state-active { color: var(--ok); background: rgba(124, 199, 155, .1); }
.state-gone { color: var(--no); background: rgba(234, 138, 128, .12); }
.state-unknown { color: var(--muted-2); border: 1px dashed rgba(255, 255, 255, .28); }
.state-unknown::before { background: none; border: 1.5px solid currentColor; }
.delta { font-weight: 600; padding: 1px 7px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.delta-down { color: var(--ok); background: rgba(124, 199, 155, .12); }
.delta-up { color: var(--warn); background: rgba(226, 178, 90, .12); }
.note-text { color: var(--text); background: var(--s2); border-radius: 6px; padding: 7px 10px; border-inline-start: 2px solid var(--gold-deep); white-space: pre-line; overflow-wrap: anywhere; }

/* list layout (desktop) */
.results[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.results[data-layout="list"] .card { flex-direction: row; }
.results[data-layout="list"] .card-media { width: 232px; flex: none; aspect-ratio: auto; min-height: 174px; }
.results[data-layout="list"] .card-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px; column-gap: 24px; row-gap: 8px; align-content: start; grid-auto-flow: dense;
}
.results[data-layout="list"] .card-body > * { grid-column: 1; }
.results[data-layout="list"] .card-price-row,
.results[data-layout="list"] .match,
.results[data-layout="list"] .card-saved,
.results[data-layout="list"] .card-actions { grid-column: 2; }
.results[data-layout="list"] .card-price-row { grid-row: 1; }
.results[data-layout="list"] .card-actions { margin-top: 0; align-self: end; }

/* skeleton */
.skel { pointer-events: none; }
.skel .card-media, .skel i { background: var(--s2); animation: pulse 1.2s ease-in-out infinite; }
.skel i { display: block; height: 12px; border-radius: 4px; }
@keyframes pulse { 50% { opacity: .45; } }

.results-more { display: grid; place-items: center; padding: 20px 0 4px; }

.state-box:empty { display: none; }
.state-box { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 64px 16px; color: var(--muted-2); }
.state-box .ico-lg { color: #4f555d; margin-bottom: 4px; }
.state-box h3 { font: 700 20px/1.3 var(--display); color: var(--text); }
.state-box p { max-width: 46ch; font-size: 14.5px; }
.state-box .btn { margin-top: 10px; }

/* ───────────── saved ───────────── */
.view-saved { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: var(--pad); align-items: start; }
.folders { position: sticky; top: calc(var(--topbar-h) + var(--pad)); display: grid; gap: 12px; padding: 16px; background: var(--s1); border: 1px solid var(--line); border-radius: 14px; }
.folders h2 { font: 700 18px/1.2 var(--display); }
.folder-list { display: grid; gap: 4px; }
.folder-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%;
  min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid transparent;
  color: var(--muted-2); font-size: 14.5px; text-align: start;
}
.folder-item:hover { background: var(--s2); color: var(--text); }
.folder-item[aria-current="true"] { background: rgba(212, 175, 55, .1); border-color: rgba(212, 175, 55, .45); color: var(--gold-hi); }
.folder-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-item .n { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--muted); }
.folder-item[aria-current="true"] .n { color: var(--gold-soft); }
.saved-col { min-width: 0; }
.saved-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; margin-bottom: 18px; }
.saved-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; min-width: 0; }
.saved-title h1, .history-head h1 { font: 700 26px/1.25 var(--display); overflow-wrap: anywhere; }
.folder-actions { display: inline-flex; gap: 2px; align-self: center; }
.saved-tools { display: flex; flex-wrap: wrap; gap: 8px; }

/* ───────────── history ───────────── */
.view-history { max-width: 1040px; margin-inline: auto; }
.history-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.history-list { display: grid; gap: 10px; }
.hrow { display: flex; align-items: center; gap: 16px; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 16px 6px 12px; transition: border-color .15s var(--ease); }
.hrow:hover { border-color: var(--line-2); }
.hrow-main { flex: 1; min-width: 0; display: grid; gap: 4px; padding: 10px 0; color: var(--text); }
.hrow-main:hover { text-decoration: none; }
.hrow-main:hover .hrow-label { color: var(--gold-hi); }
.hrow-label { font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.hrow-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--muted-2); }
.hrow-meta .srcs { color: var(--steel); }

/* ───────────── drawer ───────────── */
.drawer-wrap, .dialog-wrap { position: fixed; inset: 0; z-index: 60; }
.dialog-wrap { z-index: 80; display: grid; place-items: center; padding: 16px; }
.backdrop { position: absolute; inset: 0; background: rgba(4, 5, 7, .62); animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.drawer {
  position: absolute; top: 0; bottom: 0; inset-inline-end: 0; width: min(620px, 100vw);
  display: flex; flex-direction: column; background: var(--s1); border-inline-start: 1px solid var(--line-2);
  box-shadow: 0 0 60px rgba(0, 0, 0, .6); animation: slide-in .22s var(--ease); outline: none;
}
@keyframes slide-in { from { transform: translateX(-28px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px; border-bottom: 1px solid var(--line); }
.drawer-title { flex: 1; min-width: 0; font-size: 15.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-badges { display: inline-flex; gap: 6px; flex: none; }
.drawer-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
.d-sec { padding: 18px 20px 0; }
.d-sec h3 { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; margin-bottom: 10px; }
.banner { display: flex; align-items: center; gap: 10px; margin: 14px 20px 0; padding: 10px 12px; border-radius: var(--r-sm); font-size: 14px; }
.banner-gone { background: rgba(234, 138, 128, .12); border: 1px solid rgba(234, 138, 128, .5); color: var(--no); font-weight: 600; }
.banner-quiet { background: var(--s2); color: var(--muted-2); font-size: 13px; }

.gal { direction: ltr; }
.gal-main { position: relative; aspect-ratio: 3 / 2; background: #07080a; overflow: hidden; touch-action: pan-y; }
.gal-main img { width: 100%; height: 100%; object-fit: contain; }
.gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(11, 13, 16, .7); border: 1px solid var(--line-2); color: var(--text); }
.gal-nav:hover { background: rgba(11, 13, 16, .92); border-color: var(--gold); }
.gal-prev { left: 12px; }
.gal-next { right: 12px; }
.gal-count { position: absolute; bottom: 10px; right: 12px; }
.gal-thumbs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 20px 2px; scrollbar-width: thin; scrollbar-color: var(--s4) transparent; }
.gal-thumbs button { flex: none; width: 76px; height: 57px; border-radius: 6px; overflow: hidden; border: 2px solid transparent; opacity: .55; background: var(--s2); transition: opacity .15s var(--ease); }
.gal-thumbs button:hover { opacity: .9; }
.gal-thumbs button[aria-current="true"] { border-color: var(--gold); opacity: 1; }
.gal-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.d-summary { display: grid; gap: 6px; }
.d-title { font-size: 19px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.d-priceline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-top: 4px; }
.d-priceline .price { font-size: 28px; }
.d-priceline .price .cur { font-size: 13px; }
.d-sub { font-size: 14px; color: var(--muted-2); }
.d-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-actions .wide { grid-column: 1 / -1; }
.d-actions .btn { white-space: normal; text-align: center; line-height: 1.25; padding-block: 6px; }

.checks { display: grid; gap: 6px; }
.checks li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.checks .what { color: var(--muted-2); min-width: 92px; }
.checks .verdict { color: var(--muted); font-size: 13px; margin-inline-start: auto; text-align: end; }

.spec { display: grid; }
.spec > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec > div:last-child { border-bottom: 0; }
.spec dt { color: var(--muted); }
.spec dd { font-weight: 500; overflow-wrap: anywhere; }
.spec dd.unknown { font-weight: 400; }
.spec dd a { display: inline-flex; align-items: center; gap: 5px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; }
.opts li { padding: 4px 9px; border-radius: 6px; background: var(--s2); border: 1px solid var(--line); font-size: 13px; }
.desc { font-size: 14px; line-height: 1.65; color: var(--muted-2); white-space: pre-line; overflow-wrap: anywhere; }
.note-edit { display: grid; gap: 8px; }
.note-edit .btn { justify-self: start; }
.d-saved-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13.5px; color: var(--muted-2); margin-bottom: 10px; }

/* ───────────── dialog ───────────── */
.dialog {
  position: relative; width: min(440px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
  background: var(--s2); border: 1px solid var(--line-2); border-radius: 14px; padding: 20px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .6); animation: pop .18s var(--ease); outline: none;
}
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }
.dialog h2 { font: 700 20px/1.3 var(--display); margin-bottom: 4px; }
.dialog .sub { font-size: 13.5px; color: var(--muted-2); margin-bottom: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog .input { background: var(--s1); }
#dialog-body { display: grid; gap: 14px; margin-top: 12px; }
#dialog-body > p { font-size: 14.5px; color: var(--muted-2); }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.dialog-actions .spacer { flex: 1; }
.pick-list { display: grid; gap: 4px; max-height: 40dvh; overflow-y: auto; }
.pick { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line); cursor: pointer; font-size: 14.5px; }
.pick:hover { border-color: var(--line-2); }
.pick input { accent-color: var(--gold); width: 17px; height: 17px; margin: 0; }
.pick:has(input:checked) { border-color: var(--gold); background: rgba(212, 175, 55, .1); }
.pick .n { margin-inline-start: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.inline-new { display: flex; gap: 8px; }
.inline-new .input { flex: 1; }

/* ───────────── toasts ───────────── */
.toasts { position: fixed; z-index: 100; inset-inline: 0; bottom: calc(14px + var(--bottom-ui)); display: grid; justify-items: center; gap: 8px; padding: 0 16px; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: min(560px, 100%);
  padding: 10px 14px; background: var(--s3); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55); font-size: 14px; animation: pop .18s var(--ease);
}
.toast-error { border-inline-start: 3px solid var(--no); }
.toast-ok { border-inline-start: 3px solid var(--ok); }
.toast .msg { overflow-wrap: anywhere; }
.toast .act { color: var(--gold-hi); font-weight: 600; white-space: nowrap; min-height: 32px; padding: 0 4px; }
.toast .icon-btn { width: 30px; height: 30px; margin-inline-start: auto; }

/* ───────────── compact: form becomes a sheet (tablet and mobile) ───────────── */
@media (max-width: 1099px) {
  .view-search { display: block; }
  .view-search:not(.has-search) .results-col { display: none; }
  .view-search:not(.has-search) .panel { position: static; max-height: none; max-width: 640px; margin-inline: auto; }
  .view-search:not(.has-search) .panel-scroll { overflow: visible; }
  .view-search:not(.has-search) .panel-foot {
    position: sticky; bottom: var(--bottom-ui); background: var(--s1);
    border-radius: 0 0 14px 14px;
  }
  .view-search.has-search .panel {
    display: none; position: fixed; inset: 0; z-index: 70; max-height: none; border: 0; border-radius: 0;
    padding-top: env(safe-area-inset-top, 0px); animation: sheet-up .22s var(--ease);
  }
  .view-search.has-search.sheet-open .panel { display: flex; }
  .view-search.has-search .sheet-close { display: inline-grid; }
  .view-search.has-search .panel-foot { padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
  .open-sheet { display: inline-flex; flex: none; }
  .query-bar { position: sticky; top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px)); z-index: 20; align-items: center; background: var(--bg); margin: calc(var(--pad) * -1) calc(var(--pad) * -1) 12px; padding: 12px var(--pad); border-bottom: 1px solid var(--line); }
  .query-title { font-size: 20px; }
  .view-saved { grid-template-columns: minmax(0, 1fr); }
  .folders { position: static; padding: 12px; }
  .folders h2 { display: none; }
  .folder-list { display: flex; flex-wrap: wrap; gap: 8px; }
  .folder-item { width: auto; border-color: var(--line-2); border-radius: 999px; }
  .folders > .btn { justify-self: start; }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }

/* ───────────── mobile ───────────── */
@media (max-width: 767px) {
  .topbar { gap: 0; }
  .brand { gap: 9px; }
  .brand-am { height: 28px; }
  .brand-jfp { height: 24px; }
  .brand-rule { height: 24px; margin-inline: 2px; }
  .brand-name strong { font-size: 17px; }
  .brand-name small { font-size: 11px; }

  .tabs {
    position: fixed; z-index: 50; inset-inline: 0; bottom: 0; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px); gap: 0;
    background: rgba(13, 16, 20, .98); border-top: 1px solid var(--line-2);
  }
  .tab { flex: 1; flex-direction: column; justify-content: center; gap: 3px; padding: 0 4px; font-size: 11.5px; }
  .tab .ico { width: 21px; height: 21px; }
  .tab::after { top: -1px; bottom: auto; inset-inline: 22%; }
  .tab-count { position: absolute; top: 6px; inset-inline-start: calc(50% + 8px); min-width: 17px; height: 17px; font-size: 10.5px; padding: 0 4px; background: var(--gold); color: #14110a; }

  .panel-head { padding: 14px 16px 2px; }
  .panel-scroll { padding: 12px 16px 16px; }
  .panel-foot { padding: 12px 16px; }

  .query-title { font-size: 18px; }
  .query-meta { font-size: 12.5px; }
  .src-chip { flex: 1 1 auto; justify-content: flex-start; }
  .toolbar-tools { gap: 6px; }
  .filters-toggle { display: inline-flex; }
  .view-toggle { display: none; }
  .filters { display: none; }
  .filters.open { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
  .filters .select-inline { display: grid; gap: 4px; }
  .filters .select-inline .input { width: 100%; }
  .filters .check, .filters .link-btn { grid-column: 1 / -1; }
  .filters .link-btn { justify-self: start; min-height: 44px; }

  .results, .results[data-layout="list"] { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .results[data-layout="list"] .card { flex-direction: column; }
  .results[data-layout="list"] .card-media { width: auto; aspect-ratio: 4 / 3; }
  .results[data-layout="list"] .card-body { display: flex; }
  .card-title { font-size: 16px; }
  .price { font-size: 23px; }

  .saved-title h1, .history-head h1 { font-size: 22px; }
  .saved-tools { width: 100%; }
  .saved-tools .btn { flex: 1; }
  .hrow { flex-direction: column; align-items: stretch; gap: 0; padding: 4px 14px 12px; }

  .drawer { width: 100vw; border: 0; animation-name: sheet-up; }
  .gal-main { aspect-ratio: 4 / 3; }
  .gal-nav { display: none; }
  .d-sec { padding: 16px 16px 0; }
  .banner { margin-inline: 16px; }
  .gal-thumbs { padding-inline: 16px; }
  .spec > div { grid-template-columns: 112px minmax(0, 1fr); }

  .dialog-wrap { place-items: end center; padding: 0; }
  .dialog { width: 100%; border-radius: 16px 16px 0 0; border-bottom: 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); animation-name: sheet-up; }
  .dialog-actions .btn { flex: 1; }
  .dialog-actions .spacer { display: none; }
}

@media (min-width: 1700px) {
  .results { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spinner { border-top-color: var(--steel); border-right-color: var(--steel); }
}

/* ───────────── buttons used as blocks (added with app.js) ───────────── */
button.card-media { width: 100%; cursor: pointer; }
button.card-title { text-align: start; width: 100%; }
button.hrow-main { text-align: start; background: none; border: 0; cursor: pointer; }
button.src-chip { cursor: pointer; }
.card-dealer.unknown { font-style: normal; }
.d-sec.hint { padding-bottom: 8px; }
.d-sub bdi { unicode-bidi: isolate; }

/* ───────────── review fixes ───────────── */
.price[dir="ltr"] { text-align: right; }
.d-sec .d-title { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: 0; margin-bottom: 0; }
.drawer-title[dir="ltr"] { text-align: right; }
.card-dealer { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.chip-more { width: auto; }
.ph { text-align: center; padding: 0 16px; }
@media (max-width: 767px) {
  .query-bar { position: static; margin: 0 0 12px; padding: 0; border: 0; background: none; }
  .query-title { font-size: 19px; }
  .open-sheet {
    position: fixed; z-index: 45; inset-inline-start: 16px;
    bottom: calc(var(--bottom-ui) + 12px);
    min-height: 48px; padding: 0 20px; border-radius: 999px;
    background: var(--gold); color: #14110a; border-color: var(--gold);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .55);
  }
  .open-sheet:hover:not([disabled]) { background: var(--gold-hi); }
  .view-search.has-search .results-col { padding-bottom: 72px; }
}
@media (max-width: 767px) { .toasts { bottom: calc(var(--bottom-ui) + 70px); } }
.topbar { background: var(--bg); }
.card-dealer .dist { white-space: nowrap; }
.d-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.drawer-badges:empty { display: none; }
@media (max-width: 767px) { .open-sheet { inset-inline-start: auto; inset-inline-end: 16px; } }
@media (max-width: 767px) {
  .src-chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .src-chip { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 8px; row-gap: 1px; padding: 7px 10px; justify-items: start; text-align: start; }
  .src-chip > :first-child { grid-row: span 2; align-self: center; }
  .src-chip .name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .src-chip .st { font-size: 12.5px; }
}
.card-dealer { display: grid; gap: 1px; -webkit-line-clamp: unset; white-space: nowrap; }
.card-dealer > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.card-dealer .dl-name { color: var(--text); font-weight: 500; }
.card-dealer .dl-name.unknown { color: var(--muted); font-weight: 400; }
.src-chip .name, .card-dealer .dl-name { direction: ltr; text-align: right; }
.d-sub .dist { white-space: nowrap; }

/* ───────────── lead fixes ───────────── */
@media (max-width: 1099px) {
  /* the floating search button must never hide the last card's buttons */
  .view-search.has-search .results-col { padding-bottom: 104px; }
  .open-sheet { box-shadow: 0 8px 24px rgba(0, 0, 0, .55); }
}
.d-sub .dist { white-space: nowrap; }
.card-trim { margin-top: -6px; font-size: 13px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: ltr; text-align: right; }

/* ───────────── wide dialog (colour picker) ───────────── */
.dialog.dialog-wide { width: min(640px, 100%); }

/* ───────────── factory colour picker ───────────── */
.chip-color { color: var(--text); border-style: solid; border-color: rgba(212, 175, 55, .5); background: rgba(212, 175, 55, .08); }
.chip-color bdi { max-width: 190px; overflow: hidden; text-overflow: ellipsis; }
.color-open { color: var(--gold-soft); border-color: rgba(212, 175, 55, .4); }
.pal-label { font-size: 12.5px; font-weight: 600; color: var(--muted-2); margin-bottom: -6px; }
.pal-fams .chip { font-size: 12.5px; }
.pal-list { display: grid; gap: 4px; max-height: min(52dvh, 520px); overflow-y: auto; overscroll-behavior: contain; padding-inline-end: 2px; }
.pal-group { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; gap: 8px; padding: 10px 2px 6px; background: var(--s2); font-size: 12.5px; font-weight: 600; color: var(--muted-2); }
.pal-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--s1); text-align: start; transition: border-color .15s var(--ease), background .15s var(--ease); }
.pal-item:hover { border-color: var(--line-2); }
.pal-item[aria-pressed="true"] { border-color: var(--gold); background: rgba(212, 175, 55, .1); }
.pal-dot { width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.pal-name { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 500; overflow-wrap: anywhere; }
.pal-meta { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.pal-tag { font-size: 11.5px; color: var(--muted); padding: 1px 7px; border-radius: 6px; border: 1px solid var(--line); white-space: nowrap; }
.pal-on { color: var(--gold-soft); border-color: rgba(212, 175, 55, .45); }
.pal-check { width: 20px; height: 20px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid var(--line-2); color: transparent; }
.pal-item[aria-pressed="true"] .pal-check { background: var(--gold); border-color: var(--gold); color: #14110a; }
.pal-empty { padding: 18px 4px; }
@media (max-width: 767px) { .pal-meta { display: none; } .pal-item[aria-pressed="true"] .pal-meta, .pal-item .pal-on { display: inline-flex; } }

/* ───────────── near matches (other colour) ───────────── */
.near { margin-top: 28px; padding-top: 18px; border-top: 1px dashed var(--line-2); }
.near-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.near-head h2 { font: 700 20px/1.25 var(--display); }
.near-head .hint { margin-top: 4px; font-size: 13.5px; max-width: 60ch; }
.dialog .sub.sub-he { white-space: normal; overflow: visible; }
@media (max-width: 767px) {
  .pal-fams { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin-inline: -4px; padding-inline: 4px; scrollbar-width: none; }
  .pal-fams::-webkit-scrollbar { display: none; }
  .pal-fams .chip { flex: none; min-height: 38px; }
}
/* scroll lists: a grid inside a max-height scroller squeezes its rows; a flex column does not */
.pal-list { display: flex; flex-direction: column; }
.pal-list > * { flex: none; }
@media (max-width: 767px) {
  .pal-meta { display: inline-flex; }
  .pal-meta .pal-tag:not(.pal-on) { display: none; }
}

/* ───────────── dialogs: actions always visible, only the list scrolls (11.11) ───────────── */
.dialog { display: flex; flex-direction: column; overflow: hidden; }
.dialog > h2 { flex: none; }
#dialog-body { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#dialog-body > * { flex: none; }
.dialog-actions { flex: none; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); background: var(--s2); }
.dialog.dialog-wide { height: min(780px, calc(100dvh - 32px)); }
.dialog.dialog-wide #dialog-body { overflow: hidden; }
.dialog.dialog-wide .pal-list { flex: 1 1 auto; min-height: 120px; max-height: none; }
@media (max-width: 767px) {
  .dialog { max-height: calc(100dvh - 12px); }
  .dialog.dialog-wide { height: calc(100dvh - 12px); }
  .dialog-actions { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
/* the list is the only scroller; "#dialog-body > *" (flex: none) must not win over it */
#dialog-body > .pal-list { flex: 1 1 auto; min-height: 120px; max-height: none; overflow-y: auto; }
.query-bar .new-search { flex: none; align-self: center; }
@media (max-width: 1099px) { .query-bar .new-search span { display: none; } .query-bar .new-search { width: var(--tap); padding: 0; } }
/* three actions per card: watch · copy message · save */
.card-actions { gap: 6px; }
.card-actions .btn { padding-inline: 8px; gap: 6px; min-width: 0; }
.card-actions .btn-copy { flex: 1.25; }
.card-actions .btn span, .card-actions .btn { overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 768px) {
  .card-actions:has(> :nth-child(3)) .btn .ico { display: none; }
  .card-actions:has(> :nth-child(3)) .btn { padding-inline: 6px; font-size: 13px; }
}

/* ═════════════ shell 11.11: intro, brand, six tabs, fixed credit bar ═════════════ */

/* ── intro (index.html #intro): a static first screen. The inline script adds .intro-live (stays until Adi
      scrolls / clicks / presses a key) and .intro-leave (slides up and fades). Without the script, the CSS
      fallback below fades it out after 8s, so it can never block the app. ── */
.intro {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center;
  padding: 24px 24px calc(96px + env(safe-area-inset-bottom, 0px));
  background:
    radial-gradient(ellipse 55% 42% at 50% 44%, rgba(212, 175, 55, .11), transparent 72%),
    radial-gradient(ellipse 90% 70% at 50% 120%, rgba(66, 103, 127, .14), transparent 70%),
    var(--bg);
  cursor: pointer; user-select: none; -webkit-user-select: none; overscroll-behavior: contain; touch-action: none;
  animation: intro-out .5s ease 8s forwards;
}
.intro.intro-live { animation: none; }
.intro.intro-leave { animation: intro-leave .62s cubic-bezier(.55, 0, .25, 1) forwards; pointer-events: none; }
@keyframes intro-out { to { opacity: 0; visibility: hidden; } }
@keyframes intro-leave { to { opacity: 0; transform: translateY(-14vh); visibility: hidden; } }
.intro-stage { display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 100%; }
.intro-leave .intro-stage { animation: intro-stage-leave .62s cubic-bezier(.55, 0, .25, 1) forwards; }
@keyframes intro-stage-leave { to { transform: translateY(-6vh) scale(.97); } }
.intro-logos { display: flex; align-items: center; justify-content: center; gap: clamp(14px, 3vw, 30px); max-width: 100%; }
.intro-am {
  height: clamp(80px, 16vw, 150px); width: auto;
  filter: drop-shadow(0 6px 28px rgba(212, 175, 55, .28));
  animation: intro-in .8s var(--ease) both;
}
.intro-x { color: var(--gold); font: 200 clamp(22px, 3.4vw, 36px)/1 var(--font); opacity: .8; animation: intro-fade .6s ease .25s both; }
.intro-jfp { height: clamp(54px, 11.5vw, 110px); width: auto; animation: intro-in .8s var(--ease) .12s both; }
.intro-rule {
  display: block; width: min(260px, 60vw); height: 1px; margin: clamp(22px, 3.6vh, 34px) 0 clamp(14px, 2.4vh, 22px);
  background: linear-gradient(90deg, transparent, var(--gold) 20%, var(--gold-hi) 50%, var(--gold) 80%, transparent);
  animation: intro-rule .7s var(--ease) .3s both;
}
.intro-title { font: 700 clamp(30px, 5vw, 48px)/1.15 var(--display); color: var(--text); letter-spacing: .01em; animation: intro-up .6s var(--ease) .4s both; }
.intro-sub { margin-top: 6px; font-size: clamp(13px, 1.5vw, 16px); color: var(--muted-2); animation: intro-up .6s var(--ease) .48s both; }
.intro-credit {
  margin-top: clamp(24px, 4.4vh, 40px); font-size: clamp(13px, 1.5vw, 15px); color: var(--muted-2); letter-spacing: .02em;
  animation: intro-up .6s var(--ease) .62s both;
}
.intro-credit strong { color: var(--gold-hi); font-weight: 600; }
.intro-credit bdi { color: var(--gold-soft); font-weight: 600; letter-spacing: .08em; }
.intro-hint {
  position: absolute; inset-inline: 0; margin-inline: auto; width: max-content;
  bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 18px; border-radius: 999px;
  color: var(--muted-2); font-size: 13px; letter-spacing: .04em;
  animation: intro-fade .8s ease 1s both;
}
.intro-hint:hover { color: var(--gold-hi); }
.intro-hint .ico { width: 24px; height: 24px; color: var(--gold); animation: intro-nudge 1.6s ease-in-out 1.4s infinite; }
@keyframes intro-nudge { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(6px); opacity: 1; } }
@keyframes intro-in { from { opacity: 0; transform: translateY(10px) scale(.92); } }
@keyframes intro-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes intro-fade { from { opacity: 0; } }
@keyframes intro-rule { from { transform: scaleX(0); opacity: 0; } }
@media (max-height: 560px) {
  .intro { padding-bottom: 72px; }
  .intro-credit { margin-top: 14px; }
  .intro-hint { bottom: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  /* no movement: appears still, leaves with a short fade */
  .intro { animation: intro-out .2s ease 8s forwards !important; }
  .intro.intro-live { animation: none !important; }
  .intro.intro-leave { animation: intro-out .2s ease forwards !important; }
  .intro * { animation: none !important; }
}

/* ── brand: AM a bit bigger, with a soft gold glow and "מבית AM" ── */
.brand-am { height: 42px; filter: drop-shadow(0 2px 10px rgba(212, 175, 55, .22)); }
.brand-jfp { height: 30px; }
.brand-x { color: var(--gold-deep); }
.brand-by { color: var(--gold-soft); }
.brand-by bdi { font-weight: 600; letter-spacing: .05em; }

/* ── tabs: a strip that scrolls sideways when it does not fit (desktop/tablet), a bottom bar on phones ── */
.topbar { gap: 32px; }
.brand { flex: none; }
.tabs { flex: 0 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; white-space: nowrap; padding: 0 13px; }
.tab::after { bottom: 0; }
.tab-short { display: none; }
@media (max-width: 1279px) and (min-width: 768px) {
  .topbar { gap: 20px; }
  .brand-name small { display: none; }
  .tab { padding: 0 10px; gap: 6px; font-size: 14px; }
}
@media (max-width: 1099px) and (min-width: 768px) {
  .brand-rule, .brand-name { display: none; }
  .tab .ico { display: none; }
}
@media (max-width: 767px) {
  .brand-am { height: 32px; }
  .brand-jfp { height: 23px; }
  .tabs { overflow: visible; }
  .tab { flex: 1 1 0; min-width: 0; padding: 0 2px; gap: 3px; font-size: 11px; letter-spacing: -.01em; }
  .tab .ico { width: 21px; height: 21px; }
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .tab-lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
  .tab::after { top: -1px; bottom: auto; inset-inline: 24%; }
  .tab-count { top: 5px; inset-inline-start: calc(50% + 6px); }
}

/* ── credit bar on phones: slimmer, part of the bottom chrome, mail hidden on narrow screens ── */
@media (max-width: 767px) {
  .foot { font-size: 11.5px; gap: 14px; background: #0d1014; padding: 0 12px; }
  .tabs { background: #0d1014; }
  .foot-am { height: 15px; }
  .foot-credit { gap: 6px; }
  .foot-link { min-height: var(--foot-h); }
}
@media (max-width: 559px) { .foot-mail { display: none; } }
@media (max-width: 379px) { .foot-by { display: none; } }

/* ── "הוסף למעקב" in the results bar ── */
.query-bar .watch-query { flex: none; align-self: center; }
@media (max-width: 1099px) {
  .query-bar .watch-query span { display: none; }
  .query-bar .watch-query { width: var(--tap); padding: 0; }
}

/* ── round 2 (11.11): brand = home button, seven tabs ── */
button.brand { color: inherit; text-align: start; cursor: pointer; border-radius: 10px; padding: 4px 6px; margin-inline: -6px; transition: background .15s var(--ease); }
button.brand:hover { background: rgba(255, 255, 255, .03); }
button.brand:hover .brand-name strong { color: var(--gold-hi); }
button.brand:focus-visible { outline: 2px solid var(--steel); outline-offset: 2px; }
.brand-name strong { transition: color .15s var(--ease); }
@media (max-width: 767px) {
  /* 7 columns from 360px: short labels, a little smaller */
  .tab { font-size: 10.5px; gap: 3px; padding: 0 1px; }
  .tab .ico { width: 20px; height: 20px; }
  .tab-count { top: 4px; inset-inline-start: calc(50% + 5px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .tab::after { inset-inline: 20%; }
}
@media (max-width: 389px) {
  .tab { font-size: 10px; letter-spacing: -.02em; }
  .tab .ico { width: 19px; height: 19px; }
}
/* seven tabs on 1280-1439: tighter so the whole strip fits next to the brand */
@media (max-width: 1439px) and (min-width: 1100px) {
  .topbar { gap: 20px; }
  .brand-by { display: none; }
  .tab { padding: 0 9px; gap: 6px; }
  .tab-count { min-width: 18px; height: 18px; font-size: 11px; padding: 0 5px; }
}
@media (max-width: 1279px) and (min-width: 768px) {
  .brand-rule, .brand-name { display: none; }
}
@media (max-width: 1099px) and (min-width: 768px) {
  .tab-long { display: none; }
  .tab-short { display: inline; }
  .tab { padding: 0 8px; }
}

/* ── card foot: client / team message pair above the actions (11.11) ── */
.card-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-foot .card-actions { margin-top: 0; padding-top: 0; border-top: 0; }
.results[data-layout="list"] .card-foot { grid-column: 2; margin-top: 0; align-self: end; }
.copy-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.copy-pair .btn { min-width: 0; padding-inline: 8px; gap: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.copy-client { background: rgba(212, 175, 55, .14); color: var(--gold-soft); border: 1px solid rgba(212, 175, 55, .55); }
.copy-client:hover { background: rgba(212, 175, 55, .24); border-color: var(--gold); }
.copy-team { background: rgba(143, 176, 196, .12); color: #cfe0ea; border: 1px solid rgba(143, 176, 196, .5); }
.copy-team:hover { background: rgba(143, 176, 196, .24); border-color: var(--steel); }
.d-actions .copy-pair { grid-column: 1 / -1; }
/* roles without the "messages" permission (the team in Canada) never see message buttons */
body.no-messages .msg-only { display: none !important; }

/* ── language toggle + English (LTR) mode (web/i18n.js) ── */
.lang-toggle { flex: none; min-width: 40px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line-2, rgba(255,255,255,.14));
  background: transparent; color: var(--gold-soft); font: 600 13px/1 var(--font); letter-spacing: .04em; cursor: pointer; }
.lang-toggle:hover { border-color: var(--gold); background: rgba(212, 175, 55, .08); }
.lang-toggle:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.login-card .lang-toggle { position: absolute; top: 14px; inset-inline-end: 14px; }
html.lang-en body { font-family: Inter, Heebo, system-ui, sans-serif; }
html.lang-en input.ltr, html.lang-en input.num, html.lang-en .combo-list li, html.lang-en .tags input,
html.lang-en .price[dir="ltr"], html.lang-en .drawer-title[dir="ltr"], html.lang-en .src-chip .name, html.lang-en .card-dealer .dl-name,
html.lang-en .card-trim, html.lang-en .stock-name, html.lang-en .vin-title, html.lang-en .vin-typed, html.lang-en .vin-cand-title,
html.lang-en .watch-title-txt[dir="ltr"], html.lang-en .watch-pick-row .t[dir="ltr"] { text-align: left; }
html.lang-en .input[type="text"], html.lang-en select.input { text-align: left; }
html.lang-en select.input { background-position: right 10px center; }
.login-card { position: relative; }
/* phones: the language toggle and the user box must fit next to the brand (no sideways scroll at 360) */
@media (max-width: 767px) {
  .topbar { gap: 8px; }
  .brand { flex: 0 1 auto; min-width: 0; overflow: hidden; }
  .brand-name small { display: none; }
  .lang-toggle { min-width: 34px; height: 30px; padding: 0 6px; font-size: 12px; }
}
@media (max-width: 400px) { .brand-rule, .brand-name { display: none; } }
/* English labels are longer: tighten the desktop strip so all tabs stay visible */
@media (min-width: 768px) and (max-width: 1599px) {
  html.lang-en .brand-name small { display: none; }
  html.lang-en .topbar { gap: 18px; }
  html.lang-en .tab { padding: 0 9px; gap: 6px; font-size: 14px; }
}
@media (min-width: 768px) and (max-width: 1279px) { html.lang-en .tab-long { display: none; } html.lang-en .tab-short { display: inline; } }
