/* ============ Близко — прототип в стиле Telegram ============ */

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

:root {
  --bg: #0e1621;
  --panel: #17212b;
  --panel-2: #1c2836;
  --card: #1c2836;
  --text: #e8eef5;
  --muted: #76889b;
  --accent: #3390ec;
  --accent-2: #6ab2f2;
  --accent-soft: rgba(51, 144, 236, .16);
  --border: rgba(255, 255, 255, .07);
  --bubble-in: #182533;
  --bubble-out: #2b5278;
  --search: #232f3d;
  --pattern: rgba(255, 255, 255, .03);
  --shadow: 0 24px 70px rgba(0, 0, 0, .65);
}

[data-theme="light"] {
  --bg: #e9eef3;
  --panel: #ffffff;
  --panel-2: #f2f4f7;
  --card: #ffffff;
  --text: #101a24;
  --muted: #6d7b88;
  --accent: #3390ec;
  --accent-2: #1f7fd6;
  --accent-soft: rgba(51, 144, 236, .12);
  --border: rgba(0, 0, 0, .075);
  --bubble-in: #ffffff;
  --bubble-out: #d7e9fb;
  --search: #eef1f5;
  --pattern: rgba(0, 0, 0, .028);
  --shadow: 0 24px 70px rgba(15, 40, 65, .22);
}

html, body { height: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 25% 15%, #14283d 0%, #0a1018 55%, #070b10 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 72px;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Промо-панель (десктоп) ---------- */

.promo { width: 380px; color: #eaf2fa; }
.promo-logo {
  width: 76px; height: 76px; border-radius: 24px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3390ec, #1f6fd0);
  box-shadow: 0 18px 40px rgba(51, 144, 236, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.promo-logo svg { width: 42px; height: 42px; color: #fff; }
.promo h1 {
  margin: 26px 0 6px;
  font-size: 46px; line-height: 1; letter-spacing: -1.2px; font-weight: 700;
  background: linear-gradient(100deg, #ffffff, #9cc9f5);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.promo-tag { margin: 0 0 28px; font-size: 17px; color: #93a9bd; }
.promo-list { list-style: none; margin: 0 0 34px; padding: 0; display: grid; gap: 13px; }
.promo-list li { display: flex; align-items: flex-start; gap: 11px; font-size: 14.5px; line-height: 1.45; color: #c3d4e3; }
.promo-list .tick {
  flex: 0 0 21px; width: 21px; height: 21px; margin-top: 1px;
  border-radius: 50%; display: grid; place-items: center;
  background: rgba(51, 144, 236, .18); color: #6ab2f2; font-size: 11px; font-weight: 700;
}
.promo-note { font-size: 12px; letter-spacing: .3px; text-transform: uppercase; color: #5f7690; }

/* ---------- Каркас приложения ---------- */

.app {
  position: relative;
  width: min(430px, 100vw);
  height: min(880px, 100dvh);
  background: var(--bg);
  border-radius: 28px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, .06);
}

.screens { position: relative; flex: 1; overflow: hidden; }

.screen {
  position: absolute; inset: 0;
  display: none;
  flex-direction: column;
  background: var(--bg);
}
.screen.active { display: flex; }

/* ---------- Шапка ---------- */

.topbar {
  flex: 0 0 auto;
  min-height: 56px;
  padding: 7px 10px 7px 12px;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  z-index: 5;
}
.topbar-title { font-size: 17.5px; font-weight: 600; letter-spacing: -.2px; }
.topbar-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 2px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: rgba(127, 140, 155, .14); color: var(--text); }
.icon-btn svg { width: 22px; height: 22px; }

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 38px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3390ec, #1f6fd0);
  color: #fff;
}
.brand-logo svg { width: 23px; height: 23px; }
.brand-text { min-width: 0; }

.badge-18 {
  display: inline-block; vertical-align: 2px;
  margin-left: 3px; padding: 1px 5px;
  border-radius: 5px;
  background: var(--accent-soft); color: var(--accent-2);
  font-size: 10.5px; font-weight: 700; letter-spacing: .2px;
}

/* ---------- Поиск ---------- */

.search-wrap { position: relative; padding: 8px 12px 4px; background: var(--panel); }
.search-wrap .search-icon {
  position: absolute; left: 24px; top: 50%; transform: translateY(-42%);
  width: 17px; height: 17px; color: var(--muted); pointer-events: none;
}
.search-wrap svg { width: 17px; height: 17px; }
.search-wrap input {
  width: 100%; height: 38px;
  padding: 0 12px 0 34px;
  border: 0; border-radius: 10px;
  background: var(--search); color: var(--text);
  font-size: 14.5px; outline: none;
}
.search-wrap input::placeholder { color: var(--muted); }

/* ---------- Списки ---------- */

.list { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.list::-webkit-scrollbar { width: 5px; }
.list::-webkit-scrollbar-thumb { background: rgba(127, 140, 155, .3); border-radius: 5px; }

.row {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 12px;
  cursor: pointer;
  transition: background .12s;
}
.row:hover { background: rgba(127, 140, 155, .09); }
.row:active { background: rgba(127, 140, 155, .15); }

.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.row-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-name {
  font-size: 15.5px; font-weight: 600; letter-spacing: -.1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 5px;
}
.row-name .verified {
  width: 14px; height: 14px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: 0 0 14px;
  background: var(--accent); color: #fff; font-size: 8.5px; font-weight: 700;
}
.row-time { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.row-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.row-msg {
  font-size: 13.5px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.row-msg .me-prefix { color: var(--muted); }
.unread {
  flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px; display: grid; place-items: center;
  background: var(--accent); color: #fff;
  font-size: 11.5px; font-weight: 600;
}

.avatar {
  position: relative; flex: 0 0 auto;
  width: 54px; height: 54px; border-radius: 50%;
  display: grid; place-items: center;
  background-image: var(--g, linear-gradient(135deg, #3390ec, #1f6fd0));
  color: #fff; font-weight: 600; letter-spacing: .3px;
  user-select: none;
}
.avatar .dot {
  position: absolute; right: 0; bottom: 0;
  width: 13px; height: 13px; border-radius: 50%;
  background: #4dcd5e; border: 2.5px solid var(--panel);
}
.avatar.sm { width: 40px; height: 40px; }
.avatar.sm .dot { width: 11px; height: 11px; border-width: 2px; }

.empty { padding: 30px 20px; text-align: center; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); font-weight: 400; }

/* ---------- Нижние вкладки ---------- */

.tabbar {
  flex: 0 0 auto;
  display: flex;
  background: var(--panel);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 6;
}
.tabbar.hidden { display: none; }
.tab {
  flex: 1; height: 58px;
  border: 0; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font: inherit; font-size: 10.5px;
  transition: color .15s;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--accent-2); }
.tab:hover { color: var(--text); }
.tab.active:hover { color: var(--accent-2); }

/* ---------- Переписка ---------- */

.chat-top { gap: 9px; }
.chat-head-text { display: flex; flex-direction: column; min-width: 0; }
.chat-name { font-size: 15.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.chat-name .verified {
  width: 13px; height: 13px; border-radius: 50%;
  display: inline-grid; place-items: center; flex: 0 0 13px;
  background: var(--accent); color: #fff; font-size: 8px; font-weight: 700;
}
.chat-status { font-size: 12px; color: var(--accent-2); }

.messages {
  flex: 1; overflow-y: auto; overscroll-behavior: contain;
  padding: 14px 12px 10px;
  display: flex; flex-direction: column; gap: 7px;
  background-color: var(--bg);
  background-image: radial-gradient(var(--pattern) 1.1px, transparent 1.1px);
  background-size: 22px 22px;
}
.messages::-webkit-scrollbar { width: 5px; }
.messages::-webkit-scrollbar-thumb { background: rgba(127, 140, 155, .3); border-radius: 5px; }

.day {
  align-self: center;
  margin: 2px 0 6px; padding: 3px 11px;
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  color: #a9bdcd; font-size: 11.5px;
}
[data-theme="light"] .day { background: rgba(0, 0, 0, .07); color: #6d7b88; }

.bubble {
  position: relative;
  max-width: 79%;
  padding: 7px 10px;
  border-radius: 14px;
  font-size: 14.7px; line-height: 1.36;
  word-break: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  animation: pop .18s ease-out;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.985); } }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-bottom-left-radius: 5px; }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-bottom-right-radius: 5px; }
.bubble-time {
  float: right; margin: 6px 0 -2px 9px;
  font-size: 10.5px; opacity: .62; user-select: none;
}
[data-theme="light"] .bubble.out { color: #10202e; }

.typing {
  align-self: flex-start;
  display: flex; gap: 4px; align-items: center;
  padding: 11px 13px; border-radius: 14px; border-bottom-left-radius: 5px;
  background: var(--bubble-in);
}
.typing span {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted);
  animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: .18s; }
.typing span:nth-child(3) { animation-delay: .36s; }
@keyframes blink { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.composer {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--panel);
  border-top: 1px solid var(--border);
}
.composer input {
  flex: 1; height: 40px;
  padding: 0 15px;
  border: 0; border-radius: 20px;
  background: var(--search); color: var(--text);
  font: inherit; font-size: 14.5px; outline: none;
}
.composer input::placeholder { color: var(--muted); }
.send-btn {
  flex: 0 0 40px; width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; cursor: pointer;
  opacity: .45; transform: scale(.96);
  transition: opacity .15s, transform .15s;
}
.send-btn svg { width: 19px; height: 19px; margin-left: -1px; }
.send-btn.ready { opacity: 1; transform: scale(1); }
.send-btn:active { transform: scale(.92); }

/* ---------- Радар ---------- */

.radar-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 10px; }
.radar-scroll::-webkit-scrollbar { width: 5px; }
.radar-scroll::-webkit-scrollbar-thumb { background: rgba(127, 140, 155, .3); border-radius: 5px; }

.radar {
  position: relative;
  width: min(318px, 80vw);
  aspect-ratio: 1;
  margin: 14px auto 2px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, rgba(51, 144, 236, .12), rgba(51, 144, 236, .02) 62%, transparent 72%),
    var(--panel-2);
  border: 1px solid var(--border);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .35), 0 10px 36px rgba(0, 0, 0, .3);
  overflow: hidden;
  user-select: none;
}
.ring {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(51, 144, 236, .17);
}
.r1 { width: 38%; height: 38%; }
.r2 { width: 64%; height: 64%; }
.r3 { width: 90%; height: 90%; }
.cross { position: absolute; inset: 0; }
.cross::before, .cross::after {
  content: ""; position: absolute; background: rgba(51, 144, 236, .12);
}
.cross::before { left: 5%; right: 5%; top: 50%; height: 1px; }
.cross::after { top: 5%; bottom: 5%; left: 50%; width: 1px; }

.sweep {
  position: absolute; inset: 5%;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(51, 144, 236, 0) 0deg,
    rgba(51, 144, 236, 0) 268deg,
    rgba(51, 144, 236, .07) 300deg,
    rgba(51, 144, 236, .3) 348deg,
    rgba(51, 144, 236, .48) 359deg,
    rgba(51, 144, 236, 0) 360deg);
  animation: sweep 4.6s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }

.me-dot {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3390ec, #1f6fd0);
  color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 0 0 5px rgba(51, 144, 236, .16), 0 0 22px rgba(51, 144, 236, .55);
  z-index: 4;
}

.blips { position: absolute; inset: 0; z-index: 3; }
.blip {
  position: absolute;
  width: 36px; height: 36px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  background-image: var(--g);
  color: #fff; font: inherit; font-size: 12.5px; font-weight: 600;
  display: grid; place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .45);
  animation: blipIn .45s both, floaty 3.6s ease-in-out infinite;
  transition: transform .15s;
}
@keyframes blipIn { from { opacity: 0; scale: .4; } }
@keyframes floaty { 50% { translate: 0 -3px; } }
.blip:hover { transform: translate(-50%, -50%) scale(1.14); z-index: 6; box-shadow: 0 6px 18px rgba(0, 0, 0, .55), 0 0 0 5px rgba(51, 144, 236, .18); }
.blip::after {
  content: ""; position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(51, 144, 236, .5);
  animation: ping 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes ping { 0% { transform: scale(1); opacity: .8; } 80%, 100% { transform: scale(1.7); opacity: 0; } }

.chips { display: flex; gap: 8px; padding: 12px 14px 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 6px 13px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--panel-2); color: var(--muted);
  font: inherit; font-size: 13px; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--accent-soft); color: var(--accent-2);
  border-color: rgba(51, 144, 236, .45);
}

.section-title {
  padding: 10px 16px 6px;
  font-size: 13px; font-weight: 600;
  color: var(--muted); letter-spacing: .2px;
}

.list.nearby { flex: 0 0 auto; overflow: visible; }
.nearby-row .row-msg { font-size: 12.5px; }

/* ---------- Анкета ---------- */

.person-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: 18px; }
.person-scroll::-webkit-scrollbar { width: 5px; }
.person-scroll::-webkit-scrollbar-thumb { background: rgba(127, 140, 155, .3); border-radius: 5px; }

.person-hero {
  position: relative;
  height: 216px;
  background-image: var(--g);
  display: grid; place-items: center;
  overflow: hidden;
}
.person-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, .38), transparent 55%);
}
.hero-initials {
  font-size: 78px; font-weight: 700; color: rgba(255, 255, 255, .9);
  text-shadow: 0 8px 40px rgba(0, 0, 0, .3);
  z-index: 2; letter-spacing: 1px;
}
.hero-glow {
  position: absolute; width: 260px; height: 260px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); filter: blur(60px);
  top: -90px; right: -70px;
}
.hero-online {
  position: absolute; left: 14px; bottom: 12px; z-index: 3;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(0, 0, 0, .42); backdrop-filter: blur(6px);
  color: #fff; font-size: 11.5px;
}

.person-body { padding: 16px; display: flex; flex-direction: column; gap: 13px; }
.person-head { display: flex; align-items: center; gap: 7px; }
.person-head h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.person-head .verified {
  width: 17px; height: 17px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
}
.age-muted { color: var(--muted); font-weight: 500; }
.person-meta { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.person-meta svg { width: 15px; height: 15px; flex: 0 0 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  padding: 5px 11px; border-radius: 999px;
  background: var(--panel-2); color: var(--text);
  font-size: 12.5px;
}
.bio { margin: 2px 0 0; font-size: 14.5px; line-height: 1.5; color: var(--text); opacity: .92; }

.person-actions { display: flex; gap: 9px; margin-top: 3px; }
.btn {
  border: 0; cursor: pointer; font: inherit;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: transform .12s, filter .15s, background .15s;
}
.btn:active { transform: scale(.98); }
.btn.primary {
  flex: 1; height: 46px;
  background: linear-gradient(135deg, #3390ec, #1f7fd6);
  color: #fff; font-size: 15px; font-weight: 600;
  box-shadow: 0 8px 22px rgba(51, 144, 236, .28);
}
.btn.primary:hover { filter: brightness(1.06); }
.btn.primary svg { width: 20px; height: 20px; }
.btn.icon-heart {
  flex: 0 0 46px; width: 46px; height: 46px;
  background: var(--panel-2); color: var(--muted);
}
.btn.icon-heart svg { width: 22px; height: 22px; }
.btn.icon-heart.liked { color: #ff5c8a; background: rgba(255, 92, 138, .13); }
.btn.ghost {
  height: 44px; padding: 0 22px;
  background: transparent; color: var(--muted); font-size: 14.5px;
}
.btn.ghost:hover { color: var(--text); }

.info-list {
  margin-top: 4px;
  border-radius: 14px;
  background: var(--panel-2);
  overflow: hidden;
}
.info-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 13px 14px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.info-row:last-child { border-bottom: 0; }
.info-row span { color: var(--muted); }
.info-row b { font-weight: 500; text-align: right; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin: 2px 0 4px;
}
.stats > div {
  padding: 13px 8px;
  border-radius: 14px;
  background: var(--panel-2);
  text-align: center;
}
.stats b { display: block; font-size: 19px; font-weight: 700; }
.stats span { font-size: 11.5px; color: var(--muted); }

.settings { border-radius: 14px; background: var(--panel-2); overflow: hidden; margin-top: 4px; }
.setting {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 14px;
  border: 0; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--text);
  font: inherit; font-size: 14.5px; text-align: left; cursor: pointer;
}
.setting:last-child { border-bottom: 0; }
.setting:hover { background: rgba(127, 140, 155, .08); }
.setting-icon {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent-2);
}
.setting-icon svg { width: 17px; height: 17px; }
.setting-value { margin-left: auto; color: var(--muted); font-size: 13px; }
.setting .chev { width: 16px; height: 16px; color: var(--muted); }

.hint { margin: 8px 0 0; text-align: center; font-size: 11.5px; color: var(--muted); }

/* ---------- 18+ гейт ---------- */

.gate {
  position: absolute; inset: 0; z-index: 40;
  display: grid; place-items: center;
  padding: 28px;
  background:
    radial-gradient(520px 340px at 50% 8%, rgba(51, 144, 236, .18), transparent 70%),
    var(--bg);
  text-align: center;
}
.gate-inner { display: flex; flex-direction: column; align-items: center; max-width: 320px; }
.gate-inner[hidden] { display: none !important; }
.gate-logo {
  width: 84px; height: 84px; border-radius: 26px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3390ec, #1f6fd0);
  color: #fff;
  box-shadow: 0 18px 44px rgba(51, 144, 236, .4), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.gate-logo svg { width: 46px; height: 46px; }
.gate-logo.warn {
  background: rgba(255, 176, 32, .12);
  color: #ffb020;
  border: 1px solid rgba(255, 176, 32, .3);
  font-size: 36px; font-weight: 700;
  box-shadow: none;
}
.gate h2 { margin: 22px 0 10px; font-size: 25px; font-weight: 700; letter-spacing: -.5px; }
.gate p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.gate-actions { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; margin-top: 24px; }
.gate-actions .btn.primary { height: 48px; font-size: 15.5px; }
.gate-fine { margin-top: 20px; font-size: 11px; color: var(--muted); opacity: .75; }

/* ---------- Тост ---------- */

.toast {
  position: absolute; left: 50%; bottom: 82px; z-index: 50;
  transform: translate(-50%, 14px);
  max-width: 84%;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(20, 30, 42, .92);
  color: #eaf1f8;
  font-size: 13px; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s, transform .22s;
}
[data-theme="light"] .toast { background: rgba(28, 40, 54, .94); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Мобильная раскладка ---------- */

@media (min-width: 821px) {
  .app { height: min(880px, 92dvh); }
}

@media (max-width: 820px) {
  body { gap: 0; background: #000; }
  .promo { display: none; }
  .app {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
    box-shadow: none;
  }
}

@media (max-height: 720px) {
  .radar { width: min(268px, 72vw); margin-top: 8px; }
  .person-hero { height: 180px; }
}
/* ============ Веб-клиент «Близко»: формы, вход, матчи ============ */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12.5px; color: var(--muted); padding-left: 2px; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field input::placeholder,
.field textarea::placeholder { color: var(--muted); }
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(51, 144, 236, .55);
  box-shadow: 0 0 0 3px rgba(51, 144, 236, .12);
}
.field textarea { resize: vertical; min-height: 76px; }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }

.auth-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.auth-logo {
  width: 72px; height: 72px;
  border-radius: 22px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #3390ec, #1f6fd0);
  color: #fff;
  box-shadow: 0 16px 40px rgba(51, 144, 236, .35), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.auth-logo svg { width: 40px; height: 40px; }
.auth-title { margin: 16px 0 4px; font-size: 28px; font-weight: 700; letter-spacing: -.6px; }
.auth-sub { margin: 0; color: var(--muted); font-size: 13.5px; }
.auth-tabs {
  display: flex; gap: 4px;
  width: 100%;
  margin-top: 22px;
  padding: 4px;
  border-radius: 12px;
  background: var(--panel-2);
}
.auth-tab {
  flex: 1; padding: 9px 0;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 14px; cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-tab.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.auth-form { display: flex; flex-direction: column; gap: 12px; width: 100%; margin-top: 18px; }
.auth-form[hidden] { display: none; }
.auth-submit { height: 48px; font-size: 15.5px; margin-top: 4px; }
.auth-error {
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(255, 92, 138, .12);
  border: 1px solid rgba(255, 92, 138, .25);
  color: #ff9db8;
  font-size: 13px; line-height: 1.4;
}
.auth-fine { margin: 2px 0 0; font-size: 11.5px; color: var(--muted); text-align: center; }
.auth-demo { margin-top: 20px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-demo b { color: var(--accent-2); font-weight: 600; }

.onboarding-scroll { flex: 1; overflow-y: auto; padding: 18px 18px 30px; }
.onboarding-form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.section-hint { margin: 0 0 6px; color: var(--muted); font-size: 13.5px; }

.segmented {
  display: flex; gap: 4px;
  margin: 10px 14px 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--panel-2);
}
.seg {
  flex: 1; padding: 8px 0;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  font: inherit; font-size: 13.5px; cursor: pointer;
  transition: background .15s, color .15s;
}
.seg.active { background: var(--panel); color: var(--text); }

.mini-badge {
  display: inline-block; vertical-align: 3px;
  margin-left: 5px; padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 176, 32, .16);
  color: #ffb020;
  font-size: 10px; font-weight: 600;
}

.radar-note { margin: 8px 16px 16px; font-size: 11.5px; color: var(--muted); line-height: 1.45; text-align: center; }

.people-row { padding: 10px 12px; border-bottom: 1px solid var(--border); }
.people-row:last-child { border-bottom: 0; }
.people-row .row-msg { font-size: 12.5px; }
.like-btn {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border: 0; border-radius: 50%;
  background: var(--panel-2); color: var(--muted);
  display: grid; place-items: center; cursor: pointer;
  transition: color .15s, background .15s, transform .12s;
}
.like-btn svg { width: 20px; height: 20px; }
.like-btn:hover { color: #ff5c8a; background: rgba(255, 92, 138, .12); }
.like-btn:active { transform: scale(.94); }
.like-btn.liked { color: #ff5c8a; background: rgba(255, 92, 138, .16); }

.matches-row .row-time { color: var(--accent-2); font-size: 11.5px; }

.profile-edit { display: flex; flex-direction: column; gap: 12px; margin-top: 6px; }
.profile-actions { display: flex; gap: 9px; margin-top: 6px; }
.btn.secondary { height: 44px; padding: 0 18px; background: var(--panel-2); color: var(--text); font-size: 14px; }
.btn.danger { height: 44px; padding: 0 18px; background: rgba(255, 92, 138, .12); color: #ff9db8; font-size: 14px; }

.loading { padding: 30px 20px; text-align: center; color: var(--muted); font-size: 13.5px; }

.chat-status.typing { color: var(--accent-2); }

/* Фото и PWA */
.avatar { overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
.photo-tile { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--panel-2); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-add {
  aspect-ratio: 1;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--panel-2);
  color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  cursor: pointer; font-size: 24px; line-height: 1;
  transition: color .15s, border-color .15s;
}
.photo-add span { font-size: 10.5px; }
.photo-add:hover { color: var(--text); border-color: var(--accent); }
.photo-del {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border: 0; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}

/* Карточка человека с радара */
.sheet { position: absolute; inset: 0; z-index: 35; display: flex; align-items: flex-end; justify-content: center; background: rgba(0, 0, 0, .55); }
.sheet[hidden] { display: none; }
.sheet-card {
  position: relative;
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  background: var(--panel);
  border-radius: 20px 20px 0 0;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  animation: sheetUp .22s ease-out;
}
@keyframes sheetUp { from { transform: translateY(26px); opacity: 0; } }
.sheet-hero {
  height: 180px;
  display: grid; place-items: center;
  background-image: var(--g, linear-gradient(135deg, #3390ec, #1f6fd0));
  font-size: 64px; font-weight: 700;
  color: rgba(255, 255, 255, .92);
  overflow: hidden;
}
.sheet-hero img { width: 100%; height: 100%; object-fit: cover; }
.sheet-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: rgba(0, 0, 0, .42); color: #fff;
  font-size: 20px; line-height: 1; cursor: pointer;
  display: grid; place-items: center;
}
.sheet-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.sheet-body h2 { margin: 0; font-size: 22px; letter-spacing: -.4px; }
.sheet-body .btn.primary { height: 46px; margin-top: 4px; }

[hidden] { display: none !important; }
.sheet-card { max-height: 92%; }
.sheet-hero { height: 160px; }
.captcha-row { display: flex; gap: 8px; align-items: flex-end; }
.captcha-row .field { flex: 1; min-width: 0; }
.captcha-row .field b { color: var(--accent-2); font-weight: 600; }
.captcha-refresh {
  flex: 0 0 44px; height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 19px; cursor: pointer;
}
.captcha-refresh:hover { color: var(--text); }
.photo-pending {
  position: absolute; left: 4px; bottom: 4px;
  padding: 2px 6px; border-radius: 6px;
  background: rgba(0, 0, 0, .62);
  color: #ffb020;
  font-size: 9.5px; font-weight: 600;
}
.sheet-actions { display: flex; gap: 8px; margin-top: 2px; }
.sheet-actions .btn { flex: 1; height: 42px; font-size: 13.5px; }
.danger-text { color: #ff9db8; }
.blocked-row { padding: 8px 12px; }
.blocked-row .unblock-btn { height: 34px; padding: 0 12px; font-size: 12px; flex: 0 0 auto; }
.blocked-list .section-hint { padding: 4px 16px 12px; }
