/* ==========================================================================
   STARS MOTORS — Telegram-виджет (по макету). Чистый HTML/CSS, без картинок и JS.
   --------------------------------------------------------------------------
   Все размеры заданы в em от базового font-size, поэтому ВЕСЬ виджет
   масштабируется одной переменной --s (1 = размер макета, панель 480px).
   Сейчас --s: .55 — панель 264px (на 30 % меньше предыдущих 374px).

   Цвета — в переменных ниже, правятся в одном месте.
   ========================================================================== */

.smtg {
  /* масштаб ------------------------------------------------------------- */
  --s: .55;

  /* палитра ------------------------------------------------------------- */
  --blue-1:   #2ba3e6;   /* шапка, светлый край градиента */
  --blue-2:   #0d6cb4;   /* шапка, тёмный край */
  --blue-cta: #229ed9;   /* кнопка и круглая иконка */
  --green:    #2ebf11;   /* «онлайн» */
  --check:    #4bbf3a;   /* галочки «прочитано» */
  --ink:      #1f2733;   /* основной текст */
  --muted:    #6b7683;   /* вторичный текст */
  --note:     #8b95a1;   /* подпись под кнопкой */
  --bubble:   #eef3f5;   /* пузырь сообщения */
  --line:     rgba(255, 255, 255, .35);

  /* производные --------------------------------------------------------- */
  --radius:   1.35em;
  --shadow:   0 .5em 1.6em rgba(16, 42, 67, .18);

  position: fixed;
  left: 15px;
  bottom: 15px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: .7em;
  font-size: calc(16px * var(--s));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.3;
  -webkit-font-smoothing: antialiased;
  pointer-events: none;
}

.smtg *,
.smtg *::before,
.smtg *::after { box-sizing: border-box; }

/* скрытый переключатель состояния -------------------------------------- */
.smtg__toggle { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

/* ============================== ПАНЕЛЬ ================================= */
.smtg__panel {
  width: 30em;                           /* 480px при --s: 1 */
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  pointer-events: auto;
  transform-origin: left bottom;
  transition: opacity .28s ease, transform .28s ease, visibility .28s;
}
.smtg__toggle:not(:checked) ~ .smtg__panel {
  opacity: 0;
  visibility: hidden;
  transform: translateY(1.2em) scale(.97);
  pointer-events: none;
}

/* ============================== ШАПКА ================================== */
.smtg__head {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "logo titles close"
    "status status status";
  align-items: center;
  gap: .35em 1em;
  padding: 1.25em 1.25em 1.1em;
  background: linear-gradient(155deg, var(--blue-1) 0%, var(--blue-2) 100%);
  color: #fff;
  overflow: hidden;
}
/* мягкий блик справа — намёк на фото автомобиля с макета */
.smtg__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(70% 120% at 108% 42%, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 62%),
    radial-gradient(50% 90% at 88% 0%, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 60%);
  pointer-events: none;
}

.smtg__logo { grid-area: logo; display: block; width: 4.6em; height: 4.6em; position: relative; }
.smtg__logo svg { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 .15em .5em rgba(6, 40, 70, .25); }

.smtg__titles { grid-area: titles; position: relative; min-width: 0; }
.smtg__title  { font-size: 1.75em; font-weight: 800; letter-spacing: .01em; }
.smtg__sub    { font-size: 1.02em; font-weight: 500; color: rgba(255, 255, 255, .88); margin-top: .18em; }

.smtg__close {
  grid-area: close;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: transform .2s ease;
}
.smtg__close:hover { transform: scale(1.06); }
.smtg__close svg { width: 1.1em; height: 1.1em; }
.smtg__close path { stroke: #1f2733; }

.smtg__status {
  grid-area: status;
  display: flex;
  align-items: center;
  gap: .6em;
  margin-top: .55em;
  font-size: 1.05em;
  min-width: 0;
}
.smtg__dot {
  width: .62em;
  height: .62em;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 .18em rgba(46, 191, 17, .25);
  flex: 0 0 auto;
}
.smtg__online { font-weight: 700; white-space: nowrap; }
.smtg__sep    { width: 1px; height: 1.3em; background: var(--line); flex: 0 0 auto; }
.smtg__statusnote { color: rgba(255, 255, 255, .82); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =============================== ТЕЛО ================================== */
.smtg__body { padding: 1.25em 1.25em 1.1em; background: #fff; }

/* сообщение -------------------------------------------------------------- */
.smtg__msgrow { display: flex; align-items: flex-start; gap: .8em; }

.smtg__avatar {
  flex: 0 0 auto;
  width: 3.4em;
  height: 3.4em;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 .15em .5em rgba(16, 42, 67, .12);
}
.smtg__avatar svg { display: block; width: 100%; height: 100%; border-radius: 50%; }

.smtg__bubble {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  background: var(--bubble);
  border-radius: 1.1em;
  padding: .95em 1.05em .7em;
}
.smtg__msg  { margin: 0; font-size: 1.28em; line-height: 1.42; color: var(--ink); }
.smtg__msg2 { margin: .45em 0 0; font-size: 1.08em; color: var(--muted); }
.smtg__meta { display: flex; align-items: center; justify-content: flex-end; gap: .4em; margin-top: .45em; }
.smtg__time { font-size: .95em; color: var(--muted); }
.smtg__checks { width: 1.85em; height: auto; }
.smtg__checks path { stroke: var(--check); }

/* три преимущества ------------------------------------------------------- */
.smtg__features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5em;
  margin: 1.15em 0 1.05em;
  padding: 0;
  list-style: none;
}
.smtg__feature { display: flex; flex-direction: column; align-items: center; text-align: center; }

.smtg__fi {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.1em;
  height: 4.1em;
  border-radius: 50%;
  margin-bottom: .5em;
}
.smtg__fi svg { width: 1.75em; height: 1.75em; display: block; }
.smtg__fi--blue   { background: #e2f0fb; color: #2f8fd8; }
.smtg__fi--green  { background: #e9f7e4; color: #3aa621; }
.smtg__fi--purple { background: #ece8fb; color: #6a5bd6; }

.smtg__fi-label { font-size: .98em; line-height: 1.28; color: var(--ink); }

/* кнопка канала ---------------------------------------------------------- */
.smtg__cta {
  display: flex;
  align-items: center;
  gap: .7em;
  height: 4.1em;
  padding: 0 1.25em;
  border-radius: 999px;
  background: var(--blue-cta);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 .35em 1em rgba(34, 158, 217, .35);
  transition: background-color .2s ease, transform .2s ease;
}
.smtg__cta:hover { background: #1b8ec6; transform: translateY(-1px); }
.smtg__cta-plane { width: 2.1em; height: 2.1em; flex: 0 0 auto; }
.smtg__cta-text {
  flex: 1 1 auto;
  font-size: 1.32em;
  font-weight: 700;
  text-align: center;
}
.smtg__cta-arrow { width: 1.25em; height: 1.25em; flex: 0 0 auto; color: rgba(255, 255, 255, .9); }

.smtg__note { margin: .85em 0 0; text-align: center; font-size: .98em; color: var(--note); }

/* ссылка на канал — под основной кнопкой */
.smtg__channel {
  display: block;
  margin-top: .5em;
  text-align: center;
  font-size: 1.02em;
  font-weight: 600;
  color: var(--blue-cta);
  text-decoration: none;
}
.smtg__channel:hover { text-decoration: underline; }

/* ======================= ПЛАВАЮЩАЯ КНОПКА ============================== */
.smtg__launcher {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.9em;
  height: 3.9em;
  border-radius: 50%;
  background: var(--blue-cta);
  box-shadow: 0 .35em 1em rgba(34, 158, 217, .45);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .2s ease, background-color .2s ease;
}
.smtg__launcher:hover { transform: translateY(-2px); background: #1b8ec6; }
.smtg__launcher svg { width: 2.1em; height: 2.1em; }

/* ============================ УЗКИЙ ЭКРАН ============================== */
@media (max-width: 480px) {
  .smtg { left: 10px; right: 10px; bottom: 10px; --s: .72; }
  .smtg__panel { width: 100%; }
  .smtg__launcher { width: 3.6em; height: 3.6em; }
}
