:root {
  --bg: #F4F1F6; --surface: #FFFFFF; --surface-2: #ECE7F0; --ink: #221B2E; --muted: #6E6680; --line: #DDD5E4;
  --accent: #B3123F; --accent-soft: #F7DCE4; --accent-ink: #FFFFFF; --good: #1F7A55; --warn: #9A5B00;
  --tg: #2A8BD6; --shadow: 0 10px 30px rgba(52, 22, 60, .14);
  --display: "Unbounded", "Arial Black", system-ui, sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17121E; --surface: #221B2C; --surface-2: #2C2438; --ink: #F2ECF6; --muted: #A79CB6; --line: #3A3048;
    --accent: #F0577F; --accent-soft: #46202F; --accent-ink: #1A0E14; --good: #5CC995; --warn: #F0B45C;
    --tg: #6CB8F0; --shadow: 0 10px 30px rgba(0,0,0,.45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #17121E; --surface: #221B2C; --surface-2: #2C2438; --ink: #F2ECF6; --muted: #A79CB6; --line: #3A3048;
    --accent: #F0577F; --accent-soft: #46202F; --accent-ink: #1A0E14; --good: #5CC995; --warn: #F0B45C;
    --tg: #6CB8F0; --shadow: 0 10px 30px rgba(0,0,0,.45); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 var(--body); }
body { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); -webkit-tap-highlight-color: transparent; }
#app { max-width: 520px; margin: 0 auto; padding: 12px 16px 32px; }
.top { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
.top h1 { font: 700 22px var(--display); margin: 0; flex: 1; letter-spacing: -.01em; }
.logo { width: 36px; height: 36px; border-radius: 9px; }
h2 { font: 600 19px var(--display); margin: 0 0 6px; }
h3 { font: 600 16px var(--display); margin: 0 0 4px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; margin: 0 0 12px; box-shadow: var(--shadow); }
.sub { color: var(--muted); margin: 0 0 12px; }
.small { font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px 16px; margin: 8px 0 0; background: var(--accent);
  color: var(--accent-ink); font: 600 16px var(--body); text-align: center; text-decoration: none; cursor: pointer; }
.btn.ghost { background: var(--surface-2); color: var(--ink); }
.btn.tg { background: var(--tg); color: #fff; }
.btn.sm { padding: 10px 14px; font-size: 14px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
.top .btn { width: auto; margin: 0; }
.btn:disabled { opacity: .5; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: 14px var(--body); margin: 10px 0 0; padding: 0; cursor: pointer; }
.code { display: block; width: 100%; margin: 14px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  color: var(--ink); font: 700 28px var(--display); letter-spacing: .3em; text-align: center; }
.code.wide { font-size: 20px; letter-spacing: .15em; }
/* Игорь 21.11 18:50: дата рождения и город — обычным шрифтом; город — из списка настоящих городов */
.field { display: block; width: 100%; margin: 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg);
  color: var(--ink); font: 16px var(--body); min-height: 50px; }
.cityBox { position: relative; }
.sugg { margin-top: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--card, var(--bg)); overflow: hidden; }
.sugg button { display: block; width: 100%; text-align: left; padding: 12px 14px; border: 0; border-top: 1px solid var(--line); background: none;
  color: var(--ink); font: 16px var(--body); cursor: pointer; }
.sugg button:first-child { border-top: 0; }
.sugg button span { color: var(--muted); }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: var(--bg); color: var(--ink); font: 16px var(--body); resize: vertical; }
.msg { min-height: 1.4em; margin: 10px 0 0; color: var(--accent); font-weight: 600; }
.or { text-align: center; color: var(--muted); margin: 14px 0 0; font-size: 14px; }
.steps { padding-left: 20px; margin: 0 0 6px; } .steps li { margin: 0 0 8px; }
.ico { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--surface-2); }
.invite { margin: 10px 0 0; padding: 12px; border-radius: 14px; background: var(--accent-soft); text-align: center; }
.invite code { font: 700 22px var(--display); letter-spacing: .15em; }
.conn { width: 12px; height: 12px; border-radius: 50%; background: var(--line); flex: none; }
.conn.on { background: var(--good); } .conn.wait { background: var(--warn); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); opacity: .5; vertical-align: middle; }
.dot.on { background: var(--good); opacity: 1; }
.conn-txt { font-size: 13px; color: var(--warn); }
.dev { margin: 14px 0 0; padding: 10px; border: 1px dashed var(--warn); border-radius: 12px; font-size: 13px; }
.dev input { font: 13px var(--body); padding: 4px; border-radius: 6px; border: 1px solid var(--line); }
[hidden] { display: none !important; }
.alt { margin: 16px 0 0; padding: 12px 0 0; border-top: 1px solid var(--line); }

/* профиль */
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; padding: 0; flex: none; cursor: pointer;
  background: var(--accent-soft) center/cover no-repeat; color: var(--accent); font: 700 16px var(--display);
  display: inline-flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); }
.avatar.lg { width: 56px; height: 56px; font-size: 22px; cursor: default; }
.avatar.sm { width: 26px; height: 26px; font-size: 12px; cursor: default; box-shadow: none; }
.pairhead { display: flex; align-items: center; gap: 8px; }
.pairhead .avatar.sm + .avatar.sm { margin-left: -10px; box-shadow: 0 0 0 2px var(--surface); }
dialog.sheet { border: 0; padding: 0; width: min(520px, 100%); max-width: 100%; margin: auto auto 0; border-radius: 22px 22px 0 0;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow); max-height: 92vh; overflow: auto; }
@media (min-width: 600px) { dialog.sheet { margin: 64px auto auto; border-radius: 22px; } }
dialog.sheet::backdrop { background: rgba(20, 10, 25, .45); }
.sheet-in { padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.sheet-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.sheet-head > div:nth-child(2) { flex: 1; min-width: 0; }
.sheet-head b { font: 600 18px var(--display); }
.x { border: 0; background: var(--surface-2); color: var(--ink); width: 34px; height: 34px; border-radius: 50%; font-size: 16px; cursor: pointer; }
.menu { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.mi { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--ink); font: 500 16px var(--body); text-align: left; text-decoration: none; cursor: pointer; }
.menu > .mi:first-child { border-top: 0; }
.mi span { flex: 1; }
.mi em { font-style: normal; color: var(--muted); font-size: 14px; text-align: right; }
.mi em.bad { color: var(--accent); }
.mi.danger { color: var(--accent); }
.subm { background: var(--bg); }
.subm .mi { padding-left: 42px; min-height: 46px; font-size: 15px; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--muted); font: 600 13px var(--body); padding: 6px 9px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.center { text-align: center; }
.seg.wide { display: flex; width: 100%; } .seg.wide button { flex: 1; padding: 10px; font-size: 15px; }

/* Игорь 22.11: вход в 1–2 нажатия и понятные шаги */
.land h2 { font-size: 22px; margin: 2px 0 12px; }
.land-inv { margin: 0 0 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); font-weight: 600; }
.land-list { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.land-list li { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.land-list li span { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 12px; background: var(--surface-2); font-size: 19px; }
.btn.big { padding: 16px; font-size: 17px; }
.land-note { margin: 10px 0 6px; text-align: center; }
.land .linkbtn.small, #v-pair .linkbtn.small { display: block; margin: 8px auto 0; font-size: 14px; color: var(--muted); }
.land-foot { margin: 18px 0 0; text-align: center; } .land-foot a { color: var(--muted); }
.wait { margin: 12px 0 0; padding: 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.wait p { margin: 0 0 6px; } .wait .linkbtn { font-size: 14px; }
.spin { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border: 2px solid var(--muted); border-top-color: transparent; border-radius: 50%; animation: hhSpin 1s linear infinite; vertical-align: -1px; }
@keyframes hhSpin { to { transform: rotate(360deg); } }
.stepno { margin: 0 0 4px; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; } .row3 .btn { margin-top: 8px; }
details.more { margin: 14px 0 0; } details.more summary { cursor: pointer; color: var(--accent); font-weight: 600; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
.linkbtn.skip { display: block; margin: 12px auto 0; color: var(--muted); font-size: 14px; }

.wait .alt { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.altrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; font-size: 14px; }
.altrow .btn { width: auto; margin: 0; flex: none; }
.altrow .btn { background: var(--surface); border: 1px solid var(--line); }
