/* FR apps — лендинг ботов в стиле iOS-страницы (chatbots.html). Подключается после styles.css: здесь только переписки в телефонах. */

/* телефон с перепиской */
.phone--chat .phone__screen { padding: 14px 0 0; gap: 0; background: #EEF1F5; }
.phone--chat .phone__bar { padding: 0 20px 8px; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 8px 14px 10px; background: var(--bg); border-bottom: 1px solid var(--border); }
.chat-head__back { width: 16px; height: 16px; color: var(--orange); transform: rotate(180deg); flex: none; }
.chat-head__ava { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: var(--inv); display: grid; place-items: center; flex: none; }
.chat-head__ava svg { width: 18px; height: 18px; }
.chat-head b { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.chat-head small { display: block; font-size: 10px; line-height: 1.3; color: var(--text-3); }

.chat { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 12px 10px; overflow: hidden; }
.chat--end { justify-content: flex-end; }
.chat__day { align-self: center; padding: 3px 9px; border-radius: var(--r-pill); background: rgba(20,20,20,.12); color: var(--text-2); font-size: 9.5px; font-weight: 600; }
.msg { max-width: 84%; padding: 7px 10px 6px; border-radius: 14px; font-size: 11.5px; line-height: 1.4; background: var(--bg); color: var(--text); box-shadow: 0 1px 1px rgba(0,0,0,.06); }
.msg b { font-weight: 600; }
.msg small { display: block; text-align: right; font-size: 9px; color: var(--text-3); margin-top: 2px; }
.msg--in { align-self: flex-start; border-bottom-left-radius: 4px; }
.msg--out { align-self: flex-end; background: var(--orange-soft); border-bottom-right-radius: 4px; }
.msg--out small { color: var(--orange); }
.msg__tag { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 600; color: var(--orange); }
.msg__tag svg { width: 11px; height: 11px; }
.kb { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 84%; }
.kb span { padding: 7px 4px; border-radius: 9px; background: rgba(20,20,20,.07); color: var(--text); font-size: 10.5px; font-weight: 600; text-align: center; }
.kb .w { grid-column: 1 / -1; }
.kb .on { background: var(--orange); color: var(--inv); }
.chat-input { display: flex; align-items: center; gap: 8px; padding: 8px 10px 18px; background: var(--bg); border-top: 1px solid var(--border); }
.chat-input span { flex: 1; padding: 8px 12px; border-radius: var(--r-pill); background: var(--muted); font-size: 11px; color: var(--text-3); }
.chat-input i { width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: var(--inv); display: grid; place-items: center; flex: none; }
.chat-input i svg { width: 15px; height: 15px; }

/* Instagram Direct */
.phone--ig .phone__screen { background: var(--bg); }
.phone--ig .chat-head__ava { background: linear-gradient(135deg, #FEDA75 0%, #D62976 55%, #4F5BD5 100%); }
.phone--ig .msg--in { background: #EFEFEF; box-shadow: none; }
.phone--ig .msg--out { background: linear-gradient(135deg, #7B3FE4 0%, #C13584 100%); color: var(--inv); }
.phone--ig .msg--out small { color: rgba(255,255,255,.75); }
.ig-comment { align-self: stretch; display: flex; gap: 8px; padding: 9px 10px; border: 1px solid var(--border); border-radius: 12px; font-size: 11px; line-height: 1.4; }
.ig-comment i { width: 24px; height: 24px; border-radius: 50%; background: var(--muted); flex: none; }
.ig-comment small { display: block; font-size: 9px; color: var(--text-3); }
.ig-file { display: flex; align-items: center; gap: 8px; margin-top: 4px; padding: 7px 8px; border-radius: 9px; background: rgba(255,255,255,.18); font-weight: 600; }
.phone--ig .msg--in .ig-file { background: var(--bg); }
.ig-file svg { width: 14px; height: 14px; flex: none; }

/* первый экран: сообщения уже, чтобы плашки по бокам не закрывали текст */
.hero .chat .msg, .hero .chat .kb { max-width: 76%; }
.hero .note--1 { top: 185px; }
.hero .note--3 { top: 300px; }
@media (max-width: 1279px) {
  .hero .note--1, .hero .note--3 { display: none; }
}
@media (max-width: 767px) {
  .hero .note--1 { display: flex; top: auto; bottom: 16px; left: 12px; }
  /* стрелка-бейдж на телефоне скрыта — без тире заголовок читается слитно */
  .hero__accent::before { content: "— "; }
}

/* появление сообщений в первом экране */
@media (prefers-reduced-motion: no-preference) {
  .hero .chat > * { opacity: 0; transform: translateY(6px); animation: msg-in .4s ease forwards; }
  .hero .chat > :nth-child(1) { animation-delay: .2s; }
  .hero .chat > :nth-child(2) { animation-delay: .7s; }
  .hero .chat > :nth-child(3) { animation-delay: 1.3s; }
  .hero .chat > :nth-child(4) { animation-delay: 1.9s; }
  .hero .chat > :nth-child(5) { animation-delay: 2.5s; }
  .hero .chat > :nth-child(6) { animation-delay: 3.1s; }
  .hero .chat > :nth-child(7) { animation-delay: 3.7s; }
  @keyframes msg-in { to { opacity: 1; transform: none; } }
}

/* бейдж на примерах — справа на верхней рамке телефона, чтобы не закрывать сообщения */
.rating--top { left: auto; right: 24px; bottom: auto; top: max(16px, calc(50% - 340px)); }
@media (max-width: 767px) {
  /* на телефоне видна только верхняя часть макета — сообщения сверху, бейдж над рамкой */
  .rating--top { left: auto; right: 14px; top: 8px; }
  .chat--end { justify-content: flex-start; }
}
