/* Отзывы салонов: карточки-переписки на главной (#otzyvy-salonov, лента в два
   ряда) и на /otzyvy-salonov/ (стена с фильтром). Разметку карточек пишет
   tools/landing/testimonials.py. Базовые цвета тёмные, как у внутренних
   страниц; [data-theme="light"] перекрашивает их для главной. */
.tm {
  --tm-card: linear-gradient(180deg, #141a37, #0d1128);
  --tm-card-shadow:
    inset 0 1px 0 #ffffff12, 0 0 0 1px #96aaff1f, 0 16px 40px -20px #000000b0;
  --tm-line: #96aaff1a;
  --tm-wall:
    radial-gradient(120% 90% at 0 0, #3e60ff1c, transparent 60%),
    radial-gradient(110% 90% at 100% 100%, #7c5cff17, transparent 60%), #0a0e22;
  --tm-bubble: #1b2246;
  --tm-bubble-shadow: 0 1px 1px #00000040;
  --tm-text: #e6eaf8;
  --tm-day: #ffffff12;
  --tm-day-ink: #aeb8d9;
  --tm-tag: #3e60ff24;
  --tm-tag-ink: #b9c6ff;
  --tm-tag-line: #8fa6ff2e;
  /* Имя автора — цвет салона, осветлённый под тёмный пузырь. */
  --tm-name-mix: #fff 45%;
}
[data-theme="light"] .tm {
  --tm-card: #fff;
  --tm-card-shadow:
    0 0 0 1px #0d10240f, 0 1px 2px #0d10240a, 0 14px 32px -18px #1b2a7a33;
  --tm-line: #0d10240f;
  --tm-wall:
    radial-gradient(120% 90% at 0 0, #e3e9ff, transparent 60%),
    radial-gradient(110% 90% at 100% 100%, #efe8ff, transparent 60%), #f3f5fc;
  --tm-bubble: #fff;
  --tm-bubble-shadow: 0 1px 2px #0d10241a;
  --tm-text: var(--ink);
  --tm-day: #0d10240f;
  --tm-day-ink: #4b5270;
  --tm-tag: #3e60ff12;
  --tm-tag-ink: #2f4bd8;
  --tm-tag-line: #3e60ff29;
  --tm-name-mix: #0d1024 22%;
}

/* ---------- Карточка: шапка чата и пузыри ---------- */
.tm-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tm-card {
  --tm-av: #3e60ff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: var(--tm-card);
  box-shadow: var(--tm-card-shadow);
  color: var(--tm-text);
  font-size: 15px;
  line-height: 1.45;
  text-align: left;
}
.tm-card[data-brand="tochka"] {
  --tm-av: #7c5cff;
}
.tm-card[data-brand="nuga"] {
  --tm-av: #c9821b;
}
.tm-card[data-brand="garmonia"] {
  --tm-av: #d6528a;
}
.tm-card[data-brand="nailsup"] {
  --tm-av: #1f9d6b;
}
.tm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 14px 16px 0;
}
.tm-tag {
  padding: 2px 10px;
  border-radius: 999px;
  color: var(--tm-tag-ink);
  background: var(--tm-tag);
  box-shadow: inset 0 0 0 1px var(--tm-tag-line);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  white-space: nowrap;
}
.tm-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px 14px;
  border-bottom: 1px solid var(--tm-line);
}
.tm-avatar {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: #fff;
  background: var(--tm-av);
  background: linear-gradient(
    160deg,
    color-mix(in srgb, var(--tm-av) 62%, #fff),
    var(--tm-av) 55%,
    color-mix(in srgb, var(--tm-av) 78%, #000)
  );
  font-size: 17px;
  font-weight: 600;
}
.tm-title {
  min-width: 0;
  margin: 0;
}
.tm-title b {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.tm-src {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}
.tm-src::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='M21.4 3.6 2.6 10.9c-1.1.4-1.1 2 0 2.3l4.7 1.5 1.8 5.7c.2.8 1.2 1 1.7.4l2.7-2.6 4.8 3.5c.6.5 1.6.1 1.7-.7L23.4 5.3c.2-1.2-.9-2.1-2-1.7Z'/%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='M21.4 3.6 2.6 10.9c-1.1.4-1.1 2 0 2.3l4.7 1.5 1.8 5.7c.2.8 1.2 1 1.7.4l2.7-2.6 4.8 3.5c.6.5 1.6.1 1.7-.7L23.4 5.3c.2-1.2-.9-2.1-2-1.7Z'/%3E%3C/svg%3E")
    center / contain no-repeat;
}
/* Переписка прижата к низу, как в мессенджере: в карточках одной высоты
   пустое место остаётся сверху. */
.tm-thread {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 6px;
  padding: 14px 12px 16px;
  background: var(--tm-wall);
}
.tm-day {
  align-self: center;
  margin: 0 0 4px;
  padding: 2px 10px;
  border-radius: 999px;
  color: var(--tm-day-ink);
  background: var(--tm-day);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
}
.tm-bubble + .tm-day {
  margin-top: 8px;
}
.tm-bubble {
  max-width: 100%;
  padding: 8px 13px 9px;
  border-radius: 16px 16px 16px 6px;
  background: var(--tm-bubble);
  box-shadow: var(--tm-bubble-shadow);
}
.tm-author {
  display: block;
  margin-bottom: 2px;
  color: var(--tm-av);
  color: color-mix(in srgb, var(--tm-av), var(--tm-name-mix));
  font-size: 13.5px;
  font-weight: 600;
}
.tm-bubble blockquote,
.tm-bubble p {
  margin: 0;
}
.tm-bubble p {
  overflow-wrap: anywhere;
}
.tm-ref {
  text-decoration: underline dotted;
  text-decoration-color: var(--muted);
  text-underline-offset: 3px;
}
.tm-note {
  margin: 2px 4px 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.4;
}

/* ---------- Главная: блок и лента ---------- */
.tm-section {
  margin-top: 110px;
}
/* Без JavaScript и при reduced-motion — статичная сетка. */
.tm-reel .tm-list {
  columns: 3 300px;
  column-gap: 20px;
}
.tm-reel .tm-list > .tm-card,
.tm-wall .tm-list > .tm-card {
  margin-bottom: 20px;
  break-inside: avoid;
}
/* Лента: исходный список остаётся для читалок, глазу видны копии в двух рядах. */
.tm-reel.is-moving > .tm-list {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Ряды тянут мышью и пальцем; вертикальную прокрутку страницы ведёт браузер. */
.tm-rows {
  display: grid;
  gap: 20px;
  margin-inline: calc(50% - 50vw);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent);
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y pinch-zoom;
}
.tm-rows.is-dragging {
  cursor: grabbing;
}
.tm-row {
  overflow-x: clip;
  padding-block: 4px 24px;
  margin-block: -4px -24px;
}
.tm-track {
  display: flex;
  width: max-content;
  margin: 0;
  padding: 0;
  list-style: none;
  will-change: transform;
}
.tm-track > .tm-card {
  flex: none;
  width: 340px;
  margin-right: 20px;
}

/* ---------- /otzyvy-salonov/: фильтр и стена ---------- */
.tm-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}
/* display у классов перебивает атрибут hidden: фильтр без JavaScript не нужен,
   скрытые фильтром карточки должны пропасть. */
.tm-filter[hidden],
.tm-card[hidden] {
  display: none;
}
.tm-filter .chip {
  border: 0;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.tm-filter .chip[aria-pressed="true"] {
  color: #fff;
  background: #3e60ff;
  box-shadow: none;
}
.tm-wall .tm-list {
  columns: 3 300px;
  column-gap: 20px;
}
.tm-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 767px) {
  .tm-section {
    margin-top: 72px;
  }
  /* Телефон: свайп-карусель, следующая карточка выглядывает справа. */
  .tm-reel .tm-list {
    display: flex;
    gap: 12px;
    columns: auto;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 18px;
    margin-inline: -18px;
    padding: 4px 18px 24px;
    scrollbar-width: none;
  }
  .tm-reel .tm-list::-webkit-scrollbar {
    display: none;
  }
  .tm-reel .tm-list > .tm-card {
    flex: 0 0 min(84%, 340px);
    margin: 0;
    scroll-snap-align: start;
  }
  .tm-wall .tm-list {
    columns: 1;
  }
}
