/* COFI: почти чёрный фон, сочный оранжевый, «надутые» объёмные формы.
   Скругления: интерактивное (кнопки, чипы) — пилюля, контейнеры — 28px, поля ввода — 16px. */
:root {
  /* палитра из макета «Нити» */
  --bg: #120c09;
  --surface: #1f1510;
  --surface-2: #2c1e17;
  --line: #4a3329;
  --text: #f3e9df;
  --muted: #b39b8c;
  --dim: #8f7869;
  --orange: #f2621f;
  --orange-deep: #9e3409;
  --orange-hi: #ffb07a;
  --on-orange: #1a0f0b;
  --text-soft: #d8c8bc;
  --nav-bg: rgba(31, 21, 16, .9);
  --scrim: rgba(18, 12, 9, .9);
  --toast-bg: #efe9e1;
  --toast-fg: #191613;
  --hero-shadow: rgba(18, 12, 9, .75);
  --placeholder: #8a7d72;
  --cream: #efe9e1;
  --ink: #191613;
  --ink-muted: #6e665e;
  --danger: #ff4b3e;
  --ok: #7fdc9a;

  --sans: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Unbounded", "Arial Black", sans-serif;
  --num: "Unbounded", "Onest", sans-serif; /* цифры: счётчики, таймеры, статистика */

  --r-box: 28px;
  --r-field: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  /* «надутый» материал для активных элементов */
  --puff: inset 0 -6px 12px rgba(80, 18, 0, .35), inset 0 4px 8px rgba(255, 214, 190, .45), 0 10px 24px -10px rgba(255, 91, 31, .6);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f5eee6;
  --surface: #fffaf4;
  --surface-2: #ece1d5;
  --line: #dccbbb;
  --text: #1a0f0b;
  --muted: #6b574b;
  --dim: #85695a;
  --orange-hi: #b8400e;
  --text-soft: #3c2c24;
  --nav-bg: rgba(255, 250, 244, .9);
  --scrim: rgba(245, 238, 230, .94);
  --toast-bg: #1f1510;
  --toast-fg: #f3e9df;
  --hero-shadow: transparent;
  --placeholder: #8a7365;
  --panel: #ffffff;
  --panel-line: #e6d9cb;
  --ok: #1f8a4c;
  --danger: #d83a2c;
  color-scheme: light;
}
html { transition: background-color .3s; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
body::after { /* зерно как у ткани на референсах */
  content: ""; position: fixed; inset: 0; z-index: 200; pointer-events: none; opacity: .06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; border-radius: 10px; }
a { color: var(--orange); }
img, video { display: block; max-width: 100%; }
[hidden] { display: none !important; }
.ph, .ph-fill { font-size: 22px; line-height: 1; }

h1, h2, h3 { font-weight: 600; line-height: 1.02; margin: 0; letter-spacing: -0.035em; }
h1 { font-size: clamp(34px, 9.5vw, 44px); }
h2 { font-size: 28px; }
h3 { font-size: 19px; letter-spacing: -0.02em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { color: var(--muted); font-size: 17px; max-width: 34ch; }

/* ---------- Оболочка ---------- */
#app { position: relative; max-width: 460px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; padding: 20px 16px calc(100px + env(safe-area-inset-bottom)); }
.screen.no-nav { padding-bottom: 28px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 12px; }

/* ---------- Логотип ---------- */
.wordmark { display: block; width: 100%; height: auto; overflow: visible; }
.wordmark text { font: 800 120px var(--sans); letter-spacing: 6px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 56px; padding: 0 26px; border-radius: 999px;
  background: var(--orange); color: var(--on-orange);
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  box-shadow: var(--puff);
  transition: transform .2s var(--ease), filter .2s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.quiet { background: var(--surface-2); color: var(--text); box-shadow: none; }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1.5px rgba(255, 75, 62, .45); }
.btn.dark { background: var(--ink); color: var(--cream); box-shadow: none; }
.btn.block { width: 100%; }
.btn.tg { background: #1979bd; color: #fff; box-shadow: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text); flex: none; }
.link { color: var(--orange); font-weight: 500; }

/* ---------- Поля ---------- */
.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 14px; color: var(--muted); }
.input, textarea.input, select.input {
  width: 100%; background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-field);
  padding: 15px 16px; outline: none; transition: border-color .2s;
}
textarea.input { resize: vertical; min-height: 104px; line-height: 1.45; }
.input:focus { border-color: var(--orange); }
.input::placeholder { color: var(--placeholder); }
.hint { font-size: 13px; color: var(--muted); }
.error-text { color: var(--danger); font-size: 14px; }

/* кремовая панель, как карточки на референсе */
.panel { background: var(--panel, var(--cream)); color: var(--ink); box-shadow: inset 0 0 0 1px var(--panel-line, transparent); border-radius: var(--r-box); padding: 22px 18px; }
.panel .field > span, .panel .hint, .panel .muted { color: var(--ink-muted); }
.panel .input { background: #fff; border-color: #d9d1c6; color: var(--ink); }
.panel .input:focus { border-color: var(--orange); }
.panel .input::placeholder { color: #8d857c; }
.panel .error-text { color: #c42a1d; }
.panel .link { color: var(--orange-deep); }
.panel .tabs { background: #e2dace; }
.panel .tabs button { color: #5a534c; }
.panel .tabs button.on { background: var(--ink); color: var(--cream); }
.panel .divider { color: var(--ink-muted); }
.panel .divider::before, .panel .divider::after { background: #d6cdc1; }
.panel .checklist { color: var(--ink-muted); }
.panel .checklist li.ok { color: #1c7a3c; }
/* контраст на кремовой панели (WCAG AA): подпись капчи и ссылка поддержки */
.panel .captcha-label, .panel .help-link, .panel .auth-legal { color: var(--ink-muted); }
.panel .help-link:hover { color: var(--ink); }

.checklist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.checklist li::before { content: "○"; display: inline-block; width: 22px; }
.checklist li.ok { color: var(--ok); }
.checklist li.ok::before { content: "●"; }

.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--surface); border-radius: 999px; padding: 4px; }
.tabs button { min-height: 44px; border-radius: 999px; color: var(--muted); font-weight: 600; }
.tabs button.on { background: var(--surface-2); color: var(--text); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.switch { display: flex; align-items: center; gap: 14px; padding: 14px 0; cursor: pointer; }
.switch input { appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background .2s; cursor: pointer; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: transform .25s var(--ease); }
.switch input:checked { background: var(--orange); }
.switch input:checked::after { transform: translateX(20px); background: var(--on-orange); }
.switch .label { flex: 1; }
.switch .label small { display: block; color: var(--muted); font-size: 13px; }

.code-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-boxes input { text-align: center; font: 600 26px var(--sans); padding: 14px 0; }

/* ---------- Выбор вариантов (опрос) ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 15px; font-weight: 500;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: background .2s, color .2s, box-shadow .2s, transform .2s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip[aria-pressed="true"] { background: var(--orange); color: var(--on-orange); box-shadow: var(--puff); }
.chip.static { min-height: 34px; padding: 0 14px; font-size: 14px; cursor: default; }
.chip.static.hot { background: var(--orange); color: var(--on-orange); box-shadow: none; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice-grid .chip { justify-content: center; min-height: 54px; }

.survey-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.survey-count { font: 600 14px var(--num); font-variant-numeric: tabular-nums; color: var(--orange); }

/* ---------- Онбординг ---------- */
.steps { display: grid; grid-auto-flow: column; gap: 6px; margin-bottom: 28px; }
.steps i { height: 4px; border-radius: 4px; background: var(--line); }
.steps i.done { background: var(--orange); }
.photo-drop {
  position: relative; aspect-ratio: 1; border-radius: var(--r-box);
  background: var(--surface) center / cover no-repeat;
  border: 2px dashed var(--line);
  display: grid; place-items: center; text-align: center; color: var(--muted); cursor: pointer; overflow: hidden;
}
.photo-drop .ph { font-size: 40px; display: block; margin-bottom: 8px; color: var(--orange); }
.photo-drop.has { border: 0; }

/* ---------- Сканер лица ---------- */
.scanner { position: relative; aspect-ratio: 3 / 4; border-radius: var(--r-box); overflow: hidden; background: #000; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .01; }
.scanner canvas.live { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.scanner .mask { position: absolute; inset: 0; background: radial-gradient(ellipse 34% 30% at 50% 45%, transparent 98%, rgba(18, 17, 16, .82) 100%); }
.scanner .oval { position: absolute; left: 16%; right: 16%; top: 15%; bottom: 25%; border-radius: 50%; border: 3px solid rgba(255, 91, 31, .35); transition: border-color .3s; }
.scanner .oval.active { border-color: var(--orange); animation: scanpulse 1.2s ease-in-out infinite; }
.scanner .oval.ok { border-color: var(--ok); }
.scanner .instruction { position: absolute; left: 16px; right: 16px; bottom: 18px; text-align: center; font-weight: 600; font-size: 20px; letter-spacing: -0.02em; }
.scanner .arrow { position: absolute; top: 42%; font-size: 46px; font-weight: 600; color: var(--orange); }
.scanner .arrow.left { left: 6%; } .scanner .arrow.right { right: 6%; }
.scanner .countdown { position: absolute; top: 14px; right: 18px; font: 700 34px var(--num); font-variant-numeric: tabular-nums; color: var(--orange); }
@keyframes scanpulse { 50% { box-shadow: 0 0 0 10px rgba(255, 91, 31, .18); } }

/* ---------- Лента ---------- */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.deck { position: relative; flex: 1; min-height: 560px; }
.empty { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding: 24px 4px; }
.empty .btn { align-self: flex-start; }

/* скелетон карточки, пока грузится лента */
.skeleton { position: absolute; inset: 0; border-radius: var(--r-box); background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- Навигация ---------- */
.nav {
  position: fixed; z-index: 20; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(428px, calc(100% - 32px)); display: grid; grid-template-columns: repeat(3, 1fr);
  background: var(--nav-bg); backdrop-filter: blur(16px); border-radius: 999px; padding: 6px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 14px 30px -12px rgba(0, 0, 0, .7);
}
.nav a { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; border-radius: 999px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav a.on { background: var(--orange); color: var(--on-orange); box-shadow: var(--puff), 0 8px 26px -6px rgba(255, 91, 31, .7); }
.nav .badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--orange); color: var(--on-orange); font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.nav a.on .badge { background: var(--on-orange); color: var(--orange); }

/* ---------- Чаты ---------- */
.chat-list { display: flex; flex-direction: column; margin-top: 10px; }
.chat-item { display: flex; gap: 14px; align-items: center; padding: 12px 0; text-decoration: none; color: inherit; }
.chat-item + .chat-item { border-top: 1px solid var(--line); }
.avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.avatar-wrap { position: relative; flex: none; }
.avatar-wrap .dot { position: absolute; right: 2px; bottom: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ok); border: 2.5px solid var(--bg); }
.chat-item .body { flex: 1; min-width: 0; }
.chat-item .top { display: flex; gap: 8px; align-items: baseline; }
.chat-item .top b { font-weight: 600; }
.chat-item .time { margin-left: auto; font-size: 12px; color: var(--muted); }
.chat-item .preview { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .unread { min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; background: var(--orange); color: var(--on-orange); font-size: 12px; font-weight: 700; display: grid; place-items: center; }

.new-matches { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 12px; margin: 16px 0 8px; scrollbar-width: none; }
.new-matches a { flex: none; width: 84px; color: inherit; text-decoration: none; font-size: 13px; }
.new-matches img { width: 84px; height: 108px; border-radius: 20px; object-fit: cover; margin-bottom: 6px; box-shadow: 0 0 0 2.5px var(--bg), 0 0 0 4.5px var(--orange); }

/* ---------- Переписка ---------- */
.chat-screen { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--bg); max-width: 460px; margin: 0 auto; }
.chat-header { display: flex; align-items: center; gap: 10px; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); }
.chat-header .who { flex: 1; min-width: 0; }
.chat-header .who b { display: block; font-weight: 600; }
.chat-header .who small { color: var(--muted); }
.chat-header .avatar { width: 42px; height: 42px; }
.chat-header .icon-btn { background: transparent; }
.messages { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; }
.day-sep { align-self: center; font-size: 12px; color: var(--muted); padding: 10px 0 6px; }
.msg { max-width: 80%; align-self: flex-start; position: relative; }
.msg.mine { align-self: flex-end; }
.bubble { padding: 9px 14px 7px; border-radius: 22px 22px 22px 8px; background: var(--surface-2); line-height: 1.4; word-break: break-word; }
.bubble.text { white-space: pre-wrap; }
.msg.mine .bubble { background: var(--orange); color: var(--on-orange); border-radius: 22px 22px 8px 22px; }
.msg .time { font-size: 11px; opacity: .65; margin-left: 8px; float: right; margin-top: 6px; }
.msg.media .bubble { padding: 4px; }
.msg.media img, .msg.media video { border-radius: 18px; max-height: 320px; cursor: pointer; }
.msg.media .caption { padding: 6px 10px 2px; }
.msg.sticker .st { font-size: 96px; line-height: 1.1; filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff) drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); animation: pop .5s var(--ease); }
.msg.sticker .time, .msg.circle .time { float: none; display: block; text-align: right; }
@keyframes pop { 0% { transform: scale(.3) rotate(-20deg); } 70% { transform: scale(1.1) rotate(4deg); } }
.circle-msg { width: 220px; height: 220px; border-radius: 50%; overflow: hidden; position: relative; cursor: pointer; background: var(--surface);
  -webkit-mask-image: -webkit-radial-gradient(white, black); isolation: isolate; transform: translateZ(0); } /* iPhone: без этого видео в круге бывает чёрным */
.circle-msg video { width: 100%; height: 100%; object-fit: cover; max-height: none; border-radius: 0; }
.circle-msg svg.ring { position: absolute; inset: 0; transform: rotate(-90deg); pointer-events: none; }
.circle-msg .dur { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(0, 0, 0, .5); padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.voice { display: flex; align-items: center; gap: 10px; min-width: 210px; padding: 4px 4px 0; }
.voice .play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); flex: none; }
.msg.mine .voice .play { background: var(--on-orange); color: var(--orange); }
.voice .play .ph-fill { font-size: 18px; }
.voice .bars { flex: 1; display: flex; align-items: center; gap: 2px; height: 30px; }
.voice .bars i { flex: 1; background: currentColor; opacity: .35; border-radius: 2px; }
.voice .bars i.on { opacity: 1; }
.voice .len { font-size: 12px; opacity: .8; }
.call-line { display: flex; gap: 8px; align-items: center; }
.call-line .ph { font-size: 18px; }
.typing { font-size: 13px; color: var(--muted); padding: 0 16px 6px; height: 20px; }
.upload-status { display: flex; align-items: center; gap: 10px; padding: 0 16px 8px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.upload-status > i { flex: 1; height: 3px; border-radius: 3px; background: var(--line, rgba(127, 127, 127, .25)); overflow: hidden; }
.upload-status > i > b { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s; }

.composer { display: flex; align-items: flex-end; gap: 4px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.composer textarea { flex: 1; resize: none; max-height: 120px; min-height: 44px; padding: 11px 16px; border-radius: 22px; background: var(--surface); border: 0; outline: none; line-height: 1.35; }
.composer .icon-btn { background: transparent; color: var(--muted); }
.composer .icon-btn.send { background: var(--orange); color: var(--on-orange); box-shadow: var(--puff); }
.composer .icon-btn.rec { background: var(--danger); color: #fff; }
.rec-bar { flex: 1; display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px; color: var(--danger); font-weight: 600; }
.rec-bar .cancel { color: var(--muted); font-weight: 500; margin-left: auto; }

.sticker-panel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 10px; background: var(--surface); border-top: 1px solid var(--line); max-height: 240px; overflow-y: auto; }
.sticker-panel .packs { grid-column: 1 / -1; display: flex; gap: 6px; margin-bottom: 4px; overflow-x: auto; }
.sticker-panel .packs button { padding: 7px 14px; border-radius: 999px; font-size: 13px; color: var(--muted); background: var(--surface-2); flex: none; }
.sticker-panel .packs button.on { color: var(--on-orange); background: var(--orange); }
.sticker-panel .st-btn { font-size: 36px; padding: 6px 0; border-radius: 12px; transition: transform .12s; }
.sticker-panel .st-btn:hover { transform: scale(1.15); }

/* Запись кружочка */
.circle-recorder { position: fixed; inset: 0; z-index: 60; background: var(--scrim); backdrop-filter: blur(8px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.circle-recorder .lens { width: min(78vw, 320px); aspect-ratio: 1; position: relative; }
.circle-recorder video { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; background: #000; display: block; }
.circle-recorder video.live { position: absolute; inset: 0; opacity: .01; } /* поток идёт, видно канвас (он уже зеркальный) */
.circle-recorder .live-canvas { width: 100%; height: 100%; border-radius: 50%; background: #000; display: block; }
.circle-recorder .live-canvas[hidden] { display: none; }
.circle-recorder svg.ring { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); transform: rotate(-90deg); overflow: visible; pointer-events: none; }
.circle-recorder .lens-flip { position: absolute; right: -4px; bottom: 6px; width: 44px; height: 44px; background: rgba(18, 12, 9, .65); color: #f3e9df; }
.circle-recorder .sound-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); padding: 5px 10px; border-radius: 999px; background: rgba(18, 12, 9, .6); color: #f3e9df; font-size: 12px; white-space: nowrap; pointer-events: none; }
.circle-recorder .timer { display: flex; align-items: center; gap: 8px; font: 700 24px var(--num); font-variant-numeric: tabular-nums; color: var(--orange); }
.circle-recorder .rec-dot { width: 10px; height: 10px; border-radius: 50%; background: #ff3b30; animation: blink 1s steps(2) infinite; }
.circle-recorder.paused .rec-dot { animation: none; background: var(--muted); }
.circle-recorder.paused svg.ring circle { stroke: var(--muted); }
.circle-recorder.previewing .timer { display: none; }
.circle-recorder.busy .controls, .circle-recorder.busy .trim { opacity: .5; pointer-events: none; }
.circle-recorder .controls { display: flex; gap: 18px; align-items: center; }
.circle-recorder .controls .icon-btn { width: 52px; height: 52px; font-size: 22px; }
.circle-recorder .controls .big { width: 64px; height: 64px; font-size: 26px; }
.circle-recorder .controls .send { width: 64px; height: 64px; font-size: 26px; background: var(--orange); color: var(--on-orange); box-shadow: var(--puff); }
.circle-recorder [data-pause] .ph-record { color: #ff3b30; }
@keyframes blink { 50% { opacity: .2; } }
/* обрезка: полоса с двумя ручками */
.trim { position: relative; width: min(86vw, 360px); }
.trim-track { position: relative; height: 52px; border-radius: 12px; background: var(--surface); overflow: hidden; }
.trim-track .film { position: absolute; inset: 0; display: flex; }
.trim-track .film img { flex: 1; min-width: 0; height: 100%; object-fit: cover; opacity: .85; }
.trim-sel { position: absolute; top: 0; bottom: 0; left: 0; right: 0; border: 3px solid var(--orange); border-radius: 12px; background: color-mix(in srgb, var(--orange) 18%, transparent); }
.trim-pos { position: absolute; top: 6px; bottom: 6px; width: 2px; background: var(--text); left: 0; }
.trim input[type=range] { position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 52px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.trim input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 18px; height: 52px; border-radius: 6px; background: var(--orange); cursor: ew-resize; }
.trim input[type=range]::-moz-range-thumb { pointer-events: auto; width: 18px; height: 44px; border: 0; border-radius: 6px; background: var(--orange); cursor: ew-resize; }
.trim input[type=range]::-webkit-slider-runnable-track { background: none; }
.trim-times { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.trim-times [data-len] { color: var(--text); font-weight: 600; }

/* ---------- Звонок ---------- */
.call { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; background: radial-gradient(120% 70% at 50% 30%, #6a2408 0%, #2a1209 45%, var(--bg) 80%); }
.call .remote { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.call .local { position: absolute; right: 16px; top: calc(16px + env(safe-area-inset-top)); width: 110px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 20px; transform: scaleX(-1); box-shadow: 0 8px 24px rgba(0, 0, 0, .5); z-index: 2; }
.call .persona { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 16px; }
.call .persona img { width: 156px; height: 156px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 6px rgba(255, 91, 31, .35); }
.call.ringing .persona img { animation: ring 1.6s ease-out infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255, 91, 31, .6); } 100% { box-shadow: 0 0 0 40px transparent; } }
.call .persona h2 { font-size: 34px; }
.call.has-video .persona { justify-content: flex-start; align-items: flex-start; text-align: left; padding: 24px 150px 16px 20px; }
.call.has-video .persona h2 { font-size: 24px; text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.call.has-video .persona img { display: none; }
.call .bar { position: relative; z-index: 2; display: flex; justify-content: center; gap: 22px; padding: 24px 16px calc(36px + env(safe-area-inset-bottom)); }
.call .bar button { width: 66px; height: 66px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); backdrop-filter: blur(10px); color: #fff; }
.call .bar .ph, .call .bar .ph-fill { font-size: 28px; }
.call .bar button.off { background: var(--cream); color: var(--ink); }
.call .bar button.hang { background: var(--danger); }
.call .bar button.accept { background: var(--orange); color: var(--on-orange); box-shadow: var(--puff); }

/* ---------- Метч ---------- */
.overlay { position: fixed; inset: 0; z-index: 70; background: var(--scrim); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay.match { background: radial-gradient(110% 80% at 50% 20%, #ff7a3d 0%, #e04a12 35%, #7a2406 75%, #2a0f05 100%); }
.match-modal { width: min(400px, 100%); text-align: center; display: flex; flex-direction: column; gap: 20px; }
.match-modal .wordmark { margin: 0 auto -6px; max-width: 360px; animation: slam .8s var(--ease); }
@keyframes slam { 0% { transform: scale(1.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
.match-modal .pair { display: flex; justify-content: center; }
.match-modal .pair img { width: 128px; height: 164px; object-fit: cover; border-radius: 24px; border: 4px solid var(--cream); }
.match-modal .pair img:first-child { transform: rotate(-7deg) translateX(14px); }
.match-modal .pair img:last-child { transform: rotate(6deg) translateX(-14px); }
.overlay.match p { color: #fff3ea; }
.overlay.match .chip.static { background: rgba(28, 12, 4, .35); color: #fff; box-shadow: none; }
.overlay.match .chips { justify-content: center; }
.overlay.match .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .5); }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .92); display: grid; place-items: center; padding: 16px; }
.lightbox img { max-height: 92vh; border-radius: 14px; }

.toast-host { position: fixed; z-index: 100; top: calc(12px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); width: min(428px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { touch-action: none; user-select: none; pointer-events: auto; background: var(--toast-bg); color: var(--toast-fg); border-radius: 20px; padding: 12px 16px; box-shadow: 0 14px 34px rgba(0, 0, 0, .5); display: flex; gap: 12px; align-items: center; animation: drop .4s var(--ease); cursor: pointer; font-weight: 500; }
.toast img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.toast.error { background: var(--danger); color: #fff; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } }

/* ---------- Профиль ---------- */
.section { margin-top: 30px; }
.section > h3 { margin-bottom: 10px; }
.profile-hero { display: grid; grid-template-columns: 112px 1fr; gap: 16px; align-items: end; }
.profile-hero img { width: 112px; height: 140px; border-radius: 24px; object-fit: cover; }
.badge-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: 14px; }
.badge-ok .ph-fill { font-size: 18px; }
.badge-warn { color: var(--danger); font-size: 14px; }
input[type="range"] { width: 100%; accent-color: var(--orange); }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 16px 18px; border-radius: var(--r-box); background: var(--surface); text-align: left; color: var(--text); text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Вход: 3D-сцена с вязаным узлом ---------- */
.hero3d { position: relative; margin: -20px -16px 0; height: min(66dvh, 600px); min-height: 460px; overflow: hidden; isolation: isolate; }
.hero3d .stage { position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; }
.hero3d .stage canvas { width: 100% !important; height: 100% !important; display: block; opacity: 0; animation: reveal 1.4s var(--ease) .1s forwards; }
.hero3d .stage .wordmark { width: 92%; }
.hero3d::after { /* затемнение снизу, чтобы текст читался поверх объекта */
  content: ""; position: absolute; inset: 35% 0 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg) 60%, transparent) 40%, var(--bg) 92%);
}
.hero3d .brand { position: absolute; top: calc(18px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); font-weight: 500; font-size: 17px; letter-spacing: -0.02em; color: var(--text); }
.hero3d .brand sup { color: var(--orange); font-size: 13px; }
.hero-copy { position: absolute; left: 16px; right: 16px; bottom: 64px; text-align: center; }
.hero-copy h1 { font-size: clamp(34px, 9.6vw, 46px); font-weight: 500; letter-spacing: -0.045em; line-height: 1; text-shadow: 0 2px 30px var(--hero-shadow); }
.hero-copy p { margin: 14px auto 0; max-width: 30ch; color: var(--text-soft); font-size: 16px; text-shadow: 0 1px 14px var(--hero-shadow); }
.sheet { position: relative; margin-top: -36px; box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .7); animation: rise .8s var(--ease) .15s both; }
@keyframes reveal { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(30px); } }

/* ---------- Метч: вязаное сердце ---------- */
.heart-stage { width: min(78vw, 300px); aspect-ratio: 1; margin: -30px auto -18px; display: grid; place-items: center; }
.heart-stage canvas { width: 100% !important; height: 100% !important; animation: reveal 1s var(--ease) both; }
.match-title { font-size: clamp(54px, 16vw, 76px); font-weight: 600; letter-spacing: -0.06em; color: #fff7f1; text-shadow: 0 6px 30px rgba(90, 20, 0, .5); }
.overlay.match .pair img { width: 104px; height: 132px; }

/* ---------- Переходы и микродвижение ---------- */
::view-transition-old(root) { animation: vt-out .22s ease-in both; }
::view-transition-new(root) { animation: vt-in .38s var(--ease) both; }
@keyframes vt-out { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }
.chips .chip { animation: chip-in .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 22ms); }
@keyframes chip-in { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.screen::before { /* тёплое свечение сверху экрана, как на референсах */
  content: ""; position: fixed; z-index: -1; left: 50%; top: -30vh; width: 140vw; height: 60vh; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 91, 31, .16), transparent); pointer-events: none;
}

/* ---------- Лента «Нити»: человек + общие интересы бусинами на нитке ---------- */
.feed { padding-top: 8px; }
.feed .topbar { height: 48px; margin: 0 4px; }
.logo { font: 700 20px var(--display); letter-spacing: -0.5px; }
.logo span { color: var(--orange); }
.counter { font-size: 13px; color: var(--muted); }
.feed .deck { min-height: 0; flex: none; display: flex; flex-direction: column; touch-action: pan-y; user-select: auto; }
.person { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 6px; }
.person.enter { animation: person-in .5s var(--ease) both; }
@keyframes person-in { from { opacity: 0; transform: translateY(18px); } }
.ava { position: relative; width: 176px; height: 176px; border-radius: 50%; padding: 0; background: repeating-linear-gradient(135deg, #c9461a 0 8px, #a9380f 8px 11px); color: var(--text); font: 700 64px var(--display); display: grid; place-items: center; transition: transform .25s var(--ease); }
.ava img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.ava:active { transform: scale(.97); }
.ava::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1.5px solid rgba(242, 98, 31, .45); }
.ava .more { position: absolute; right: 4px; bottom: 8px; padding: 5px 10px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font: 600 12px var(--sans); box-shadow: 0 6px 16px rgba(0, 0, 0, .35); }
.pname { margin-top: 18px; font: 600 28px var(--display); letter-spacing: -0.8px; line-height: 1.1; }
.pname span { color: var(--muted); }
.person .meta { margin-top: 6px; font-size: 13px; color: var(--muted); }
.pbio { margin-top: 12px; max-width: 320px; font-size: 15px; line-height: 1.45; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.shared-lbl { margin-top: 20px; text-align: center; font-size: 13px; color: var(--muted); }
.shared-lbl b { font: 700 15px var(--display); color: var(--orange-hi); }
.thread { position: relative; height: 150px; margin: 0 -16px; overflow: visible; }
.thread svg.yarn { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.thread.compact .bead { padding: 8px 12px; font-size: 13px; }
.bead { position: absolute; transform: translate(-50%, -50%); padding: 10px 16px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font: 600 15px/1 var(--sans); white-space: nowrap; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.yarn-heart { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; border-radius: 50%; background: var(--orange); color: var(--on-orange); display: grid; place-items: center; opacity: 0; box-shadow: 0 10px 40px rgba(242, 98, 31, .5); }
.rest { margin: 4px auto 0; max-width: 350px; text-align: center; font-size: 13px; line-height: 1.5; color: var(--dim); }
.btns { display: flex; justify-content: center; gap: 28px; margin-top: 14px; align-items: flex-start; }
.bw { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.btns button { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; transition: transform .2s var(--ease); }
.btns button:active { transform: scale(.92); }
.btns button:disabled { opacity: .6; cursor: default; }
.btns .skip { border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); }
.btns .like { background: var(--orange); color: var(--on-orange); box-shadow: 0 8px 28px rgba(242, 98, 31, .35); }
.btns .ph, .btns .ph-fill { font-size: 26px; }
.swipe-hint { margin-top: 10px; text-align: center; font-size: 12px; color: var(--dim); }

/* ---------- Подробная анкета ---------- */
.profile-view { position: fixed; inset: 0; z-index: 50; background: var(--bg); overflow-y: auto; max-width: 460px; margin: 0 auto; animation: sheet-up .45s var(--ease); overscroll-behavior: contain; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } }
.gallery { position: relative; }
.gallery .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 5; max-height: 68dvh; }
.gallery .track::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gallery .dots { position: absolute; left: 0; right: 0; top: calc(12px + env(safe-area-inset-top)); display: flex; gap: 4px; padding: 0 16px; }
.gallery .dots i { flex: 1; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .35); transition: background .2s; }
.gallery .dots i.on { background: #fff; }
.gallery::after { content: ""; position: absolute; inset: auto 0 0; height: 30%; background: linear-gradient(transparent, var(--bg)); pointer-events: none; }
.profile-view .close { position: absolute; z-index: 2; top: calc(26px + env(safe-area-inset-top)); left: 12px; background: rgba(18, 12, 9, .55); backdrop-filter: blur(10px); }
.profile-body { position: relative; margin-top: -54px; padding: 0 16px 200px; }
.profile-body .pname { margin-top: 0; font-size: 34px; }
.profile-body h3 { margin: 26px 0 10px; font-size: 15px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.chips .chip.static.ghost { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line); color: var(--text); }
.match-strip { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 18px; border-radius: 22px; background: var(--surface); }
.match-strip > div { padding: 14px 14px 12px; }
.match-strip > div + div { border-left: 1px solid var(--line); }
.match-strip b { display: block; font: 700 22px var(--display); letter-spacing: -0.5px; color: var(--orange-hi); }
.match-strip span { font-size: 12px; color: var(--muted); }
.profile-actions { position: fixed; z-index: 51; left: 50%; bottom: 0; transform: translateX(-50%); width: min(460px, 100%); padding: 28px 16px calc(16px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, transparent, var(--bg) 26px); display: flex; flex-direction: column; gap: 8px; }
.profile-actions .btns { margin: 0; }
.profile-actions .note { text-align: center; font-size: 13px; color: var(--muted); }

/* галерея в настройках */
.gallery-edit { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.gallery-edit .ph-cell { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--surface); }
.gallery-edit img { width: 100%; height: 100%; object-fit: cover; }
.gallery-edit .del { position: absolute; top: 6px; right: 6px; width: 30px; height: 30px; border-radius: 50%; background: rgba(18, 12, 9, .7); display: grid; place-items: center; }
.gallery-edit .del .ph { font-size: 16px; }
.gallery-edit .add { display: grid; place-items: center; color: var(--orange); border: 1.5px dashed var(--line); background: transparent; }
.gallery-edit .add .ph { font-size: 28px; }
.chat-header .who-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; text-align: left; }

/* ---------- Переключатель темы ---------- */
.theme-toggle { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; z-index: 2; background: color-mix(in srgb, var(--surface) 80%, transparent); backdrop-filter: blur(8px); }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.hero-links .chip { min-height: 40px; font-size: 14px; text-decoration: none; background: color-mix(in srgb, var(--surface) 75%, transparent); backdrop-filter: blur(8px); }
.hero-links .chip.hot { background: var(--orange); color: var(--on-orange); box-shadow: var(--puff); }
.demo-banner { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; color: var(--muted); }
.demo-banner .ph { color: var(--orange); }
.demo-pill { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font-weight: 600; }

/* ---------- Инструкция ---------- */
.guide-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.guide-title { font: 600 32px var(--display); letter-spacing: -1px; margin-bottom: 18px; }
.reel { display: grid; grid-template-columns: 1fr; gap: 14px; justify-items: center; }
.phone { width: min(74vw, 300px); aspect-ratio: 390 / 780; border-radius: 42px; padding: 8px; background: #0b0705; box-shadow: 0 30px 70px -30px rgba(242, 98, 31, .55), inset 0 0 0 1.5px #3a2a22; }
.phone-screen { position: relative; width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--bg); }
.mini { position: absolute; left: 0; top: 0; width: 390px; height: 780px; overflow: hidden; transform-origin: 0 0; padding: 26px 16px 16px; display: flex; flex-direction: column; pointer-events: none; }
.mini .thread { height: 150px; }
.mini .person.enter { animation-duration: .6s; }
.reel-bars { position: absolute; z-index: 5; left: 14px; right: 14px; top: 12px; display: flex; gap: 4px; }
.reel-bars i { flex: 1; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--text) 25%, transparent); position: relative; overflow: hidden; }
.reel-bars i.done { background: var(--orange); }
.reel-bars i.on::after { content: ""; position: absolute; inset: 0; background: var(--orange); transform-origin: left; animation: bar 4.5s linear forwards; }
@keyframes bar { from { transform: scaleX(0); } }
.fake-btn { width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; transition: transform .2s; }
.fake-btn.skip { border: 1px solid var(--line); background: var(--surface); color: var(--text-soft); }
.fake-btn.like { background: var(--orange); color: var(--on-orange); }
.fake-btn .ph, .fake-btn .ph-fill { font-size: 26px; }
.fake-btn.press { animation: press .4s var(--ease); }
@keyframes press { 50% { transform: scale(.86); } }
.finger { position: absolute; left: 0; top: 0; z-index: 6; width: 44px; height: 44px; border-radius: 50%; opacity: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, .95) 0 30%, rgba(255, 255, 255, .35) 31% 100%); box-shadow: 0 0 0 6px rgba(255, 255, 255, .18), 0 6px 18px rgba(0, 0, 0, .35); }
.mini-profile { position: absolute; inset: 0; z-index: 4; background: var(--bg); transform: translateY(100%); transition: transform .55s var(--ease); }
.mini-profile.show { transform: none; }
.mp-photo { height: 46%; background: repeating-linear-gradient(135deg, #c9461a 0 10px, #a9380f 10px 14px); }
.mp-body { padding: 18px 16px; }
.mp-body .pname { margin: 0 0 14px; font-size: 32px; }
.mp-body .note { margin-top: 18px; font-size: 14px; color: var(--muted); }
.mini-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 28px 20px 34px; border-radius: 28px 28px 0 0; background: var(--orange); color: var(--on-orange); transform: translateY(100%); transition: transform .5s cubic-bezier(.2, .9, .3, 1); }
.mini-sheet.show { transform: none; }
.mini-sheet h2 { margin: 0 0 12px; font: 700 34px var(--display); letter-spacing: -1px; }
.mini-sheet p { margin-bottom: 16px; font-size: 15px; }
.mini-sheet .wide { display: grid; place-items: center; height: 54px; border-radius: 999px; background: var(--on-orange); color: #f3e9df; font-weight: 600; }
.reel-side { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 360px; }
.reel-caption { flex: 1; min-height: 64px; }
.reel-caption b { display: block; font: 600 20px var(--display); letter-spacing: -0.5px; }
.reel-caption span { font-size: 14px; color: var(--muted); }
.features { display: grid; gap: 10px; margin-top: 26px; }
.feature { display: flex; gap: 14px; padding: 16px; border-radius: 22px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.feature > .ph { font-size: 26px; color: var(--orange); flex: none; }
.feature b { display: block; margin-bottom: 4px; font-weight: 600; }
.feature p { font-size: 14px; line-height: 1.45; color: var(--muted); }
@media (min-width: 720px) { .reel { grid-template-columns: auto 1fr; align-items: center; } }

/* ---------- Переключатель лент ---------- */
.feed-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 2px 0 10px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.feed-tabs a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 14px; }
.feed-tabs a .ph-fill { font-size: 17px; }
.feed-tabs a.on { background: var(--orange); color: var(--on-orange); box-shadow: var(--puff); }
.btns .undo { width: 52px; height: 52px; margin-top: 8px; border: 1px solid var(--line); background: transparent; color: var(--muted); }
.btns .undo:not(:disabled) { color: var(--text); }
.btns .undo:disabled { opacity: .35; }
.btns .undo .ph { font-size: 22px; }

/* ---------- Лента «Животные» ---------- */
.animals .topbar { height: 48px; margin: 0 4px; }
.cat-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 0 12px; }
.cat-chips .chip { flex: none; min-height: 36px; padding: 0 14px; font-size: 14px; }
.pet-stage { flex: 1; min-height: 0; touch-action: pan-y; }
.pet { border-radius: var(--r-box); overflow: hidden; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.pet.from-right { animation: pet-in-r .4s var(--ease); }
.pet.from-left { animation: pet-in-l .4s var(--ease); }
@keyframes pet-in-r { from { opacity: 0; transform: translateX(40px); } }
@keyframes pet-in-l { from { opacity: 0; transform: translateX(-40px); } }
.pet-photos { position: relative; }
.pet-photos .track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 4 / 3; }
.pet-photos .track::-webkit-scrollbar { display: none; }
.pet-photos img, .pet-noimg { flex: none; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.pet-noimg { display: grid; place-items: center; background: repeating-linear-gradient(135deg, #c9461a 0 10px, #a9380f 10px 14px); color: #f3e9df; }
.pet-noimg .ph-fill { font-size: 72px; }
.pet-cat, .fund, .pet-photo-count { position: absolute; padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; backdrop-filter: blur(8px); }
.pet-cat { left: 12px; top: 12px; background: rgba(18, 12, 9, .6); color: #f3e9df; }
.pet-photo-count { right: 12px; top: 12px; background: rgba(18, 12, 9, .6); color: #f3e9df; }
.fund { left: 12px; bottom: 12px; }
.fund.open { background: #1f8a4c; color: #fff; }
.fund.closed { background: rgba(18, 12, 9, .7); color: #f3e9df; }
.pet-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.pet-name { font: 600 28px var(--display); letter-spacing: -0.8px; }
.pet-goal b { color: var(--orange-hi); }
.pet-desc { font-size: 15px; line-height: 1.5; color: var(--text-soft); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.owner-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.owner-tools .btn { min-height: 40px; font-size: 14px; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); }
.seg .chip { min-height: 34px; font-size: 13px; }
.pet-nav { display: grid; grid-template-columns: 52px 1fr 52px; gap: 12px; align-items: center; margin-top: 14px; }
.pet-nav .icon-btn { width: 52px; height: 52px; box-shadow: inset 0 0 0 1px var(--line); }
.pet-nav .icon-btn:disabled { opacity: .35; }
.pet-nav .flip .ph { transform: scaleX(-1); }
.help-btn:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; }

/* нижняя шторка */
.sheet-overlay { align-items: flex-end; padding: 0; }
.bottom-sheet { width: min(460px, 100%); max-height: 92dvh; overflow-y: auto; padding: 24px 16px calc(20px + env(safe-area-inset-bottom)); border-radius: 28px 28px 0 0; background: var(--bg); box-shadow: 0 -20px 60px rgba(0, 0, 0, .5); display: flex; flex-direction: column; gap: 14px; animation: sheet-up .4s var(--ease); }
.bottom-sheet h2 { font: 600 26px var(--display); letter-spacing: -0.6px; }

/* ---------- Вход: низ экрана ---------- */
.hero-foot { display: flex; justify-content: center; gap: 16px; align-items: center; margin-top: 14px; font-size: 14px; }
.hero-foot a { color: var(--muted); }
.lang-toggle { min-width: 40px; min-height: 30px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); font-weight: 600; font-size: 13px; }

/* ---------- Профиль ---------- */
.readonly { padding: 14px 16px; border-radius: var(--r-field); background: var(--surface-2); color: var(--text-soft); }
.report { display: inline-flex; align-items: center; gap: 6px; margin-top: 26px; color: var(--muted); font-size: 14px; }
.report .ph { font-size: 18px; }
.row-link .ph { color: var(--orange); }

/* ---------- Поддержка и реклама ---------- */
.support-new { display: grid; gap: 8px; margin-top: 18px; }
.support-chat { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column; background: var(--bg); max-width: 460px; margin: 0 auto; }
.support-ava { display: grid; place-items: center; background: var(--orange); color: var(--on-orange); }
.support-ava .ph { font-size: 22px; }
.who-label { font-size: 12px; color: var(--muted); margin: 6px 0 2px 6px; }
.quick { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 8px 10px 0; }
.quick .chip { flex: none; min-height: 36px; font-size: 13px; }
.support-chat .composer textarea { flex: 1; }

/* имитация окна Telegram в демо */
.tg-sheet .tg-head { display: flex; align-items: center; gap: 10px; color: #2aabee; font-size: 18px; }
.tg-logo { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #2aabee; color: #fff; }
.tg-logo .ph-fill { font-size: 20px; transform: translateX(-1px); }
.guide-section { margin: 30px 0 -12px; font: 600 22px var(--display); letter-spacing: -0.5px; }
.mini .pet-stage { flex: none; }
.mini .pet-photos .track { aspect-ratio: 16 / 10; }
.mini-sheet.help .wide { margin-top: 8px; }
.mini-sheet.help .wide.tg { background: #1979bd; color: #fff; }

/* ---------- Подробная карточка животного ---------- */
.pet-view .gallery .track { aspect-ratio: 1 / 1; }
.pet-view .pet-noimg { width: 100%; height: 100%; }
.pet-view .pet-noimg .ph-fill { font-size: 110px; }
.pet-full { font-size: 16px; line-height: 1.55; white-space: pre-wrap; color: var(--text-soft); }
.pet-facts { display: grid; grid-template-columns: 130px 1fr; gap: 10px 14px; margin: 0; font-size: 15px; }
.pet-facts dt { color: var(--muted); }
.pet-facts dd { margin: 0; word-break: break-word; }
.chip.static.ok { background: #1f8a4c; color: #fff; box-shadow: none; }
.more-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin-top: 2px; font-size: 14px; }
.more-link .ph { font-size: 16px; }
.pet-desc { cursor: pointer; }
.pet-view .match-strip b { font-size: 19px; }
.animals .pet-photos .track { aspect-ratio: auto; height: min(calc(100vw - 32px), 40dvh, 520px); } /* почти квадрат: карточка с информацией о питомце видна целиком */
/* прозрачный край нижней панели анкеты не должен перехватывать нажатия */
.profile-actions { pointer-events: none; }
.profile-actions > * { pointer-events: auto; }

/* предложение рекламы в профиле */
.ad-offer { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 18px; border-radius: var(--r-box); text-decoration: none; color: var(--on-orange);
  background: radial-gradient(120% 140% at 0% 0%, #ff8a4c 0%, var(--orange) 45%, #c9461a 100%); box-shadow: var(--puff); font-size: 14px; line-height: 1.4; }
.ad-offer b { font-size: 17px; }
.ad-offer .ph { font-size: 22px; }
.ad-offer-icon { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: rgba(26, 15, 11, .14); }
.ad-offer-icon .ph { font-size: 24px; }

/* ---------- Лента: прокрутка пальцем и кнопки всегда на виду ---------- */
.feed .ava { transition: box-shadow .2s; }
.feed .swipe-hint { margin-top: 6px; }
/* кнопки ответа закреплены над нижним меню: экран можно мотать, они не прячутся */
.feed .btns, .animals .pet-nav {
  position: sticky; z-index: 6;
  bottom: calc(80px + env(safe-area-inset-bottom));
  margin: 8px -16px 0; padding: 14px 16px 10px;
  background: linear-gradient(to bottom, transparent, var(--bg) 26%);
}
.feed .btns .bw span { text-shadow: 0 1px 6px var(--bg); }
/* невысокие экраны (Telegram, маленькие телефоны): компактнее, чтобы анкета помещалась */
@media (max-height: 820px) {
  .feed .ava { width: 128px; height: 128px; font-size: 48px; }
  .feed .pname { margin-top: 12px; font-size: 24px; }
  .feed .pbio { margin-top: 8px; font-size: 14px; -webkit-line-clamp: 2; }
  .feed .shared-lbl { margin-top: 12px; }
  .feed .thread { height: 124px; }
  .feed .btns button { width: 58px; height: 58px; }
  .feed .btns .undo { width: 46px; height: 46px; margin-top: 6px; }
  .feed .rest { -webkit-line-clamp: 1; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
}
/* нитка: свайп вверх/вниз = ответ, как по фото */
.feed .thread { touch-action: none; cursor: grab; transition: transform .3s var(--ease), opacity .3s; }
.feed .thread.dragging { cursor: grabbing; user-select: none; }
/* «Назад» на шагах регистрации */
.back-btn { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: 4px 0 16px -6px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--surface); color: var(--text); font: 600 14px/1 inherit; font-family: inherit; }
.back-btn i { font-size: 18px; }
.back-btn:active { transform: scale(.96); }
/* ожидание подтверждения входа в Telegram */
.tg-wait { display: flex; align-items: center; justify-content: center; gap: 8px; }
.spinner { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
/* съёмка фото с камеры при регистрации */
.camera-shot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); background: rgba(10, 7, 5, .94); }
.camera-shot .cam-frame { position: relative; width: min(86vw, 420px); aspect-ratio: 1; border-radius: 32px; overflow: hidden; background: #000; }
.camera-shot video, .camera-shot canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-shot video { opacity: .01; } /* должен оставаться на странице, иначе iPhone останавливает поток; видно canvas.live */
.camera-shot [hidden] { display: none !important; }
.camera-shot canvas.live.mirror { transform: scaleX(-1); }
.camera-shot .cam-flip { position: absolute; right: 12px; bottom: 12px; width: 44px; height: 44px; background: rgba(18, 12, 9, .6); color: #f3e9df; z-index: 2; }
.camera-shot.chat-shot .cam-frame { aspect-ratio: 3 / 4; }
.camera-shot.chat-shot video, .camera-shot.chat-shot canvas { object-fit: contain; background: #000; }
.camera-shot .cam-oval { position: absolute; inset: 12% 22%; border: 2px dashed rgba(255, 255, 255, .55); border-radius: 50%; pointer-events: none; }
.camera-shot canvas.shot:not([hidden]) ~ .cam-oval { display: none; }
.camera-shot .cam-hint { color: #f3e9df; opacity: .8; text-align: center; font-size: 14px; }
.camera-shot .cam-actions { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; width: min(86vw, 420px); }
.camera-shot .cam-actions .btn { color: #f3e9df; }
.camera-shot [data-retake] { grid-column: 3; }
.camera-shot .shutter { width: 72px; height: 72px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 5px rgba(255, 255, 255, .3); grid-column: 2; }
.camera-shot .shutter:active { transform: scale(.92); }
.camera-shot [data-use] { width: min(86vw, 420px); }
/* плашка согласий на шаге «Знакомимся» */
.consent { display: grid; gap: 10px; padding: 14px 16px; border-radius: var(--r-box); background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--orange); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.4; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--orange); }
.check a { color: var(--orange); }
.auth-legal { font-size: 12px; line-height: 1.4; color: var(--muted); text-align: center; }
.auth-legal a { color: inherit; text-decoration: underline; }
/* Пользовательское соглашение */
.terms { display: grid; gap: 6px; padding-bottom: 32px; }
.terms h1 { font-size: clamp(26px, 7vw, 34px); line-height: 1.1; }
.terms h2 { font-size: 18px; margin: 18px 0 4px; scroll-margin-top: 16px; }
.terms p, .terms li { font-size: 15px; line-height: 1.55; color: var(--text-soft); }
.terms ul { margin: 4px 0 8px; padding-left: 20px; display: grid; gap: 4px; }
.terms-toc { display: grid; gap: 6px; margin: 8px 0 4px; padding: 14px 16px; border-radius: var(--r-box); background: var(--surface); }
.terms-toc a { color: var(--text); text-decoration: none; font-size: 14px; }
.terms-overlay { align-items: stretch; padding: 0; }
.terms-sheet { position: relative; width: min(680px, 100%); margin: 0 auto; overflow-y: auto; padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); background: var(--bg); }
.terms-close { position: sticky; top: 0; margin-left: auto; z-index: 2; }
.terms-ok { position: sticky; bottom: 0; }
/* входящий звонок — плашка вверху экрана, по «Ответить» разворачивается на весь экран */
.call.ringing { inset: calc(10px + env(safe-area-inset-top)) 10px auto; height: auto; flex-direction: row; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; border-radius: 26px; background: rgba(28, 18, 13, .94); backdrop-filter: blur(16px); box-shadow: 0 18px 50px rgba(0, 0, 0, .55); animation: drop-in .35s var(--ease); }
.call.ringing .persona { flex: 1; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0; text-align: left; min-width: 0; }
.call.ringing .persona img { width: 48px; height: 48px; box-shadow: 0 0 0 3px rgba(255, 91, 31, .45); }
.call.ringing .persona h2 { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.call.ringing .persona .status { font-size: 13px; margin: 2px 0 0; }
.call.ringing .persona > div { min-width: 0; }
.call.ringing .bar { padding: 0; gap: 10px; }
.call.ringing .bar button { width: 50px; height: 50px; }
.call.ringing .bar .ph, .call.ringing .bar .ph-fill { font-size: 22px; }
.call .call-tip { margin-top: 6px; max-width: 300px; font-size: 13px; color: var(--muted); }
@keyframes drop-in { from { transform: translateY(-120%); opacity: 0; } }
.call.ringing .persona img { animation: ring-small 1.6s ease-out infinite; }
@keyframes ring-small { 0% { box-shadow: 0 0 0 0 rgba(255, 91, 31, .6); } 100% { box-shadow: 0 0 0 10px rgba(255, 91, 31, 0); } }
/* значок администратора */
.admin-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font: 700 11px/1.6 var(--sans); letter-spacing: .02em; vertical-align: middle; }
.admin-badge.big { align-self: flex-start; padding: 6px 14px; font-size: 13px; }
.admin-badge .ph { font-size: 14px; }
/* проверка на робота */
.captcha-box { display: grid; gap: 8px; }
.captcha-label { font-size: 14px; color: var(--muted); }
.captcha-row { display: flex; align-items: center; gap: 10px; }
.captcha-row img { width: 220px; max-width: calc(100% - 54px); height: auto; aspect-ratio: 220 / 80; border-radius: 14px; background: var(--surface); }
/* предложение подключить Telegram для уведомлений */
.tg-nudge { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin: 12px 0 16px; padding: 14px 16px; border-radius: var(--r-box); background: color-mix(in srgb, #2aabee 14%, var(--surface)); }
.tg-nudge > .ph-fill, .tg-nudge > .ph { font-size: 26px; color: #2aabee; }
.tg-nudge b { display: block; }
.tg-nudge span { display: block; font-size: 13px; color: var(--muted); }
.tg-nudge .btn { min-height: 40px; padding: 0 16px; font-size: 14px; }
@media (max-width: 520px) { .tg-nudge { grid-template-columns: auto 1fr; } .tg-nudge .btn { grid-column: 1 / -1; } }
/* логотип COFI: значок рядом с названием */
.hero3d .brand { display: inline-flex; align-items: center; }

/* ---------- Пол и сексуальность: спокойный блок, без ярких плашек ---------- */
.identity-box { display: flex; flex-direction: column; gap: 2px; padding: 6px 14px 10px; border-radius: var(--r-box); background: var(--surface); }
.soft-details { border-bottom: 1px solid var(--line); }
.soft-details:last-child { border-bottom: 0; }
.soft-details summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; list-style: none; font-size: 15px; }
.soft-details summary::-webkit-details-marker { display: none; }
.soft-details summary::after { content: "›"; color: var(--muted); font-size: 20px; line-height: 1; transition: transform .2s var(--ease); }
.soft-details[open] summary::after { transform: rotate(90deg); }
.soft-details summary .muted { margin-left: auto; font-size: 14px; }
.soft-details .hint { margin: 8px 0 12px; }
.small-chips { gap: 6px; }
.small-chips .chip { min-height: 36px; padding: 0 14px; font-size: 14px; }
.switch.compact { padding: 10px 0; font-size: 15px; }
.switch.compact input { width: 42px; height: 26px; }
.switch.compact input::after { width: 18px; height: 18px; }
.switch.compact input:checked::after { transform: translateX(16px); }
.identity-box > .hint { margin-top: 2px; }
.section .soft-details { background: var(--surface); border-radius: var(--r-box); padding: 0 16px; border: 0; }
.howto { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; font-size: 14px; color: var(--text-soft); }

/* Строка «Парень · Би · 182 см · Лев» в анкете */
.about-line { margin-top: 10px; font-size: 14px; color: var(--muted); letter-spacing: .01em; }
.profile-links { display: flex; gap: 22px; flex-wrap: wrap; }

/* Рост, вес, знак зодиака */
.big-value { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 18px 0 4px; }
.big-value b { font-size: 72px; line-height: 1; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.big-value span { font-size: 20px; color: var(--muted); }
.big-range { width: 100%; accent-color: var(--orange); height: 32px; }
.range-ends { display: flex; justify-content: space-between; margin-top: -4px; }
.zodiac-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip.zodiac { flex-direction: column; justify-content: center; gap: 2px; min-height: 66px; padding: 6px 4px; font-size: 13px; }
.chip.zodiac span { font-size: 22px; line-height: 1; }
.extras-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.extras-row select.input { padding-right: 8px; }

/* Чёрный список */
.block-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.block-row .avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.block-row b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-sheet .btn .ph { margin-right: 6px; }

/* Документы и согласия */
.legal-note { padding: 12px 14px; border-radius: 16px; background: var(--surface-2); color: var(--text-soft); font-size: 14px; line-height: 1.45; }
.legal-note.small { font-size: 13px; padding: 10px 12px; }
.terms .legal-note { margin: 12px 0 18px; }
.terms-docs { display: flex; flex-direction: column; gap: 8px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.terms-docs h2 { margin: 0 0 4px; }
.docs-list { padding: 0 18px !important; }
.docs-list summary { padding: 16px 0; }
.doc-link { display: block; padding: 12px 0; border-top: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 15px; }
.doc-link:last-child { margin-bottom: 6px; }
.check.consent { font-size: 14px; }

/* Шторка «Прикрепить» в чате */
.attach-sheet { position: fixed; inset: 0; z-index: 55; }
.attach-scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); opacity: 0; transition: opacity .25s; }
.attach-panel { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--bg); border-radius: 24px 24px 0 0;
  padding: 0 14px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 50px -20px rgba(0, 0, 0, .6);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2, .9, .3, 1), height .25s cubic-bezier(.2, .9, .3, 1); overflow-y: auto; overscroll-behavior: contain; }
.attach-sheet.show .attach-scrim { opacity: 1; }
.attach-sheet.show .attach-panel { transform: none; }
.attach-grab { position: sticky; top: 0; display: flex; justify-content: center; padding: 10px 0 14px; touch-action: none; cursor: grab; background: var(--bg); z-index: 1; }
.attach-grab i { width: 40px; height: 5px; border-radius: 3px; background: var(--line); }
.attach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.attach-tile { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); color: var(--text);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; border: 0; }
.attach-tile svg, .attach-tile i { font-size: 28px; }
.attach-tile.cam { background: #000; color: #fff; }
.attach-tile.cam video { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .01; }
.attach-tile.cam canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.attach-tile.cam.live canvas { opacity: 1; }
.attach-tile.cam span { position: relative; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .6)); }
.attach-hint { text-align: center; margin: 14px 0 0; }

/* Ещё не отправленные файлы в чате: превью, кольцо прогресса, пауза/продолжить, размер */
.pending-box { display: contents; }
.pending-msg .bubble { position: relative; }
.pending-msg .pend-media img, .pending-msg .pend-media video { display: block; max-height: 320px; max-width: 100%; border-radius: 18px; opacity: .75; }
.pending-msg.circle .pend-media video { width: 200px; height: 200px; object-fit: cover; border-radius: 50%; }
.pending-msg .pend-voice { width: 160px; height: 56px; display: grid; place-items: center; font-size: 24px; }
.pending-msg .pend-btn { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px 0 0 -27px; border: 0; padding: 0;
  border-radius: 50%; background: rgba(18, 12, 9, .55); color: #fff; display: grid; place-items: center; }
.pending-msg .pend-btn svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.pending-msg .pend-btn circle { fill: none; stroke-width: 3; }
.pending-msg .pend-btn .track { stroke: rgba(255, 255, 255, .25); }
.pending-msg .pend-btn .bar { stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .2s; }
.pending-msg .pend-btn .ico { position: relative; font-size: 20px; line-height: 1; }
.pending-msg.paused .pend-btn .ico { transform: rotate(-90deg); } /* стрелка вверх — «продолжить отправку» */
.pending-msg .pend-size { position: absolute; left: 10px; bottom: 10px; padding: 2px 8px; border-radius: 999px; background: rgba(18, 12, 9, .6);
  color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.upload-status .icon-btn { width: 32px; height: 32px; margin-right: -6px; flex: none; }

/* Меню Telegram (⋯ → «Настройки»): выпадает из правого верхнего угла */
.tg-menu { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, 0); transition: background .18s; }
.tg-menu.show { background: rgba(0, 0, 0, .25); }
.tg-drop { position: absolute; top: calc(8px + var(--tg-content-safe-area-inset-top, 0px) + env(safe-area-inset-top, 0px)); right: 10px;
  min-width: 230px; padding: 6px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .55); transform-origin: top right; transform: scale(.6) translateY(-8px); opacity: 0;
  transition: transform .18s cubic-bezier(.2, .9, .3, 1.2), opacity .14s; }
.tg-menu.show .tg-drop { transform: none; opacity: 1; }
.tg-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 0; border-radius: 12px; background: none;
  color: var(--text); font: inherit; font-size: 15px; text-align: left; text-decoration: none; cursor: pointer; }
.tg-item:active, .tg-item:hover { background: var(--surface-2); }
.tg-item svg, .tg-item i { font-size: 20px; flex: none; }
.tg-item.main { color: var(--orange); font-weight: 600; }

/* «Как видят мою анкету» */
.preview-pill { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 3;
  display: flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 999px; background: rgba(18, 12, 9, .7); color: #fff;
  font-size: 13px; white-space: nowrap; backdrop-filter: blur(8px); }

/* Язычок «Открыть в браузере» — свисает из правого верхнего угла (только в Telegram) */
.tg-tab { position: fixed; top: 0; right: 12px; z-index: 45; width: 44px; height: 26px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line); border-top: 0; border-radius: 0 0 14px 14px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--orange); font-size: 16px; box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .5); cursor: pointer; }
.tg-tab:active { transform: translateY(2px); }
html.in-tg .screen { padding-top: 34px; }
html.in-tg .theme-toggle { top: calc(36px + env(safe-area-inset-top)); }
html.in-tg .chat-header { padding-top: 30px; }
html.in-tg .tg-drop { top: 32px; }

.person .liked-before { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; padding: 4px 12px; border-radius: 999px;
  background: color-mix(in srgb, var(--orange) 18%, transparent); color: var(--orange); font-size: 13px; font-weight: 600; }

/* Ответ, изменение, закрепление сообщений */
.pinned-bar { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 14px; border: 0; border-bottom: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.pinned-bar[hidden] { display: none; }
.pinned-bar .pin-ico { color: var(--orange); font-size: 18px; flex: none; }
.pinned-bar .pin-body { flex: 1; min-width: 0; display: flex; flex-direction: column; border-left: 2px solid var(--orange); padding-left: 10px; }
.pinned-bar .pin-body b { font-size: 12px; color: var(--orange); }
.pinned-bar .pin-text { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pinned-bar .pin-x { color: var(--muted); font-size: 18px; padding: 4px; }
.reply-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px 0 16px; }
.reply-bar[hidden] { display: none; }
.reply-bar .rb-ico { color: var(--orange); font-size: 18px; }
.reply-bar .rb-body { flex: 1; min-width: 0; display: flex; flex-direction: column; border-left: 2px solid var(--orange); padding-left: 10px; }
.reply-bar .rb-body b { font-size: 12px; color: var(--orange); }
.reply-bar .rb-text { font-size: 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reply-quote { display: flex; flex-direction: column; gap: 1px; width: 100%; margin: 0 0 6px; padding: 4px 10px; border: 0; border-left: 3px solid currentColor;
  border-radius: 8px; background: rgba(0, 0, 0, .12); color: inherit; font: inherit; text-align: left; cursor: pointer; }
.reply-quote b { font-size: 12px; }
.reply-quote span { font-size: 13px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.msg.media .reply-quote, .msg.circle > .reply-quote { margin: 4px 4px 6px; width: auto; }
.msg .edited { opacity: .7; }
.msg.flash { animation: msgflash 1.4s ease; }
@keyframes msgflash { 0%, 40% { filter: drop-shadow(0 0 10px var(--orange)); } 100% { filter: none; } }
.msg-menu-overlay { position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0); transition: background .15s; }
.msg-menu-overlay.show { background: rgba(0, 0, 0, .3); }
.msg-menu { position: absolute; left: 16px; min-width: 210px; padding: 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 50px -12px rgba(0, 0, 0, .55); transform: scale(.85); opacity: 0; transform-origin: top left; transition: transform .15s, opacity .12s; }
.msg-menu.right { left: auto; right: 16px; transform-origin: top right; }
.msg-menu-overlay.show .msg-menu { transform: none; opacity: 1; }
.msg-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--text); font: inherit; font-size: 15px; text-align: left; cursor: pointer; }
.msg-menu button:active, .msg-menu button:hover { background: var(--surface-2); }
.messages .msg { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }

/* кадры вне выбранного куска — затемнены */
.trim-sel { box-shadow: 0 0 0 999px rgba(0, 0, 0, .55); background: transparent !important; }

/* Нижнее меню на 4 раздела: значок над подписью, чтобы помещалось на узких телефонах */
.nav { grid-template-columns: repeat(4, 1fr); }
.nav a { flex-direction: column; gap: 2px; min-height: 52px; font-size: 11px; }
.nav a i { font-size: 20px; }
.nav a .badge { position: absolute; top: 4px; right: calc(50% - 22px); }

/* Отклики */
.likes-section { margin-top: 22px; }
.likes-section h2 { display: flex; align-items: center; gap: 8px; font-size: 18px; margin: 0 0 4px; }
.likes-section h2 .count { min-width: 24px; height: 24px; padding: 0 8px; border-radius: 12px; background: var(--surface-2); color: var(--muted);
  font-size: 13px; display: inline-grid; place-items: center; }
.likes-section .hint { margin: 0 0 8px; }
.like-list { display: flex; flex-direction: column; }
.like-item { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.like-item:last-child { border-bottom: 0; }
.like-item .avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.like-item .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.like-item .act { color: var(--orange); font-size: 20px; }
.empty-line { margin: 6px 0 0; }

.help-link { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 4px; padding: 10px; color: var(--muted);
  font-size: 14px; text-decoration: none; }
.help-link:hover { color: var(--text); }
.hero-foot { gap: 14px; }
.guest-support .icon-btn { align-self: flex-start; }

.my-place { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hero-links .tg-chip { display: inline-flex; align-items: center; gap: 6px; background: #1979bd; color: #fff; border-color: transparent; }
.hero-links { flex-wrap: wrap; justify-content: center; }
