/* Веб-Лампа (app.mylampa.ru) — дизайн-система N2, стиль v3 «шпаргалки».
   Токены — из лендинг-v2/css/lampa-web.css (единственный источник для сайта), здесь только
   то, что нужно чату. Маскот рисует lampa.js (лава в вебе мятная — решение 18.10). */
:root {
  --ink: #221C1F;
  --muted: #7C6F6A;
  --soft: #4E4448;
  --card: rgba(255,255,255,.92);
  --edge: rgba(255,255,255,.95);
  --sh: 0 26px 60px -30px rgba(120,70,80,.38);
  --sh-s: 0 14px 34px -22px rgba(120,70,80,.35);
  --grad: linear-gradient(110deg,#FFA94A 0%,#F7849E 55%,#A894F0 100%);
  --lilac: #8A5BD6;
  --mint-bg: #DDF0E1; --mint-ink: #3B7552; --mint: #6BCDA5;
  --c1: #FFB25E; --c2: #F994A0; --c3: #A894F0;
  --user: linear-gradient(135deg,#FFE1D2,#FFCDBB);
  --r: 20px;
  --col: 720px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 500;
  color: var(--ink);
  background: linear-gradient(165deg,#FFFFFF 0%,#FFF6F0 38%,#FDEEF2 68%,#F3EEFC 100%) fixed;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--lilac); }
[hidden] { display: none !important; }

.app {
  height: 100dvh;
  max-width: var(--col);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

/* ── Шапка ── */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 12px;
  padding: calc(10px + var(--safe-t)) 16px 10px;
  background: rgba(255,255,255,.78);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 2px solid rgba(34,28,31,.05);
}
.top .av { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; flex: none; background: #E9F6EE; }
.top .av svg, .top .av img { width: 100%; height: 100%; display: block; }
.who { flex: 1; min-width: 0; }
.who b { display: block; font-weight: 800; font-size: 16px; line-height: 1.15; }
.who { overflow: hidden; }
.who small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; font-weight: 600; color: var(--mint-ink); }
.who small i { display: inline-block; vertical-align: 1px; margin-right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 3px rgba(107,205,165,.25); }
/* Плашка «Лампа в MAX · Telegram» в шапке */
.ch { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: #F3EEFC; flex: none; }
.ch-lead { font-size: 11.5px; font-weight: 700; color: var(--lilac); padding: 0 4px 0 7px; }
.ch-btn { border: 0; border-radius: 999px; padding: 5px 9px; font-size: 12px; font-weight: 800; background: #fff; color: var(--ink); box-shadow: inset 0 0 0 1.5px rgba(138,91,214,.25); }
.ch-btn.on { background: var(--mint-bg); color: var(--mint-ink); box-shadow: none; }
.ch-btn.big { padding: 9px 16px; font-size: 14.5px; }
.ch-btn.max { color: #4B3AE0; }
.ch-btn.tg { color: #1C8AD6; }
.ch-btn.on.max, .ch-btn.on.tg { color: var(--mint-ink); }
@media (max-width: 440px) { .ch-lead { display: none; } .top { gap: 10px; } }
.pin-note { margin-top: 14px; }
.pin-note .pin { display: block; margin: 6px 0 2px; font-size: 26px; letter-spacing: .08em; color: var(--ink); }
.pin-note small { color: var(--muted); }
.link-status { margin-top: 10px; font-weight: 700; color: var(--muted); }
.link-status.ok { color: var(--mint-ink); }
.sheet .cta { text-decoration: none; margin-top: 4px; }

.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(34,28,31,.05); display: grid; place-items: center; fill: var(--soft); }
.icon-btn:hover { background: rgba(34,28,31,.09); }

/* ── Лента ── */
.feed {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 8px;
  padding: 18px 14px 12px;
  scroll-padding-bottom: 12px;
}
.day { align-self: center; font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: rgba(255,255,255,.7); margin: 4px 0; }
.bub {
  max-width: min(86%, 560px);
  padding: 11px 14px 12px;
  border-radius: var(--r);
  font-size: 16px; line-height: 1.45;
  white-space: pre-wrap; overflow-wrap: anywhere;
  animation: msgin .3s ease-out both;
}
.bub.l { align-self: flex-start; background: #fff; box-shadow: var(--sh-s), inset 0 0 0 2px var(--edge); border-bottom-left-radius: 6px; }
.bub.u { align-self: flex-end; background: var(--user); border-bottom-right-radius: 6px; }
.bub.sys { align-self: center; max-width: 92%; background: rgba(255,255,255,.72); font-size: 14.5px; color: var(--soft); text-align: center; box-shadow: inset 0 0 0 2px var(--edge); }
.bub.err { align-self: center; background: #FFF1EC; color: #8A3B2A; font-size: 14.5px; text-align: center; }
.bub .acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.typing { align-self: flex-start; display: inline-flex; gap: 5px; padding: 14px 15px; border-radius: var(--r); border-bottom-left-radius: 6px; background: #fff; box-shadow: var(--sh-s), inset 0 0 0 2px var(--edge); animation: msgin .25s ease-out both; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--c1); animation: tb 1.3s ease-in-out infinite; }
.typing span:nth-child(2) { animation-delay: .18s; background: var(--c2); }
.typing span:nth-child(3) { animation-delay: .36s; background: var(--c3); }
@keyframes tb { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes msgin { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Первый экран ── */
.hello { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 8px 14px; animation: msgin .4s ease-out both; }
.hello-av { width: 112px; height: 112px; margin-bottom: 6px; }
.hello-av svg, .hello-av img { width: 100%; height: 100%; overflow: visible; display: block; }
.hello h1 { margin: 0; font-weight: 800; font-size: clamp(24px, 6.4vw, 32px); line-height: 1.08; letter-spacing: -.03em; text-wrap: balance; max-width: 15em; }
.hello p { margin: 8px 0 0; font-size: 16px; line-height: 1.4; color: var(--soft); max-width: 24em; }
.pills { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pills li { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.85); box-shadow: inset 0 0 0 2px var(--edge), var(--sh-s); font-size: 13px; font-weight: 700; color: var(--soft); }

/* ── Карточки: итог, пейвол ── */
.card {
  align-self: stretch;
  margin: 6px 0;
  padding: 20px 18px 18px;
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--sh), inset 0 0 0 2px var(--edge);
  animation: msgin .35s ease-out both;
}
.loader h3, .pw h3 { margin: 0 0 12px; font-weight: 800; font-size: 19px; letter-spacing: -.02em; line-height: 1.2; }
.loader ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15.5px; color: var(--soft); }
.loader li { display: flex; gap: 8px; align-items: baseline; animation: msgin .3s ease-out both; }

.pw { border: 3px solid transparent; background: linear-gradient(#fff,#fff) padding-box, var(--grad) border-box; }
.pw .lines { display: grid; gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.pw .lines li { display: grid; grid-template-columns: 26px 1fr; gap: 6px; font-size: 15.5px; line-height: 1.42; }
.pw .lines b { display: block; font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--lilac); margin-bottom: 1px; }
.pw .txt { white-space: pre-wrap; font-size: 15.5px; line-height: 1.45; color: var(--soft); margin: 0 0 14px; }
.pw .remember { font-size: 15px; color: var(--soft); margin: 0 0 14px; }
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
.plan {
  position: relative; text-align: left;
  padding: 12px 12px 11px; border-radius: 18px; border: 0;
  background: #fff; box-shadow: inset 0 0 0 2px rgba(124,111,106,.16);
  transition: box-shadow .15s, transform .15s;
}
.plan b { display: block; font-weight: 800; font-size: 15px; }
.plan span { display: block; font-weight: 800; font-size: 18px; letter-spacing: -.01em; margin-top: 2px; }
.plan small { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-top: 2px; }
.plan[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--lilac); }
.plan .tag { position: absolute; top: -9px; right: 10px; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--mint-bg); color: var(--mint-ink); }
.cta {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 54px; padding: 14px 20px;
  border: 0; border-radius: 999px;
  background: var(--grad); color: #fff;
  font-weight: 800; font-size: 16.5px; letter-spacing: -.01em;
  box-shadow: 0 16px 30px -16px rgba(247,132,158,.9);
}
.cta:disabled { opacity: .7; cursor: progress; }
.cta.small { width: auto; min-height: 42px; padding: 10px 18px; font-size: 15px; }
.ghost { border: 0; background: rgba(34,28,31,.06); border-radius: 999px; padding: 10px 16px; font-weight: 700; font-size: 14.5px; }
.fine { margin: 10px 2px 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.contact { display: grid; gap: 8px; margin: 0 0 12px; }
.contact p { margin: 0; font-size: 14px; color: var(--soft); }
.contact input { width: 100%; padding: 13px 14px; border-radius: 14px; border: 0; box-shadow: inset 0 0 0 2px rgba(124,111,106,.2); font: inherit; font-size: 16px; background: #fff; }

/* ── Кнопки анкеты под репликой ── */
.chips { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; max-width: min(92%, 600px); margin: 2px 0 4px; animation: msgin .3s ease-out both; }
.chip {
  border: 0; border-radius: 999px; padding: 10px 14px; min-height: 42px;
  background: #fff; color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.2; text-align: left;
  box-shadow: var(--sh-s), inset 0 0 0 2px rgba(138,91,214,.28);
  transition: transform .12s, box-shadow .15s, background .15s;
}
.chip:hover { box-shadow: var(--sh-s), inset 0 0 0 2px rgba(138,91,214,.6); }
.chip:active { transform: scale(.97); background: #F6F1FF; }
.chip-hint { align-self: center; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 0 4px; }
.copy { display: block; margin-top: 10px; border: 0; border-radius: 999px; padding: 8px 14px; background: #F3EEFC; color: var(--lilac); font-weight: 800; font-size: 13.5px; }

/* ── Картина ── */
.pic { position: sticky; top: calc(61px + var(--safe-t)); z-index: 4; padding: 8px 14px 0; }
.pic-bar {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border: 0; border-radius: 999px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--sh-s), inset 0 0 0 2px var(--edge); text-align: left;
}
.pic-bar.pulse { animation: picpulse 1.1s ease-out; }
@keyframes picpulse { 0% { box-shadow: var(--sh-s), inset 0 0 0 2px rgba(107,205,165,.9); } 100% { box-shadow: var(--sh-s), inset 0 0 0 2px var(--edge); } }
.pic-title { font-weight: 800; font-size: 14px; }
.pic-dots { display: inline-flex; gap: 5px; flex: 1; }
.pic-dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(124,111,106,.22); transition: background .3s; }
.pic-dots i.on { background: var(--mint); }
.pic-count { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.pic-chev { color: var(--muted); transition: transform .2s; }
.pic-bar[aria-expanded="true"] .pic-chev { transform: rotate(180deg); }
.pic-panel { margin-top: 8px; padding: 16px; border-radius: 22px; background: #fff; box-shadow: var(--sh), inset 0 0 0 2px var(--edge); max-height: 60dvh; overflow-y: auto; animation: msgin .2s ease-out both; }
.pic-lead { margin: 0 0 10px; font-size: 13.5px; color: var(--muted); }
.pic-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pic-list li { display: grid; grid-template-columns: 20px 1fr auto; gap: 8px; align-items: start; }
.pic-list .mark { color: rgba(124,111,106,.5); font-weight: 800; }
.pic-list li.on .mark { color: var(--mint-ink); }
.pic-list b { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--lilac); }
.pic-list span { font-size: 15px; line-height: 1.35; }
.pic-list li:not(.on) span { color: var(--muted); }
.pic-edit { border: 0; background: transparent; color: var(--lilac); font-weight: 700; font-size: 13px; padding: 2px 0; text-decoration: underline; text-underline-offset: 3px; }
.chips.in-pic { grid-column: 1 / -1; max-width: 100%; margin: 4px 0 2px; }
.chips.in-pic .chip { min-height: 36px; padding: 8px 12px; font-size: 14px; }

/* ── Переход в мессенджер: полоска над полем ввода и кнопки в цветах брендов ── */
.chbar { display: flex; align-items: center; gap: 8px; margin: 0 2px 8px; padding: 7px 6px 7px 14px; border-radius: 20px; background: #fff; box-shadow: var(--sh-s), inset 0 0 0 2px var(--edge); animation: msgin .3s ease-out both; }
.chbar-lead { margin-right: auto; font-size: 14px; font-weight: 800; color: var(--soft); white-space: nowrap; }
.mbtn { display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 9px 15px; border: 0; border-radius: 999px; color: #fff; font-weight: 800; font-size: 14.5px; white-space: nowrap; box-shadow: 0 10px 20px -12px rgba(40,40,120,.6); transition: transform .12s; }
.mbtn:active { transform: scale(.97); }
.mbtn svg { width: 17px; height: 17px; flex: none; }
.mbtn.tg { background: #2AABEE; }
.mbtn.max { background: linear-gradient(135deg, #3B6CF6, #8A3FFC); }
.mbtn.on { background: var(--mint-bg); color: var(--mint-ink); box-shadow: none; }
.chbar-x { flex: none; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); font-size: 20px; line-height: 1; }
@media (max-width: 360px) { .chbar-lead { display: none; } }

/* ── Поле ввода ── */
.composer { padding: 8px 12px calc(10px + var(--safe-b)); background: linear-gradient(180deg, rgba(255,246,240,0), rgba(255,246,240,.9) 30%); }
.field { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 26px; background: #fff; box-shadow: var(--sh-s), inset 0 0 0 2px rgba(124,111,106,.14); }
.field:focus-within { box-shadow: var(--sh-s), inset 0 0 0 2px rgba(138,91,214,.45); }
.field textarea {
  flex: 1; min-height: 44px; max-height: 40vh; resize: none;
  padding: 11px 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink);
}
.field textarea::placeholder { color: #A69A95; }
.send { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; transition: opacity .15s, transform .15s; }
.send:disabled { opacity: .35; cursor: default; }
.send:not(:disabled):active { transform: scale(.94); }
/* Голос (24.10.2026): пустое поле — микрофон, есть текст — стрелка, как в мессенджерах. */
.mic { flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; transition: opacity .15s, transform .15s; }
.mic:disabled { opacity: .35; cursor: default; }
.mic:not(:disabled):active { transform: scale(.94); }
.field.recording { box-shadow: var(--sh-s), inset 0 0 0 2px rgba(229,72,77,.4); }
.rec { flex: 1; min-width: 0; min-height: 44px; display: flex; align-items: center; gap: 10px; margin-left: -10px; }
.rec-x { flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(34,28,31,.06); color: var(--muted); font-size: 22px; line-height: 1; display: grid; place-items: center; }
.rec-dot { flex: none; width: 10px; height: 10px; border-radius: 50%; background: #E5484D; animation: recdot 1.2s ease-in-out infinite; }
.rec-time { flex: none; font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.rec-hint { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 14.5px; color: var(--muted); }
@keyframes recdot { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
/* Голосовое — волной, как в Telegram (не текстом расшифровки: Whisper иногда ошибается). */
.bub.voice { display: flex; align-items: center; gap: 10px; width: min(250px, 86%); padding: 8px 14px 8px 8px; white-space: normal; }
.vplay { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: #fff; color: #D2583F; display: grid; place-items: center; box-shadow: 0 6px 14px -8px rgba(160,70,50,.6); }
.vplay svg { margin-left: 1px; }
.vplay.off { background: rgba(255,255,255,.55); color: rgba(120,60,45,.55); box-shadow: none; cursor: default; }
.vwave { flex: 1; min-width: 0; height: 24px; display: flex; align-items: center; justify-content: space-between; }
.vwave i { flex: none; width: 3px; border-radius: 2px; background: rgba(160,70,50,.32); transition: background .1s; }
.vwave i.on { background: #D2583F; }
.vdur { flex: none; font-size: 12.5px; font-weight: 700; color: rgba(120,60,45,.7); font-variant-numeric: tabular-nums; }
.bub.u.pending { opacity: .7; }
.note { margin: 7px 8px 0; font-size: 12px; line-height: 1.4; color: var(--muted); text-align: center; }
.note a { color: var(--muted); }

/* ── Меню (шторка) ── */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(34,28,31,.32); animation: fade .2s ease-out; }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 88dvh; overflow-y: auto; padding: 22px 20px calc(22px + var(--safe-b)); border-radius: 28px 28px 0 0; background: #fff; box-shadow: var(--sh); animation: up .24s ease-out; }
@media (min-width: 760px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 28px; } }
.sheet-x { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(34,28,31,.06); font-size: 22px; line-height: 1; display: grid; place-items: center; }
.sheet-title { margin: 0 0 14px; font-weight: 800; font-size: 21px; letter-spacing: -.02em; }
.sheet h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--lilac); }
.sheet p { margin: 0 0 10px; font-size: 15px; line-height: 1.45; color: var(--soft); }
.sheet .row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.sheet ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sheet li a { font-weight: 700; text-decoration: none; }
.sub-box { padding: 14px 16px; border-radius: 18px; background: #FFF8F3; box-shadow: inset 0 0 0 2px var(--edge); }
.danger { border: 0; background: transparent; color: #A0452F; font-weight: 700; padding: 8px 0; text-decoration: underline; text-underline-offset: 3px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.noscript { padding: 24px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .bub, .typing, .card, .loader li, .sheet, .sheet-back, .hello, .chips, .pic-panel, .pic-bar.pulse { animation: none; }
  .typing span { animation: none; opacity: .8; }
  .rec-dot { animation: none; }
}
