/* Urban Hub — оформление в стиле Bybit (тёмная и светлая темы, переключатель в шапке).
   Цвета и шрифт взяты из их дизайн-системы: фон #000, карточки #101014,
   фирменный оранжевый #FF9C2E, рост #06C167, падение #F63649, шрифт Inter. */
:root {
  --ground: #000000;        /* страница */
  --surface: #101014;       /* карточки */
  --surface-2: #1e1f24;     /* поля, плашки */
  --line: #222227;          /* разделители */
  --line-strong: #404347;   /* рамки полей */
  --text: #ffffff;
  --muted: #9aa0a6;
  --faint: #6a6e73;
  --accent: #ff9c2e;        /* фирменный оранжевый Bybit */
  --accent-ink: #000000;    /* текст на оранжевой кнопке */
  --accent-soft: rgba(255, 156, 46, 0.16);
  --up: #06c167;
  --down: #f63649;
  --warn: #ff9c2e;
  --info: #3e8bff;
  --topbar: rgba(0, 0, 0, 0.92);
  --hover: rgba(255, 255, 255, 0.04);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.5);
  --heat: 255, 156, 46;
  --tint-warn: rgba(255, 156, 46, 0.1);
  --tint-err: rgba(246, 54, 73, 0.12);
  --tint-info: rgba(62, 139, 255, 0.1);
  --tint-ok: rgba(6, 193, 103, 0.1);
  --radius: 8px;
  --radius-btn: 12px;
  --font-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-num: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-brand: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: dark;
}

/* светлая тема: включается кнопкой в шапке (светлые токены Bybit) */
:root[data-theme='light'] {
  --ground: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f3f5f7;
  --line: #e9ecf0;
  --line-strong: #dde1e5;
  --text: #000000;
  --muted: #7f838a;
  --faint: #a1a5ab;
  --accent: #f29229;
  --accent-ink: #000000;
  --accent-soft: rgba(255, 156, 46, 0.14);
  --up: #06c167;
  --down: #f63649;
  --warn: #f29229;
  --info: #1f6feb;
  --topbar: rgba(255, 255, 255, 0.94);
  --hover: rgba(0, 0, 0, 0.04);
  --shadow: 0 14px 34px rgba(18, 18, 20, 0.14);
  --shadow-sm: 0 8px 22px rgba(18, 18, 20, 0.1);
  --heat: 242, 146, 41;
  --tint-warn: rgba(255, 156, 46, 0.14);
  --tint-err: rgba(246, 54, 73, 0.1);
  --tint-info: rgba(31, 111, 235, 0.09);
  --tint-ok: rgba(6, 193, 103, 0.1);
  color-scheme: light;
}
/* чуть больше контраста: карточки отделены от фона, шапка таблиц заметнее */
:root[data-theme='light'] .box { box-shadow: 0 1px 2px rgba(18, 18, 20, 0.06); }
:root[data-theme='light'] th { background: var(--surface-2); color: #45484d; }
:root[data-theme='light'] .topbar { border-bottom-color: var(--line); }
:root[data-theme='light'] .pill { border-color: var(--line-strong); }
:root[data-theme='light'] { --line-strong: #b9c0c9; }
:root[data-theme='light'] .input, :root[data-theme='light'] select.input { background: #fff; border-color: #b9c0c9; box-shadow: inset 0 1px 2px rgba(18, 18, 20, 0.05); }
:root[data-theme='light'] .input::placeholder { color: #8b9199; }
:root[data-theme='light'] .input:focus { border-color: var(--accent); }
:root[data-theme='light'] .btn { border-color: #c9ced6; }
:root[data-theme='light'] .seg { border-color: #b9c0c9; }
:root[data-theme='light'] .table-wrap { border-color: #d7dce2; }
:root[data-theme='light'] th, :root[data-theme='light'] td { border-bottom-color: #e3e7ec; }
:root[data-theme='light'] .rate__big, :root[data-theme='light'] .tick__value { color: #000; }
:root[data-theme='light'] .rate__big.is-fee, :root[data-theme='light'] .tick__value.is-fee { color: var(--accent); }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { background: var(--ground); color: var(--text); }
body { margin: 0; font: 14px/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }

/* Телефоны и планшеты. iPhone (и Telegram внутри него) сам увеличивает страницу, когда нажимаешь
   на поле со шрифтом мельче 16px, и обратно не отдаляет. Даём полям ровно 16px — прыжков больше нет,
   а увеличить пальцами фото или мелкую цифру по-прежнему можно. Двойной тап тоже больше не зумит. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { touch-action: manipulation; }
@media (pointer: coarse) {
  input:not([type='checkbox']):not([type='radio']):not([type='file']):not([type='range']), select, textarea { font-size: 16px; }
}
a { color: var(--info); }
.num { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- каркас ---------- */
.wrap { max-width: 1320px; margin: 0 auto; padding-inline: 16px; }
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: var(--topbar); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar__row { display: flex; align-items: center; gap: 20px; min-height: 56px; }
.brand { font-family: var(--font-brand); font-weight: 700; font-size: 16px; letter-spacing: -0.01em; white-space: nowrap; }
.brand b { color: var(--accent); font-weight: 600; }
.tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  background: none; border: 0; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  color: var(--muted); white-space: nowrap; font-weight: 500;
}
.tab:hover { color: var(--text); background: var(--surface); }
.tab[aria-selected='true'] { color: var(--accent-ink); background: var(--accent); font-weight: 600; }
.topbar__side { display: flex; align-items: center; gap: 8px; }

/* ---------- лента курсов ---------- */
.ticker { border-bottom: 1px solid var(--line); background: var(--surface); }
.ticker__row { display: flex; align-items: stretch; gap: 0; overflow-x: auto; scrollbar-width: thin; }
.tick { padding: 8px 18px 8px 0; margin-right: 18px; border-right: 1px solid var(--line); white-space: nowrap; }
.tick:last-of-type { border-right: 0; }
.tick__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; display: flex; gap: 6px; align-items: center; }
.tick__value { font-family: var(--font-num); font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tick__sub { font-family: var(--font-num); font-size: 11px; color: var(--faint); }
.tick__value.is-fee { color: var(--accent); }
.ticker__meta { margin-left: auto; display: flex; align-items: center; gap: 10px; padding-left: 12px; white-space: nowrap; color: var(--faint); font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); display: inline-block; }
.dot.is-err { background: var(--down); }
.dot.is-manual { background: var(--warn); }

/* ---------- общее ---------- */
main { padding-block: 20px 48px; }
.panel { display: none; }
.panel.is-active { display: block; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); }
.cols-4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
/* карточки курсов: все пять в одной строке, на узких экранах — по 3, 2 и 1 */
.cols-rates { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1500px) { .cols-rates { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cols-rates { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cols-rates { grid-template-columns: 1fr; } }
.cols-rates .box { padding: 14px; }
.cols-rates .rate__big { font-size: clamp(22px, 2vw, 30px); }
.cols-rates .kv { font-size: 12px; }
.cols-rates .rate__name { font-size: 13px; }
.cols-rates .rate__src, .cols-rates .rate__unit { font-size: 11px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.box--flat { background: transparent; }
h1, h2, h3 { margin: 0; font-weight: 600; text-wrap: balance; }
h2 { font-size: 18px; }
h3 { font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; font-weight: 500; }
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 2px 8px; border-radius: 99px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.pill--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.pill--err { color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, transparent); }
.pill--ok { color: var(--up); border-color: color-mix(in srgb, var(--up) 40%, transparent); }
.pill--accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.notice { border-left: 3px solid var(--warn); background: var(--tint-warn); padding: 8px 12px; border-radius: 0 6px 6px 0; font-size: 13px; }
.notice--err { border-color: var(--down); background: var(--tint-err); }
.notice--info { border-color: var(--info); background: var(--tint-info); }
.notice--warn { border-color: var(--warn); background: var(--tint-warn); }

/* ---------- формы ---------- */
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.input, select.input {
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: var(--radius); 
  padding: 8px 10px; min-height: 38px; width: 100%; min-width: 0;
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.input.is-green { border-color: color-mix(in srgb, var(--up) 55%, transparent); background: var(--tint-ok); }
.input.is-auto { background: var(--surface-2); color: var(--muted); }
.form-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: block; padding: 7px 12px; color: var(--muted); cursor: pointer; font-size: 13px; }
.seg input:checked + span { background: var(--accent-soft); color: var(--accent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.seg input:disabled + span { opacity: 0.35; cursor: not-allowed; }
.seg label + label span { border-left: 1px solid var(--line-strong); }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }
.btn {
  border: 1px solid var(--line-strong); background: var(--surface-2); padding: 7px 14px; border-radius: var(--radius-btn);
  cursor: pointer; font-weight: 600; white-space: nowrap; min-height: 34px;
}
.btn:hover { border-color: var(--muted); }
.btn--primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn--primary:hover { background: #ffad52; border-color: #ffad52; filter: none; }
.btn--ghost { background: transparent; }
.btn--sm { padding: 3px 10px; min-height: 28px; font-size: 12px; border-radius: 8px; }
.btn--danger { color: var(--down); }
.btn[disabled] { opacity: 0.5; cursor: progress; }
.legend { font-size: 12px; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- курсы ---------- */
.rate { display: flex; flex-direction: column; gap: 10px; }
.rate__top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rate__name { font-weight: 600; }
.rate__src { font-size: 12px; color: var(--faint); }
.rate__big { font-family: var(--font-num); font-size: 34px; font-weight: 600; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rate__unit { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 13px; }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.kv .is-accent { color: var(--accent); font-weight: 600; }
.rate__ctl { border-top: 1px dashed var(--line); padding-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mini { width: 74px; min-height: 30px; padding: 4px 8px; }
.up { color: var(--up); }
.down { color: var(--down); }

/* ---------- таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 12px; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
td.n, th.n { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
tbody tr:hover td { background: var(--row-hover); }
:root { --row-hover: rgba(255, 255, 255, 0.08); }
:root[data-theme='light'] { --row-hover: rgba(18, 18, 20, 0.06); }
tr.is-hit td { background: var(--accent-soft); }
td input.cell { background: transparent; border: 1px solid transparent; border-radius: 4px; padding: 3px 6px; width: 100%; min-width: 60px; }
td input.cell:hover { border-color: var(--line-strong); }
td input.cell:focus { border-color: var(--accent); outline: none; background: var(--ground); }
td input.cell.n { text-align: right; font-family: var(--font-num); }
td.check-flag { color: var(--warn); }
.scroll-y { max-height: 62vh; overflow: auto; }

/* ---------- результат ---------- */
.result { display: flex; flex-direction: column; gap: 14px; }
.total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 14px 16px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent); }
.total__label { color: var(--muted); font-size: 13px; }
.total__value { font-family: var(--font-num); font-size: 30px; font-weight: 600; color: var(--accent); font-variant-numeric: tabular-nums; }
.total__sub { font-family: var(--font-num); color: var(--muted); font-size: 13px; }
.lines { display: grid; grid-template-columns: 1fr auto; font-size: 14px; }
.lines > div { padding: 8px 0; border-bottom: 1px solid var(--line); }
.lines .v { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; }
.lines .r { grid-column: 1 / -1; padding-top: 0; font-size: 12px; color: var(--faint); border-bottom: 1px solid var(--line); margin-top: -1px; }
.lines .is-sum { font-weight: 600; }

details.box > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; gap: 8px; align-items: center; }
details.box > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
details.box[open] > summary::before { transform: rotate(90deg); }
details.box[open] > summary { margin-bottom: 14px; }

.frame { width: 100%; height: calc(100vh - 190px); min-height: 520px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }

.toast { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); background: var(--surface-2); border: 1px solid var(--line-strong); padding: 10px 14px; border-radius: 8px; z-index: 50; box-shadow: var(--shadow-sm); max-width: calc(100vw - 32px); }
.toast.is-err { border-color: var(--down); }

.demo-banner { background: var(--accent); color: var(--accent-ink); font-size: 12px; text-align: center; padding: 4px 16px; font-weight: 500; }

@media (max-width: 720px) {
  .topbar__row { flex-wrap: wrap; gap: 4px 10px; padding-block: 6px; min-height: 0; }
  .brand { font-size: 14px; }
  .topbar__side { margin-left: auto; gap: 6px; }
  .tabs { order: 3; flex-basis: 100%; margin-inline: -4px; }
  .tab { padding: 7px 10px; }
  .tick { padding: 5px 12px 5px 0; margin-right: 12px; }
  .tick__value { font-size: 16px; }
  .rate__big { font-size: 28px; }
  .ticker__meta { display: none; }
  /* шапка уезжает вверх, когда листаете вниз, и возвращается при прокрутке вверх (класс ставит app.js) */
  /* появление — быстрее и мягко тормозит, уход — чуть дольше и плавно разгоняется; лёгкое затухание сглаживает движение */
  .topbar { transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), opacity 0.4s ease; will-change: transform; }
  .topbar.is-away { transform: translateY(calc(-100% - env(safe-area-inset-top, 0px))); opacity: 0; transition: transform 0.5s cubic-bezier(0.45, 0, 0.25, 1), opacity 0.45s ease-in; }
}

input[type='file'] { color: var(--muted); max-width: 100%; }
input[type='file']::file-selector-button { font: inherit; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; padding: 6px 12px; margin-right: 10px; cursor: pointer; }

/* ---------- утильсбор ---------- */
.util-top { display: grid; gap: 16px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 16px; align-items: stretch; }
.util-total { flex-direction: column; justify-content: center; align-items: flex-start; }
.util-total .total__value { font-size: 34px; }
.util-filters { margin-bottom: 12px; }
.util-table { border-collapse: separate; border-spacing: 0; }
.util-table th, .util-table td { padding: 10px 14px; }
.util-table thead th { text-align: right; font-size: 12px; }
.util-table thead th:first-child { text-align: left; }
.util-table th .sub, .util-table td .sub { display: block; font-size: 11px; color: var(--faint); font-weight: 400; }
.util-table td.pw { font-weight: 500; }
.util-table td.v { text-align: right; font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 14px; background-image: linear-gradient(rgba(var(--heat), var(--heat-a, 0)), rgba(var(--heat), var(--heat-a, 0))); }
.util-table td.v small { color: var(--faint); font-size: 11px; margin-left: 4px; }
.util-table td.v { white-space: nowrap; }
.util-table tr.is-row td { background-color: var(--tint-info); }
.util-table td.is-col, .util-table th.is-col { box-shadow: inset 1px 0 0 color-mix(in srgb, var(--info) 45%, transparent), inset -1px 0 0 color-mix(in srgb, var(--info) 45%, transparent); }
.util-table th.is-col { color: var(--info); }
.util-table td.is-pref { color: var(--up); }
.util-table td.is-pref small { color: var(--up); opacity: 0.75; }
.util-table td.is-hit { outline: 2px solid var(--accent); outline-offset: -2px; color: var(--accent); font-weight: 600; border-radius: 4px; }
.util-table tr.is-flag td.pw { color: var(--warn); }
.util-table input.cell { min-width: 110px; }
.pref { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; padding: 14px 16px; border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.pref__big { font-family: var(--font-num); font-size: 20px; font-weight: 600; color: var(--up); }
.pref .form-grid { flex: 1; }

/* ---------- база авто ---------- */
.cars-table tbody tr { cursor: pointer; }
.cars-table.is-edit tbody tr { cursor: default; }
.cars-table td.muted { color: var(--faint); }
@media (max-width: 720px) { .util-top { grid-template-columns: 1fr; } }
.util-table.is-narrow { width: auto; min-width: min(100%, 520px); }
.util-wrap:has(.is-narrow) { width: fit-content; max-width: 100%; }

/* ---------- справочник ТХ ---------- */
.td-filters { display: flex; flex-direction: column; gap: 14px; margin-bottom: 14px; }
.td-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) repeat(3, minmax(0, 0.8fr)); align-items: start; }
.td-grid + .td-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1.2fr) auto; }
.td-range { display: flex; gap: 8px; align-items: center; }
.td-range .input { min-width: 0; }
.td-range .seg { flex-shrink: 0; }
.td-summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; min-height: 26px; }
.td-summary .big { font-family: var(--font-num); font-size: 18px; font-weight: 600; color: var(--accent); margin-right: 6px; }
.td-wrap { max-height: 68vh; overflow: auto; }
.td-table { table-layout: fixed; }
.td-table th { cursor: pointer; user-select: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.td-table td { overflow: hidden; text-overflow: ellipsis; }
.td-table th[aria-sort] { color: var(--accent); }
.td-table th .arr { font-size: 10px; margin-left: 3px; }
.td-table td.hp { color: var(--muted); }
.td-table td .sub { color: var(--faint); font-size: 11px; margin-left: 4px; }
.td-table td.empty { color: var(--faint); }
.td-table tbody tr { cursor: default; }
.td-table mark { background: var(--accent-soft); color: var(--accent); border-radius: 2px; }
.td-pager { margin-top: 10px; }
.eco { display: inline-block; min-width: 18px; text-align: center; padding: 1px 6px; border-radius: 99px; font-size: 11px; border: 1px solid var(--line-strong); color: var(--muted); }
@media (max-width: 1000px) { .td-grid, .td-grid + .td-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); } }
a.btn { text-decoration: none; color: var(--text); display: inline-flex; align-items: center; }

/* ---------- выпадающий список с поиском ---------- */
.field > label { font-size: 12px; color: var(--muted); }
.cb { position: relative; }
.cb .input { padding-right: 34px; }
.cb-clear { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1; }
.cb-clear:hover { background: var(--surface-2); color: var(--text); }
.cb-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; }
.cb-item { display: flex; justify-content: space-between; gap: 12px; padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 14px; }
.cb-item .n { color: var(--faint); font-family: var(--font-num); font-size: 12px; white-space: nowrap; }
.cb-item mark { background: none; color: var(--accent); font-weight: 600; }
.cb-item.is-active, .cb-item:hover { background: var(--accent-soft); }
.cb-more { padding: 6px 10px; color: var(--faint); font-size: 12px; }

/* диагностика источников */
.ok { color: var(--up); }
.bad { color: var(--down); }
.diag-pre { max-height: 220px; overflow: auto; font-size: 12px; background: var(--ground); padding: 8px; font-family: var(--font-num); border-radius: 6px; white-space: pre-wrap; word-break: break-all; }
.diag-detail { white-space: normal; word-break: break-word; min-width: 220px; }

/* карточки курсов: блок наценки всегда внизу, на одном уровне */
.rate__ctl { margin-top: auto; }
.rate__err { display: flex; flex-direction: column; gap: 4px; }
.rate__err details summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.rate__errtext { font-size: 12px; color: var(--muted); word-break: break-word; margin: 4px 0 6px; }
.td-status { margin: 14px 0 0; font-size: 12px; }
.input::placeholder { color: var(--faint); opacity: 0.8; }
.td-summary--bottom { margin: 12px 0 0; min-height: 0; gap: 6px; }
.td-summary--bottom .big { font-size: 13px; color: var(--muted); margin-right: 2px; }
.td-summary--bottom .pill { font-size: 11px; }
.td-summary--bottom + .td-status { margin-top: 6px; }

/* ---------- справочник ТХ на телефоне: карточки вместо таблицы ---------- */
.td-cards { display: none; }
.tdc { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tdc__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.tdc__name { min-width: 0; font-size: 13px; line-height: 1.3; color: var(--muted); overflow-wrap: anywhere; }
.tdc__name b { color: var(--text); font-weight: 600; margin-right: 2px; }
.tdc__head .eco { flex-shrink: 0; }
.tdc__tiles { display: grid; grid-template-columns: 0.8fr 1.1fr 1.1fr; gap: 6px; }
.tdc__tile { display: flex; flex-direction: column; min-width: 0; padding: 6px 9px 7px; border-radius: 8px; background: var(--surface-2); }
.tdc__tile--empty .tdc__lbl { color: var(--faint); }
.tdc__nil { color: var(--faint); font-weight: 500; }
.tdc__lbl { font-size: 10.5px; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.tdc__val { font-family: var(--font-num); font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 700; line-height: 1.2; color: var(--text); white-space: nowrap; }
.tdc__val small { font-size: 12px; font-weight: 500; color: var(--muted); }
.tdc__sub { font-family: var(--font-num); font-size: 12px; line-height: 1.3; color: var(--muted); white-space: nowrap; }
/* мощность — главная цифра, оранжевая; 30-минутная — отдельной плиткой со своей подписью, приглушённая */
.tdc__tile--pow .tdc__val { color: var(--accent); }
.tdc__tile--p30 { background: none; border: 1px dashed var(--line-strong); }
.tdc__tile--p30 .tdc__val { font-size: 17px; font-weight: 600; }
.tdc__foot { font-size: 12px; line-height: 1.4; color: var(--muted); overflow-wrap: anywhere; }
.tdc__foot span { color: var(--text); font-family: var(--font-num); }
.tdc__foot i { font-style: normal; margin: 0 6px; color: var(--faint); }
.tdc mark { background: var(--accent-soft); color: var(--accent); border-radius: 2px; }
:root[data-theme='light'] .tdc { box-shadow: 0 1px 2px rgba(18, 18, 20, 0.05); }
.td-msort { display: none; }
@media (max-width: 720px) {
  .td-msort { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; scroll-margin-top: 170px; }
  .td-msort label { flex-shrink: 0; }
  .td-msort select { flex: 1; min-width: 0; }
  .td-msort .btn { flex-shrink: 0; min-height: 38px; min-width: 44px; font-size: 18px; justify-content: center; }

  /* фильтры: марка и модель во всю ширину, «год от / до» — парой, остальное друг под другом */
  .td-grid, .td-grid + .td-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .td-grid > * { grid-column: 1 / -1; }
  .td-grid > .td-y { grid-column: auto; }
  .td-actions > span { display: none; }

  /* на телефоне вместо таблицы — компактные карточки (#tdCards, их рисует app.js) */
  .td-wrap { display: none; }
  .td-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }

  .td-pager { flex-wrap: wrap; gap: 8px; }
  .td-pager .btn { min-height: 38px; }
  .td-pager .spacer { display: none; }
  .td-pager label, .td-pager #tdExport { flex-basis: 100%; }
  .td-pager #tdExport { text-align: center; justify-content: center; }
}

/* загрузка */
.skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--line) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skel 1.2s ease-in-out infinite; }
.skel--big { height: 34px; width: 55%; margin: 6px 0 10px; }
.skel-card { min-height: 220px; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; vertical-align: -1px; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .skel, .spin { animation: none; } }
/* светлая тема: таблицы утиля и справочника — на белом, как карточки */
:root[data-theme='light'] .table-wrap { background: var(--surface); box-shadow: 0 1px 2px rgba(15, 23, 32, 0.06); }
:root[data-theme='light'] .td-summary--bottom, :root[data-theme='light'] .td-pager { color: var(--muted); }

/* выбор столбцов справочника */
.cols { position: relative; }
.cols > summary { list-style: none; cursor: pointer; }
.cols > summary::-webkit-details-marker { display: none; }
.cols__panel { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 220px; display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: var(--shadow); padding: 10px; }
.cols__panel .check { white-space: nowrap; }

/* авто по ссылке */
/* КП для клиента */
.offer { margin-top: 4px; }
.offer > summary { list-style: none; display: inline-flex; }
.offer > summary::-webkit-details-marker { display: none; }
.offer[open] > summary { background: transparent; color: var(--accent); }
.offer__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.offer__row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .offer__row { grid-template-columns: 1fr; } }
.eq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.eq-chip { font-size: 12.5px; line-height: 1.3; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.car-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px; }
.car-photos img { width: 100%; height: 82px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }

/* галерея фото */
.car-photos figure { position: relative; margin: 0; }
.car-photos img { cursor: zoom-in; }
.car-photos__dl { position: absolute; right: 4px; bottom: 4px; padding: 0 6px; min-height: 22px; line-height: 20px; opacity: 0; transition: opacity 0.15s; }
.car-photos figure:hover .car-photos__dl { opacity: 1; }
/* на телефоне наведения нет — кнопку «сохранить это фото» показываем всегда, чуть прозрачной */
@media (pointer: coarse) { .car-photos__dl { opacity: 0.85; min-height: 28px; line-height: 26px; padding: 0 9px; } }
#photoSaveAll.is-ready { box-shadow: 0 0 0 3px var(--accent-soft); }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.88); display: flex; align-items: center; justify-content: center; gap: 12px; padding: 24px; }
.lightbox img { max-width: calc(100% - 140px); max-height: calc(100vh - 120px); object-fit: contain; border-radius: 8px; }
.lightbox__close { position: absolute; top: 16px; right: 16px; }
.lightbox__bar { position: absolute; bottom: 16px; display: flex; gap: 12px; align-items: center; }
.lightbox__nav { min-width: 44px; font-size: 22px; line-height: 1; }
.lightbox img { touch-action: pinch-zoom; will-change: transform; }
html.lb-open, html.lb-open body { overflow: hidden; }
/* телефон: фото на всю ширину, стрелки и счётчик — внизу, листать можно свайпом */
@media (max-width: 720px) {
  .lightbox { padding: calc(56px + env(safe-area-inset-top)) 0 calc(76px + env(safe-area-inset-bottom)); }
  .lightbox img { max-width: 100%; max-height: 100%; width: 100%; height: 100%; border-radius: 0; }
  .lightbox__close { top: calc(12px + env(safe-area-inset-top)); right: 12px; }
  .lightbox__nav { position: absolute; bottom: calc(16px + env(safe-area-inset-bottom)); min-width: 40px; min-height: 34px; font-size: 18px; padding: 0 12px; }
  .lightbox__prev { left: 12px; }
  .lightbox__next { right: 12px; }
  .lightbox__bar { left: 64px; right: 64px; bottom: calc(18px + env(safe-area-inset-bottom)); justify-content: center; gap: 10px; flex-wrap: wrap; }
  #lbSize { display: none; }
}

/* порядок фото: номер, булавка, перетаскивание; первые 10 — в КП */
.car-photos figure { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.car-photos figure img { -webkit-user-drag: none; }
@media (pointer: fine) { .car-photos figure:not(.is-pinned) img { cursor: grab; } }
.car-photos__num { position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.62); color: #fff; font-size: 11px; font-weight: 600; display: grid; place-items: center; pointer-events: none; }
.car-photos figure.is-cover .car-photos__num { background: var(--accent); color: var(--accent-ink); }
.car-photos__pin { position: absolute; right: 4px; top: 4px; padding: 0 5px; min-height: 22px; line-height: 20px; display: grid; place-items: center; opacity: 0; transition: opacity 0.15s; }
.car-photos figure:hover .car-photos__pin { opacity: 1; }
.car-photos figure.is-pinned .car-photos__pin { opacity: 1; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.car-photos figure.is-pinned img { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (pointer: coarse) { .car-photos__pin { opacity: 0.85; min-height: 28px; padding: 0 8px; } }
.car-photos figure.is-dragging { opacity: 0.3; }
.car-photos figure.is-drop-before::before, .car-photos figure.is-drop-after::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 2px; background: var(--accent); z-index: 2;
}
.car-photos figure.is-drop-before::before { left: -5px; }
.car-photos figure.is-drop-after::after { right: -5px; }
.car-photos__more { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 2px 4px; margin-top: 4px; border-top: 1px dashed var(--line); border-radius: 4px; }
.car-photos__more.is-drop { border-top: 2px solid var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.photo-ghost { position: fixed; left: 0; top: 0; z-index: 80; pointer-events: none; object-fit: cover; border-radius: 8px; opacity: 0.92; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45); will-change: transform; contain: strict; }
/* курсор «тащу» — только у страницы и галереи: правило на все элементы (*) заставляло браузер пересчитывать всю страницу */
body.is-photo-drag { cursor: grabbing; user-select: none; -webkit-user-select: none; }
body.is-photo-drag .car-photos figure, body.is-photo-drag .car-photos img { cursor: grabbing !important; }
/* фото проявляются по мере загрузки, а не вспыхивают; новые — мягко появляются */
.car-photos figure { background: var(--surface-2); border-radius: 6px; }
.car-photos figure img { opacity: 0; transition: opacity 0.25s ease; }
.car-photos figure img.is-loaded { opacity: 1; }
.car-photos figure.is-moving { z-index: 1; }
.car-photos figure.is-enter { animation: photo-in 0.26s ease both; }
@keyframes photo-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
/* пересчёт той же машины: прошлый результат приглушён, сверху — строка статуса */
#carResult.is-busy > :not(.car-busy) { opacity: 0.45; pointer-events: none; transition: opacity 0.2s; }
.car-busy { position: sticky; top: 76px; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px;
  border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); font-weight: 600; }

/* форма калькулятора */
.car-form { gap: 18px; }
.car-form__top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.switches { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13px; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 14px 6px 10px; background: var(--surface-2); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { position: relative; width: 34px; height: 18px; border-radius: 999px; background: var(--line-strong); transition: background 0.15s; flex: none; }
.switch__track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); transition: transform 0.15s; }
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:checked ~ .switch__text { color: var(--text); }
.switch:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* режим расчёта: на компьютере — как было («Китай вручную» одной строкой), подписи только для телефона */
.car-mode b { font-weight: inherit; }
.car-mode em { font-style: normal; }
.car-mode em.m-only, .switch__hint { display: none; }

@media (max-width: 720px) {
  .car-form__top { flex-direction: column; align-items: stretch; gap: 12px; }

  /* три равные кнопки в одну строку, как переключатель в iOS; выбранная — оранжевая, как активная вкладка */
  .car-mode { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); overflow: visible; }
  .car-mode label { display: flex; }
  .car-mode label + label span { border-left: 0; }
  .car-mode span { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    padding: 9px 4px; border-radius: 10px; text-align: center; line-height: 1.2; font-size: 15px; color: var(--text);
    transition: background 0.15s, color 0.15s; }
  .car-mode b { font-weight: 600; }
  .car-mode em, .car-mode em.m-only { display: block; font-size: 12px; color: var(--muted); }
  .car-mode input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
  .car-mode input:checked + span em { color: var(--accent-ink); opacity: 0.7; }
  :root[data-theme='light'] .car-mode { border-color: var(--line); }

  /* переключатели — списком, как в настройках телефона: подпись слева, тумблер справа */
  .switches { margin-left: 0; flex-direction: column; flex-wrap: nowrap; gap: 0;
    border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--surface-2); }
  .switch { flex-direction: row-reverse; justify-content: space-between; gap: 14px;
    border: 0; border-radius: 0; background: none; padding: 11px 14px; font-size: 15px; color: var(--text); }
  .switch + .switch { border-top: 1px solid var(--line); }
  .switches .switch:has(input:checked) { background: var(--accent-soft); border-color: var(--line); }
  .switch__text { flex: 1; min-width: 0; }
  .switch__hint { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); line-height: 1.35; }
  .switch__track { width: 46px; height: 28px; }
  .switch__track::after { top: 3px; left: 3px; width: 22px; height: 22px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3); }
  .switch input:checked + .switch__track::after { transform: translateX(18px); }
}

.car-form__params { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 16px; }
.car-form__caption { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; }
.car-form__caption h3 { margin: 0; }
.car-group { display: flex; flex-direction: column; gap: 10px; }
.car-group__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 12px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--faint); }
.car-group__title .hint { text-transform: none; letter-spacing: 0; }
/* ровная сетка: колонки одинаковой ширины, поля не «прыгают» при переключении режимов */
.form-grid--4 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px 10px; }
@media (max-width: 1240px) { .form-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .form-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .form-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .form-grid--4 { grid-template-columns: 1fr; } }
/* поля калькулятора — компактнее обычных */
.car-form .field { gap: 3px; }
.car-form .field > span { font-size: 11px; line-height: 1.25; }
.car-form .input, .car-form select.input { padding: 5px 8px; min-height: 30px; font-size: 13px; }
.car-form { gap: 14px; }
.car-form__params { padding-top: 12px; gap: 12px; }
.car-group { gap: 7px; }
.car-form__actions { padding-top: 12px; }
/* результат — отдельным блоком, с отступом от формы; когда расчёт есть,
   он занимает оставшийся экран, чтобы при прокрутке вниз смотрелся цельно */
#carResult { margin-top: 18px; scroll-margin-top: 142px; }
/* расчёт занимает оставшийся экран: карточки по содержимому, а свободное
   место распределяется между блоками, без дыр внутри карточек */
#carResult.is-full { min-height: calc(100vh - 196px); display: flex; flex-direction: column; gap: 14px; }
#carResult.is-full > p { margin: 0; }
.car-note { margin: 0; }
/* фото сохраняют пропорции кадра; на большом экране — крупнее */
#carResult .car-photos img { height: auto; aspect-ratio: 4 / 3; }
/* размер миниатюр подстраивается под высоту экрана: на большом мониторе фото крупнее */
#carResult .car-photos { grid-template-columns: repeat(auto-fill, minmax(clamp(105px, 11vh, 175px), 1fr)); }
#carResult.is-full > p { margin: 0; }
#carResult .lines > div { padding: 6px 0; }
#carResult .kv { row-gap: 2px; }
.car-form__actions { border-top: 1px solid var(--line); padding-top: 14px; }
/* стрелки у числовых полей только мешают */
.input.num::-webkit-outer-spin-button, .input.num::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input.num[type='number'] { -moz-appearance: textfield; appearance: textfield; }
.box--soft { background: var(--surface-2); }

/* поле, которое нужно заполнить для расчёта */
.input.is-missing { border-color: var(--down); box-shadow: 0 0 0 3px color-mix(in srgb, var(--down) 25%, transparent); }
.field:has(.is-missing) > span { color: var(--down); }

/* Комплектация объявления */
.eq-archive { grid-template-columns: repeat(3, minmax(0, 1fr) auto); gap: 6px 14px; }
.eq-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px 24px; }
.eq-group .car-group__title { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.eq-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.eq-item { display: grid; grid-template-columns: 16px 1fr; gap: 6px; align-items: baseline; line-height: 1.35; }
.eq-mark { font-weight: 700; text-align: center; }
.eq-item.is-yes .eq-mark { color: var(--up); }
.eq-item.is-opt .eq-mark { color: var(--warn); }
.eq-item.is-no { color: var(--faint); display: none; }
.eq-item.is-no .eq-mark { color: var(--faint); }
.eq--all .eq-item.is-no { display: grid; }
.eq-item.is-info .eq-mark::before { content: '·'; color: var(--muted); }
.eq-tag { font-size: 11px; color: var(--warn); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 2px; }
.eq-params > summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.eq-params .kv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.eq-params .kv dt { white-space: normal; }
.eq-params .kv dd { white-space: normal; overflow-wrap: anywhere; }
@media (max-width: 900px) { .eq-archive { grid-template-columns: minmax(0, 1fr) auto; } }
.eq-unsure { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); column-gap: 24px; }
.eq-unsure .eq-mark { color: var(--warn); }

/* История авто Encar */
.hist-filter { gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.hist-filter .btn.is-on { border-color: var(--accent); color: var(--accent); }
.hist-line { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.hist-ev { display: grid; grid-template-columns: 74px 26px 1fr; gap: 10px; align-items: start; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hist-ev[hidden] { display: none; }
.hist-date { font-family: var(--font-num); color: var(--muted); font-size: 12px; padding-top: 3px; }
.hist-dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.hist-ev.is-insurance .hist-dot { background: var(--tint-err); color: var(--down); }
.hist-ev.is-repair .hist-dot { background: var(--tint-warn); color: var(--warn); }
.hist-ev.is-recall .hist-dot { background: var(--tint-info); color: var(--info); }
.hist-ev.is-release .hist-dot, .hist-ev.is-inspection .hist-dot { background: var(--tint-ok); color: var(--up); }
.hist-title { font-weight: 600; }
.hist-more > summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-top: 4px; }
.hist-kv { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); margin-top: 6px; }
.hist-kv dt { white-space: normal; overflow-wrap: anywhere; }
.hist-kv dd { text-align: left; white-space: normal; overflow-wrap: anywhere; font-family: var(--font-ui); }
.hist-parts { font-size: 13px; margin-top: 4px; }
@media (max-width: 700px) {
  .hist-ev { grid-template-columns: 60px 24px 1fr; gap: 8px; }
  /* подробности события: подпись над значением, а не в узкой колонке рядом — иначе они наезжают друг на друга */
  .hist-kv { grid-template-columns: minmax(0, 1fr); row-gap: 0; }
  .hist-kv dt { font-size: 11.5px; margin-top: 8px; }
  .hist-kv dt:first-child { margin-top: 0; }
  .hist-kv dd { font-size: 13.5px; line-height: 1.4; }
  /* владельцы и пробег: вместо широкой таблицы с прокруткой — строка на владельца */
  .hist-own, :root[data-theme] .table-wrap.hist-own { border: 0; background: none; box-shadow: none; overflow: visible; }
  .hist-own thead { display: none; }
  .hist-own table, .hist-own tbody { display: block; width: 100%; }
  .hist-own tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
  .hist-own td { padding: 0; border: 0; white-space: normal; text-align: left; }
  .hist-own td:nth-child(1) { grid-column: 1; grid-row: 1; font-family: var(--font-num); }
  .hist-own td:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; font-weight: 600; }
  .hist-own td:nth-child(2) { grid-column: 1; grid-row: 2; color: var(--muted); font-size: 13px; }
  .hist-own td:nth-child(3) { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 13px; text-align: right; }
}

/* телефон: два столбца — первые 10 фото (для КП) ровно 5 рядами, фото крупнее */
@media (max-width: 720px) {
  #carResult .car-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* подсказки у поля (Справочник ТХ, мощности): выбрать из списка или вписать своё */
.field.suggest { position: relative; }
.suggest__list { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 40; max-height: 290px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); padding: 4px;
  -webkit-overflow-scrolling: touch; }
@media (min-width: 721px) { .suggest__list { min-width: 300px; } }
.suggest__item { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; text-align: left;
  padding: 6px 10px; border: 0; border-radius: 7px; background: none; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.suggest__item:hover, .suggest__item.is-active { background: var(--surface-2); }
.suggest__v { font-weight: 600; }
.suggest__h { color: var(--muted); font-size: 11.5px; line-height: 1.3; }
.suggest__more { padding: 6px 10px; font-size: 11.5px; }
@media (pointer: coarse) { .suggest__item { padding: 9px 12px; font-size: 14px; } }

/* выбор месяца и года (дата выпуска): кнопка вместо ручного ввода «ММ/ГГГГ» */
.date-field { position: relative; }
.date-store { position: absolute !important; width: 1px; height: 1px; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
.date-pick { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--text); }
.date-pick svg { flex: none; color: var(--muted); }
.date-pick:hover svg { color: var(--accent); }
.date-pick__ph { color: var(--muted); opacity: 0.8; }
.date-pick__v { font-weight: 600; }
/* компьютер: всплывающая панель */
.mp { position: absolute; top: 100%; left: 0; z-index: 45; margin-top: 6px; width: 284px; padding: 10px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line-strong); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4); animation: mp-in 0.14s ease; }
  .mp.mp--right { left: auto; right: 0; }
@keyframes mp-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.mp__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.mp__nav { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font-size: 18px; cursor: pointer; }
.mp__nav:disabled { opacity: 0.3; cursor: default; }
.mp__title { border: 0; background: none; color: var(--text); font: inherit; font-size: 16px; font-weight: 700; padding: 6px 12px; border-radius: 8px; cursor: pointer; }
.mp__title:hover { background: var(--surface-2); color: var(--accent); }
.mp__title.is-static { cursor: default; }
.mp__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.mp__grid--years { grid-template-columns: repeat(4, 1fr); }
.mp__cell { padding: 10px 0; border-radius: 9px; border: 1px solid transparent; background: var(--surface-2); color: var(--text); font: inherit; font-size: 14px; font-variant-numeric: tabular-nums; cursor: pointer; transition: border-color 0.12s, background 0.12s; }
.mp__cell:hover:not(:disabled) { border-color: var(--accent); }
.mp__cell.is-now { box-shadow: inset 0 0 0 1px var(--line-strong); }
.mp__cell.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.mp__cell:disabled { opacity: 0.3; cursor: default; }
.mp__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
/* телефон: лист снизу с колёсами, как будильник iPhone */
.mp-sheet { position: fixed; inset: 0; z-index: 90; }
.mp-sheet__back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.25s; }
.mp-sheet__box { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line-strong);
  padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1); }
.mp-sheet.is-open .mp-sheet__back { opacity: 1; }
.mp-sheet.is-open .mp-sheet__box { transform: none; }
.mp-sheet__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mp-sheet__btn { border: 0; background: none; color: var(--muted); font: inherit; font-size: 16px; padding: 6px 4px; cursor: pointer; }
.mp-sheet__btn.is-main { color: var(--accent); font-weight: 700; }
.mp-sheet__wheels { position: relative; display: flex; gap: 6px; padding: 10px 18px; perspective: 700px; }
.mp-sheet__wheels::before { content: ''; position: absolute; left: 14px; right: 14px; top: calc(10px + 80px); height: 40px; border-radius: 11px; background: var(--surface-2); pointer-events: none; }
.wheel { flex: 1; position: relative; }
.wheel--month { flex: 1; }
.wheel__list { position: relative; height: 200px; overflow-y: scroll; scroll-snap-type: y mandatory; padding: 80px 0; box-sizing: border-box;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; transform-style: preserve-3d;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 30%, #000 70%, transparent); }
.wheel__list::-webkit-scrollbar { display: none; }
.wheel__item { height: 40px; line-height: 40px; text-align: center; scroll-snap-align: center; font-size: 21px; font-variant-numeric: tabular-nums; color: var(--text); user-select: none; -webkit-user-select: none; cursor: pointer; }
.wheel__item.is-on { font-weight: 700; }
.mp-sheet__clear { display: block; margin: 4px auto 14px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 14px; padding: 8px 14px; cursor: pointer; }

/* подсказки марок и моделей: найденные буквы — цветом, как в Справочнике ТХ; число записей справа */
.suggest__v mark { background: none; color: var(--accent); font-weight: 700; }
.suggest__item--row { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.suggest__n { color: var(--faint); font-family: var(--font-num); font-size: 12px; white-space: nowrap; }
.suggest__item--row .suggest__v { font-weight: 500; }

/* годы выбранной модели в выборе даты выпуска — точкой */
.mp__dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; margin-right: 2px; }
.mp__cell.has-dot, .mp__title.has-dot { position: relative; }
.mp__cell.has-dot::after, .mp__title.has-dot::after { content: ''; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--accent); }
.mp__cell.is-on.has-dot::after { background: var(--accent-ink); }
.mp__note { margin-top: 8px; padding: 7px 9px; border-radius: 8px; background: var(--accent-soft); color: var(--text); font-size: 12px; line-height: 1.35; }
.wheel__item.has-dot::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 6px; border-radius: 50%; background: var(--accent); vertical-align: middle; }
.mp-sheet__note { min-height: 20px; margin: 0 18px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.35; }

/* переключатели во всю ширину: равные плитки, без пустого «хвоста» справа */
.seg--fill { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.seg--fill label { display: flex; min-width: 0; }
.seg--fill span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; text-align: center; padding: 8px 8px; }
.seg--tiles span { flex-direction: column; gap: 1px; line-height: 1.2; min-height: 40px; padding: 6px 6px; }
.seg--tiles small { color: var(--faint); font-size: 10.5px; }
.seg--tiles input:checked + span small { color: inherit; opacity: 0.75; }
/* мощность и её единицы — в одной строке: поле + маленький переключатель л.с./кВт */
.unit-input { display: flex; gap: 6px; align-items: stretch; }
.unit-input .input { flex: 1; min-width: 0; }
.seg--unit { flex: none; display: flex; }
.seg--unit label { display: flex; }
.seg--unit span { display: flex; align-items: center; padding: 0 10px; font-size: 12.5px; }
.cf-kind { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.cf-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cf-power { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cf-hybrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.cf-hybrid__seq { min-height: 36px; }
@media (max-width: 720px) {
  .cf-kind, .cf-hybrid { grid-template-columns: 1fr; }
  .cf-power { grid-template-columns: 1fr; }
  .cf-top { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .cf-top > .field:first-child { grid-column: 1 / -1; } /* возраст — во всю ширину, цена и валюта — рядом */
  .seg--tiles span { gap: 2px; padding: 9px 4px; font-size: 13.5px; }
  .seg--tiles small { font-size: 10.5px; }
  .seg--fill span { min-height: 42px; }
  .seg--unit span { padding: 0 14px; font-size: 13.5px; }
}
/* галочка «последовательного типа» в калькуляторе авто — ячейка сетки, выровнена по полям */
.field--check { justify-content: flex-end; }
.field--check .check { min-height: 38px; font-size: 13px; color: var(--text); line-height: 1.3; }
/* настройки: широкий блок на всю строку */
.settings-wide { grid-column: 1 / -1; }
/* короткие и длинные подписи: на телефоне — короткая */
.only-m { display: none; }
@media (max-width: 720px) { .only-m { display: inline; } .only-d { display: none; } }

/* история расчётов */
.car-hist { margin-top: 12px; padding-top: 10px; padding-bottom: 10px; }
.car-hist > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; cursor: pointer; list-style: none; }
.car-hist > summary::-webkit-details-marker { display: none; }
.car-hist > summary::before { content: '›'; display: inline-block; width: 12px; color: var(--muted); font-size: 18px; line-height: 1; transition: transform 0.15s; }
.car-hist[open] > summary::before { transform: rotate(90deg); }
.car-hist__title { font-weight: 600; }
.car-hist__sub { font-size: 12px; }
.car-hist__bar { display: flex; align-items: center; gap: 10px; margin: 12px 0 8px; flex-wrap: wrap; }
.seg--sm span { padding: 5px 10px; font-size: 12px; }
.car-hist__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 8px; max-height: 520px; overflow-y: auto; overscroll-behavior: contain; }
.ch-item { display: flex; align-items: center; gap: 10px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.ch-item__img { flex: none; width: 72px; height: 50px; border-radius: 7px; object-fit: cover; background: var(--surface); }
.ch-item__img--none { display: block; border: 1px dashed var(--line-strong); }
.ch-item__main { flex: 1; min-width: 0; }
.ch-item.is-link .ch-item__main { cursor: pointer; }
.ch-item.is-link:hover { border-color: var(--line-strong); }
.ch-item__title { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-item__year { color: var(--muted); font-weight: 500; }
.ch-item__meta { margin-top: 2px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-item__meta b { color: var(--text); font-family: var(--font-num); }
.ch-item__btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: 17px; cursor: pointer; text-decoration: none; }
.ch-item__btn:hover { background: var(--surface); color: var(--text); }
.ch-item__fav.is-on { color: var(--accent); }
@media (max-width: 720px) {
  .car-hist__sub { flex-basis: 100%; }
  .car-hist__list { max-height: 60vh; }
  .ch-item__img { width: 64px; height: 46px; }
  .ch-item__btn { width: 30px; }
}
/* описание продавца */
.car-desc { margin-top: 12px; }
.car-desc .head { flex-wrap: wrap; gap: 8px; }
.car-desc__text { white-space: pre-line; font-size: 13.5px; line-height: 1.55; color: var(--text); max-height: 420px; overflow-y: auto; }
.car-hist__list > p, .car-hist__list > .notice { grid-column: 1 / -1; margin: 4px 0; }
#f_seq { grid-column: span 2; }
@media (max-width: 760px) { #f_seq { grid-column: 1 / -1; } }
.reg-note { display: block; margin-top: 2px; font-size: 12px; line-height: 1.35; }
.car-hist__who { order: -1; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.ch-name { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; max-width: 520px; }
.ch-name .field { flex: 1; min-width: 220px; }

/* кнопка «История» в шапке калькулятора и окно истории */
.car-hist-btn { margin-left: 12px; display: inline-flex; align-items: center; gap: 7px; }
#panel-link > .head .car-head__hint { margin-left: auto; }
@media (max-width: 720px) { #panel-link > .head .car-head__hint { display: none; } .car-hist-btn { margin-left: auto; } }
.hist-drawer { position: fixed; inset: 0; z-index: 90; }
.hist-drawer__back { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.2s; }
.hist-drawer__box { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border-left: 1px solid var(--line-strong); box-shadow: -18px 0 40px rgba(0, 0, 0, 0.35); padding: 16px 16px 12px;
  transform: translateX(100%); transition: transform 0.22s ease; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.hist-drawer.is-open .hist-drawer__back { opacity: 1; }
.hist-drawer.is-open .hist-drawer__box { transform: none; }
.hist-drawer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.hist-drawer__head h3 { margin: 0 0 3px; font-size: 16px; }
.hist-drawer__head .hint { font-size: 12px; }
.hist-drawer__x { flex: none; width: 34px; height: 34px; padding: 0; }
.hist-drawer .car-hist__list { flex: 1; max-height: none; grid-template-columns: 1fr; align-content: start; overflow-y: auto; padding-right: 2px; }
@media (max-width: 720px) {
  .hist-drawer__box { width: 100%; border-left: 0; padding-top: max(14px, env(safe-area-inset-top)); }
  .hist-drawer .car-hist__list { max-height: none; }
}
/* резерв прямо в калькуляторе */
.car-reserve { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.car-reserve .input { width: 72px; padding-top: 6px; padding-bottom: 6px; text-align: center; }

/* ручная правка итоговой таблицы: маленькая кнопка в углу; поля выглядят как обычные суммы */
.lines-edit { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; margin: -4px 0 -6px; min-height: 26px; }
.lines-edit .hint { font-size: 12px; margin-right: auto; }
.lines-edit__btn { width: 26px; height: 26px; border-radius: 7px; border: 1px solid transparent; background: none; color: var(--faint); font-size: 14px; line-height: 1; cursor: pointer; }
.lines-edit__btn:hover { color: var(--accent); border-color: var(--line-strong); background: var(--surface-2); }
.lines__inp { border: 0; border-bottom: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); background: transparent; color: inherit;
  font: inherit; font-weight: inherit; font-variant-numeric: tabular-nums; text-align: right; padding: 0 1px; margin: 0; width: auto; border-radius: 0; }
.lines__inp:focus { outline: none; border-bottom-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.lines__inp.is-own { color: var(--accent); }
.lines.is-editing .v { white-space: nowrap; }

/* ключи доступа для программ */
.apikey-full { font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line); word-break: break-all; user-select: all; flex: 1; min-width: 0; }
.apikey-row { padding: 8px 0; border-bottom: 1px solid var(--line); gap: 10px; }
.apikey-row:last-child { border-bottom: 0; }

.warn-inline { color: var(--warn, #f5a524); font-size: 12px; line-height: 1.35; margin-top: 2px; }

/* отправка клиенту в Telegram (мини-приложение) */
.tgsend > summary { gap: 8px; align-items: center; }
.tgsend > summary svg { width: 18px; height: 18px; flex: none; }
.tgs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.tgs__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tgs__tab { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 8px; border: 0; border-radius: 9px; background: transparent;
  color: var(--muted); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.tgs__tab svg { width: 18px; height: 18px; flex: none; }
.tgs__tab small { font-weight: 400; opacity: .8; }
.tgs__tab.is-on { background: var(--accent); color: var(--accent-ink); }
.tgs__file { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.tgs__doc { width: 42px; height: 50px; flex: none; border-radius: 8px; display: grid; place-items: end center; padding-bottom: 7px; position: relative;
  background: linear-gradient(160deg, #3a2a14, #1c1a17); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent); font-size: 10.5px; font-weight: 700; letter-spacing: .04em; }
.tgs__doc::before { content: ''; position: absolute; top: 9px; left: 9px; right: 9px; height: 2px; background: currentColor; opacity: .5; box-shadow: 0 6px 0 currentColor, 0 12px 0 currentColor; }
.tgs__fileinfo { display: grid; gap: 2px; min-width: 0; flex: 1; }
.tgs__fileinfo b { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgs__fileinfo small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgs__state { font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.tgs__state.is-ok { color: var(--up); }
.tgs__state.is-err { color: var(--down); white-space: normal; }
.tgs__text { font-family: inherit; line-height: 1.45; resize: vertical; min-height: 240px; white-space: pre-wrap; }
.tgs__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.tgs__send { width: 100%; justify-content: center; min-height: 48px; font-size: 15.5px; gap: 8px; }
.tgs__send svg { width: 18px; height: 18px; }
.tgs__send { display: flex; align-items: center; }
.tgs__send .spin { border-color: rgba(0, 0, 0, .25); border-top-color: var(--accent-ink); }
.tgs__foot { margin: -6px 0 0; }
.tgs__actions { display: grid; gap: 8px; }
.tgs__send--alt { background: var(--surface); }
/* пост клиенту от своего имени («Telegram для бизнеса»): список чатов, нажатие — отправка через 3 с */
.tgs__chats { display: grid; gap: 8px; }
.tgs__chatsHead { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tgs__chatsHead b { font-size: 14px; }
.tgs__list { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.tgs__chat { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: background-color .2s, border-color .2s; }
.tgs__chat:hover:not(:disabled) { border-color: var(--line-strong); }
.tgs__chat:disabled { opacity: .5; cursor: not-allowed; }
.tgs__ava { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 700;
  background: var(--accent-soft); color: var(--accent); }
.tgs__who { display: grid; gap: 1px; min-width: 0; flex: 1; }
.tgs__who b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgs__who small { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tgs__go { flex: none; font-size: 13px; font-weight: 600; padding: 6px 10px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tgs__chat:disabled .tgs__go { background: var(--surface-2); color: var(--muted); }
.tgs__chat.is-sending { border-color: var(--accent); }
.tgs__chat.is-sending .tgs__go { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tgs__chat.is-sent .tgs__go { background: transparent; color: var(--up); box-shadow: inset 0 0 0 1px currentColor; }
.tgs__q { min-height: 38px; }
.tgs__me { color: var(--muted); font-size: 12.5px; margin-top: -4px; }
.tgs__how { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.45; }
.tgs__how ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
:root[data-theme='light'] .tgs__doc { background: linear-gradient(160deg, #fff4e6, #ffe9cf); }

/* справочник ТХ: отчёт о чтении файла */
.td-report { margin: -4px 0 8px; }
.td-report > summary { cursor: pointer; }
.td-report ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; }

/* длинная надпись на кнопке («Собираю PDF…») не растягивает форму шире экрана */
.offer__form .btn, .tgs .btn { white-space: normal; text-align: center; }
.offer__form > *, .offer__row > * { min-width: 0; }
.offer__ready { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 12px; border-radius: 10px;
  border: 1px solid color-mix(in srgb, var(--up) 40%, transparent); background: var(--tint-ok); }
.offer__readyName { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 100%; }
.offer__readyBtns { display: flex; gap: 8px; }
.offer__go { display: flex; flex-wrap: wrap; gap: 8px; }
.offer__go .btn { flex: 1 1 160px; justify-content: center; }
.offer__prep { display: flex; align-items: center; gap: 6px; min-height: 18px; }
.offer__prep.is-ok { color: var(--up); }
.offer__prep.is-err { color: var(--down); }

/* какие фото идут в КП: галочка на фото и число */
.car-photos__kp { position: absolute; left: 4px; bottom: 4px; display: inline-flex; align-items: center; gap: 3px; padding: 0 6px; min-height: 22px; font-size: 11px;
  background: rgba(0, 0, 0, 0.62); color: #fff; border-color: rgba(255, 255, 255, 0.2); }
.car-photos__kp svg { color: var(--accent); }
.car-photos__kp[aria-pressed='false'] { color: rgba(255, 255, 255, 0.7); text-decoration: line-through; }
.car-photos__kp[aria-pressed='false'] svg { display: none; }
@media (pointer: coarse) { .car-photos__kp { min-height: 28px; padding: 0 8px; } }
.car-photos figure.is-off img, .car-photos figure.is-extra img { opacity: 0.35; filter: grayscale(0.6); }
.car-photos figure.is-extra .car-photos__num { background: rgba(0, 0, 0, 0.45); color: var(--muted); }
.kp-count { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.kp-count__ctl { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-count__ctl .btn { min-width: 34px; justify-content: center; }

/* оплата по инвойсу: порядок оплаты и выгода против ВТБ */
.pay { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.pay__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.pay__head h4 { margin: 0; font-size: 14px; font-weight: 600; }
.pay__vtb summary { cursor: pointer; color: var(--muted); font-size: 13px; line-height: 1.4; }
.pay__vtb .lines { margin-top: 8px; color: var(--muted); }
.pay__benefit { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: var(--tint-ok); border: 1px solid color-mix(in srgb, var(--up) 40%, transparent); }
.pay__benefit > div { display: grid; gap: 2px; font-weight: 600; font-size: 14px; }
.pay__benefit b { font-size: 20px; color: var(--up); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay__benefit.is-neg { background: var(--tint-err); border-color: color-mix(in srgb, var(--down) 40%, transparent); }
.pay__benefit.is-neg b { color: var(--down); }
.pay__benefit .hint { font-weight: 400; font-size: 12px; }

/* элементы нового (стеклянного) оформления — в прежнем дизайне скрыты; см. glass.css */
.tab__ico, .brand__logo, #navToggle, .nav-menu, .seg__ind { display: none; }
.brand__hub::before { content: '· '; }
/* смена темы: мягкая смена цветов (где браузер умеет View Transitions — плавное перетекание всей страницы) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.6s; animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
html.theme-anim, html.theme-anim *, html.theme-anim *::before, html.theme-anim *::after { transition: background-color 0.6s ease, color 0.6s ease, border-color 0.6s ease, fill 0.6s ease !important; }
/* смена темы на телефоне: короткое затухание в цвет новой темы (app.js) */
.theme-dip { position: fixed; left: 0; right: 0; top: -25vh; height: calc(100lvh + 50vh); z-index: 9999; pointer-events: none; opacity: 0;
  transition: opacity 0.17s ease-out; }
.theme-dip.is-on { opacity: 0.88; }
.theme-dip:not(.is-on) { transition: opacity 0.34s ease-in-out; }

/* ---------- новые авто · Autohome ---------- */
.ah-pick__row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ah-pick__url { flex: 1 1 320px; }
.ah-pick__or { margin: 6px 0 -2px; padding-top: 12px; border-top: 1px solid var(--line); }
/* каталог: поиск, буквы, марки плитками, модели карточками */
.ah-cat { display: flex; flex-direction: column; gap: 10px; }
.ah-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 46px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); }
.ah-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ah-search input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font: inherit; font-size: 15px; color: var(--text); padding: 10px 0; }
.ah-letters { display: flex; flex-wrap: wrap; gap: 4px; }
.ah-letter { min-width: 30px; height: 30px; padding: 0 6px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: 600 13px var(--font-ui); cursor: pointer; transition: background-color 0.2s, border-color 0.2s, color 0.2s; }
.ah-letter:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.ah-letter.is-empty { opacity: 0.3; cursor: default; }
.ah-brands { max-height: 420px; overflow-y: auto; overscroll-behavior: contain; padding: 2px 4px 4px 0; scroll-behavior: smooth; }
.ah-lgroup { display: grid; grid-template-columns: 34px 1fr; gap: 6px 8px; padding: 8px 0; border-top: 1px solid var(--line); }
.ah-lgroup:first-child { border-top: 0; }
.ah-lgroup__l { margin: 6px 0 0; font-size: 18px; font-weight: 800; color: var(--accent); text-transform: none; letter-spacing: 0; text-align: center; }
.ah-brandgrid, .ah-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.ah-brand, .ah-model { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 8px 34px 8px 11px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color 0.2s, background-color 0.2s, transform 0.2s; min-width: 0; }
.ah-brand b, .ah-model b { font-size: 13.5px; font-weight: 650; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-brand span, .ah-model span { font-size: 11.5px; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-brand em { position: absolute; right: 9px; top: 9px; font-style: normal; font-size: 10.5px; color: var(--faint); font-family: var(--font-num); }
.ah-model { padding-right: 11px; }
.ah-model em { font-style: normal; font-size: 11px; color: var(--faint); margin-top: 2px; }
.ah-model.is-off { opacity: 0.6; }
.ah-brand:hover, .ah-model:hover { border-color: var(--accent); transform: translateY(-1px); }
.ah-brand.is-on, .ah-model.is-on { border-color: var(--accent); background: var(--accent-soft); }
.ah-cat__crumbs { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ah-cat__brand { margin: 0; font-size: 18px; font-weight: 750; color: var(--text); text-transform: none; letter-spacing: 0; }
.ah-cat__brand span { font-size: 13px; font-weight: 500; color: var(--muted); }
.ah-cat__off { margin-top: 10px; }
.ah-cat__off > summary { cursor: pointer; margin-bottom: 8px; }
/* модель */
/* окно: фото, характеристики, сравнение */
.ah-drawer .hist-drawer__box { width: min(1040px, 100%); }
.ah-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.ah-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ah-chip { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; font: inherit; font-size: 12.5px; }
.ah-chip.is-on { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.ah-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ah-grid a { display: block; border-radius: 10px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; }
.ah-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ah-grid a.is-broken { display: none; }
.ah-sp__group { margin: 8px 0 2px; }
.ah-sp { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
.ah-sp dd { text-align: left; white-space: normal; overflow-wrap: anywhere; font-family: var(--font-ui); }
.ah-cmp table { min-width: 100%; border-collapse: separate; border-spacing: 0; }
.ah-cmp th, .ah-cmp td { padding: 8px 10px; vertical-align: top; text-align: left; font-size: 13px; white-space: normal; min-width: 150px; border-bottom: 1px solid var(--line); }
.ah-cmp th { position: sticky; top: 0; background: var(--pop, var(--surface)); z-index: 2; }
.ah-cmp th b { display: block; font-size: 13.5px; }
.ah-cmp .ah-cmp__p { position: sticky; left: 0; z-index: 1; background: var(--pop, var(--surface)); color: var(--muted); min-width: 170px; max-width: 220px; }
.ah-cmp th.ah-cmp__p { z-index: 3; }
.ah-cmp__g td { font-weight: 750; color: var(--text); background: var(--surface-2); position: sticky; left: 0; }
.ah-cmp tr.is-diff td:not(.ah-cmp__p) { background: var(--accent-soft); }
.ah-cmp__key td b { font-family: var(--font-num); }
.ah-cmp__total { color: var(--accent); }
@media (max-width: 720px) {
  .ah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ah-brandgrid, .ah-models { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ah-lgroup { grid-template-columns: 24px 1fr; }
  .ah-brands { max-height: 360px; }
}

/* обязательный выбор типа гибрида: вписана 30-минутная мощность ЭД, а тип не выбран */
.field.is-need > span:first-child, .field-need { color: var(--down, #e5484d); }
.field.is-need .seg { outline: 1.5px solid var(--down, #e5484d); outline-offset: 2px; border-radius: 12px; }
select.is-need { border-color: var(--down, #e5484d) !important; }
.field-need { display: block; margin-top: 4px; font-size: 12px; }
.field-need[hidden] { display: none; }

/* стрелка выпадающих списков: своя, с отступом от края (системная стояла вплотную к рамке).
   !important — темы и новый дизайн задают фон списка сокращённым background и иначе стёрли бы стрелку */
select.input:not([multiple]) {
  -webkit-appearance: none; appearance: none; padding-right: 34px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a8f98' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important; background-position: right 12px center !important; background-size: 12px 12px !important;
}
.hint.field-need { color: var(--down, #e5484d); }

/* ---------- новые авто · модель (переделано 16.11.2026) ----------
   Шапка модели с главным фото · карточки комплектаций с галочкой «Выбрать» · нижняя панель выбора ·
   окно фото (все цвета, разделы, галочки, повтор ракурсов) · окно «КП для клиента». Компьютер и телефон. */
.ah-model__tx { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ah-model__tx select { width: auto; min-width: 140px; }
.ah-pairall { flex-basis: 100%; margin-top: 2px; }
.ah-pairall select { width: 100%; }
.ah-year--off { opacity: 0.45; }
.ah-warn { color: var(--warn, #c77700); }
.ah-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--accent); color: var(--accent-ink); font-size: 11.5px; font-weight: 700; margin-left: 4px; }
.ah-sw { width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.45); display: inline-block; flex: none; }
.ah-sw--lg { width: 30px; height: 30px; }

/* шапка модели */
.ah-hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; padding: 16px; margin-top: 14px; align-items: stretch; }
/* фото — по ширине своей колонки и в пропорции 4:3; align-self: start — иначе сетка тянет его по высоте правой колонки
   (много цветов), а пропорция растягивает и ширину — фото наезжает на текст */
.ah-hero__media { position: relative; align-self: start; width: 100%; min-width: 0; border-radius: 18px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; display: grid; place-items: center; }
.ah-hero__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ah-hero__ph { color: var(--muted); font-size: 13px; }
.ah-hero__info { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: 4px 4px 2px 0; }
.ah-hero__brand { font-size: 12px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ah-hero__title { margin: -6px 0 0; font-size: 32px; line-height: 1.1; font-weight: 800; letter-spacing: -0.02em; color: var(--text); text-transform: none; }
.ah-hero__meta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ah-hero__link { font-size: 13px; color: var(--muted); text-decoration: none; margin-left: 4px; }
.ah-hero__link:hover { color: var(--accent); }
.ah-hero__colors { display: flex; gap: 6px 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.ah-hero__c { display: inline-flex; align-items: center; gap: 6px; }
.ah-hero__more { color: var(--faint); }
.ah-hero__ctrl { display: flex; gap: 10px 18px; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px solid var(--line); }
.ah-hero__actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.ah-note { margin: 10px 4px 0; font-size: 12.5px; line-height: 1.45; }
.ah-year-h { margin: 22px 4px 2px; font-size: 15px; color: var(--text); text-transform: none; letter-spacing: 0; font-weight: 750; display: flex; gap: 8px; align-items: center; }

/* карточка комплектации */
.ah-specs { display: grid; gap: 12px; margin-top: 8px; padding-bottom: 70px; }
.ah-spec { position: relative; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); overflow: hidden; transition: border-color 0.25s, box-shadow 0.25s; }
.ah-spec.is-focus { box-shadow: 0 0 0 2px var(--accent); }
.ah-spec.is-sel { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.ah-spec__top { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 16px 18px 6px; }
.ah-selck { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding-top: 2px; user-select: none; }
.ah-selck input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ah-selck__box { width: 26px; height: 26px; border-radius: 9px; border: 1.5px solid var(--line-strong); background: var(--surface-2); display: grid; place-items: center; transition: background 0.2s, border-color 0.2s, transform 0.15s; }
.ah-selck__box::after { content: ''; width: 11px; height: 6px; border: 2.4px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px) scale(0); transition: transform 0.18s; }
.ah-selck input:checked + .ah-selck__box { background: var(--accent); border-color: var(--accent); }
.ah-selck input:checked + .ah-selck__box::after { transform: rotate(-45deg) translate(1px, -1px) scale(1); }
.ah-selck input:focus-visible + .ah-selck__box { box-shadow: 0 0 0 3px var(--accent-soft); }
.ah-selck:active .ah-selck__box { transform: scale(0.94); }
.ah-selck__txt { font-size: 10.5px; color: var(--muted); }
.ah-spec__title { min-width: 0; }
.ah-spec__tags { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.ah-tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; background: var(--accent); color: var(--accent-ink); }
.ah-tag--soft { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.ah-tag--off { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); }
.ah-spec__name { margin: 0; font-size: 19px; font-weight: 750; color: var(--text); text-transform: none; letter-spacing: -0.01em; line-height: 1.25; }
.ah-spec__cn { font-size: 12px; }
.ah-spec__rrp { text-align: right; display: flex; flex-direction: column; gap: 2px; }
.ah-spec__rrp small, .ah-stat small, .ah-res small { font-size: 11px; color: var(--muted); }
.ah-spec__rrp b { font-size: 21px; font-family: var(--font-num); font-weight: 750; white-space: nowrap; }
.ah-spec__stats { display: flex; flex-wrap: wrap; gap: 0; padding: 6px 18px 14px 58px; }
.ah-stat { display: flex; flex-direction: column; gap: 2px; padding: 4px 18px 4px 0; margin-right: 18px; border-right: 1px solid var(--line); }
.ah-stat:last-child { border-right: 0; margin-right: 0; }
.ah-stat b { font-size: 14px; font-weight: 650; font-family: var(--font-num); white-space: nowrap; }
.ah-stat b span { color: var(--muted); font-weight: 500; }
.ah-cdots { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 1px; }
.ah-cdots__sep { width: 1px; height: 16px; background: var(--line-strong); margin: 0 4px; }
.ah-cdot { position: relative; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; transition: transform 0.15s; }
.ah-cdot .ah-sw { width: 18px; height: 18px; }
.ah-cdot:hover { transform: scale(1.15); }
.ah-cdot em { position: absolute; right: 0; top: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.ah-calc { padding: 14px 18px 16px; border-top: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 12px; }
.ah-spec__inputs { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px 10px; }
.ah-spec__pair { grid-column: span 2; }
.ah-spec__actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ah-res { display: flex; gap: 10px 22px; align-items: flex-end; flex-wrap: wrap; padding: 12px 14px; border-radius: 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.ah-res.is-busy { background: none; border-style: dashed; align-items: center; }
.ah-res__main { display: flex; flex-direction: column; }
.ah-res__total { font-size: 26px; font-family: var(--font-num); font-weight: 800; color: var(--accent); line-height: 1.1; }
.ah-res__parts { display: flex; gap: 6px 18px; flex-wrap: wrap; }
.ah-res__parts span { display: flex; flex-direction: column; }
.ah-res__parts b { font-family: var(--font-num); font-size: 14px; }
.ah-res__note { flex-basis: 100%; }

/* нижняя панель выбора */
.ah-bar { position: sticky; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 6; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; width: max-content; max-width: 100%;
  margin: -56px auto 0; padding: 8px 8px 8px 16px; border-radius: 999px; background: var(--pop, var(--surface)); border: 1px solid var(--line-strong);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6); }
.ah-bar[hidden] { display: none; }
.ah-bar__info { font-size: 13px; color: var(--muted); margin-right: 4px; }
.ah-bar__info b { color: var(--text); font-family: var(--font-num); }
.ah-bar__x { width: 32px; padding: 0; }

/* окно фото */
.ah-drawer .hist-drawer__box { width: min(1120px, 100%); }
.ah-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 10px; padding: 4px 2px 10px; }
.ah-drawer[data-kind="studio"] .ah-drawer__body, .ah-drawer[data-kind="kp"] .ah-drawer__body { padding-bottom: 0; }
.ah-st { display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.ah-st__top { display: flex; flex-direction: column; gap: 8px; }
.ah-cols { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: start; }
.ah-cols__l { font-size: 12px; color: var(--muted); padding-top: 9px; }
.ah-cols__list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.ah-col { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; transition: border-color 0.2s, background 0.2s; }
.ah-col .ah-sw { width: 20px; height: 20px; }
.ah-col:hover { border-color: var(--line-strong); }
.ah-col.is-on { border-color: var(--accent); background: var(--accent-soft); }
.ah-col__n { font-size: 11.5px; color: var(--muted); font-family: var(--font-num); }
.ah-col__n b { color: var(--accent); }
.ah-sides { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); align-self: flex-start; }
.ah-side { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 0; border-radius: 10px; background: none; color: var(--muted); font: inherit; font-size: 14px; font-weight: 650; cursor: pointer; transition: background 0.2s, color 0.2s; }
.ah-side em { font-style: normal; font-weight: 500; font-size: 12px; color: var(--faint); }
.ah-side b { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 11.5px; display: inline-grid; place-items: center; }
.ah-side.is-on { background: var(--surface); color: var(--text); box-shadow: 0 1px 0 var(--line-strong), 0 6px 16px -10px rgba(0, 0, 0, 0.5); }
.ah-side:disabled { opacity: 0.45; cursor: default; }
.ah-col.is-off { opacity: 0.5; cursor: default; border-style: dashed; }
.ah-st__next { display: flex; flex-direction: column; gap: 8px; padding: 14px; margin-top: 4px; border-radius: 16px; border: 1px dashed var(--line-strong); }
.ah-st__nextc { display: flex; gap: 6px; flex-wrap: wrap; }
.ah-st__bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.ah-st__cur { display: flex; flex-direction: column; min-width: 0; }
.ah-st__cur b { font-size: 15px; }
.ah-copy { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12.5px; }
.ah-copy.is-off { color: var(--faint); }
.ah-copy__l { color: var(--muted); margin-right: 2px; }
.ah-copy__c { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 999px; border: 1px dashed var(--line-strong); background: none; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; }
.ah-copy__c:hover { border-color: var(--accent); }
.ah-copy__c.is-on { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.ah-copy__c.is-on::after { content: '✓'; color: var(--accent); font-weight: 700; }
.ah-st__wait { padding: 30px 0; text-align: center; }
.ah-st__sec { display: flex; flex-direction: column; gap: 8px; }
.ah-st__h { display: flex; gap: 8px; align-items: center; position: sticky; top: 0; z-index: 2; padding: 6px 0; background: var(--pop, var(--surface)); }
.ah-st__h b { font-size: 14px; }
.ah-st__h .btn { margin-left: auto; }
.ah-st__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ah-ph { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); aspect-ratio: 4 / 3; cursor: pointer; outline: none; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 0.15s, transform 0.15s; }
.ah-ph img { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity 0.2s, transform 0.25s; }
.ah-ph:hover img { transform: scale(1.03); }
.ah-ph:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.ah-ph.is-on { box-shadow: 0 0 0 3px var(--accent); }
.ah-ph.is-broken { display: none; }
.ah-ph__ck { position: absolute; top: 7px; right: 7px; width: 22px; height: 22px; border-radius: 7px; background: rgba(0, 0, 0, 0.45); border: 1.5px solid rgba(255, 255, 255, 0.85); display: grid; place-items: center; }
.ah-ph.is-on .ah-ph__ck { background: var(--accent); border-color: var(--accent); }
.ah-ph.is-on .ah-ph__ck::after { content: ''; width: 9px; height: 5px; border: 2.2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.ah-ph__n { position: absolute; left: 7px; bottom: 7px; min-width: 20px; height: 18px; padding: 0 5px; border-radius: 6px; background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 11px; font-family: var(--font-num); display: grid; place-items: center; }
.ah-ph__zoom { position: absolute; right: 7px; bottom: 7px; width: 26px; height: 26px; border-radius: 8px; background: rgba(0, 0, 0, 0.55); color: #fff; text-decoration: none; display: grid; place-items: center; font-size: 14px; opacity: 0; transition: opacity 0.15s; }
.ah-ph:hover .ah-ph__zoom, .ah-ph:focus-within .ah-ph__zoom { opacity: 1; }
@media (hover: none) { .ah-ph__zoom { opacity: 0.9; } }
.ah-st__foot { position: sticky; bottom: 0; z-index: 3; display: flex; gap: 8px; align-items: center; margin-top: auto; padding: 10px 0 2px; background: var(--pop, var(--surface)); border-top: 1px solid var(--line); }
.ah-st__sum { font-size: 13px; color: var(--muted); }
.ah-st__sum b { color: var(--text); font-family: var(--font-num); }

/* окно «КП для клиента» */
.ah-drawer[data-kind="kp"] .hist-drawer__box { width: min(720px, 100%); }
.ah-kp { display: flex; flex-direction: column; gap: 12px; }
.ah-kp__sec { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); }
.ah-kp__sec h4 { margin: 0; font-size: 14px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 700; }
.ah-kp__sec h4 .hint { font-weight: 400; }
.ah-kp__trims { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ah-kp__trim { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 6px 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.ah-kp__trim > div { display: flex; flex-direction: column; min-width: 0; }
.ah-kp__trim b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ah-kp__sum { color: var(--accent); font-family: var(--font-num); }
.ah-kp__colors { display: flex; gap: 6px 14px; flex-wrap: wrap; font-size: 13px; }
.ah-kp__c { display: inline-flex; gap: 6px; align-items: center; }
.ah-kp__c b { font-family: var(--font-num); color: var(--muted); }
.ah-kp__thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); gap: 5px; }
.ah-kp__thumbs img, .ah-kp__more { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; background: var(--surface); }
.ah-kp__more { display: grid; place-items: center; font-size: 13px; color: var(--muted); }
.ah-kp__row { display: flex; gap: 8px; flex-wrap: wrap; }
.ah-kp__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 10px; }
.ah-kp__go { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

@media (max-width: 900px) {
  .ah-hero { grid-template-columns: 1fr; gap: 14px; padding: 12px; }
  .ah-hero__media { aspect-ratio: 16 / 10; }
  .ah-hero__title { font-size: 26px; }
}
@media (max-width: 720px) {
  .ah-spec { border-radius: 18px; }
  .ah-spec__top { grid-template-columns: auto minmax(0, 1fr); padding: 14px 14px 4px; gap: 10px 12px; }
  .ah-spec__rrp { grid-column: 2; text-align: left; flex-direction: row; align-items: baseline; gap: 8px; }
  .ah-spec__rrp b { font-size: 18px; }
  .ah-spec__name { font-size: 17px; }
  .ah-spec__stats { display: grid; grid-template-columns: 1fr 1fr; padding: 6px 14px 12px; gap: 10px 12px; }
  .ah-stat { padding: 0; margin: 0; border-right: 0; }
  .ah-stat--colors { grid-column: 1 / -1; }
  .ah-calc { padding: 12px 14px 14px; }
  .ah-spec__inputs { grid-template-columns: 1fr 1fr; }
  .ah-spec__pair { grid-column: 1 / -1; }
  .ah-spec__actions .spacer { display: none; }
  .ah-spec__actions .btn { flex: 1 1 auto; }
  .ah-bar { width: auto; border-radius: 20px; left: 0; right: 0; margin: -56px 0 0; padding: 10px; justify-content: center; }
  .ah-bar__info { flex-basis: 100%; text-align: center; }
  .ah-cols { grid-template-columns: 1fr; gap: 4px; }
  .ah-cols__l { padding-top: 0; }
  .ah-st__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .ah-st__foot .btn { flex: 1 1 auto; }
  .ah-kp__trim { grid-template-columns: minmax(0, 1fr) auto; }
  .ah-kp__trim > :nth-child(2) { grid-row: 2; grid-column: 1; }
  /* ТПО и НДС в шапке модели — две одинаковые «таблетки» рядом: подпись слева, тумблер справа */
  .ah-hero__ctrl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 12px; }
  .ah-hero__ctrl .switch { flex-direction: row-reverse; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px;
    padding: 8px 10px 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); font-size: 14px; line-height: 1.2; color: var(--text); }
  .ah-hero__ctrl .switch + .switch { border-top: 1px solid var(--line); }
  .ah-hero__ctrl .switch:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
  .ah-st__foot { gap: 6px; }
  .ah-st__sum { flex: none; font-size: 12.5px; }
  .ah-st__sum .ah-warn { display: none; }
  .ah-st__foot .spacer { display: none; }
  .ah-wide { display: none; }
  .ah-st__foot .btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ah-hero__actions .btn { flex: 1 1 auto; }
}
/* поле поправлено вручную (РРЦ на один расчёт, итог для КП) — подсвечено */
.ah-calc .field.is-edited .input { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ah-calc .field.is-edited > span { color: var(--accent); }

/* «Опубликовать в каталог»: в расчёте — вместо «Отправить клиенту в Telegram», в истории — значок на каждой записи */
.catpub { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.catpub__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.catpub__btn.is-busy { cursor: progress; opacity: 0.85; }
.catpub__btn .spin { width: 16px; height: 16px; }
.catpub__ok { margin: 0; font-size: 13.5px; color: var(--up, #2fbf71); font-weight: 600; }
.catpub__err, .catpub__hint { margin: 0; }
.ch-item__pub svg { width: 17px; height: 17px; }
.ch-item__pub:hover { color: var(--accent); }
.ch-item__pub.is-busy { cursor: progress; }
.ch-item__pub.is-busy .spin { width: 14px; height: 14px; }
.ch-item__pub.is-done { width: auto; min-width: 32px; padding: 0 7px; color: var(--up, #2fbf71); }
.ch-item__pub em { font-style: normal; font-size: 11.5px; font-weight: 700; font-family: var(--font-num); }

/* ---------- новые авто: поля карточки блоками «Цена · Двигатель и мощность · Для КП», платежи итога вручную, анимации ---------- */
.ah-form { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.35fr) minmax(0, 1fr); gap: 10px; }
.ah-fg { display: grid; grid-template-columns: 1fr; gap: 8px; align-content: start; padding: 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.ah-fg--power { grid-template-columns: 1fr 1fr; }
.ah-fg__wide { grid-column: 1 / -1; }
.ah-fg__h { grid-column: 1 / -1; margin: 0 0 2px; font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ah-fg__h .hint { text-transform: none; letter-spacing: 0; font-weight: 500; }
.ah-fg .field > span { font-size: 12px; }
.ah-pay:empty { display: none; }
.ah-pay { display: flex; flex-direction: column; gap: 4px; padding: 9px 11px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent); font-size: 12.5px; animation: ah-fade 0.25s ease; }
.ah-pay__row { display: flex; justify-content: space-between; gap: 10px; }
.ah-pay__row span { color: var(--muted); }
.ah-pay__row b { font-family: var(--font-num); white-space: nowrap; }
.ah-pay__note { color: var(--muted); font-size: 12px; }
@media (max-width: 1100px) {
  .ah-form { grid-template-columns: 1fr 1fr; }
  .ah-fg--power { grid-column: 1 / -1; grid-row: 1; }
}
@media (max-width: 720px) {
  .ah-form { grid-template-columns: 1fr; }
  .ah-fg { padding: 10px; }
  .ah-fg--power { grid-row: auto; }
  .ah-fg--price { grid-template-columns: 1fr 1fr; }
  .ah-fg--kp { grid-template-columns: 1fr; }
}

/* анимации: ползунки ТПО/НДС доезжают мягко, галочки «пружинят», выбор фото и смена цвета — плавно */
@keyframes ah-pop { 0% { transform: scale(0.82); } 55% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes ah-fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ah-hero .switch__track::after { transition: transform 0.26s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.2s; }
.ah-hero .switch__track { transition: background-color 0.25s ease, box-shadow 0.25s ease; }
.ah-selck input:checked + .ah-selck__box { animation: ah-pop 0.3s ease; }
.ah-ph.is-on .ah-ph__ck { animation: ah-pop 0.26s ease; }
.ah-ph { transition: box-shadow 0.18s ease, transform 0.18s ease; }
.ah-ph:active { transform: scale(0.97); }
.ah-st__body { animation: ah-fade 0.28s ease; }
.ah-spec { transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease; }
.ah-side, .ah-col, .ah-copy__c, .ah-cdot { transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease; }
.ah-side:active, .ah-col:active, .ah-copy__c:active { transform: scale(0.96); }
.ah-copy__c.is-on { animation: ah-pop 0.28s ease; }
@media (prefers-reduced-motion: reduce) {
  .ah-selck input:checked + .ah-selck__box, .ah-ph.is-on .ah-ph__ck, .ah-st__body, .ah-copy__c.is-on, .ah-pay { animation: none; }
}

/* курс расчёта в «Новых авто»: Rapira / ЦБ +1,5% — переключатель-«таблетка» */
.ah-rate { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }
.ah-rate__l { font-size: 12px; color: var(--muted); padding: 0 8px 0 10px; }
.ah-rate label { position: relative; cursor: pointer; }
.ah-rate input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ah-rate span:not(.ah-rate__l) { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; color: var(--muted); transition: background-color 0.22s ease, color 0.22s ease, box-shadow 0.22s ease; }
.ah-rate input:checked + span { background: var(--accent); color: var(--accent-ink); box-shadow: 0 4px 12px -6px var(--accent); }
.ah-rate input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
@media (max-width: 720px) {
  .ah-rate { grid-column: 1 / -1; justify-content: space-between; }
  .ah-rate label { flex: 1; }
  .ah-rate span:not(.ah-rate__l) { width: 100%; justify-content: center; }
}

/* окно «КП для клиента»: цены каждой комплектации можно поправить — итог и три платежа */
.ah-kp__trim > .ah-kpp, .ah-kpp { grid-column: 1 / -1; display: grid; grid-template-columns: 1.15fr 1fr 1fr 1fr; gap: 6px 8px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line); align-items: end; }
.ah-kpp__f { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ah-kpp__f span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ah-kpp__f .input { min-height: 36px; padding: 6px 10px; font-size: 14px; font-family: var(--font-num); }
.ah-kpp__f--total .input { font-weight: 700; color: var(--accent); }
.ah-kpp__reset { grid-column: 1 / -1; justify-self: start; font-size: 12px; display: none; }
.ah-kpp.is-edited .ah-kpp__reset { display: inline; }
.ah-kpp.is-edited .input { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.ah-warn-input { border-color: var(--down, #e5484d) !important; }
@media (max-width: 720px) { .ah-kp__trim > .ah-kpp, .ah-kpp { grid-template-columns: 1fr 1fr; } }
.ah-kp__state { display: inline-flex; align-items: baseline; gap: 2px; white-space: nowrap; min-width: 0; }
/* подробный расчёт комплектации — свёрнут под итогом, правится как в «Калькуляторе авто» */
.ah-det { flex-basis: 100%; min-width: 0; border-top: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); padding-top: 8px; }
.ah-det > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 600; user-select: none; -webkit-user-select: none; min-height: 28px; }
.ah-det > summary::-webkit-details-marker { display: none; }
.ah-det > summary::before { content: ''; flex: none; width: 7px; height: 7px; margin: 0 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .25s ease; opacity: .7; }
.ah-det[open] > summary::before { transform: rotate(45deg); }
.ah-det > summary:hover .ah-det__t { color: var(--accent); }
.ah-det__state { margin-left: auto; font-weight: 400; }
.ah-det__state .hint { font-size: 12px; }
.ah-det__body { padding-top: 6px; animation: ahDetIn .28s ease; }
.ah-det__bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 2px; }
.ah-det__bar .hint { font-size: 12px; }
.ah-det .lines { font-size: 13px; }
.ah-det .lines > div { padding: 6px 0; }
.ah-det .lines .v { white-space: nowrap; }
@keyframes ahDetIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ah-det__body { animation: none; } .ah-det > summary::before { transition: none; } }
.ah-det__t { white-space: nowrap; }
@media (max-width: 520px) { .ah-det__state .hint { display: none; } }
/* подарки в КП — «пилюли» с галочкой (форма обычного КП и окно КП по модели) */
.kp-gifts { display: flex; flex-direction: column; gap: 7px; }
.kp-gifts__h { font-size: 13px; font-weight: 600; }
.kp-gifts__h .hint { font-weight: 400; }
.kp-gifts__list { display: flex; flex-wrap: wrap; gap: 6px; }
.kp-gift { position: relative; display: inline-flex; cursor: pointer; }
.kp-gift input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.kp-gift span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; line-height: 1.2; transition: background .2s ease, border-color .2s ease, color .2s ease; user-select: none; -webkit-user-select: none; }
.kp-gift span::before { content: '+'; width: 10px; text-align: center; font-weight: 700; color: var(--muted); }
.kp-gift:hover span { border-color: var(--line-strong, var(--line)); }
.kp-gift input:checked + span { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: var(--accent-soft); color: var(--accent); }
.kp-gift input:checked + span::before { content: '✓'; color: var(--accent); }
.kp-gift input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* ключ каталога: обычное текстовое поле, но символы скрыты (type="password" Safari принимает за логин и подставляет старое) */
.input--secret { -webkit-text-security: disc; text-security: disc; }
.input--secret:focus { -webkit-text-security: none; text-security: none; }

/* ---- правка названий авто: ✎ у названия, окно «Как писать», «Словарь названий» в Настройках ---- */
.name-edit { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-left: 8px; padding: 0; vertical-align: middle;
  border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; line-height: 1; cursor: pointer;
  opacity: 0.55; transition: opacity 0.15s, color 0.15s, border-color 0.15s; }
.name-edit:hover, .name-edit:focus-visible { opacity: 1; color: var(--accent); border-color: var(--accent); }
.ah-hero__title .name-edit { width: 30px; height: 30px; font-size: 15px; }
.name-dlg .hist-drawer__box { width: min(520px, 100%); }
.name-dlg__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 14px; padding: 8px 2px 10px; }
.name-dlg__src { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.name-dlg__src small { color: var(--muted); font-size: 11.5px; }
.name-dlg__src b { font-size: 16px; font-weight: 650; word-break: break-word; }
.name-dlg__words { display: flex; flex-direction: column; gap: 8px; }
.name-dlg__words h4 { margin: 4px 0 0; font-size: 13.5px; }
.name-dlg__words .hint { margin: 0; }
.name-dlg__w { display: grid; grid-template-columns: minmax(90px, 40%) 1fr; gap: 10px; align-items: center; }
.name-dlg__w > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.name-dlg__w b { font-size: 15px; font-weight: 650; }
.name-dlg__w small { font-size: 11px; }
.name-dlg__btns { gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.names-add { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.names-h { margin: 6px 0 4px; font-size: 13px; color: var(--muted); font-weight: 650; }
.names-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; max-height: 340px; overflow-y: auto; }
.names-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 5px 4px 5px 8px;
  border-radius: var(--radius); }
.names-list li:hover { background: var(--hover); }
.names-list li b { font-weight: 600; word-break: break-word; }
.names-list li span { word-break: break-word; }
.names-arrow { color: var(--faint); }
@media (max-width: 560px) {
  .name-dlg__w { grid-template-columns: 1fr; gap: 4px; }
  .names-add { grid-template-columns: 1fr; }
}

/* «Новые авто»: загрузка модели — отдельная карточка-заготовка под каталогом, в форме будущей шапки */
.ah-loading { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 22px; padding: 16px; margin-top: 14px; align-items: stretch;
  animation: ah-load-in 0.35s ease both; }
.ah-loading__media { height: auto; min-height: 220px; border-radius: calc(var(--radius) + 6px); }
.ah-loading__info { display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 4px 0; }
.ah-loading__msg { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.ah-loading__msg .spin { width: 14px; height: 14px; }
.ah-loading__info .hint { margin-top: -4px; }
.ah-loading__chips { display: flex; gap: 8px; margin-top: auto; }
.ah-loading__chips .skel { flex: 1; height: 54px; border-radius: var(--radius); }
.ah-load-err { margin-top: 14px; }
@keyframes ah-load-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .ah-loading { grid-template-columns: 1fr; gap: 14px; padding: 12px; }
  .ah-loading__media { min-height: 170px; }
}
@media (prefers-reduced-motion: reduce) { .ah-loading { animation: none; } }
