/* Окно чата на страницах персонажей: тёмное матовое стекло поверх размытого портрета, тёплый белый текст и один золотой
   акцент. Цвета — переменные landing.css, новых основных цветов нет. Разметку создаёт chat-widget.js (textContent). */
.cw { --cw-bg: rgba(18, 18, 24, .82); --cw-me: rgba(212, 175, 90, .16); --cw-me-line: rgba(212, 175, 90, .28); --cw-on: #43D99B; --cw-err: #FF8A80;
  --cw-ink: var(--lp-ink, #F3F1EC); --cw-ink2: var(--lp-ink-2, #D8D5CE); --cw-mute: var(--lp-mute, #A5A29B); --cw-dim: var(--lp-dim, #8E8B85);
  --cw-gold: var(--lp-gold, #D4AF5A); --cw-gold-ink: var(--lp-gold-ink, #15120A); --cw-glass: var(--lp-glass, rgba(255, 255, 255, .06)); --cw-line: var(--lp-line, rgba(255, 255, 255, .1));
  --cw-ease: cubic-bezier(.2, .8, .2, 1); --cw-bottom: 20px;
  position: fixed; right: 20px; bottom: calc(var(--cw-bottom) + env(safe-area-inset-bottom, 0px)); z-index: 9000; display: flex; flex-direction: column; align-items: flex-end;
  font: 14.5px/1.45 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--cw-ink); -webkit-font-smoothing: antialiased; }
.cw.above-sticky { --cw-bottom: 96px; }
.cw [hidden] { display: none !important; }
.cw button { font: inherit; color: inherit; cursor: pointer; }
.cw :focus-visible { outline: 2px solid var(--cw-gold); outline-offset: 2px; }

/* свёрнуто: маленький круг с фото, сайт не загораживает */
.cw-launcher { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1.5px solid rgba(212, 175, 90, .7); background: rgba(18, 18, 24, .72); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); box-shadow: 0 8px 24px rgba(0, 0, 0, .4); transition: border-color .15s, transform .15s; }
.cw-launcher:hover { border-color: var(--cw-gold); transform: translateY(-1px); }
.cw-av { position: relative; flex: 0 0 auto; width: 40px; height: 40px; }
.cw-av img, .cw-av .cw-sg { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.cw-av .cw-sg { display: inline-flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .08); border: 1px solid var(--cw-line); font-family: "Unbounded", "Inter", sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .1em; color: var(--cw-ink2); box-sizing: border-box; }
.cw-av .cw-on { position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--cw-on); border: 2px solid #15151b; box-sizing: border-box; }
.cw-av .cw-on.off { background: var(--cw-dim); }
.cw-launcher .cw-av { width: 38px; height: 38px; }
.cw-launcher .cw-av .cw-sg { font-size: 8px; }
.cw-launcher .cw-on { width: 10px; height: 10px; right: -1px; bottom: -1px; }
.cw-dot { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--cw-gold); color: var(--cw-gold-ink); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; border: 2px solid #15151b; box-sizing: border-box; }

/* окно */
.cw-panel { position: relative; width: 380px; height: 600px; max-width: calc(100vw - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-sizing: border-box; border-radius: 22px; border: 1px solid var(--cw-line); background: var(--cw-bg); backdrop-filter: blur(24px) saturate(1.2); -webkit-backdrop-filter: blur(24px) saturate(1.2); box-shadow: 0 24px 80px rgba(0, 0, 0, .6); overflow: hidden; transform-origin: bottom right; animation: cw-open .22s var(--cw-ease), cw-glow 3.5s ease-in-out .3s infinite; }
@supports not (backdrop-filter: blur(1px)) { .cw-panel, .cw-launcher { background: #14141A; } }
.cw-panel::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 90px; background: linear-gradient(180deg, rgba(212, 175, 90, .09), rgba(212, 175, 90, 0)); pointer-events: none; }
@keyframes cw-open { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
@keyframes cw-glow { 0%, 100% { box-shadow: 0 24px 80px rgba(0, 0, 0, .6), 0 0 0 0 rgba(212, 175, 90, 0); } 50% { box-shadow: 0 24px 80px rgba(0, 0, 0, .6), 0 -6px 40px 2px rgba(212, 175, 90, .16); } }
@keyframes cw-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.cw-head { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 10px 12px 16px; border-bottom: 1px solid var(--cw-line); }
.cw-who { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.cw-title { font-size: 15px; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cw-status { font-size: 12px; color: var(--cw-on); }
.cw-status.off { color: var(--cw-mute); }
.cw-by { font-size: 12px; color: var(--cw-mute); }
.cw-mark { font-family: "Unbounded", "Inter", sans-serif; font-size: 10px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--cw-ink2); }
.cw-acts { display: flex; gap: 0; flex: 0 0 auto; }
.cw-min, .cw-close { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--cw-mute); display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; }
.cw-min:hover, .cw-close:hover { background: var(--cw-glass); color: var(--cw-ink); }
.cw-min svg { width: 16px; height: 16px; }
.cw-msgs { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 14px 14px 6px; display: flex; flex-direction: column; gap: 8px; }
.cw-msg { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; animation: cw-up .16s var(--cw-ease); }
.cw-msg-op { align-self: flex-start; background: var(--cw-glass); border-bottom-left-radius: 6px; }
.cw-msg-me { align-self: flex-end; background: var(--cw-me); border: 1px solid var(--cw-me-line); border-bottom-right-radius: 6px; padding-right: 34px; position: relative; }
.cw-tick { position: absolute; right: 9px; bottom: 6px; width: 18px; height: 12px; display: inline-flex; color: var(--cw-dim); }
.cw-tick svg { width: 18px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cw-tick .c2 { display: none; }
.cw-tick.is-read .c2 { display: block; }
.cw-tick.is-read { color: var(--cw-gold); }
.cw-msg-sys { align-self: center; text-align: center; font-size: 12px; line-height: 1.4; color: var(--cw-mute); padding: 2px 10px; max-width: 100%; }
.cw-msg-join { align-self: center; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--cw-line); background: rgba(255, 255, 255, .04); font-size: 12px; color: var(--cw-ink2); max-width: 100%; text-align: center; }
.cw-msg-err { align-self: center; color: var(--cw-err); font-size: 13px; }
.cw-typing { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 18px; border-bottom-left-radius: 6px; background: var(--cw-glass); font-size: 12.5px; color: var(--cw-mute); }
.cw-dots { display: inline-flex; gap: 3px; }
.cw-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--cw-ink2); animation: cw-blink 1.2s infinite; }
.cw-dots i:nth-child(2) { animation-delay: .2s; } .cw-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes cw-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.cw-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 8px 14px; }
.cw-text { flex: 1 1 auto; min-height: 44px; max-height: 120px; padding: 11px 14px; box-sizing: border-box; border-radius: 16px; border: 1px solid var(--cw-line); background: rgba(255, 255, 255, .05); color: var(--cw-ink); font: inherit; font-size: 16px; line-height: 1.35; resize: none; }
.cw-text::placeholder { color: var(--cw-mute); }
.cw-text:focus { border-color: rgba(212, 175, 90, .6); outline: none; }
.cw-send { flex: 0 0 auto; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--cw-gold); color: var(--cw-gold-ink); display: inline-flex; align-items: center; justify-content: center; transition: filter .15s; }
.cw-send:hover { filter: brightness(1.06); }
.cw-send:disabled { opacity: .45; cursor: default; }
.cw-send svg { width: 18px; height: 18px; }
.cw-foot { padding: 4px 14px 12px; border-top: 1px solid var(--cw-line); display: flex; flex-direction: column; gap: 6px; }

/* форма: в ленте после приветствия (имя, телефон, почта) и отдельным экраном, когда никого нет в сети */
.cw-card { align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 18px; border: 1px solid var(--cw-line); background: var(--cw-glass); animation: cw-up .16s var(--cw-ease); }
.cw-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 16px 16px 12px; }
.cw-label { font-size: 10px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--cw-gold); }
.cw-form-title { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.25; letter-spacing: -.01em; }
.cw-form-hint, .cw-card p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--cw-mute); }
.cw-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--cw-mute); }
.cw-card .cw-field { gap: 3px; font-size: 11px; }
.cw-input { width: 100%; height: 46px; padding: 0 14px; box-sizing: border-box; border-radius: 14px; border: 1px solid var(--cw-line); background: rgba(255, 255, 255, .05); color: var(--cw-ink); font: inherit; font-size: 16px; }
.cw-card .cw-input { height: 42px; border-radius: 12px; }
.cw-input:focus { border-color: rgba(212, 175, 90, .6); outline: none; }
.cw-input.bad { border-color: var(--cw-err); }
textarea.cw-input { height: auto; min-height: 72px; padding: 11px 14px; resize: none; line-height: 1.4; }
.cw-consent { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; line-height: 1.4; color: var(--cw-mute); }
.cw-card .cw-consent { font-size: 11px; }
.cw-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--cw-gold); flex: 0 0 auto; }
.cw-error { margin: 0; font-size: 13px; color: var(--cw-err); }
.cw-submit { height: 48px; border: 0; border-radius: 999px; background: var(--cw-gold); color: var(--cw-gold-ink); font-size: 14px; font-weight: 600; }
.cw-card .cw-submit { height: 44px; margin-top: 2px; flex: 1 1 auto; }
.cw-card-row { display: flex; gap: 8px; align-items: center; }
.cw-later { height: 44px; padding: 0 14px; border: 1px solid var(--cw-line); border-radius: 999px; background: transparent; color: var(--cw-ink2); font-size: 13px; }
.cw-later:hover { background: var(--cw-glass); color: var(--cw-ink); }
.cw-submit:hover { filter: brightness(1.06); }
.cw-submit:disabled { opacity: .55; cursor: default; }
.cw-back { align-self: flex-start; border: 0; background: none; padding: 6px 0 0; color: var(--cw-ink2); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; min-height: 28px; }
.cw-back:hover { color: var(--cw-ink); }
.cw-contact-link { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--cw-line); background: transparent; color: var(--cw-ink2); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.cw-contact-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cw-contact-link:hover { color: var(--cw-ink); border-color: var(--cw-gold); }

/* телефон: лист снизу на 92% высоты, страница под ним видна */
@media (max-width: 600px) {
  .cw { right: 16px; }
  .cw.is-open { left: 0; right: 0; top: 0; bottom: 0; align-items: stretch; justify-content: flex-end; background: rgba(10, 10, 13, .35); }
  .cw.is-open .cw-panel { width: 100%; max-width: none; height: 92%; max-height: none; border-radius: 22px 22px 0 0; border-bottom: 0; transform-origin: bottom center; animation: cw-sheet .22s var(--cw-ease); }
  .cw.is-open .cw-panel::after { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px; border-radius: 999px; background: rgba(255, 255, 255, .25); }
  .cw.is-open .cw-head { padding-top: 20px; }
  .cw.is-open .cw-foot { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
  @keyframes cw-sheet { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (prefers-reduced-motion: reduce) { .cw-panel, .cw-msg, .cw-card, .cw-dots i { animation: none; } }

/* карточка доната под приветствием: по ширине сообщения, суммы в ряд, поле и кнопка пополам */
.cw-tip { align-self: flex-start; width: 86%; max-width: 300px; box-sizing: border-box; margin-top: -2px; padding: 10px 10px 9px; border-radius: 16px; border-top-left-radius: 6px; background: rgba(212, 175, 90, .07); border: 1px solid rgba(212, 175, 90, .22); display: flex; flex-direction: column; gap: 8px; animation: cw-up .16s var(--cw-ease); }
.cw-tip-t { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cw-gold); font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.cw-tip-t svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cw-tip-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.cw-tip-amt { width: 100%; height: 36px; border-radius: 999px; border: 1px solid rgba(212, 175, 90, .5); background: rgba(212, 175, 90, .06); color: var(--cw-ink); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; transition: background .15s, color .15s, transform .15s; }
.cw-tip-amt:hover, .cw-tip-amt.is-on { background: var(--cw-gold); color: var(--cw-gold-ink); border-color: var(--cw-gold); }
.cw-tip-amt:hover { transform: translateY(-1px); }
.cw-tip-own { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-items: center; }
.cw-tip-own label { min-width: 0; box-sizing: border-box; display: flex; align-items: center; height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--cw-line); background: rgba(255, 255, 255, .05); color: var(--cw-mute); font-size: 13px; gap: 5px; }
.cw-tip-own label b { color: var(--cw-gold); font-weight: 600; }
.cw-tip-own input { flex: 1 1 auto; min-width: 0; width: 100%; border: 0; background: transparent; color: var(--cw-ink); font: inherit; outline: 0; -moz-appearance: textfield; font-size: 16px; }   /* <16px — iPhone приближает страницу при вводе */
.cw-tip-own input::-webkit-outer-spin-button, .cw-tip-own input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cw-tip-own input::placeholder { color: var(--cw-dim); }
.cw-tip-go { justify-content: center; height: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: var(--cw-gold); color: var(--cw-gold-ink); font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; }
.cw-tip-go:hover { filter: brightness(1.06); }
.cw-tip-go svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.cw-tip-own:only-child, .cw-tip-own.one { grid-template-columns: 1fr; }
.cw-tip-err { font-size: 12px; color: var(--cw-err); text-align: center; }
.cw-tip-note { font-size: 10.5px; color: var(--cw-dim); display: flex; align-items: center; justify-content: center; gap: 6px; }
.cw-tip-note svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
/* сбор на цель под заголовком карточки доната */
.cw-fund { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border-radius: 12px; background: rgba(0, 0, 0, .22); border: 1px solid rgba(212, 175, 90, .2); }
.cw-fund-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--cw-ink); }
.cw-fund-h b { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-fund-h span { font-weight: 700; color: var(--cw-gold); font-variant-numeric: tabular-nums; }
.cw-fund-bar { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 7px; border: 0; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .08); color: var(--cw-gold); }
.cw-fund-bar::-webkit-progress-bar { background: rgba(255, 255, 255, .08); border-radius: 999px; }
.cw-fund-bar::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, #B8913C, var(--cw-gold) 55%, #F2D68A); }
.cw-fund-bar::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, #B8913C, var(--cw-gold) 55%, #F2D68A); }
.cw-fund-f { font-size: 11.5px; color: var(--cw-mute); font-variant-numeric: tabular-nums; }
.cw-fund.is-done .cw-fund-f { color: var(--cw-gold); font-weight: 600; }

/* письмо справа налево (ar, he, fa): пузыри и галочка — зеркально */
[dir="rtl"] .cw-msg-op, [dir="rtl"] .cw-typing { border-bottom-left-radius: 18px; border-bottom-right-radius: 6px; }
[dir="rtl"] .cw-msg-me { border-bottom-right-radius: 18px; border-bottom-left-radius: 6px; padding-right: 13px; padding-left: 34px; }
[dir="rtl"] .cw-tick { right: auto; left: 9px; }
/* вводят свою сумму доната (клавиатура открыта): строка сообщения и «Оставить контакты» уступают место плиткам и кнопкам */
.cw.is-tip-typing .cw-foot, .cw.is-tip-typing .cw-compose { display: none; }
.cw-ask { color: var(--cw-ink, inherit); font-size: 13px; padding: 10px 12px; border-radius: 12px; background: rgba(212, 175, 90, .12); border: 1px solid rgba(212, 175, 90, .35); }
