/* Сильвер Авто — чат-лендинг.
   Токены сняты с макета Claude Design «Silver Auto Chat v3».
   oklch() из макета переведён в hex: старые браузеры отбрасывают
   объявление с oklch целиком и теряют цвет текста. */

:root {
  --blue: #3390EC;
  --blue-dk: #2481CC;
  --blue-dkr: #1C6DB5;
  --blue-lt: #EAF4FE;
  --blue-lt2: #D6E9FB;
  --blue-pale: #C5DFF7;
  --blue-faded: #A9CFF5;
  --blue-ring: #4FA6F7;
  --blue-text: #E3F0FF;

  --ink: #192029;
  --ink-2: #414853;
  --ink-3: #4E5661;
  --ink-4: #5C646F;
  --ink-5: #616A75;
  --ink-6: #6A727D;
  --ink-7: #78818C;
  --ink-8: #7E8792;

  --line: #E3E8EE;
  --line-soft: #EEF1F4;
  --field: #F0F4F7;
  --field-line: #D5DEE8;
  --box-line: #C3CED9;

  --user-bg: #EEFFDE;
  --check: #4FAE4E;
  --online: #4FCB4A;

  --opt: rgba(35, 65, 35, 0.5);
  --opt-h: rgba(35, 65, 35, 0.66);
  --pill: rgba(40, 70, 40, 0.4);
  --pill-h: rgba(40, 70, 40, 0.55);

  --bubble-sh: 0 1px 2px rgba(0, 0, 0, 0.12);
}

* { -webkit-tap-highlight-color: rgba(51, 144, 236, 0.15); }

html, body { margin: 0; height: 100%; overflow: hidden; }

body {
  background: #fff;
  color: var(--ink);
  font-family: 'Onest', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); }
a:hover { color: var(--blue-dkr); }

button { font: inherit; }

/* ---------- каркас ---------- */

.app {
  height: 100vh;               /* база для старых браузеров */
  display: flex;
  overflow: hidden;
  background: #fff;
}
@supports (height: 100dvh) {
  .app { height: 100dvh; }     /* dvh в Chrome 70 отбрасывается вместе со строкой */
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- боковая колонка ---------- */

.sidebar {
  flex: none;
  width: 340px;
  display: none;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: #fff;
}

.sidebar__head {
  flex: none;
  height: 64px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--line-soft);
}

.sidebar__logo { height: 34px; width: auto; display: block; }

.mgr {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  margin: 8px;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
}

.mgr__ava-wrap { position: relative; flex: none; width: 56px; height: 56px; }

.mgr__ava {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: var(--blue-lt);
}

.mgr__online {
  position: absolute;
  right: 1px;
  bottom: 1px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 0 3px var(--blue);
}

.mgr__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mgr__name { font-size: 16px; font-weight: 600; line-height: 1.25; }
.mgr__role { font-size: 13px; line-height: 1.35; color: var(--blue-text); }

/* ---------- шапка ---------- */

.topbar {
  flex: none;
  min-height: 64px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.topbar__mgr { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; }

.topbar__ava {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  display: block;
  object-fit: cover;
  background: var(--blue-lt);
}

.topbar__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.topbar__name { font-size: 16px; font-weight: 600; }
.topbar__status { font-size: 13px; color: var(--blue); }

.addr { display: none; align-items: center; gap: 10px; }

.addr__ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue-lt);
  display: flex;
  align-items: center;
  justify-content: center;
}

.addr__text { display: flex; flex-direction: column; gap: 1px; }
.addr__label { font-size: 12px; color: var(--ink-5); }
.addr__value { font-size: 14px; font-weight: 500; }

.tel {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s;
}
.tel:hover { color: var(--blue); }

.tel__ico {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tel__num { display: none; }

/* ---------- полотно чата ---------- */

.chat {
  flex: 1;
  min-height: 0;
  position: relative;
  background: linear-gradient(135deg, #D9DEB0 0%, #A7CB97 40%, #8DBB8C 65%, #CED89A 100%);
}

.chat__pattern {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;   /* inset в Chrome 70 схлопывает блок */
  background-image: radial-gradient(rgba(40, 70, 30, 0.12) 1.2px, transparent 1.4px);
  background-size: 22px 22px;
  pointer-events: none;
}

.chat__scroll {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.chat__inner {
  max-width: 780px;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 20px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feed, .answers { display: flex; flex-direction: column; gap: 8px; }
.answers:empty, .feed:empty { display: none; }

.daypill {
  align-self: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--pill);
  padding: 5px 12px;
  border-radius: 999px;
}

/* ---------- облачка ---------- */

.bubble {
  box-shadow: var(--bubble-sh);
  display: flex;
  flex-direction: column;
}

.bubble--bot {
  align-self: flex-start;
  max-width: 480px;
  background: #fff;
  border-radius: 16px 16px 16px 6px;
  padding: 10px 14px 7px;
  gap: 6px;
}

.bubble--user {
  align-self: flex-end;
  max-width: 420px;
  background: var(--user-bg);
  border-radius: 16px 16px 6px 16px;
  padding: 9px 14px 7px;
  gap: 3px;
}

.bubble__p { font-size: 16px; line-height: 1.45; }
.bubble__p--bold { font-weight: 600; }

.bubble__time {
  align-self: flex-end;
  font-size: 12px;
  color: var(--ink-7);
}

.bubble__time--user {
  display: flex;
  gap: 4px;
  color: var(--check);
}

/* ---------- первое сообщение с офферами ---------- */

.hero { max-width: 640px; padding: 12px 14px 8px; gap: 12px; }

.hero__author { font-size: 14px; font-weight: 600; color: var(--blue); }

.hero__h1 {
  margin: 0;
  font-size: 26px;              /* база: clamp() старые браузеры отбрасывают */
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
}
@supports (font-size: clamp(1px, 1vw, 2px)) {
  .hero__h1 { font-size: clamp(22px, 3vw, 30px); }
}

.hero__cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.offer {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--blue-lt);
  border-radius: 12px;
  padding: 14px 14px 16px;
}

.offer--accent { background: var(--blue); color: #fff; }

.offer__blob {
  position: absolute;
  right: -34px;
  top: -34px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: var(--blue-ring);
}

.offer__badge {
  position: relative;
  align-self: flex-start;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--blue);
  color: #fff;
  padding: 4px 9px;
  border-radius: 999px;
}

.offer__badge--inv { background: #fff; color: var(--blue-dk); }

.offer__title {
  position: relative;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}

.offer__rate { display: flex; align-items: baseline; gap: 6px; }
.offer__from { font-size: 15px; font-weight: 600; color: var(--blue-dk); }

.offer__big {
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--blue-dk);
}

.offer__note {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--ink-2);
}

/* ---------- итоговая карточка ---------- */

.summary {
  align-self: flex-start;
  width: 100%;
  max-width: 480px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 16px 16px 16px 6px;
  box-shadow: var(--bubble-sh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.summary__title {
  padding: 14px 16px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue-dk);
}



/* Строка брони: что закреплено за клиентом и по какой цене. Блока нет,
   если конкретной модели в каталоге не выбрано (см. booked() во flow.js). */
.summary__booked {
  margin: 0 16px 6px;
  padding: 11px 13px;
  background: var(--blue-lt);
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--blue-dkr);
}

.summary__rows { display: flex; flex-direction: column; padding: 2px 16px 0; }

.srow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.srow__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.srow__label { font-size: 12px; color: var(--ink-6); }
.srow__value { font-size: 15px; font-weight: 600; line-height: 1.35; }

.srow__edit {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue-dk);
  background: var(--blue-lt);
  border: none;
  border-radius: 999px;
  padding: 7px 12px;
  cursor: pointer;
  transition: background .15s;
}
.srow__edit:hover { background: var(--blue-lt2); }

.summary__time {
  align-self: flex-end;
  font-size: 12px;
  color: var(--ink-7);
  padding: 6px 14px 8px;
}

/* ---------- «печатает» ---------- */

.typing {
  align-self: flex-start;
  background: #fff;
  border-radius: 16px 16px 16px 6px;
  padding: 14px 16px;
  display: flex;
  gap: 5px;
  box-shadow: var(--bubble-sh);
}

.typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--blue);
  display: block;
  animation: saDot 1.2s infinite ease-in-out;
}
.typing__dot:nth-child(2) { animation-delay: .15s; }
.typing__dot:nth-child(3) { animation-delay: .3s; }

@keyframes saDot {
  0%, 60%, 100% { opacity: .25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

/* ---------- варианты ответа ---------- */

.opts {
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.opt {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  color: #fff;
  background: var(--opt);
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .15s;
}
.opt:hover { background: var(--opt-h); }
.opt:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

.opt--wide { grid-column: 1 / -1; font-weight: 500; }

/* кнопки выбора марки: вместо подписи — логотип.
   Логотипы приведены к одному оптическому весу в build/make_brand_logos.py,
   поэтому здесь задаём им общий бокс и ничего не правим поштучно. */
.opt--brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 11px 14px 10px;
}
.opt__logo {
  display: block;
  width: 96px;
  height: 36px;
  object-fit: contain;
}
/* отступ марджином, а не flex-gap: у Стаса Chrome 70 */
.opt__brandname {
  display: block;
  margin-top: 5px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  opacity: .85;
}

/* множественный выбор */

.multi { width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 6px; }

.mopt {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.3;
  color: #fff;
  background: var(--opt);
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: background .15s;
}
.mopt:hover { background: var(--opt-h); }

.mopt--on {
  font-weight: 600;
  color: var(--blue-dk);
  background: #fff;
}
.mopt--on:hover { background: #fff; }

.mopt__radio {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-sizing: border-box;
}

.mopt__check {
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-main {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 10px;
  padding: 14px;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(51, 144, 236, 0.8);
  transition: background .15s;
}
.btn-main:hover { background: var(--blue-dk); }

.btn-main--off {
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(51, 144, 236, 0.5);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}

/* призыв */

.cta { width: 100%; max-width: 480px; display: flex; }

.cta__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 10px;
  padding: 15px;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 6px 16px -8px rgba(51, 144, 236, 0.8);
  transition: background .15s;
}
.cta__btn:hover { background: var(--blue-dk); color: #fff; }

/* телефон */

.phonebox {
  align-self: flex-start;
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--bubble-sh);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.phonebox__input {
  font: inherit;
  font-size: 18px;
  font-weight: 500;
  color: var(--ink);
  border: 1.5px solid var(--field-line);
  border-radius: 10px;
  padding: 12px 14px;
  outline: none;
  width: 100%;
  box-sizing: border-box;
}
.phonebox__input::placeholder { color: var(--ink-8); }
.phonebox__input:focus { border-color: var(--blue); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-3);
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
}

.consent__box {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 6px;
  border: 2px solid var(--box-line);
  box-sizing: border-box;
}

.consent__box--on {
  width: 20px;
  height: 20px;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-submit-off {
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--blue-faded);
  border: none;
  border-radius: 10px;
  padding: 14px;
  text-align: center;
  cursor: not-allowed;
}

/* начать заново */

.restart {
  align-self: center;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: var(--pill);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  padding: 6px 14px;
  margin-top: 6px;
  transition: background .15s;
}
.restart:hover { background: var(--pill-h); }

/* ---------- нижняя панель ---------- */

.composer {
  flex: none;
  background: #fff;
  border-top: 1px solid var(--line);
}

.composer__inner {
  max-width: 780px;
  margin: 0 auto;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
}

.quick {
  flex: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--blue-dk);
  background: var(--blue-lt);
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.quick:hover { background: var(--blue-lt2); }
.quick--hidden { display: none; }

.composer__field { flex: 1; min-width: 0; display: flex; }

.composer__hint {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  color: var(--ink-8);
  background: var(--field);
  border-radius: 999px;
  padding: 12px 18px;
}

.composer__input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--field);
  border: 1.5px solid var(--blue);
  outline: none;
  border-radius: 999px;
  padding: 11px 17px;
}
.composer__input::placeholder { color: var(--ink-8); }

.send {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--blue);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.send:hover { background: var(--blue-dk); }

.send--idle { background: var(--blue-pale); cursor: default; }
.send--idle:hover { background: var(--blue-pale); }

.send__arrow {
  width: 0;
  height: 0;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #fff;
  margin-left: 3px;
}

/* ---------- ширины ---------- */

@media (min-width: 560px) {
  .tel__num { display: inline; }
}

@media (min-width: 900px) {
  .sidebar { display: flex; }
}

@media (min-width: 1180px) {
  .addr { display: flex; }
}

@media (max-width: 480px) {
  .chat__inner { padding: 14px 10px 22px; }
  .topbar { gap: 10px; padding: 8px 12px; }
  .composer__inner { padding: 8px 10px; gap: 8px; }
  .quick { padding: 11px 13px; font-size: 13px; }
  .bubble--bot, .bubble--user { max-width: 100%; }
  .hero { max-width: 100%; }
  .hero__cards { grid-template-columns: 1fr; }
  .offer__big { font-size: 30px; }
}

/* ---------- фоллбэк для браузеров без flex-gap (Chrome 70 и младше) ---------- */

.no-flexgap .mgr > * + * { margin-left: 14px; }
.no-flexgap .mgr__text > * + * { margin-top: 3px; }
.no-flexgap .topbar > * + * { margin-left: 16px; }
.no-flexgap .topbar__mgr > * + * { margin-left: 12px; }
.no-flexgap .topbar__text > * + * { margin-top: 1px; }
.no-flexgap .addr > * + * { margin-left: 10px; }
.no-flexgap .addr__text > * + * { margin-top: 1px; }
.no-flexgap .tel > * + * { margin-left: 10px; }
.no-flexgap .chat__inner > * + * { margin-top: 8px; }
.no-flexgap .feed > * + * { margin-top: 8px; }
.no-flexgap .answers > * + * { margin-top: 8px; }
.no-flexgap .bubble--bot > * + * { margin-top: 6px; }
.no-flexgap .bubble--user > * + * { margin-top: 3px; }
.no-flexgap .bubble__time--user > * + * { margin-left: 4px; }
.no-flexgap .hero > * + * { margin-top: 12px; }
.no-flexgap .offer > * + * { margin-top: 10px; }
.no-flexgap .offer__rate > * + * { margin-left: 6px; }
.no-flexgap .srow > * + * { margin-left: 12px; }
.no-flexgap .srow__text > * + * { margin-top: 2px; }
.no-flexgap .typing > * + * { margin-left: 5px; }
.no-flexgap .multi > * + * { margin-top: 6px; }
.no-flexgap .mopt > * + * { margin-left: 12px; }
.no-flexgap .phonebox > * + * { margin-top: 12px; }
.no-flexgap .consent > * + * { margin-left: 10px; }
.no-flexgap .composer__inner > * + * { margin-left: 10px; }
.no-flexgap .cta__btn > * + * { margin-left: 10px; }

/* ---------- каталог автомобилей в чате ---------- */

/* Лента едет вбок: моделей у марки до 19, вертикальной сеткой это
   полэкрана. Без flex-gap — у Стаса на ПК Chrome 70. */
.cards {
  display: flex;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.cards > * + * { margin-left: 10px; }

.card {
  flex: 0 0 auto;
  width: 186px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 14px;
  box-shadow: var(--bubble-sh);
  overflow: hidden;
}

.card__pic { background: #F2F4F6; }
.card__pic img { display: block; width: 100%; height: 112px; object-fit: cover; }

.card__body { padding: 12px 13px 4px; }
.card__name { font-size: 14px; font-weight: 700; line-height: 1.25; }
.card__note { font-size: 11px; color: #8A8F98; margin-top: 5px; line-height: 1.25; }
.card__price { font-size: 16px; font-weight: 700; color: var(--blue); margin-top: 1px; }
.card__old {
  font-size: 12px;
  color: #8A8F98;
  text-decoration: line-through;
  margin-top: 1px;
}
.card__month { font-size: 11px; color: #6B7079; margin-top: 4px; line-height: 1.3; }

.card__pick {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: none;
  border-radius: 9px;
  padding: 11px;
  margin: 14px 13px 14px;
  cursor: pointer;
}
.card__pick:hover { background: var(--blue-dk); }

.card__brand { font-size: 11px; font-weight: 600; color: #8A8F98; letter-spacing: .02em; }

/* строка реплики менеджера: фото слева от облачка.
   Отступ марджином, не flex-gap — старые браузеры его не знают. */
.row--bot {
  align-self: flex-start;
  display: flex;
  align-items: flex-end;
  max-width: 100%;
}
.row__ava {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
  background: var(--blue-lt);
}
.row--bot .bubble--bot,
.row--bot .typing { align-self: auto; }
