/* Личный менеджер на главной (#menedzher). Карточки переписки — классы отзывов
   из v2/testimonials.css (их токены живут на .tm); здесь только своё: ответ
   менеджера справа, время сообщений, скорость ответа, тезисы и лента примеров.
   Разметку карточек пишет tools/landing/manager_chats.py. Базовые цвета тёмные,
   как у отзывов; [data-theme="light"] перекрашивает их для главной. */
.mg {
  --mg-reply: #25306b;
  --mg-reply-name: #aebcff;
  --mg-speed: #5fd6a8;
  --mg-speed-bg: #1f9d6b2e;
  --mg-sum: #ffffff12;
  --mg-button: #1b2246;
  --mg-button-shadow: 0 0 0 1px #96aaff26, 0 8px 20px -10px #000000b0;
}
[data-theme="light"] .mg {
  --mg-reply: #e8edff;
  --mg-reply-name: #2f4bd8;
  --mg-speed: #11744c;
  --mg-speed-bg: #1f9d6b1a;
  --mg-sum: #ffffffc7;
  --mg-button: #fff;
  --mg-button-shadow: 0 0 0 1px #0d10240f, 0 1px 2px #0d10241a, 0 8px 18px -10px #1b2a7a4d;
}
.tm-card[data-brand="kremvosk"] {
  --tm-av: #d0702a;
}
.tm-card[data-brand="beautycenter"] {
  --tm-av: #0f8fa0;
}

/* ---------- Заголовок и тезисы ---------- */
.mg-section {
  margin-top: 110px;
}
.mg-section .block-head {
  margin-bottom: 36px;
}
.block-head > p.mg-who {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
  padding: 4px 14px 4px 4px;
  border-radius: 999px;
  background: var(--card, #ffffff0a);
  box-shadow: var(--hair, 0 0 0 1px #96aaff26);
  font-size: 14px;
  line-height: 1.35;
}
.mg-who img {
  flex: none;
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 50%;
  background: #eef1ff;
}
.mg-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  max-width: 1000px;
  margin: 0 auto 40px;
  padding: 0;
  list-style: none;
}
.mg-points li {
  display: grid;
  align-content: start;
  gap: 4px;
  padding: 18px 22px 20px;
  border-radius: 18px;
  background: var(--card, #ffffff0a);
  box-shadow: var(--hair, 0 0 0 1px #96aaff26);
}
.mg-points b {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.mg-points span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.mg-section .seg-tabs {
  margin: 0 auto 28px;
}

/* ---------- Переписка: вопрос салона слева, ответ менеджера справа ---------- */
.mg .tm-bubble {
  max-width: 90%;
}
.mg .tm-bubble blockquote > * + * {
  margin-top: 0.55em;
}
.tm-bubble.mg-reply {
  align-self: flex-end;
  max-width: 94%;
  border-radius: 16px 16px 6px 16px;
  background: var(--mg-reply);
}
.mg-reply .tm-author {
  color: var(--mg-reply-name);
}
.mg-time {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.3;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tm-bubble .mg-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 2px;
}
.mg-foot .mg-time {
  margin: 0;
}
.mg-speed {
  align-self: flex-end;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 2px 10px 2px 8px;
  border-radius: 999px;
  color: var(--mg-speed);
  background: var(--mg-speed-bg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  white-space: nowrap;
}
.mg-speed::before {
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 2 4 13.6h6.6L9.5 22 20 9.8h-6.7L13.5 2Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 2 4 13.6h6.6L9.5 22 20 9.8h-6.7L13.5 2Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
.mg-ph,
.mg-cut {
  color: var(--muted);
}
.mg-list {
  margin: 0;
  padding-left: 1.2em;
}
ul.mg-list {
  list-style: disc;
}
.mg-list li + li {
  margin-top: 0.35em;
}
.mg-list li::marker {
  color: var(--mg-reply-name);
}
.mg .mg-sum {
  padding: 8px 11px;
  border-radius: 10px;
  background: var(--mg-sum);
}
.mg-more {
  display: none;
  margin-right: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--mg-reply-name);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

/* Длинный ответ свёрнут до кнопки, чтобы одна карточка не растягивала всю
   ленту; без JavaScript виден целиком. Разбор цифр на компьютере — целиком. */
.js .mg-text.is-long:not(.is-open) {
  max-height: 16em;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(#000 calc(100% - 4em), transparent);
  mask-image: linear-gradient(#000 calc(100% - 4em), transparent);
}
.js .mg-more {
  display: inline-block;
}
@media (min-width: 768px) {
  .js .is-wide .mg-text.is-long {
    max-height: none;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .js .is-wide .mg-more {
    display: none;
  }
}

/* ---------- Лента примеров ---------- */
/* Без JavaScript ленту листают обычной прокруткой; со стрелками полоса не нужна. */
.mg-track {
  display: flex;
  gap: 20px;
  margin: -6px -6px -28px;
  padding: 6px 6px 28px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 6px;
}
.js .mg-track {
  scrollbar-width: none;
}
.js .mg-track::-webkit-scrollbar {
  display: none;
}
/* Три карточки и край четвёртой: видно, что лента листается. */
.mg-track > .tm-card {
  flex: 0 0 calc((100% - 40px) / 3.12);
  scroll-snap-align: start;
}
.mg-arrows {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}
.mg-arrows[hidden] {
  display: none;
}
.mg-arrows button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--ink);
  background: var(--mg-button);
  box-shadow: var(--mg-button-shadow);
  cursor: pointer;
  transition: opacity 0.18s;
}
.mg-arrows button:disabled {
  opacity: 0.35;
  cursor: default;
}
.mg-arrows svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Разбор цифр: две широкие карточки рядом, каждая своей высоты. */
@media (min-width: 768px) {
  .mg-track.is-wide {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    overflow: visible;
  }
  .mg-track.is-wide > .tm-card {
    font-size: 15.5px;
  }
  .is-wide .tm-bubble.mg-reply {
    max-width: 96%;
  }
}
@media (min-width: 1024px) {
  .mg-track.is-wide {
    grid-template-columns: 1.15fr 1fr;
  }
}
@media (max-width: 1023px) and (min-width: 768px) {
  .mg-track > .tm-card {
    flex-basis: calc((100% - 20px) / 2.12);
  }
}

@media (max-width: 767px) {
  .mg-section {
    margin-top: 72px;
  }
  .mg-section .block-head {
    margin-bottom: 24px;
  }
  .block-head > p.mg-who {
    margin: 14px 0 0;
    font-size: 13.5px;
  }
  /* Тезисы — одной карточкой со строками, чтобы не съедать экран. */
  .mg-points {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    margin-bottom: 24px;
    border-radius: 16px;
    background: var(--card, #ffffff0a);
    box-shadow: var(--hair, 0 0 0 1px #96aaff26);
  }
  .mg-points li {
    gap: 2px;
    padding: 12px 16px 13px;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }
  .mg-points li + li {
    border-top: 1px solid var(--line);
  }
  .mg-points b {
    font-size: 16px;
  }
  .mg-points span {
    font-size: 14.5px;
    line-height: 1.4;
  }
  .mg-section .seg-tabs {
    width: 100%;
    max-width: none;
    margin-bottom: 20px;
  }
  .mg-section .seg-tabs button {
    flex: 1;
    padding-inline: 12px;
  }
  /* Телефон: свайп-карусель до краёв экрана, следующая карточка выглядывает.
     Карточки своей высоты: на узком экране пустая стена над перепиской заметна. */
  .mg-track {
    align-items: flex-start;
    gap: 12px;
    margin: -4px -18px -24px;
    padding: 4px 18px 24px;
    scroll-padding-inline: 18px;
  }
  .mg-track > .tm-card {
    flex: 0 0 min(88%, 340px);
    font-size: 14.5px;
  }
  .mg-track.is-wide > .tm-card {
    flex-basis: 92%;
  }
  .mg .tm-bubble {
    max-width: 94%;
  }
  .mg .tm-bubble.mg-reply {
    max-width: 97%;
  }
  .mg-arrows {
    display: none;
  }
  .js .is-wide .mg-text.is-long:not(.is-open) {
    max-height: 24em;
  }
}
