/* CRM автосалона — мини-приложение. Дизайн-система: ТЗ, раздел 8 + макеты на холсте.
   Правило: все кнопки — таблетки (радиус = половина высоты), включая сегменты и «Выдан / Отказ». */

@font-face {
  font-family: "Medeo Sans";
  src: url("fonts/MedeoSansVariable.woff2") format("woff2"),
       url("https://cdn.jsdelivr.net/npm/medeo-font/dist/fonts/medeo-sans/MedeoSansVariable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Medeo Mono";
  src: url("fonts/MedeoMonoVariable.woff2") format("woff2"),
       url("https://cdn.jsdelivr.net/npm/medeo-font/dist/fonts/medeo-mono/MedeoMonoVariable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #EEEEEC;
  --card: #FFFFFF;
  --dark: #121212;
  --muted: #5F5F5B;
  --soft: #F3F3F1;
  --line: #E6E6E3;
  --field: #F7F7F5;
  --sans: "Medeo Sans", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Medeo Mono", ui-monospace, "SFMono-Regular", "Roboto Mono", Menlo, "DejaVu Sans Mono", monospace;
  --r-card: 28px;
  --safe-b: env(safe-area-inset-bottom, 0px);

  --new: #2F6FEB;      --new-bg: #E4EDFF;      --new-tx: #1D4DB3;
  --work: #7B5CF0;     --work-bg: #EEE9FF;     --work-tx: #4E35B8;
  --pay: #12A594;      --pay-bg: #DCF5F1;      --pay-tx: #0B6A5E;
  --issued: #1E9E52;   --issued-bg: #DFF3E5;   --issued-tx: #17673A;
  --refused: #E0402F;  --refused-bg: #FDE6E2;  --refused-tx: #A12C12;
  --amber-bg: #FDF0DC; --amber-tx: #8A4A08;
  --paid: #1E8A47;
  --over-bg: #FDE6E2;  --over-tx: #A12C12;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--dark); }
body {
  font-family: var(--sans); font-size: 15px; line-height: 1.35;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.screen { padding: 14px 16px calc(120px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.screen.with-actions { padding-bottom: calc(150px + var(--safe-b)); }

/* --- типографика --- */
.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; color: var(--muted); }
.title-xl { font-size: 34px; font-weight: 700; letter-spacing: -0.035em; line-height: 1.04; margin: 4px 0 0; overflow-wrap: anywhere; }
.title-l { font-size: 26px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.title-m { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.sub { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.num-xl { font-size: 44px; font-weight: 700; letter-spacing: -0.045em; line-height: 1; }
.num-l { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; overflow-wrap: anywhere; }
.bold { font-weight: 700; }
.muted { color: var(--muted); }
.red { color: var(--over-tx); }
.amber { color: var(--amber-tx); }
mark { background: #FFE58A; color: inherit; border-radius: 4px; padding: 0 2px; }

/* --- раскладка --- */
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 10px; }
.gap-s { height: 8px; } .gap-m { height: 14px; } .gap-l { height: 22px; }
.divider { height: 1px; background: rgba(0,0,0,.08); margin: 14px 0; }
.dark .divider { background: rgba(255,255,255,.12); }

/* --- карточки --- */
.card { background: var(--card); border-radius: var(--r-card); padding: 18px; }
.card + .card, .card + .section, .section + .card { margin-top: 12px; }
.card.dark { background: var(--dark); color: #fff; }
.card.soft { background: #F7F7F5; }
.card.overdue { border: 1.5px solid #F2B8AE; }
.card.tap { cursor: pointer; }
.section { margin: 22px 2px 10px; }
.label { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: var(--muted); margin-bottom: 4px; }
.dark .label { color: #9A9A96; }

/* --- кнопки: только таблетки --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: none;
  font-weight: 600; font-size: 15px; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .08s ease, opacity .15s ease;
}
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.dark { background: var(--dark); color: #fff; }
.btn.light { background: var(--soft); color: var(--dark); }
.btn.white { background: #fff; color: var(--dark); }
.btn.outline { background: transparent; color: inherit; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }
.btn.danger { color: var(--refused-tx); background: #fff; }
.btn.red { background: var(--refused); color: #fff; }
.btn.green-tx { background: #fff; color: var(--issued-tx); }
.btn.block { width: 100%; }
.btn.lg { min-height: 52px; font-size: 16px; }
.btn.sm { min-height: 36px; padding: 0 14px; font-size: 13.5px; }
.icon-btn {
  width: 44px; height: 44px; min-height: 44px; padding: 0; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; border: none; cursor: pointer;
}
.icon-btn.white { background: #fff; color: var(--dark); }
.icon-btn.dark { background: var(--dark); color: #fff; }
.icon-btn.soft { background: var(--soft); }
.icon-btn.ghost-dark { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.2); }
.icon { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.s { width: 16px; height: 16px; }

/* --- плашки --- */
.no { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; background: var(--soft); border-radius: 999px; padding: 4px 10px; display: inline-block; white-space: nowrap; }
.dark .no { background: rgba(255,255,255,.1); }
.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 4px 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 999px; display: inline-block; flex: none; }
.s-new { background: var(--new-bg); color: var(--new-tx); } .d-new { background: var(--new); }
.s-in_work { background: var(--work-bg); color: var(--work-tx); } .d-in_work { background: var(--work); }
.s-payment_order { background: var(--pay-bg); color: var(--pay-tx); } .d-payment_order { background: var(--pay); }
.s-issued { background: var(--issued-bg); color: var(--issued-tx); } .d-issued { background: var(--issued); }
.s-refused { background: var(--refused-bg); color: var(--refused-tx); } .d-refused { background: var(--refused); }
.pay-unpaid { color: var(--muted); }
.pay-prepaid { color: var(--amber-tx); }
.pay-paid { color: var(--paid); }
.tag-prepaid { background: var(--amber-bg); color: var(--amber-tx); }
.tag-paid { background: #DFF3E5; color: var(--paid); }
.tag-unpaid { background: var(--soft); color: var(--muted); }

/* --- трекер этапа --- */
.track { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 12px 0 10px; }
.track span { height: 4px; border-radius: 4px; background: #E9E9E6; }

.stepper { display: grid; grid-template-columns: repeat(4, 1fr); position: relative; }
.stepper::before { content: ""; position: absolute; left: 12.5%; right: 12.5%; top: 11px; height: 2px; background: #E6E6E3; }
.stepper .fill { position: absolute; left: 12.5%; top: 11px; height: 2px; }
.step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; font-size: 11.5px; color: var(--muted); }
.step i { width: 24px; height: 24px; border-radius: 999px; background: #E6E6E3; display: flex; align-items: center; justify-content: center; color: #fff; }
.step.cur { color: var(--dark); font-weight: 700; }

/* --- фильтры и сегменты --- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 15px; border-radius: 999px; background: #fff; border: none; white-space: nowrap; font-size: 14px; font-weight: 500; cursor: pointer; flex: none; }
.chip.active { background: var(--dark); color: #fff; }
.seg { display: flex; gap: 4px; background: var(--soft); border-radius: 999px; padding: 4px; }
.seg.white { background: #fff; }
.seg button { flex: 1; min-height: 40px; border: none; border-radius: 999px; background: transparent; font-weight: 600; font-size: 14px; cursor: pointer; padding: 0 8px; white-space: nowrap; }
.seg button.active { background: var(--dark); color: #fff; }

/* --- поля ввода --- */
.field { display: block; }
.field + .field, .grid2 + .field, .field + .grid2 { margin-top: 12px; }
.field > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 14px;
  background: var(--field); border: 1px solid var(--line); font-size: 16px; outline: none;
}
.input:focus { border-color: #BDBDB8; background: #fff; }
textarea.input { min-height: 90px; resize: vertical; }
.input.big { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.input.error { border-color: var(--refused); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 16px; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--dark); }
.search input { border: none; outline: none; background: transparent; flex: 1; font-size: 16px; min-width: 0; }
.search.soft { box-shadow: none; background: var(--soft); }

/* --- нижнее меню --- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); z-index: 20;
  display: flex; gap: 4px; padding: 6px; background: var(--dark); border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
}
.nav a { height: 44px; min-width: 50px; border-radius: 999px; color: #9A9A96; display: flex; align-items: center; justify-content: center; gap: 7px; padding: 0 12px; font-weight: 600; font-size: 14px; }
.nav a.active { background: #fff; color: var(--dark); padding: 0 16px; }

.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; padding: 12px 16px calc(14px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 70%, rgba(238,238,236,0)); display: flex; gap: 10px; max-width: 560px; margin: 0 auto; }
.actionbar .btn { flex: 1; }
.actionbar .btn.grow2 { flex: 1.6; }

/* --- шторка, тост --- */
.overlay { position: fixed; inset: 0; background: rgba(18,18,18,.42); z-index: 40; animation: fade .15s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; background: #fff; border-radius: 28px 28px 0 0;
  padding: 10px 16px calc(18px + var(--safe-b)); max-height: 88vh; overflow-y: auto; max-width: 560px; margin: 0 auto;
  animation: up .2s ease; }
.handle { width: 40px; height: 4px; border-radius: 4px; background: #E0E0DC; margin: 0 auto 14px; }
@keyframes up { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(86px + var(--safe-b)); z-index: 60;
  background: var(--dark); color: #fff; border-radius: 999px; padding: 12px 18px; font-size: 14px; font-weight: 600;
  max-width: calc(100% - 32px); text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: var(--refused); }

/* --- статус-шторка --- */
.opt { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 20px; cursor: pointer; }
.opt + .opt { margin-top: 4px; }
.opt.sel { background: var(--soft); }
.radio { width: 22px; height: 22px; border-radius: 999px; border: 2px solid #C9C9C4; flex: none; display: flex; align-items: center; justify-content: center; }
.opt.sel .radio, .radio.on { border-color: var(--dark); }
.opt.sel .radio::after, .radio.on::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: var(--dark); }
.close-box { border-radius: 22px; padding: 12px; margin-top: 10px; background: var(--soft); }
.btn.outcome-issued { background: var(--issued-bg); color: var(--issued-tx); }
.btn.outcome-refused { background: var(--refused-bg); color: var(--refused-tx); }
.btn.outcome-issued.on { box-shadow: inset 0 0 0 2px var(--issued); }
.btn.outcome-refused.on { box-shadow: inset 0 0 0 2px var(--refused); }

/* --- задачи --- */
.tl { display: grid; grid-template-columns: 52px 1fr; gap: 10px; align-items: start; }
.tl + .tl { margin-top: 10px; }
.tl .time { font-weight: 700; font-size: 15px; padding-top: 16px; letter-spacing: -0.01em; }
.tl .time.done { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.task { background: #fff; border-radius: 22px; padding: 14px; display: flex; gap: 12px; align-items: flex-start; }
.task.done { background: #F7F7F5; }
.task.done .ttl { text-decoration: line-through; color: var(--muted); }
.task.next { background: var(--dark); color: #fff; }
.task .ttl { font-weight: 700; overflow-wrap: anywhere; }
.check { width: 24px; height: 24px; border-radius: 999px; border: 2px solid #C9C9C4; flex: none; display: flex; align-items: center; justify-content: center; cursor: pointer; background: transparent; padding: 0; }
.check.on { background: var(--issued); border-color: var(--issued); color: #fff; }
.task.next .check { border-color: rgba(255,255,255,.5); }
.hint { border: 1.5px dashed #CFCFCA; border-radius: 22px; padding: 14px; display: flex; gap: 12px; color: var(--muted); font-size: 14px; }

/* --- фото --- */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ph { position: relative; aspect-ratio: 3 / 4; border-radius: 16px; overflow: hidden; background: #D6D6D2; cursor: pointer; border: 2px solid transparent; }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph.sel { border-color: var(--dark); }
.ph .cap { position: absolute; left: 8px; right: 8px; bottom: 6px; font-size: 11px; color: #3a3a37; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ph .tick { position: absolute; left: 8px; top: 8px; width: 22px; height: 22px; border-radius: 999px; border: 2px solid #fff; background: rgba(255,255,255,.6); }
.ph.sel .tick { background: var(--dark); border-color: var(--dark); display: flex; align-items: center; justify-content: center; color: #fff; }
.strip { display: flex; gap: 8px; overflow-x: auto; margin: 0 -18px; padding: 0 18px; scrollbar-width: none; }
.strip .ph { width: 104px; flex: none; }
.viewer { position: fixed; inset: 0; background: #000; z-index: 70; display: flex; align-items: center; justify-content: center; }
.viewer img { max-width: 100%; max-height: 100%; }

/* --- история --- */
.hist { display: grid; grid-template-columns: 46px 14px 1fr; gap: 8px; align-items: start; font-size: 14px; }
.hist + .hist { margin-top: 12px; }
.hist .when { font-weight: 700; font-size: 13px; line-height: 1.2; }
.hist .when small { display: block; font-weight: 500; color: var(--muted); font-size: 11px; }
.hist .bullet { width: 8px; height: 8px; border-radius: 999px; background: var(--dark); margin-top: 5px; }
.hist .bullet.c { background: #fff; border: 2px solid var(--dark); }
.hist .bubble { background: var(--soft); border-radius: 14px; padding: 8px 10px; }
.hist .meta { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

/* --- состояния --- */
.empty { text-align: center; color: var(--muted); padding: 30px 10px; font-size: 14px; }
.skeleton { background: linear-gradient(90deg, #e6e6e3, #f1f1ef, #e6e6e3); background-size: 200% 100%; animation: sh 1.2s infinite; border-radius: var(--r-card); height: 120px; }
.skeleton + .skeleton { margin-top: 12px; }
@keyframes sh { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.banner { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 6px 6px 6px 16px; margin-top: 12px; font-size: 13.5px; cursor: pointer; }
.banner .grow { line-height: 1.25; }

/* ===== дополнения под экраны ===== */
.row.wrap { flex-wrap: wrap; gap: 8px; }
.small { font-size: 13px; }
.big { font-size: 17px; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clip2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.icon.xs { width: 13px; height: 13px; stroke-width: 2.6; }
.label.section { margin: 22px 2px 10px; }
.label.red, .label.section.red { color: var(--refused-tx); }
.text-btn { background: none; border: none; font-weight: 600; font-size: 15px; padding: 10px 4px; cursor: pointer; white-space: nowrap; min-height: 44px; }
.text-btn.small { font-size: 13px; color: var(--muted); font-weight: 500; min-height: 36px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.icon-spacer { width: 44px; height: 44px; flex: none; }
.no-lg { font-size: 13px; padding: 10px 16px; background: #fff; }

/* главный экран */
.hero { padding: 20px; border-radius: 30px; }
.hero-num { font-size: 64px; font-weight: 700; letter-spacing: -0.05em; line-height: .9; }
.hero-cap { font-size: 15px; line-height: 1.25; color: #DADAD6; }
.pill-outline { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; font-size: 10.5px; color: #CFCFCB;
  border-radius: 999px; padding: 6px 10px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); white-space: nowrap; }
.counters { display: grid; grid-template-columns: repeat(3, 1fr); }
.counter { background: none; border: none; color: inherit; text-align: left; padding: 2px 12px; cursor: pointer; min-height: 44px; min-width: 0; }
.counter:first-child { padding-left: 0; }
.counter + .counter { border-left: 1px solid rgba(255,255,255,.12); }
.counter .label { font-size: 9.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnum { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; }
.banner .sm-btn { width: 36px; height: 36px; min-height: 36px; }
.lead-name { font-size: 22px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; margin: 12px 0 3px; overflow-wrap: anywhere; }
.money { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.money.amber { color: var(--amber-tx); }
.pay { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.pill-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px;
  background: var(--soft); font-size: 14px; font-weight: 500; }
.pill-info span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pill-info.over { background: var(--over-bg); color: var(--over-tx); }
.pill-info.muted { color: var(--muted); }

/* поиск */
.hint-line { margin: 12px 2px 0; font-size: 13px; }
.small-line { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-top: 8px; flex-wrap: wrap; }
.tx-new { color: var(--new-tx); } .tx-in_work { color: var(--work-tx); } .tx-payment_order { color: var(--pay-tx); }
.tx-issued { color: var(--issued-tx); } .tx-refused { color: var(--refused-tx); }

/* карточка клиента */
.car-big { font-size: 16px; margin-top: 4px; }
.stepper-card { padding: 18px 10px 16px; }
.step { min-width: 0; }
.step i { position: relative; z-index: 1; }
.phone-big { font-size: 25px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; overflow-wrap: anywhere; }
.muted-dark { color: #8E8E8A; }
.bday-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.12); font-size: 14px; }
.bday-soon { background: #F5B547; color: var(--dark); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: 700; }
.remind { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 26px; padding: 10px 10px 10px 16px; min-height: 64px; }
.remind .grow { min-width: 0; }
.remind .small { font-size: 12.5px; }
.remind.late { box-shadow: inset 0 0 0 1.5px #F2B8AE; }
.kv { row-gap: 14px; }
.kv .val { font-size: 15.5px; font-weight: 500; overflow-wrap: anywhere; }
.note { background: var(--soft); border-radius: 18px; padding: 12px 14px; margin-top: 16px; font-size: 14.5px; overflow-wrap: anywhere; }
.num-pre { font-size: 20px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.photos.square .ph { aspect-ratio: 1 / 1; }
.ph .cap { background: linear-gradient(transparent, rgba(255,255,255,.75)); padding-top: 10px; left: 0; right: 0; bottom: 0; padding: 10px 8px 6px; }
.ph-empty { width: 80%; aspect-ratio: 3/4; background: #3a3a37; border-radius: 16px; color: #ccc; display: flex; align-items: center; justify-content: center; }
.viewer-x { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: 14px; }
.viewer-bar { position: absolute; left: 0; right: 0; bottom: calc(18px + var(--safe-b)); display: flex; gap: 10px; justify-content: center; }
.hist .bcol { position: relative; display: flex; justify-content: center; align-self: stretch; }
.hist:not(:last-child) .bcol::after { content: ""; position: absolute; top: 16px; bottom: -14px; left: 50%; border-left: 1.5px dashed #CFCFCA; }
.hist .bullet { position: relative; z-index: 1; }
.comment-input { min-height: 44px; border-radius: 999px; padding: 10px 16px; flex: 1; min-width: 0; }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 14px; border: none; background: none; border-radius: 999px; font-size: 16px; font-weight: 600; cursor: pointer; text-align: left; }
.menu-item:active { background: var(--soft); }
.btn.green { background: var(--issued); color: #fff; }

/* задачи */
.ttl-l { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin: 12px 0 4px; overflow-wrap: anywhere; }
.tmeta { display: block; font-family: var(--mono); text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; color: var(--muted); margin-top: 4px; }
.task.next .tmeta { color: #9A9A96; }
.task.late { box-shadow: inset 0 0 0 1.5px #F2B8AE; }
.task .grow { min-width: 0; }
.task .check { margin-top: 1px; }
.chip.outline { box-shadow: inset 0 0 0 1.5px #E0E0DC; background: #fff; }
.chip.outline.active { box-shadow: none; background: var(--dark); color: #fff; }
.hidden-date { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.time-row { margin-top: 12px; gap: 12px; }
.time-input { width: 150px; min-height: 44px; padding: 8px 12px; text-align: center; }
.preview { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 18px; padding: 12px 14px; margin-top: 12px; }
.picked { display: flex; align-items: center; gap: 10px; }
.mono-no { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; }
.opt .grow { min-width: 0; }

/* форма */
.voice-tip { display: flex; align-items: center; gap: 14px; padding: 14px 16px; font-size: 14.5px; line-height: 1.35; border-radius: 26px; }
.voice-tip .icon-btn { flex: none; }
.form-card .label { margin-bottom: 10px; }
.form-card .field { margin-top: 14px; }
.form-card > .label + .field { margin-top: 0; }
.form-card .grid2 { margin-top: 14px; }
.grid2 > .field, .form-card .grid2 > .field { margin-top: 0 !important; }
.dup { display: flex; align-items: center; gap: 10px; background: var(--amber-bg); color: var(--amber-tx); border-radius: 18px; padding: 10px 10px 10px 14px; margin-top: 12px; }
.dup .grow { min-width: 0; }

/* журнал */
.jr { padding: 14px 16px; }
.jr-text { margin-top: 8px; font-size: 14.5px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.money.green { color: var(--paid); }
.num-l.range { font-size: 28px; }
.tmeta .dot { margin-right: 6px; vertical-align: 1px; }

/* машины в пути */
.ship-line { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 13.5px; font-weight: 600; color: var(--pay-tx); }
.ship-line span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route { margin-top: 14px; }
.rt { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; position: relative; padding-bottom: 14px; }
.rt:last-child { padding-bottom: 0; }
.rt:not(:last-child)::after { content: ""; position: absolute; left: 10px; top: 22px; bottom: 0; width: 2px; background: #E6E6E3; }
.rt.done:not(:last-child)::after { background: var(--pay); }
.rt-dot { width: 22px; height: 22px; border-radius: 999px; border: 2px solid #D5D5D0; background: #fff; display: flex; align-items: center; justify-content: center; color: #fff; position: relative; z-index: 1; }
.rt.done .rt-dot { background: var(--pay); border-color: var(--pay); }
.rt.cur .rt-dot { background: #fff; border: 6px solid var(--dark); }
.rt-label { font-size: 15px; color: var(--muted); padding-top: 1px; }
.rt.done .rt-label { color: var(--dark); }
.rt.cur .rt-label { color: var(--dark); font-weight: 700; }
.rt-date { font-size: 13px; color: var(--muted); padding-top: 2px; white-space: nowrap; }
.ship-driver { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 12px 12px 14px; background: var(--soft); border-radius: 18px; }
.ship-hist { margin-top: 12px; }
.ship-hist summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 8px 0; list-style: none; }
.ship-hist summary::-webkit-details-marker { display: none; }
.ship-hist summary::before { content: "▸ "; color: var(--muted); }
.ship-hist[open] summary::before { content: "▾ "; }
.ship-hist-row { display: grid; grid-template-columns: 112px 1fr; gap: 8px; font-size: 13.5px; padding: 4px 0; }

/* документы */
.docs { padding: 6px 8px 6px 14px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; cursor: pointer; }
.doc-row + .doc-row { border-top: 1px solid var(--line); }
.doc-row .grow { min-width: 0; }
.doc-ico { width: 40px; height: 40px; border-radius: 12px; flex: none; color: #fff; font-family: var(--mono); font-size: 10.5px;
  font-weight: 700; letter-spacing: .04em; display: flex; align-items: center; justify-content: center; }
.icon-btn.ghost { background: transparent; color: var(--muted); }
.menu-item.danger-item { color: var(--refused-tx); }

/* ===== сайт: вход через Telegram (правка 22.11) ===== */
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.dim { color: #CFCFCB; }
.push { margin-left: auto; }
.login { min-height: 100vh; display: flex; flex-wrap: wrap; gap: 24px; padding: 28px; max-width: 1440px; margin: 0 auto; }
.login.center { align-items: center; justify-content: center; }
.login-brand { flex: 1 1 520px; background: var(--dark); color: #fff; border-radius: 32px; padding: 44px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; }
.mono.on-dark { color: #D5D5D1; font-size: 12px; }
.outline-pill { border-radius: 999px; padding: 7px 12px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.28); }
.login-title { margin: 0; font-size: 50px; line-height: 1.04; letter-spacing: -0.035em; max-width: 620px; }
.login-lead { margin: 18px 0 0; font-size: 18px; line-height: 1.5; color: #D5D5D1; max-width: 600px; }
.login-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.login-tag { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 15px; font-weight: 500; }
.login-side { flex: 1 1 420px; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 460px; background: #fff; border-radius: 32px; padding: 40px; display: flex; flex-direction: column; gap: 20px; }
.login-card.narrow { max-width: 520px; }
.login-h { margin: 0; font-size: 32px; letter-spacing: -0.03em; line-height: 1.1; }
.login-p { margin: 10px 0 0; font-size: 16px; line-height: 1.5; }
.login-card .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--muted); }
.steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
.steps li span { flex: none; width: 28px; height: 28px; border-radius: 999px; background: var(--soft); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.steps li em { font-style: normal; padding-top: 4px; }
.lock-note { gap: 12px; color: var(--muted); }
.lock-note p { margin: 0; line-height: 1.45; }
.spinner { width: 22px; height: 22px; border-radius: 999px; border: 3px solid #E3E3DF; border-top-color: var(--dark); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn.denied { background: var(--refused-bg); color: var(--refused-tx); cursor: default; }
.idbox { display: flex; align-items: center; gap: 10px; background: var(--soft); border-radius: 18px; padding: 12px 12px 12px 16px; }
.idbox code { font-family: var(--mono); font-size: 18px; }
@media (max-width: 720px) {
  .login { padding: 16px; gap: 14px; }
  .login-brand { padding: 24px; border-radius: 28px; gap: 18px; }
  .login-title { font-size: 30px; }
  .login-lead { font-size: 15px; margin-top: 10px; }
  .login-tags { display: none; }
  .login-card { padding: 24px; border-radius: 28px; gap: 16px; }
  .login-h { font-size: 26px; }
}

/* ===== сайт на компьютере: боковое меню, список рядом с карточкой ===== */
.ava { width: 40px; height: 40px; border-radius: 999px; background: var(--dark); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.ava.big { width: 52px; height: 52px; font-size: 20px; }
.ava-btn { font-weight: 700; font-size: 16px; }
.desk { display: flex; gap: 20px; padding: 20px; max-width: 1600px; margin: 0 auto; align-items: flex-start; }
.side { position: sticky; top: 20px; flex: 0 0 248px; background: #fff; border-radius: 28px; padding: 18px; display: flex; flex-direction: column; gap: 6px; height: calc(100vh - 40px); }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 18px; }
.brand .ava { width: 36px; height: 36px; font-size: 14px; }
.brand b { font-size: 16px; letter-spacing: -0.01em; }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { display: flex; align-items: center; gap: 12px; height: 46px; padding: 0 14px; border-radius: 999px; font-weight: 500; font-size: 15px; cursor: pointer; }
.side-nav a:hover { background: var(--soft); }
.side-nav a.active { background: var(--dark); color: #fff; }
.side-nav .cnt { margin-left: auto; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.side-nav a.active .cnt { color: #BDBDB8; }
.side-me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 10px 6px 10px 10px; border-radius: 22px; background: var(--soft); }
.desk-main { flex: 1; min-width: 0; }
.desk-main > .screen { max-width: 760px; margin: 0; padding: 4px 4px 60px; }
.desk-main > .screen.desk-chat { max-width: none; }
.desk-home { display: flex; flex-direction: column; gap: 14px; }
.desk-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.desk-top .title-l { font-size: 30px; }
.search-pill { flex: 1 1 260px; max-width: 420px; display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 999px; background: #fff; border: none; color: var(--muted); font-size: 15px; cursor: pointer; }
.desk-hero { background: var(--dark); color: #fff; border-radius: 28px; padding: 18px 22px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.desk-hero .hero-num { font-size: 52px; }
.desk-counters { display: flex; flex-wrap: wrap; }
.desk-counters .counter { padding: 2px 20px; border-left: 1px solid rgba(255,255,255,.14); }
.desk-counters .counter:first-child { padding-left: 20px; }
.desk-home .banner { margin-top: 0; }
.split { display: flex; gap: 18px; align-items: flex-start; }
.split-list { flex: 1 1 0; min-width: 0; padding-bottom: 60px; }
.split-list .chips { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
.split-detail { flex: 0 0 440px; max-width: 46%; position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; border-radius: 28px; scrollbar-width: thin; }
.split-detail > .screen { padding: 0 0 8px; max-width: none; }
.split-detail .actionbar { position: sticky; bottom: 0; left: auto; right: auto; max-width: none; padding: 12px 0 4px; margin: 0; }
.split-detail .screen.with-actions { padding-bottom: 0; }
.detail-empty { background: #fff; border-radius: 28px; padding: 40px 24px; text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.detail-empty .icon { width: 28px; height: 28px; }
.rows > * + * { margin-top: 8px; }
.lrow { background: #fff; border-radius: 22px; padding: 12px 14px 12px 16px; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .9fr) minmax(0, 1fr) 44px; gap: 12px; align-items: center; cursor: pointer; }
.lrow:hover { box-shadow: inset 0 0 0 1.5px #DADAD6; }
.lrow.sel { box-shadow: inset 0 0 0 2px var(--dark); }
.lrow-name { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-sub { color: var(--muted); font-size: 13px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.row-sub.over { color: var(--refused-tx); }
.row-sub.ship { color: var(--pay-tx); }
.lrow-status { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.lrow-money { min-width: 0; }
@media (max-width: 1240px) { .lrow { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 44px; } .lrow-status { display: none; } .split-detail { flex-basis: 400px; } }

/* шторки на компьютере — окно по центру */
@media (min-width: 1024px) {
  body.web .sheet { top: 50%; bottom: auto; left: 50%; right: auto; width: 560px; transform: translate(-50%, -50%); border-radius: 28px; max-height: 86vh; padding: 22px; animation: pop .16s ease; }
  body.web .sheet .handle { display: none; }
  body.web .toast { bottom: 28px; }
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%); } to { opacity: 1; transform: translate(-50%, -50%); } }

/* ===== помощник ===== */
.chat-screen { display: flex; gap: 18px; align-items: flex-start; padding-bottom: calc(170px + var(--safe-b)); }
.chat-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.chat-head .title-l { font-size: 30px; }
.chat-list { display: flex; flex-direction: column; gap: 10px; }
.chat-list .bubble { position: relative; max-width: 78%; border-radius: 22px; padding: 12px 14px 22px; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.chat-list .bubble.me { align-self: flex-end; background: var(--dark); color: #fff; border-bottom-right-radius: 6px; }
.chat-list .bubble.bot { align-self: flex-start; background: #fff; border-bottom-left-radius: 6px; }
.bubble .plain { white-space: pre-wrap; }
.bubble .btime { position: absolute; right: 12px; bottom: 5px; font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.bubble.me .btime { color: #9A9A96; }
.bubble .rich code { font-family: var(--mono); font-size: 13px; background: var(--soft); border-radius: 6px; padding: 1px 5px; }
.bubble .rich pre { white-space: pre-wrap; font-family: var(--mono); font-size: 13px; background: var(--soft); border-radius: 12px; padding: 10px; margin: 6px 0; }
.bubble .rich blockquote { margin: 6px 0; padding-left: 10px; border-left: 3px solid #E0E0DC; color: #3E3E3B; }
.bubble .rich a { text-decoration: underline; }
.bubble .transcript { margin-top: 8px; font-size: 13.5px; color: #CFCFCB; }
.bubble .caption { margin-top: 6px; }
.bubble .reaction { position: absolute; left: -10px; bottom: -8px; background: #fff; border-radius: 999px; padding: 2px 6px; font-size: 15px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.chat-photo { display: block; max-width: 260px; max-height: 260px; border-radius: 14px; }
.bbtns { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.bbtn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.bbtn-row .btn { flex: 1 1 auto; }
.file-chip { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.file-chip .doc-ico { width: 38px; height: 38px; border-radius: 12px; font-size: 10px; }
.player { display: flex; align-items: center; gap: 10px; min-width: 220px; }
.pbar { flex: 1; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); overflow: hidden; }
.bubble.bot .pbar { background: #E6E6E3; }
.pbar-fill { display: block; height: 100%; width: 0; background: currentColor; }
.ptime { font-family: var(--mono); font-size: 12px; color: inherit; opacity: .8; }
.typing { display: flex; gap: 5px; padding: 16px 18px !important; }
.typing i { width: 7px; height: 7px; border-radius: 999px; background: #BDBDB8; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.center-btn { align-self: center; }
.chat-empty { background: #fff; border-radius: 28px; padding: 28px 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.chat-empty .sub { max-width: 440px; margin: 0; line-height: 1.5; }
.chat-empty-ico { width: 52px; height: 52px; border-radius: 999px; background: var(--dark); color: #fff; display: flex; align-items: center; justify-content: center; }
.composer-wrap { position: fixed; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); bottom: calc(80px + var(--safe-b)); z-index: 18; }
.desk-chat .composer-wrap { position: sticky; left: auto; transform: none; width: auto; bottom: 16px; margin-top: 6px; }
.composer { background: #fff; border-radius: 28px; padding: 8px; display: flex; align-items: flex-end; gap: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.10); }
.composer textarea { flex: 1; border: none; resize: none; font-size: 16px; line-height: 1.4; min-height: 44px; max-height: 200px; padding: 11px 4px; outline: none; background: transparent; }
.mic { width: 48px; height: 48px; border-radius: 999px; background: var(--dark); color: #fff; border: none; display: flex; align-items: center; justify-content: center; flex: none; cursor: pointer; }
.rec-panel { background: #fff; border-radius: 28px; padding: 16px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.rec-dot { width: 10px; height: 10px; border-radius: 999px; background: var(--refused); animation: blink 1s infinite; }
.rec-wave { display: flex; align-items: center; gap: 3px; height: 44px; margin: 12px 0; }
.rec-wave i { display: block; width: 4px; height: 4px; border-radius: 4px; background: var(--dark); transition: height .08s linear; }
.chat-hints { position: sticky; top: 20px; flex: 0 0 320px; display: flex; flex-direction: column; gap: 10px; }
.chat-hints .hint { display: block; border: none; background: #fff; color: var(--dark); border-radius: 22px; padding: 14px 16px; font-size: 14px; line-height: 1.45; }
.chat-hints code { font-family: var(--sans); background: var(--soft); border-radius: 8px; padding: 1px 6px; }
.chat-screen.drop .chat-col { outline: 2.5px dashed var(--dark); outline-offset: 8px; border-radius: 28px; }
.desk-chat { padding-bottom: 20px; }
@media (max-width: 1023px) { .chat-list .bubble { max-width: 88%; } }
.chips.people { margin: 0; padding: 2px 0 4px; flex-wrap: wrap; overflow: visible; }
.ro-note { display: flex; gap: 10px; align-items: flex-start; background: var(--amber-bg); color: var(--amber-tx); border-radius: 18px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.ro-note .icon { margin-top: 2px; }
.btn.static { cursor: default; opacity: .7; }
.btn.static:active { transform: none; }
.desk-main > .screen .actionbar { position: sticky; bottom: 0; left: auto; right: auto; max-width: none; margin: 0 -4px; padding: 14px 4px 16px; }
.desk-main > .screen.with-actions { padding-bottom: 0; }
.voice-tip.tap { cursor: pointer; }
.doc-row.pick .check { cursor: pointer; }
.doc-row.pick.sel { background: var(--soft); margin: 0 -10px; padding: 10px; border-radius: 16px; }
.desk-main .photos { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 1024px) { body.web .toast { bottom: 96px; } }

/* ===== вкладка «Encar» (правка 22.11, только администратор) ===== */
.vchip { display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.vchip .dot { width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.vchip.ok { background: var(--pay-bg); color: var(--pay-tx); }
.vchip.warn { background: var(--amber-bg); color: var(--amber-tx); }
.vchip.bad { background: var(--refused-bg); color: var(--refused-tx); }
.vchip.unknown { background: var(--soft); color: var(--muted); }
.import { display: flex; gap: 8px; align-items: stretch; }
.import-box { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 999px; padding: 0 6px 0 18px; box-shadow: inset 0 0 0 1.5px var(--dark); }
.import-box .input { border: none; background: transparent; padding-left: 0; min-height: 52px; }
.import-box .input:focus { background: transparent; }
.import-status { margin-top: 10px; }
.import-status:empty { display: none; }
.import-err { display: flex; gap: 8px; align-items: flex-start; background: var(--refused-bg); color: var(--refused-tx); border-radius: 18px; padding: 12px 14px; font-size: 14px; }
.banner-soft { display: flex; gap: 8px; align-items: flex-start; background: var(--amber-bg); color: var(--amber-tx); border-radius: 18px; padding: 12px 14px; font-size: 14px; margin-top: 12px; }
.rate-line { justify-content: space-between; margin-top: 12px; color: var(--muted); }
.car-row { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 22px; padding: 10px 14px 10px 10px; text-decoration: none; color: inherit; cursor: pointer; }
.car-row:hover { box-shadow: inset 0 0 0 1.5px #DADAD6; }
.car-thumb { flex: none; width: 104px; height: 72px; border-radius: 14px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.car-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.car-price { text-align: right; flex: none; }
.share-link { font-family: var(--mono); font-size: 14px; margin-top: 4px; overflow-wrap: anywhere; color: #fff; }
.ph.off img { opacity: .3; filter: grayscale(1); }
.ph-flag { position: absolute; left: 6px; top: 6px; display: inline-flex; align-items: center; gap: 4px; background: var(--dark); color: #fff; border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 600; }
.car-photos { grid-template-columns: repeat(4, 1fr); }
.photos.car-photos .ph { aspect-ratio: 4 / 3; }
.desk-main .car-photos { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.flag { display: flex; gap: 8px; align-items: flex-start; border-radius: 16px; padding: 10px 12px; font-size: 14px; }
.flag + .flag { margin-top: 8px; }
.flag.bad { background: var(--refused-bg); color: var(--refused-tx); }
.flag.warn { background: var(--amber-bg); color: var(--amber-tx); }
.flag.unknown { background: var(--soft); color: var(--muted); }
.price-sum { background: var(--dark); color: #fff; border-radius: 22px; padding: 16px 18px; }
.price-total { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.price-lines { margin-top: 10px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 8px; display: grid; gap: 4px; font-size: 14px; color: #E2E2DE; font-variant-numeric: tabular-nums; }
.price-lines > div { display: flex; justify-content: space-between; gap: 12px; }
.price-lines > div.zero { color: #8E8E89; }
.price-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.price-field > span { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.price-field small { font-weight: 400; color: var(--muted); font-size: 12px; }
.extra-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 44px; gap: 8px; align-items: center; }
.extra-row + .extra-row { margin-top: 8px; }
.kv-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.kv-row:last-of-type { border-bottom: none; }
.kv-val { display: inline-flex; align-items: center; gap: 4px; text-align: right; overflow-wrap: anywhere; font-weight: 500; }
.kv-val .icon-btn { width: 34px; height: 34px; min-height: 34px; }
.mono-val { font-family: var(--mono); letter-spacing: .04em; }
.customs { display: grid; gap: 6px; overflow-x: auto; }
.customs-row { display: grid; grid-template-columns: 88px repeat(6, minmax(52px, 1fr)); gap: 6px; align-items: center; }
.customs-row > span { font-size: 12.5px; color: var(--muted); }
.customs-row.head > span { font-family: var(--mono); font-size: 10.5px; text-align: center; }
.customs-row.head > span:first-child { text-align: left; }
.customs-row input { width: 100%; min-width: 0; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); text-align: center; font-size: 14px; outline: none; }
.customs-row input:focus { border-color: #BDBDB8; background: #fff; }
.car-grid { display: grid; gap: 12px; }
.car-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.car-col > .card { margin-top: 0; }
@media (max-width: 480px) { .price-fields { grid-template-columns: 1fr; } .car-photos { grid-template-columns: repeat(3, 1fr); } .car-row .car-price { display: none; } }
@media (min-width: 1024px) {
  .desk-main > .screen.cars-screen { max-width: 900px; }
  .desk-main > .screen.car-detail { max-width: 1240px; }
  .car-detail .car-grid { grid-template-columns: minmax(0, 1.25fr) minmax(360px, 1fr); gap: 20px; align-items: start; }
}
.ext-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.ext-line.ok { color: var(--pay-tx); }
.ext-line.warn { color: var(--amber-tx); }
.ext-line .text-btn.small { min-height: 28px; padding: 0 4px; color: var(--dark); text-decoration: underline; }
.steps-list { margin: 12px 0; padding-left: 22px; display: grid; gap: 10px; font-size: 15px; }
.steps-list code { font-family: var(--mono); font-size: 13px; background: var(--soft); border-radius: 6px; padding: 2px 6px; }
.load-steps { display: grid; gap: 4px; }
.load-step { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; color: var(--muted); }
.load-step.skip { display: none; }
.load-step.active, .load-step.done { color: var(--dark); }
.load-step.active { font-weight: 600; }
.load-step.failed { color: var(--refused-tx); }
.load-mark { flex: none; width: 24px; height: 24px; border-radius: 999px; background: var(--soft); display: inline-flex; align-items: center; justify-content: center; margin-top: -1px; }
.load-step.done .load-mark { background: var(--pay-bg); color: var(--pay-tx); }
.load-step.failed .load-mark { background: var(--refused-bg); color: var(--refused-tx); }
.load-mark .spinner { width: 18px; height: 18px; border-width: 2.5px; }
.done-head { display: flex; gap: 12px; align-items: center; }
.done-ico { width: 44px; height: 44px; border-radius: 999px; background: var(--issued); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.done-car { display: flex; gap: 12px; align-items: center; margin-top: 16px; background: var(--soft); border-radius: 18px; padding: 10px; }
.done-car img { width: 96px; height: 66px; object-fit: cover; border-radius: 12px; flex: none; }
.done-link { display: flex; align-items: center; gap: 8px; margin-top: 12px; border: 1.5px solid var(--dark); border-radius: 16px; padding: 6px 6px 6px 14px; }
.mono-link { font-family: var(--mono); font-size: 13.5px; overflow-wrap: anywhere; flex: 1; min-width: 0; }
.done-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.done-actions .btn { padding: 0 10px; }
.cd-box svg, .cd-frame svg { display: block; width: 100%; height: auto; }
.cd-box { margin-top: 8px; }
.cd-frame { max-width: 360px; margin-top: 8px; }
.dmg-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.dmg-list li { display: flex; gap: 8px; align-items: flex-start; }
.dmg-n { flex: none; width: 22px; height: 22px; border-radius: 999px; color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.dmg-n.bad { background: var(--refused); } .dmg-n.warn { background: #E8833A; }
.insp-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.insp-ph { position: relative; display: block; border-radius: 14px; overflow: hidden; background: var(--soft); aspect-ratio: 4 / 3; }
.insp-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.insp-ph span { position: absolute; left: 8px; bottom: 6px; background: rgba(18,18,18,.72); color: #fff; font-size: 11.5px; border-radius: 999px; padding: 2px 8px; }
.ph-flag.soft { background: rgba(255,255,255,.9); color: var(--dark); }
.cc-list { display: grid; gap: 8px; }
.cc-item { border-radius: 16px; padding: 10px 12px; background: var(--soft); display: grid; gap: 3px; }
.cc-item.bad { background: var(--refused-bg); } .cc-item.warn { background: var(--amber-bg); }
.cc-item .cc-tag { font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.cc-item.bad .cc-tag { color: var(--refused-tx); } .cc-item.warn .cc-tag { color: var(--amber-tx); } .cc-item.ok .cc-tag { color: var(--pay-tx); }
.korea-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; }

/* ===== «Подбор» (правка 23.11) ===== */
.pb-desk { max-width: none !important; display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.desk-main > .screen.pb-desk { max-width: 1400px; }
.pb-aside { min-width: 0; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 40px); overflow: auto; }
.pb-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.pb-item { min-width: 0; display: flex; gap: 10px; align-items: flex-start; background: #fff; border-radius: 20px; padding: 10px; text-decoration: none; color: inherit; }
.pb-item:hover { box-shadow: inset 0 0 0 1.5px #DADAD6; }
.pb-item.sel { box-shadow: inset 0 0 0 2px var(--dark); }
.pb-thumb { flex: none; width: 64px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pb-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pb-main { min-width: 0; display: flex; flex-direction: column; gap: 12px; padding-bottom: 40px; }
.pb-chat { display: flex; flex-direction: column; gap: 12px; }
.pb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; background: #fff; border-radius: 24px; padding: 14px 16px; }
.pb-empty { background: #fff; border-radius: 28px; padding: 28px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pb-empty .chat-hints { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 8px; }
.pb-empty .chip { height: auto; min-height: 38px; white-space: normal; text-align: left; padding: 8px 14px; }
.pb-progress { display: flex; gap: 10px; align-items: center; background: #fff; border-radius: 18px; padding: 12px 14px; font-size: 14px; }
.pb-progress[hidden] { display: none; }
.pb-dock { position: sticky; bottom: 0; padding: 10px 0 14px; background: linear-gradient(to top, var(--bg) 75%, rgba(238,238,236,0)); }
.pb-composer { position: static; display: flex; align-items: flex-end; gap: 8px; background: #fff; border-radius: 28px; padding: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.pb-composer textarea { flex: 1; border: none; outline: none; resize: none; font: inherit; font-size: 15.5px; padding: 10px 6px; min-height: 44px; max-height: 160px; background: transparent; }
.pb-results { display: grid; gap: 10px; }
.pb-car { display: grid; grid-template-columns: 34px 148px minmax(0, 1fr) 150px; gap: 14px; align-items: start; background: #fff; border-radius: 22px; padding: 12px; }
.pb-rank { width: 30px; height: 30px; border-radius: 999px; background: var(--dark); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.pb-car:first-child .pb-rank { background: var(--issued); }
.pb-photo { display: block; width: 148px; height: 104px; border-radius: 14px; overflow: hidden; background: var(--soft); color: var(--muted); }
.pb-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-info { min-width: 0; }
.pb-reason { margin: 8px 0 0; font-size: 14px; line-height: 1.45; }
.pb-pm { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12.5px; }
.pm.plus { color: var(--issued-tx); } .pm.minus { color: var(--refused-tx); }
.chip-s { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; background: var(--soft); font-size: 12.5px; }
.pb-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.pb-price { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pb-others { background: #fff; border-radius: 20px; padding: 12px 14px; }
.pb-others summary { cursor: pointer; font-weight: 600; }
.pb-other { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pb-other:last-child { border-bottom: none; }
.pb-other a { text-decoration: none; color: inherit; min-width: 0; }
.vchip.info { background: var(--new-bg); color: var(--new-tx); }
@media (max-width: 900px) {
  .pb-car { grid-template-columns: 30px 96px minmax(0, 1fr); }
  .pb-photo { width: 96px; height: 72px; }
  .pb-side { grid-column: 2 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; text-align: left; }
}
.pb-screen:not(.pb-desk) .pb-dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(12px + var(--safe-b)); max-width: 560px; margin: 0 auto; z-index: 15; }
.pb-screen:not(.pb-desk) { padding-bottom: calc(150px + var(--safe-b)); }

/* значок «!» справа от названия машины — есть расхождения с Encar (правка 23.11) */
.title-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.title-line > .ellipsis { min-width: 0; }
.cc-mark { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 999px; border: none; padding: 0;
  font: 800 14px/1 inherit; color: #fff; background: var(--amber, #E8833A); cursor: default; }
.cc-mark.bad { background: #E0402F; }
button.cc-mark { cursor: pointer; }
.title-line .title-xl + .cc-mark { width: 28px; height: 28px; font-size: 17px; }
/* фото, которых ещё нет на сервере */
.fill-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border-radius: 16px; padding: 10px 12px; margin: 0 0 12px; background: var(--soft); font-size: 14px; }
.fill-line.warn { background: #FDF0DC; color: #8A4A08; }
.ph-flag.warn { background: #FDF0DC; color: #8A4A08; }

/* «Подбор»: условия поиска и кнопка «Старт» (правка 23.11) */
.pb-terms { background: #fff; border-radius: 22px; padding: 14px 16px; display: grid; gap: 10px; }
.pb-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-term { display: inline-flex; flex-direction: column; gap: 1px; background: var(--soft); border-radius: 14px; padding: 6px 10px; font-size: 14px; font-weight: 600; }
.pb-term small { font-size: 11px; font-weight: 500; color: var(--muted); }
.pb-term.changed { background: #FDF0DC; box-shadow: inset 0 0 0 1.5px #F3C98A; }
.pb-changes { font-size: 14px; display: grid; gap: 2px; }
.pb-changes s { color: var(--muted); }
.pb-start-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pb-start { min-width: 132px; }
.pb-results.stale .pb-car { opacity: .62; }
.pb-terms, .pb-chat .bubble { scroll-margin-bottom: 190px; scroll-margin-top: 16px; }
.pb-screen:not(.pb-desk) .pb-terms, .pb-screen:not(.pb-desk) .pb-chat .bubble { scroll-margin-bottom: calc(210px + var(--safe-b)); }
.pb-screen:not(.pb-desk) { padding-bottom: calc(210px + var(--safe-b)) !important; }
/* «Подбор»: источники и все ссылки (правка 23.11) */
.pm-src { font-size: 11px; color: var(--muted); font-weight: 500; }
.pb-src { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 8px; }
.bubble.with-links { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pb-links-btn { display: inline-flex; align-items: center; gap: 6px; border: none; background: var(--soft); color: var(--dark); border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.pb-links-btn:hover { background: #E6E6E2; }
.pb-links { display: grid; gap: 2px; max-height: 60vh; overflow: auto; }
.pb-link { display: flex; align-items: flex-start; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.pb-link:last-child { border-bottom: none; }
.pb-link-no { flex: none; width: 24px; height: 24px; border-radius: 999px; background: var(--soft); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
/* лист осмотра сканом (правка 23.11) */
.flag.ok { background: var(--issued-bg); color: var(--issued-tx); }
.insp-ph.scan { aspect-ratio: 3 / 4; }
.insp-ph.scan img { object-fit: cover; object-position: top; }
.car-listing { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13.5px; color: var(--muted); margin-top: 6px; }
.car-listing b { color: var(--dark); font-weight: 600; }
/* ход поиска — над полем ввода: виден всегда, даже если вернулись в подбор посреди поиска */
.pb-dock .pb-progress { margin-bottom: 8px; box-shadow: 0 4px 18px rgba(0,0,0,.06); }
.pb-dock .pb-progress span:last-child { min-width: 0; }
@media (max-width: 600px) {
  .pb-head { flex-direction: column; }
  .pb-head > .row { align-self: flex-end; margin-top: -4px; }
}
/* «Подбор»: проверено N из M, «ещё 50», компьютер не в сети, карточки ссылок (правка 23.11) */
.pb-batch { background: #fff; border-radius: 20px; padding: 12px 14px; }
.pb-batch .chip.outline { height: auto; min-height: 34px; padding: 6px 12px; }
.pb-offline { width: 100%; font-size: 14px; color: var(--amber-tx); }
.pb-progress:has(.pb-offline) { background: var(--amber-bg); }
.pb-link { display: flex; align-items: flex-start; gap: 10px; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.pb-link.on { background: linear-gradient(90deg, rgba(30,158,82,.06), transparent); }
.pb-link-ph { flex: none; width: 84px; height: 62px; border-radius: 12px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; color: var(--muted); }
.pb-link-ph img { width: 100%; height: 100%; object-fit: cover; }
.pb-link-why { margin-top: 2px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pb-check { flex: none; width: 24px; height: 24px; margin-top: 18px; border-radius: 8px; border: 1.5px solid #C9C9C4; background: #fff; color: transparent; display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer; }
.pb-check[aria-checked="true"] { background: var(--issued); border-color: var(--issued); color: #fff; }
.pb-links { max-height: 62vh; overflow: auto; }
.pb-links-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 6px; }
.pb-link .btn.sm { height: 32px; }
