/* Mini App знакомств. Цвета берутся из темы Telegram (--tg-theme-*), в браузере - запасные. */
:root {
  --bg: var(--tg-theme-bg-color, #ffffff);
  --bg2: var(--tg-theme-secondary-bg-color, #f1f1f5);
  --text: var(--tg-theme-text-color, #16161a);
  --hint: var(--tg-theme-hint-color, #8b8b94);
  --link: var(--tg-theme-link-color, #2b7fd9);
  --accent: #ff4f7b;
  --accent2: #ff7a59;
  --on-accent: #ffffff;
  --sep: rgba(128, 128, 128, .2);
  --green: #22b866;
  --red: #ff3b30;
  --radius: 16px;
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--tg-safe-area-inset-bottom, 0px));
  --safe-t: var(--tg-content-safe-area-inset-top, 0px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--tg-theme-bg-color, #17171c);
    --bg2: var(--tg-theme-secondary-bg-color, #0f0f12);
    --text: var(--tg-theme-text-color, #f2f2f5);
    --hint: var(--tg-theme-hint-color, #8d8d96);
  }
}
/* тема, выбранная ползунком в профиле, - поверх темы Telegram (пока не выбирали - как в Telegram) */
:root[data-theme="light"] { --bg: #ffffff; --bg2: #f1f1f5; --text: #16161a; --hint: #8b8b94; --link: #2b7fd9; color-scheme: light; }
:root[data-theme="dark"] { --bg: #17171c; --bg2: #0f0f12; --text: #f2f2f5; --hint: #8d8d96; --link: #6ab3f3; color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); overflow: hidden; }
body { font: 15px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: var(--text); }
[hidden] { display: none !important; }
.hint { color: var(--hint); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1; }

.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }
[data-rot] .ic { transform: rotate(135deg); }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }

/* заставка */
.splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; text-align: center; }
.splash-logo { font-size: 64px; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }

/* вкладки */
#tabs { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.tab { flex: 1; display: none; flex-direction: column; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.tab.active { display: flex; }
.top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-t)) 16px 8px; }
.top h1 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.pill { font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--bg2); color: var(--hint); }

.tabbar { display: flex; border-top: 1px solid var(--sep); background: var(--bg); padding-bottom: var(--safe-b); }
.tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--hint); font-size: 11px; position: relative; }
.tabbar button.active { color: var(--accent); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; line-height: 18px; font-style: normal; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 20px; border-radius: 14px; font-weight: 600; }
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: var(--on-accent); }
.btn.ghost { background: var(--bg2); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; }
.icon-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--hint); flex: none; }
.icon-btn.accent { background: var(--accent); color: #fff; }
.icon-btn.accent .ic { width: 20px; height: 20px; }
.link-btn { color: var(--link); padding: 8px; }
.round { width: 64px; height: 64px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; }
.round .ic { width: 28px; height: 28px; }
.round.ghost { background: rgba(255, 255, 255, .16); }
.round.ghost.off { background: #fff; color: #111; }
.round.red { background: var(--red); }
.round.green { background: var(--green); }

/* лента */
.feed { flex: 1; display: flex; flex-direction: column; padding: 4px 12px 12px; min-height: 0; }
.card { position: relative; flex: 1; min-height: 360px; border-radius: 22px; overflow: hidden; background: var(--bg2); touch-action: pan-y; transition: transform .2s ease; user-select: none; }
.card img.cover { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.card .shade { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 18px 18px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.card .nm { font-size: 26px; font-weight: 800; }
.card .ct { opacity: .85; margin-top: 2px; }
.card .ab { margin-top: 8px; max-height: 6.8em; overflow: auto; white-space: pre-wrap; word-wrap: break-word; font-size: 14px; opacity: .95; }
.card .stamp { position: absolute; top: 28px; padding: 6px 14px; border: 3px solid; border-radius: 10px; font-size: 26px; font-weight: 900; opacity: 0; transition: opacity .1s; }
.card .stamp.like { left: 22px; color: #3ddc84; transform: rotate(-14deg); }
.card .stamp.skip { right: 22px; color: #ff5a5f; transform: rotate(14deg); }
.card[data-hint="like"] .stamp.like, .card[data-hint="skip"] .stamp.skip { opacity: 1; }
.card .rep { position: absolute; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; display: flex; align-items: center; justify-content: center; }
.card .rep .ic { width: 18px; height: 18px; }
.feed-actions { display: flex; justify-content: center; gap: 28px; padding: 14px 0 4px; }
.feed-actions button { width: 66px; height: 66px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bg); box-shadow: 0 4px 18px rgba(0, 0, 0, .15); }
.feed-actions .no { color: #ff5a5f; }
.feed-actions .yes { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.feed-actions .yes .ic { fill: currentColor; }
.feed-actions .ic { width: 30px; height: 30px; }

/* каталог моделей: сетка по 2 анкеты в ряд, прокрутка вниз (прокручивает сам .tab) */
.feed { padding: 10px 12px calc(12px + var(--safe-b)); }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
/* лента: потянуть вниз - обновить. Кружок со стрелкой выезжает сверху, при отпускании крутится до конца загрузки */
#tab-feed { position: relative; }
.ptr { position: absolute; top: calc(10px + var(--safe-t)); left: 50%; margin-left: -18px; width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg); color: var(--hint); box-shadow: 0 2px 10px rgba(0, 0, 0, .18); display: flex; align-items: center;
  justify-content: center; opacity: 0; transform: translateY(-44px); pointer-events: none; z-index: 3; }
.ptr .ic { width: 20px; height: 20px; }
.ptr.ready { color: var(--accent); }
.ptr.spin .ic { animation: ptrspin .8s linear infinite; }
@keyframes ptrspin { to { transform: rotate(360deg); } }
.gc { position: relative; border-radius: 16px; overflow: hidden; background: var(--bg2); aspect-ratio: 3 / 4; cursor: pointer; }
.gc img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gc .gshade { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 10px 8px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .72)); }
.gc .gn { font-weight: 700; font-size: 15px; }
.gc .gcount { position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; display: flex; align-items: center; gap: 3px; }
.gc .gcount .ic { width: 12px; height: 12px; }

/* мини-анкета модели: карточка по центру, не на весь экран */
.mv-card { width: min(92vw, 380px); max-height: 88vh; background: var(--bg); border-radius: 22px; overflow: hidden; display: flex; flex-direction: column; }
.mv-top { position: relative; flex: none; }
.mv-gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; height: min(40vh, 300px); background: #000; }
.mv-gallery::-webkit-scrollbar { display: none; }
.mv-gallery img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; cursor: pointer; }
.mv-zoom { position: absolute; right: 10px; bottom: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: flex; align-items: center; justify-content: center; }
.mv-zoom .ic { width: 17px; height: 17px; }
.mv-dots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; gap: 6px; justify-content: center; }
.mv-dots i { width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 3px rgba(0, 0, 0, .5); }
.mv-dots i.on { background: #fff; }
.mv-close, .mv-rep { position: absolute; top: 10px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: flex; align-items: center; justify-content: center; }
.mv-close { right: 10px; }
.mv-rep { left: 10px; }
.mv-close .ic, .mv-rep .ic { width: 17px; height: 17px; }
.mv-body { padding: 14px 18px calc(16px + var(--safe-b)); overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.mv-name { font-size: 22px; font-weight: 800; }
.mv-params { list-style: none; margin: 10px 0 2px; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.mv-params li { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; border-bottom: 1px solid var(--sep); padding-bottom: 7px; }
.mv-params li span { color: var(--hint); }
.mv-params li b { font-weight: 600; text-align: right; }
.mv-sec { margin-top: 12px; font-size: 13px; font-weight: 600; color: var(--hint); }
.mv-ab { margin-top: 4px; font-size: 14px; white-space: pre-wrap; word-wrap: break-word; }
.mv-body .btn { margin-top: 14px; }
/* «Написать» - крупная, под прокручиваемой частью карточки (всегда на виду) */
.mv-card.with-foot .mv-body { padding-bottom: 6px; }
.mv-foot { flex: none; padding: 10px 18px calc(16px + var(--safe-b)); }
.mv-foot[hidden] { display: none; }
.mv-write { height: 58px; font-size: 18px; font-weight: 700; border-radius: 16px; gap: 10px; box-shadow: 0 6px 18px rgba(255, 79, 123, .35); }
.mv-write .ic { width: 23px; height: 23px; }

/* просмотр фото на весь экран поверх мини-анкеты */
.photo-view { z-index: 35; }
.pv-gallery { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.pv-gallery::-webkit-scrollbar { display: none; }
.pv-gallery img { flex: none; width: 100vw; height: 100%; object-fit: contain; scroll-snap-align: center; }
.photo-view .mv-dots { top: auto; bottom: calc(16px + var(--safe-b)); }
.photo-view .mv-close { top: calc(12px + var(--safe-t)); left: 12px; z-index: 3; }

/* два поля в ряд в анкете */
.row2 { display: flex; gap: 10px; }
.row2 .field { flex: 1; }

/* кадрирование фото при добавлении: рамка 3:4, двигать/масштабировать */
.cropper { flex-direction: column; justify-content: center; gap: 18px; padding: 20px; z-index: 30; }
.crop-head { color: #fff; font-size: 14px; text-align: center; opacity: .9; max-width: 320px; }
.crop-frame { position: relative; width: min(78vw, 320px); aspect-ratio: 3 / 4; overflow: hidden; border-radius: 16px; background: #111;
  box-shadow: 0 0 0 2px #fff; touch-action: none; -webkit-user-select: none; user-select: none; }
.crop-frame img { position: absolute; left: 0; top: 0; max-width: none; -webkit-user-drag: none; pointer-events: none; }
.crop-zoom { width: min(78vw, 320px); accent-color: var(--accent); }
.crop-actions { display: flex; gap: 12px; }
.crop-actions .btn { min-width: 130px; }
.crop-actions .btn.ghost { background: rgba(255, 255, 255, .16); color: #fff; }   /* фон затемнён - в светлой теме был белый текст на светлом */

/* экран выбора роли при первом входе */

/* поля анкеты, видимые только модели (фото, возраст, о себе) */
body:not(.role-model) .role-model { display: none !important; }
body:not(.role-model) .only-model { display: none !important; }
body:not(.role-client) .role-client { display: none !important; }   /* только у клиента (свой статус) */

/* папки чатов (Все / Покупали / Архив) */
.folders { display: flex; gap: 8px; padding: 0 16px 8px; }
.folders button { padding: 7px 14px; border-radius: 999px; background: var(--bg2); color: var(--hint); font-size: 14px; font-weight: 600; }
.folders button.on { background: var(--accent); color: #fff; }
.tag-bought { margin-left: 6px; font-size: 13px; }
.tag-mute { margin-left: 6px; display: inline-flex; color: var(--hint); }
.tag-mute .ic { width: 14px; height: 14px; }

/* свайп-строка диалога: тянем справа налево - выезжают действия */
.srow { position: relative; overflow: hidden; }
.srow-main { position: relative; z-index: 1; background: var(--bg); will-change: transform; touch-action: pan-y; }
.srow-actions { position: absolute; top: 0; right: 0; bottom: 0; display: flex; z-index: 0; }
.srow-actions .sa { width: 76px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: #fff; font-size: 11px; line-height: 1.1; }
.srow-actions .sa .ic { width: 20px; height: 20px; }
.srow-actions .a-arch { background: #6b7a8f; }
.srow-actions .a-mute { background: #e0a21f; }
.srow-actions .a-bought { background: linear-gradient(135deg, var(--accent), var(--accent2)); }

/* «халявщик» - метка моделей на клиенте (видят все модели) */
.tag-free { margin-left: 6px; padding: 1px 7px; border-radius: 9px; background: rgba(255, 59, 48, .12); color: var(--red); font-size: 11px; font-weight: 700; vertical-align: 2px; }
/* шапка чата у модели: статусы клиента - аккуратные плашки в одну строку, «в сети» - после них, без переносов */
#chatStatus { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; min-height: 17px; }
.who-pill { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 17px; padding: 0 6px; border-radius: 9px;
  font-size: 11px; font-weight: 700; line-height: 1; }
.who-pill .ic { width: 11px; height: 11px; }
.who-pill.who-free { background: rgba(255, 59, 48, .12); color: var(--red); }
#chatStatus .st-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* свой статус клиента в профиле */
.my-level { background: var(--bg2); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.ml-title { font-size: 13px; color: var(--hint); }
.ml-text { font-size: 13px; color: var(--hint); }
.ml-bar { width: 100%; height: 6px; border-radius: 3px; background: var(--sep); overflow: hidden; }
.ml-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width .4s; }
/* уровень клиента (видят модели): базовые - голубые, премиум - фиолетовый, VIP - золотой */
.tag-lvl { margin-left: 6px; padding: 1px 7px; border-radius: 9px; font-size: 11px; font-weight: 700; vertical-align: 2px; white-space: nowrap; }
.lvl-new { background: rgba(142, 142, 147, .16); color: var(--hint); }
.lvl-base1, .lvl-base2, .lvl-base3 { background: rgba(42, 158, 241, .14); color: #2a9ef1; }
.lvl-premium { background: rgba(123, 92, 255, .16); color: #7b5cff; }
.lvl-vip { background: linear-gradient(135deg, #ffd76a, #ffa94d); color: #5a3b00; }
/* шапка чата: собеседник нажимается - анкета/карточка */
.chat-head .ava-wrap, .chat-head .who { cursor: pointer; }
/* карточка клиента для модели */
.cv-head { position: relative; display: flex; justify-content: center; padding: 24px 0 4px; flex: none; }
.cv-head .mv-close { background: var(--bg2); color: var(--text); }
.cv-card .mv-body { align-items: center; text-align: center; }
.cv-card .mv-params { align-self: stretch; text-align: left; }
.cv-status { color: var(--hint); font-size: 14px; min-height: 1em; }
.cv-tags { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 8px; }
.cv-tag { padding: 4px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; }
/* подсказка по статусу (тап по плашке) - поверх карточки клиента */
#lvlInfo { z-index: 25; }
.tap { cursor: pointer; }
.li-card .mv-body { align-items: center; text-align: center; gap: 12px; padding-top: 22px; }
.li-text { font-size: 14px; color: var(--hint); line-height: 1.4; }
.li-list { list-style: none; margin: 0; padding: 0; align-self: stretch; display: flex; flex-direction: column; gap: 4px; text-align: left; }
.li-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 10px; font-size: 14px; }
.li-list li.on { background: var(--bg2); font-weight: 700; }
.li-list .tag-lvl { margin-left: 0; vertical-align: 0; }
.my-level { cursor: pointer; }
.cv-tag.bad { background: rgba(255, 59, 48, .12); color: var(--red); }

/* меню модели: статус + статистика */
.stats-body { padding: 4px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.menu-status { background: var(--bg2); border-radius: 16px; padding: 12px; }
.ms-title { font-size: 13px; color: var(--hint); margin-bottom: 8px; text-align: center; }
/* «Отошла» и под ним «скоро вернусь» - столбиком; кнопки в ряду одной высоты, однострочные - по центру */
.seg.status-seg button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; height: auto; min-width: 0; padding: 9px 4px; line-height: 1.15; }
.status-seg button small { display: block; font-size: 10px; font-weight: 400; opacity: .75; white-space: nowrap; }
.status-seg button.on[data-s="online"] { background: var(--green); color: #fff; box-shadow: none; }
.status-seg button.on[data-s="away"] { background: #e0a21f; color: #fff; box-shadow: none; }
.status-seg button.on[data-s="offline"] { background: var(--hint); color: #fff; box-shadow: none; }
.menu-sec { font-size: 13px; font-weight: 600; color: var(--hint); margin-top: 4px; }
/* пилюля статуса модели (видит клиент) */
.gc .gstatus { position: absolute; top: 8px; left: 8px; display: flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 11px; }
.gc .gstatus i, .mv-status i, .who-status i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.mv-status { display: flex; align-items: center; gap: 6px; font-size: 14px; }
.who-status { display: inline-flex; align-items: center; gap: 5px; }
.earn-card { width: min(94vw, 420px); max-height: 90vh; overflow-y: auto; background: var(--bg); border-radius: 22px;
  padding: 16px 16px calc(16px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.stats-head { display: flex; align-items: center; justify-content: space-between; }
.stats-head b { font-size: 20px; }
.stats-period button { font-size: 13px; padding: 0 6px; }
.stats-datewrap { font-size: 13px; color: var(--hint); display: flex; align-items: center; gap: 8px; }
.stats-datewrap input { padding: 8px 10px; border-radius: 10px; border: 1px solid var(--sep); background: var(--bg2); color: var(--text); font-size: 15px; }
.stats-total { text-align: center; }
.stats-total b { font-size: 34px; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats-total small { display: block; color: var(--hint); margin-top: 2px; }
.stats-chart { display: flex; align-items: flex-end; gap: 4px; height: 110px; padding: 6px 2px 0; overflow-x: auto; }
.stats-chart .bar { flex: 1 0 18px; min-width: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.stats-chart .bar i { width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(var(--accent), var(--accent2)); }
.stats-chart .bar span { font-size: 10px; color: var(--hint); white-space: nowrap; }
.stats-chart .bar b { font-size: 10px; color: var(--text); }
.stats-empty { color: var(--hint); text-align: center; padding: 24px; }
.stats-list { display: flex; flex-direction: column; }
.earn-item { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--sep); }
.earn-item .ei-main { flex: 1; min-width: 0; }
.earn-item .ei-main b { display: block; }
.earn-item .ei-main span { color: var(--hint); font-size: 12px; }
.earn-item .ei-amt { font-weight: 700; color: var(--green); }
.earn-item .ei-del { width: 30px; height: 30px; border-radius: 50%; background: var(--bg2); color: var(--hint); display: flex; align-items: center; justify-content: center; }
.earn-item .ei-del .ic { width: 15px; height: 15px; }
.earn-item .ei-wait { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; font-size: 15px; }

/* калькулятор оплат */
.earn-sum { text-align: center; font-size: 40px; font-weight: 800; }
/* процент площадки: в калькуляторе, в итоге статистики и у каждой записи */
.earn-fee { text-align: center; font-size: 14px; color: var(--hint); margin-top: -6px; }
.stats-fee { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 10px 12px; border-radius: 14px;
  background: var(--bg2); font-size: 14px; color: var(--hint); text-align: center; }
.stats-fee b { color: var(--text); }
.stats-fee small { flex-basis: 100%; font-size: 12px; }
.ei-amt small { display: block; font-size: 11px; font-weight: 400; color: var(--hint); text-align: right; }
/* модель: этап проверки анкеты */
.mod-status { padding: 10px 12px; border-radius: 12px; font-size: 14px; text-align: center; }
.mod-status.ok { background: rgba(34, 184, 102, .12); color: var(--green); }
.mod-status.wait { background: rgba(224, 162, 31, .14); color: #b77d00; }
.mod-status.no { background: rgba(255, 59, 48, .12); color: var(--red); }
.earn-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.earn-quick button { padding: 10px 14px; border-radius: 12px; background: var(--bg2); color: var(--text); font-weight: 600; font-size: 15px; }
.earn-quick button:active { background: var(--accent); color: #fff; }
.earn-custom { display: flex; gap: 8px; }
.earn-custom input { flex: 1; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--sep); background: var(--bg2); color: var(--text); font-size: 16px; }
.earn-custom button { padding: 0 16px; border-radius: 12px; background: var(--bg2); color: var(--accent); font-weight: 600; }
#earnNote { padding: 11px 14px; border-radius: 12px; border: 1px solid var(--sep); background: var(--bg2); color: var(--text); font-size: 16px; }
.earn-row { display: flex; gap: 10px; }
.earn-row .btn { flex: 1; }
.empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 30px; text-align: center; color: var(--hint); }
.empty .big { font-size: 48px; }

/* список чатов */
.list { padding-bottom: 12px; }
.row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; width: 100%; text-align: left; }
.row:active { background: var(--bg2); }
.row .mid { flex: 1; min-width: 0; }
.row .mid b { display: block; font-size: 16px; }
.row .mid > span { display: block; color: var(--hint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* превью; метки в имени - свои стили */
.row .side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; color: var(--hint); font-size: 12px; }
.row .side .badge { position: static; }
.ava-wrap { position: relative; flex: none; }
.ava { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--bg2); display: block; flex: none; }
.ava.big { width: 96px; height: 96px; }
.online { position: absolute; right: 1px; bottom: 1px; width: 13px; height: 13px; border-radius: 50%; background: var(--green); border: 2px solid var(--bg); }

/* анкета */
.form { display: flex; flex-direction: column; gap: 12px; padding: 4px 16px calc(24px + var(--safe-b)); }
/* фото анкеты модели: до 3 плиток + плитка «добавить» */
.photos { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.photos .ph, .photos .add { width: 104px; height: 132px; border-radius: 16px; overflow: hidden; background: var(--bg2); position: relative; flex: none; }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph .del { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: flex; align-items: center; justify-content: center; }
.photos .ph .del .ic { width: 15px; height: 15px; }
.photos .add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--hint); font-size: 12px; border: 1.5px dashed var(--sep); cursor: pointer; }
.photos .add .ic { width: 24px; height: 24px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; color: var(--hint); padding-left: 4px; }
.field input, .field textarea, .range input { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--sep); background: var(--bg2); font-size: 16px; outline: none; resize: none; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
/* видеоинструкция в профиле */
.guide { margin-top: 12px; width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px;
  background: var(--bg2); border-radius: 14px; color: inherit; text-align: left; cursor: pointer; }
.guide[hidden] { display: none; }
.guide-thumb { position: relative; flex: none; width: 46px; height: 62px; border-radius: 10px; overflow: hidden; background: var(--sep); }
.guide-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.guide-thumb .ic { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px 0 0 -12px; color: #fff;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55)); }
.guide-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.guide-text b { font-size: 15px; }
.guide-text small { font-size: 13px; color: var(--hint); }
.guide-go .ic { width: 18px; height: 18px; color: var(--hint); transform: rotate(180deg); }
/* админ смотрит модель: плашка сверху + всё приложение только на чтение (сервер тоже запрещает запись) */
#viewBar { flex: none; background: #b26a00; color: #fff; font-size: 13px; font-weight: 600; text-align: center;
  padding: calc(6px + var(--safe-t)) 12px 6px; }
#viewBar[hidden] { display: none; }
#viewBar b { font-weight: 800; }
body.readonly #composer, body.readonly #btnCallAudio, body.readonly #btnCallVideo, body.readonly #btnChatMenu,
body.readonly #statsAddBtn, body.readonly #saveProfile, body.readonly .ei-del,
body.readonly #photos .add, body.readonly .photos .del, body.readonly #becomeModel { display: none !important; }
body.readonly #statusSeg, body.readonly #onlineFor, body.readonly #prvCalls, body.readonly #prvNoFree, body.readonly .settings .switch {
  pointer-events: none; opacity: .55; }
.ro-note { display: none; }
body.readonly .ro-note { display: block; padding: 12px 16px calc(12px + var(--safe-b)); text-align: center;
  color: var(--hint); font-size: 13px; border-top: 1px solid var(--sep); background: var(--bg); }
/* модель: приватность - кто может ей звонить */
.privacy { margin-top: 12px; background: var(--bg2); border-radius: 14px; padding: 14px 14px 10px; }
.prv-title { font-weight: 700; font-size: 16px; }
.prv-sub { margin-top: 10px; font-size: 13px; font-weight: 600; color: var(--hint); }
.prv-opts { margin-top: 2px; }
.prv-opt { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 6px 0; border-bottom: 1px solid var(--sep); cursor: pointer; }
.prv-opt input { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.prv-opt span { display: flex; flex-direction: column; font-size: 15px; }
.prv-opt small { font-size: 12px; color: var(--hint); margin-top: 1px; }
.prv-free { border-bottom: 1px solid var(--sep); }
.prv-hint { margin-top: 8px; font-size: 12px; color: var(--hint); line-height: 1.4; }
/* меню модели: как статус сменится сам (закрыла приложение / «отошла» по сроку) */
.ms-hint { margin-top: 8px; font-size: 12px; color: var(--hint); text-align: center; line-height: 1.35; }
/* «Онлайн на время»: клиенты видят «Онлайн» и без приложения, пока не выйдет срок */
.online-for { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; font-size: 13px; color: var(--hint); }
.online-for button { padding: 6px 12px; border-radius: 16px; background: var(--bg); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.online-for button.on { background: var(--green); color: #fff; }
.online-for button.off { background: none; color: var(--accent); box-shadow: none; }
/* клиент: модель не принимает от него звонки - кнопки приглушены (нажатие объяснит почему) */
.icon-btn.off { opacity: .35; }
/* настройки под анкетой: ползунок темы */
.settings { margin-top: 12px; background: var(--bg2); border-radius: 14px; padding: 0 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; cursor: pointer; }
.switch { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 51px; height: 31px; margin: 0; border-radius: 16px;
  background: rgba(120, 120, 128, .32); transition: background .2s; cursor: pointer; outline: none; }
.switch::before { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--accent); }
.switch:checked::before { transform: translateX(20px); }
.range { display: flex; align-items: center; gap: 10px; color: var(--hint); }
.seg { display: flex; gap: 6px; background: var(--bg2); border-radius: 12px; padding: 4px; }
.seg button { flex: 1; height: 38px; border-radius: 9px; color: var(--hint); font-weight: 600; }
.seg button.on { background: var(--bg); color: var(--accent); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.check { display: flex; align-items: center; gap: 10px; padding: 4px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

/* чат */
.chat { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg2); z-index: 5; }
.chat-head { display: flex; align-items: center; gap: 8px; padding: calc(6px + var(--safe-t)) 6px 6px; background: var(--bg); border-bottom: 1px solid var(--sep); }
.chat-head .ava { width: 40px; height: 40px; }
.chat-head .online { width: 11px; height: 11px; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--hint); }
.who small.on { color: var(--accent); }
.msgs { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 10px 10px 6px; display: flex; flex-direction: column; gap: 4px; overscroll-behavior: contain; }
.day, .sys { align-self: center; margin: 8px 0; padding: 4px 12px; border-radius: 12px; background: rgba(0, 0, 0, .08); color: var(--hint); font-size: 13px; }
.sys { display: flex; align-items: center; gap: 6px; }
.sys .ic { width: 15px; height: 15px; }
.sys.sys-block { color: var(--red); max-width: 92%; text-align: center; }
/* блокировка: вместо поля ввода и записи - плашка (с «Разблокировать» у того, кто заблокировал), звонков нет */
.blockbar { display: none; flex-direction: column; align-items: center; gap: 10px; padding: 12px 16px calc(12px + var(--safe-b));
  background: var(--bg); border-top: 1px solid var(--sep); color: var(--hint); text-align: center; font-size: 14px; }
.chat.blocked .blockbar { display: flex; }
.chat.blocked .composer, .chat.blocked .crbar, .chat.blocked .cr-lock, .chat.blocked .cr-knob,
.chat.blocked #btnCallAudio, .chat.blocked #btnCallVideo { display: none !important; }
.msg { max-width: 80%; display: flex; flex-direction: column; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg.theirs { align-self: flex-start; align-items: flex-start; }
.msg.k-circle { max-width: 100%; }                 /* кружок во время просмотра - на всю ширину переписки */
.bubble { padding: 7px 11px; border-radius: 18px; background: var(--bg); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; }
/* зажать сообщение - своё меню «Копировать»: без системного выделения текста и выноски iOS; подсветка, пока меню открыто */
.msg.k-text .bubble, .cc-msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.msg.picked .bubble, .cc-msg.picked { filter: brightness(.85); transition: filter .15s; }
.mine .bubble { background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; }
.mine .bubble { border-bottom-right-radius: 6px; }
.theirs .bubble { border-bottom-left-radius: 6px; }
.meta { font-size: 11px; color: var(--hint); padding: 1px 6px; display: inline-flex; align-items: center; gap: 2px; }
.meta .ic { width: 14px; height: 14px; }
.meta .read { color: var(--accent); }
.msg img.photo { max-width: 240px; max-height: 320px; border-radius: 16px; display: block; background: var(--bg); cursor: zoom-in; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.voice .vp-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255, 255, 255, .25); display: flex; align-items: center; justify-content: center; flex: none; }
.theirs .voice .vp-btn { background: var(--accent); color: #fff; }
.voice .vp-btn .ic { width: 18px; height: 18px; }
.vp-bar { flex: 1; height: 4px; border-radius: 2px; background: rgba(128, 128, 128, .35); overflow: hidden; }
.vp-bar i { display: block; height: 100%; width: 0; background: currentColor; }
.vp-time { font-size: 12px; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; }
.circle-msg { position: relative; width: var(--cs, 200px); height: var(--cs, 200px); cursor: pointer; }
.circle-msg video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #000; display: block; }
.circle-msg svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); transform: rotate(-90deg); pointer-events: none; }
.circle-msg circle { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; stroke-linecap: round; }
.circle-msg .cm-dur { position: absolute; left: 10px; bottom: 10px; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; }
.circle-msg .cm-snd { position: absolute; right: 12px; bottom: 10px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; display: flex; align-items: center; justify-content: center; }
.circle-msg .cm-snd .ic { width: 15px; height: 15px; }
/* большой (размер --cs ставит fitCircle): подписи внутри круга, а не в далёких углах квадрата */
.circle-msg.big .cm-dur { left: 15%; bottom: 15%; }
.circle-msg.big .cm-snd { right: 15%; bottom: 15%; }
/* чужой кружок докачивается: ободок показывает проценты (или крутится, если размер неизвестен) */
.circle-msg.loading circle { transition: stroke-dashoffset .2s; }
.circle-msg.loading::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 0, 0, .25); }
.circle-msg.spin svg { animation: cmspin 1s linear infinite; }
.circle-msg.spin circle { stroke-dashoffset: 226 !important; }
@keyframes cmspin { to { transform: rotate(270deg); } }
.uploading { opacity: .92; }
.typing { color: var(--accent) !important; }

.composer { display: flex; align-items: flex-end; gap: 4px; padding: 6px 6px calc(6px + var(--safe-b)); background: var(--bg); border-top: 1px solid var(--sep); }
.composer textarea { flex: 1; min-height: 40px; max-height: 140px; padding: 9px 14px; border-radius: 20px; border: 1px solid var(--sep); background: var(--bg2); resize: none; outline: none; font-size: 16px; line-height: 1.3; }
.recbar { align-items: center; padding-left: 16px; gap: 10px; }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

/* оверлеи */
.overlay { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; }
.overlay.dark { background: rgba(0, 0, 0, .92); color: #fff; }
.overlay.dim { background: rgba(0, 0, 0, .5); }
#viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }

.cr-box { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.cr-circle { position: relative; width: min(76vw, 340px); height: min(76vw, 340px); }
.cr-circle video { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #222; }
.cr-circle video.mirror { transform: scaleX(-1); }
.cr-ring { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); pointer-events: none; }
.cr-ring circle { fill: none; stroke: var(--accent); stroke-width: 2; stroke-dasharray: 301.6; stroke-dashoffset: 301.6; stroke-linecap: round; }
.cr-time { font-variant-numeric: tabular-nums; opacity: .85; }
.cr-row { display: flex; align-items: center; gap: 28px; }
.cr-choose { display: flex; flex-direction: column; align-items: stretch; gap: 12px; width: min(76vw, 300px); }
.cr-choose[hidden] { display: none; }
.cr-choose .btn { height: 52px; font-size: 17px; }
.cr-choose .btn .ic { width: 22px; height: 22px; }
.cr-choose .btn.ghost { background: rgba(255, 255, 255, .16); color: #fff; }
.cr-choose .link-btn { color: rgba(255, 255, 255, .7); padding: 8px; }
.round.rec { width: 76px; height: 76px; border: 4px solid #fff; background: transparent; }
.round.rec i { width: 56px; height: 56px; border-radius: 50%; background: var(--red); transition: all .15s; }
.round.rec.on i { width: 30px; height: 30px; border-radius: 8px; }
.round.send { background: linear-gradient(135deg, var(--accent), var(--accent2)); }
.round:disabled { opacity: .35; }
.cr-time.live::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--red); animation: blink 1s infinite; }
/* кружок с удержанием: полоса записи поверх поля ввода, ползунок едет за пальцем, замок над ним */
.crbar { position: fixed; left: 0; right: 0; z-index: 15; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--bg); border-top: 1px solid var(--sep); }
.crbar[hidden] { display: none; }
.crbar-up { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--accent); font-weight: 600; white-space: nowrap; }
.crbar-up .ic { width: 16px; height: 16px; animation: nudge 1s ease-in-out infinite; }
.crbar-slide.armed { color: var(--red); }
.crbar-slide.armed .shine { animation: none; background: none; color: var(--red); -webkit-text-fill-color: var(--red); font-weight: 600; }
.crbar-slide.armed .chevs { animation: none; }
.crbar-slide.lockz .chevs { display: none; }
.crbar-slide.lockz .shine { animation: none; background: none; color: var(--accent); -webkit-text-fill-color: var(--accent); font-weight: 600; }
.crbar-slide { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; margin-right: 64px; color: var(--hint); font-size: 15px; will-change: transform; }
.chevs { display: flex; animation: chev 1.1s ease-in-out infinite; }
.chevs .ic { width: 16px; height: 16px; margin-right: -9px; }
.chevs .ic:last-child { opacity: .5; }
@keyframes chev { 50% { transform: translateX(-7px); } }
.shine { background: linear-gradient(90deg, var(--hint) 35%, var(--text) 50%, var(--hint) 65%); background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 2.2s linear infinite; }
@keyframes shine { from { background-position: 100% 0; } to { background-position: 0 0; } }
.cr-knob { position: fixed; z-index: 16; width: 76px; height: 76px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); color: #fff; display: flex; align-items: center; justify-content: center; pointer-events: none; will-change: transform; transition: transform .07s linear; animation: knobIn .18s ease-out, knobPulse 1.4s ease-out .2s infinite; }
.cr-knob[hidden] { display: none; }
.cr-knob .ic { width: 32px; height: 32px; }
.cr-knob.armed { animation: none; box-shadow: 0 0 0 6px rgba(255, 79, 123, .3); }
.cr-knob.cancel { animation: none; background: var(--red); box-shadow: 0 0 0 6px rgba(255, 59, 48, .25); }
.cr-knob.gone { scale: .3; opacity: 0; transition: scale .2s, opacity .2s; }
@keyframes knobIn { from { scale: .4; opacity: 0; } }
@keyframes knobPulse { 0% { box-shadow: 0 0 0 0 rgba(255, 79, 123, .45); } 100% { box-shadow: 0 0 0 22px rgba(255, 79, 123, 0); } }
.cr-lock { position: fixed; z-index: 16; width: 44px; padding: 10px 0 8px; border-radius: 22px; background: var(--bg); color: var(--hint); box-shadow: 0 2px 12px rgba(0, 0, 0, .18); display: flex; flex-direction: column; align-items: center; gap: 2px; pointer-events: none; transition: background .15s, color .15s; animation: knobIn .2s ease-out; }
.cr-lock[hidden] { display: none; }
.cr-lock .ic { width: 20px; height: 20px; }
.cr-lock.armed { background: var(--accent); color: #fff; }
.cr-up { animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-5px); } }
#btnCircle, #btnVoice { touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

.call { background: radial-gradient(circle at 50% 30%, #3a2a3f, #111 70%); color: #fff; flex-direction: column; justify-content: space-between;
  --pip-w: 104px; --pip-h: 150px; --pip-bottom: 0px; }
.call.chat-open { --pip-w: 80px; --pip-h: 116px; }
/* какое видео большое, какое в мини-окне - решает JS (классы big/mini); угол мини-окна - классы pip-l / pip-b
   на .call, нижняя граница (над кнопками и чатом) - --pip-bottom. Во время перетаскивания - left/top в style */
.call video.big { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: cover; background: #000; z-index: 0; }
.call video.mini { position: absolute; left: calc(100% - var(--pip-w) - 14px); top: calc(16px + var(--safe-t)); width: var(--pip-w); height: var(--pip-h);
  border-radius: 14px; object-fit: cover; background: #222; z-index: 4; box-shadow: 0 4px 16px rgba(0, 0, 0, .4); cursor: pointer;
  touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  transition: left .25s ease, top .25s ease, width .25s ease, height .25s ease, border-radius .25s ease; }
.call.pip-l video.mini { left: 14px; }
.call.pip-b video.mini { top: calc(100% - var(--pip-bottom) - var(--pip-h) - 12px); }
.call video.mirror { transform: scaleX(-1); }
.call-info { position: relative; z-index: 1; margin-top: 18vh; display: flex; flex-direction: column; align-items: center; gap: 10px; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.call-info b { font-size: 24px; }
.call-info.compact { margin-top: calc(18px + var(--safe-t)); align-self: flex-start; align-items: flex-start; padding-left: 18px; }
.call-info.compact .ava { display: none; }
.call-info.compact b { font-size: 18px; }
.call.pip-on.pip-l:not(.pip-b) .call-info.compact { align-self: flex-end; align-items: flex-end; padding: 0 18px 0 0; }   /* мини-окно в левом верхнем углу */
.call-bottom { position: relative; z-index: 2; align-self: stretch; display: flex; flex-direction: column; min-height: 0; }
.call-actions { position: relative; display: flex; gap: 18px; justify-content: center; padding: 0 16px calc(40px + var(--safe-b)); }
#callActive { gap: min(14px, 3vw); }
#callActive .round { width: min(60px, 14.5vw); height: min(60px, 14.5vw); position: relative; }
#callActive .round .ic { width: 26px; height: 26px; }
.call.chat-open .call-actions { padding-bottom: calc(20px + var(--safe-b)); }
#cChat.on { background: var(--accent); }
#cChat .badge { top: -2px; left: auto; right: -2px; }

/* мини-чат в звонке. Без размытия фона (backdrop-filter): поверх живого видео оно пересчитывается каждый кадр -
   лишняя работа видеокарте и нагрев; плотный полупрозрачный фон читается так же */
.call-chat { position: relative; display: flex; flex-direction: column; min-height: 0; margin: 0 10px 12px; padding: 8px 8px 8px; border-radius: 20px;
  background: rgba(0, 0, 0, .62); }
.call-msgs { flex: 0 1 auto; min-height: 0; max-height: 30vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 4px; padding: 2px 2px 6px; }
.cc-msg { max-width: 82%; padding: 6px 10px; border-radius: 16px; background: rgba(255, 255, 255, .16); white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 15px; line-height: 1.3; }
.cc-msg small { margin-left: 8px; font-size: 11px; opacity: .65; float: right; margin-top: 5px; }
.cc-msg.mine { align-self: flex-end; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-bottom-right-radius: 6px; }
.cc-msg.theirs { align-self: flex-start; border-bottom-left-radius: 6px; }
.cc-empty { align-self: center; padding: 10px; color: rgba(255, 255, 255, .7); font-size: 13px; text-align: center; }
.cc-typing { position: absolute; left: 16px; bottom: 100%; margin-bottom: 4px; font-size: 13px; color: #fff; text-shadow: 0 1px 4px rgba(0, 0, 0, .6); }
.call-compose { display: flex; align-items: flex-end; gap: 6px; }
.call-compose textarea { flex: 1; min-height: 40px; max-height: 96px; padding: 9px 14px; border-radius: 20px; border: none; background: rgba(255, 255, 255, .14);
  color: #fff; resize: none; outline: none; font-size: 16px; line-height: 1.3; }
.call-compose textarea::placeholder { color: rgba(255, 255, 255, .6); }
.call-peek { position: absolute; left: 14px; bottom: 100%; margin-bottom: 10px; max-width: min(78vw, 340px); padding: 8px 12px; border-radius: 16px 16px 16px 6px;
  background: rgba(0, 0, 0, .72); display: flex; flex-direction: column; gap: 2px;
  font-size: 14px; cursor: pointer; animation: peekIn .22s ease-out; }
.call-peek b { font-size: 13px; color: var(--accent); }
.call-peek span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
@keyframes peekIn { from { opacity: 0; transform: translateY(8px); } }
/* мини-окно в нижнем углу: сообщение и «печатает…» - не под ним */
.call.pip-on.pip-b .call-peek { max-width: calc(100% - var(--pip-w) - 42px); }
.call.pip-on.pip-b.pip-l .call-peek { left: auto; right: 14px; border-radius: 16px 16px 6px 16px; }
.call.pip-on.pip-b.pip-l .cc-typing { left: auto; right: 16px; }
.ringing .ava { animation: ring 1.4s ease-in-out infinite; }
@keyframes ring { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 79, 123, .6); } 50% { box-shadow: 0 0 0 18px rgba(255, 79, 123, 0); } }

.pop { width: min(90vw, 360px); background: var(--bg); border-radius: 24px; padding: 26px 20px 18px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.pop-title { font-size: 26px; font-weight: 800; }
.grad { background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pop-avas { display: flex; margin: 6px 0; }
.pop-avas .ava { border: 4px solid var(--bg); }
.pop-avas .ava + .ava { margin-left: -18px; }

.sheet-wrap { align-items: flex-end; }
/* пересылка: снизу - список своих чатов, после выбора - подтверждение «Отправить …?» */
.fwd-card { width: 100%; max-width: 520px; max-height: 75vh; background: var(--bg); border-radius: 20px 20px 0 0;
  display: flex; flex-direction: column; padding-bottom: calc(10px + var(--safe-b)); }
.fwd-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 6px 18px; font-size: 17px; }
.fwd-list { overflow-y: auto; padding: 0 8px; }
.fwd-list[hidden], .fwd-confirm[hidden] { display: none; }
.fwd-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 12px; text-align: left; color: inherit; }
.fwd-row:active { background: var(--bg2); }
.fwd-row .ava { width: 44px; height: 44px; }
.fwd-name { flex: 1; min-width: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fwd-row small { color: var(--hint); font-size: 12px; }
.fwd-empty { padding: 24px 16px; text-align: center; color: var(--hint); }
.fwd-confirm { padding: 6px 16px 4px; display: flex; flex-direction: column; gap: 16px; }
.fwd-to { display: flex; align-items: center; gap: 12px; }
.fwd-to .ava { width: 52px; height: 52px; }
.fwd-to b { display: block; font-size: 17px; }
.fwd-to small { color: var(--hint); font-size: 14px; }
.fwd-btns { display: flex; gap: 10px; }
.fwd-btns .btn { flex: 1; }
/* метка пересланного (без имени автора) */
.fwd-label { font-size: 12px; color: var(--hint); margin: 0 6px 3px; }
.msg.mine .fwd-label { text-align: right; }
/* зажать фото / видео / кружок / голосовое - своё меню, без системной выноски «Сохранить изображение» */
.msg.k-photo img, .msg .video-msg, .msg .circle-msg, .msg.k-voice .bubble {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; -webkit-user-drag: none; }
.msg.picked .photo, .msg.picked .video-msg, .msg.picked .circle-msg { filter: brightness(.85); transition: filter .15s; }
.sheet { width: 100%; max-width: 520px; background: var(--bg); border-radius: 20px 20px 0 0; padding: 8px 8px calc(10px + var(--safe-b)); display: flex; flex-direction: column; }
.sheet .s-title { padding: 12px 16px 6px; color: var(--hint); font-size: 13px; text-align: center; }
.sheet button { padding: 15px 16px; border-radius: 12px; text-align: center; font-size: 16px; }
.sheet button:active { background: var(--bg2); }
.sheet button.danger { color: var(--red); }
.sheet button.cancel { font-weight: 600; margin-top: 4px; background: var(--bg2); }

.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 50; max-width: 92vw; padding: 10px 16px; border-radius: 14px; background: rgba(30, 30, 34, .94); color: #fff; font-size: 14px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); }

/* голосовое: запись - живая волна; сообщение - волна, перемотка по ней, скорость */
.recbar { padding-left: 6px; }
.rec-wave { flex: 1; min-width: 0; height: 32px; }
.voice { min-width: 220px; }
.vp-wave { flex: 1; height: 30px; display: flex; align-items: center; gap: 2px; cursor: pointer; min-width: 120px; }
.vp-wave i { flex: 1; min-width: 2px; max-width: 4px; border-radius: 2px; background: currentColor; opacity: .35; }
.vp-wave i.on { opacity: 1; }
.theirs .vp-wave i { background: var(--accent); }
.vp-speed { font-size: 11px; font-weight: 700; padding: 3px 6px; border-radius: 8px; background: rgba(128, 128, 128, .25); color: inherit; flex: none; min-width: 34px; }
/* видео в чате: обложка, ▶, длительность; по нажатию - полноэкранный просмотр */
.video-msg { position: relative; min-width: 140px; min-height: 120px; max-width: 240px; border-radius: 16px; overflow: hidden; background: #000; cursor: pointer; }
.video-msg img { display: block; max-width: 240px; max-height: 320px; width: 100%; object-fit: cover; }
.vm-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 52px; height: 52px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; display: flex; align-items: center; justify-content: center; }
.vm-play .ic { width: 24px; height: 24px; margin-left: 3px; }
.vm-dur { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 10px; background: rgba(0, 0, 0, .5); color: #fff; font-size: 12px; }
.vv { background: #000; flex-direction: column; align-items: stretch; justify-content: flex-start; }
.vv-top { flex: none; display: flex; justify-content: flex-end; padding: calc(8px + var(--safe-t)) 12px 8px; }
.vv-close { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; display: flex; align-items: center; justify-content: center; }
.vv-close .ic { width: 22px; height: 22px; }
.vv-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding-bottom: var(--safe-b); }
.vv-body video { max-width: 100%; max-height: 100%; background: #000; }

/* фоновые загрузки: пузырь в чате и кольцо в списке диалогов */
.up-bubble { display: flex; align-items: center; gap: 8px; }
.up-ring { width: 20px; height: 20px; transform: rotate(-90deg); flex: none; }
.up-ring circle { fill: none; stroke-width: 2.6; }
.up-ring .trk { stroke: currentColor; opacity: .3; }
.up-ring .bar { stroke: currentColor; stroke-dasharray: 62.8; stroke-dashoffset: 62.8; stroke-linecap: round; transition: stroke-dashoffset .25s; }
.up-ring.spin { animation: cmspin 1s linear infinite; }
.up-ring.spin .bar { stroke-dashoffset: 47; }
.up-x { width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .22); color: inherit; flex: none; }
.up-x .ic { width: 14px; height: 14px; }
.up-act { padding: 4px 12px; border-radius: 12px; background: #fff; color: var(--accent); font-weight: 700; font-size: 13px; flex: none; }
.up-err { width: 20px; height: 20px; border-radius: 50%; background: #fff; color: var(--red); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; flex: none; }
.row .side .up { width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; color: var(--accent); }
.row .side .up .up-ring { width: 22px; height: 22px; }
.row .side .up.err { border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 13px; }
.row .mid > span.up-line { color: var(--accent); }
.row .mid > span.up-line.err { color: var(--red); }

/* профиль клиента: стать моделью по ключу от администратора */
.become-model { margin-top: 12px; background: var(--bg2); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bm-title { font-weight: 700; font-size: 16px; }
.bm-text { font-size: 13px; color: var(--hint); line-height: 1.4; }
.bm-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bm-btns .btn { flex: 1 1 140px; height: 40px; padding: 0 10px; font-size: 14px; background: var(--bg); }
.bm-key { display: flex; gap: 8px; }
.bm-key input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--sep); background: var(--bg);
  color: var(--text); font-size: 15px; letter-spacing: 1px; text-transform: uppercase; outline: none; }
.bm-key input::placeholder { text-transform: none; letter-spacing: 0; }
.bm-key .btn { height: 42px; padding: 0 16px; }
