:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--tg-theme-text-color, #241f22);
  background: var(--tg-theme-bg-color, #f5f1f2);
  --surface: var(--tg-theme-secondary-bg-color, #ffffff);
  --text: var(--tg-theme-text-color, #241f22);
  --muted: var(--tg-theme-hint-color, #7c7478);
  --button: var(--tg-theme-button-color, #7d2649);
  --button-text: var(--tg-theme-button-text-color, #ffffff);
  --accent: #8b3156;
  --accent-soft: rgba(139, 49, 86, .10);
  --line: rgba(90, 60, 75, .12);
  --success-bg: #e3f2e7;
  --success: #2d6a40;
  --warn-bg: #fff0d7;
  --warn: #7a520d;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--tg-theme-bg-color, #f5f1f2); }
body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
body.dark {
  --accent: #e58aaa;
  --accent-soft: rgba(229, 138, 170, .12);
  --line: rgba(255,255,255,.09);
  --success-bg: rgba(93, 178, 116, .16);
  --success: #99d8aa;
  --warn-bg: rgba(225, 168, 70, .16);
  --warn: #efc877;
}
button { font: inherit; }
.app-shell { max-width: 680px; margin: 0 auto; padding: 18px 16px 34px; }
.brandbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.eyebrow, .section-kicker { font-size: 10px; line-height: 1.3; font-weight: 850; letter-spacing: .13em; color: var(--muted); }
.brand-title { margin-top: 4px; font-size: 20px; line-height: 1.1; font-weight: 850; color: var(--text); }
.avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 18px; font-weight: 900; border: 1px solid var(--line); }
.screen { display: none; animation: fade .16s ease-out; }
.screen.active { display: block; }
@keyframes fade { from { opacity: .4; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.card, .hero-card, .stat-card { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(20, 10, 15, .04); }
.card { border-radius: 22px; padding: 18px; margin: 12px 0; }
.hero-card { border-radius: 24px; padding: 20px; display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.hero-title { font-size: 24px; line-height: 1.15; font-weight: 900; }
.hero-copy p { margin: 10px 0 0; color: var(--muted); line-height: 1.48; max-width: 480px; }
h2 { font-size: 24px; line-height: 1.15; margin: 6px 0 10px; }
h3 { font-size: 18px; margin: 6px 0 0; }
p { line-height: 1.5; margin: 8px 0 0; }
.pill { border-radius: 999px; padding: 8px 10px; font-size: 11px; white-space: nowrap; font-weight: 850; background: var(--accent-soft); color: var(--accent); }
.pill.ok { background: var(--success-bg); color: var(--success); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.action-card { position: relative; overflow: hidden; }
.action-card::after { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; right: -72px; top: -72px; background: var(--accent-soft); pointer-events: none; }
.soft-note { margin-top: 14px; border-radius: 15px; padding: 13px 14px; background: var(--accent-soft); line-height: 1.45; }
button { border: 0; border-radius: 16px; padding: 14px 16px; font-weight: 850; cursor: pointer; }
button.primary { background: var(--button); color: var(--button-text); }
button.secondary { background: var(--accent-soft); color: var(--accent); }
button.wide { width: 100%; margin-top: 14px; }
button:disabled { opacity: .55; cursor: wait; }
.route-card { padding-bottom: 17px; }
.route-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin-top: 12px; font-size: 12px; color: var(--muted); }
.route-step { padding: 6px 9px; border-radius: 999px; background: rgba(128,128,128,.08); }
.route-step.current { background: var(--accent-soft); color: var(--accent); font-weight: 850; }
.membership-title { margin-top: 8px; font-size: 28px; line-height: 1.12; font-weight: 900; color: var(--accent); }
.membership-until { margin-top: 8px; color: var(--muted); }
.days-box { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 18px; padding: 11px 14px; border-radius: 16px; background: var(--accent-soft); }
.days-box strong { color: var(--accent); font-size: 30px; }
.days-box span { color: var(--muted); font-size: 13px; }
.detail-row { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; line-height: 1.45; }
.detail-row strong { text-align: right; }
.divider { height: 1px; background: var(--line); margin: 15px 0; }
.compact-card { padding: 16px 18px; }
.invite-result { margin-top: 14px; }
.invite-link { padding: 13px; border-radius: 14px; background: var(--accent-soft); overflow-wrap: anywhere; font-size: 13px; line-height: 1.45; }
.button-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 9px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.stat-card { border-radius: 20px; padding: 17px; min-height: 108px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card strong { color: var(--accent); font-size: 36px; }
.stat-card span { color: var(--muted); font-size: 13px; line-height: 1.3; }
.people-list { margin-top: 10px; }
.person { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person-name { font-weight: 850; }
.person-meta { color: var(--muted); font-size: 12px; margin-top: 4px; }
.person-status { font-size: 11px; border-radius: 999px; padding: 5px 8px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.person-status.joined { background: var(--success-bg); color: var(--success); }
.empty { color: var(--muted); padding: 10px 0 3px; }
.principle { font-weight: 800; line-height: 1.65; color: var(--accent); }
.trust-card p { color: var(--muted); }
.notice { padding: 12px 14px; border-radius: 14px; margin: 10px 0; line-height: 1.4; }
.error { background: #ffe8e8; color: #7c1d1d; }
.hidden { display: none !important; }
.version { text-align: center; color: var(--muted); opacity: .45; font-size: 11px; margin-top: 18px; }
.bottom-nav { position: fixed; z-index: 10; bottom: 0; left: 0; right: 0; height: calc(68px + env(safe-area-inset-bottom)); padding: 6px 10px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(4, 1fr); background: color-mix(in srgb, var(--tg-theme-bg-color, #f5f1f2) 94%, transparent); backdrop-filter: blur(18px); border-top: 1px solid var(--line); }
.nav-item { background: transparent; color: var(--muted); padding: 5px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 14px; }
.nav-icon { font-size: 22px; line-height: 1; }
.nav-item small { font-size: 10px; font-weight: 800; }
.nav-item.active { color: var(--accent); background: var(--accent-soft); }
@media (max-width: 420px) {
  .app-shell { padding-left: 12px; padding-right: 12px; }
  .hero-card { flex-direction: column; }
  .pill { align-self: flex-start; }
  .brand-title { font-size: 19px; }
  .hero-title { font-size: 22px; }
  h2 { font-size: 22px; }
}
.payment-card h3 { margin-top: 7px; }
.payment-text { color: var(--muted); }
.payment-card .soft-note { color: var(--text); }

/* v0.18: чистовой платёжный экран */
.payment-card { overflow: hidden; }
.payment-card h3 { font-size: 21px; line-height: 1.25; }
.payment-card .payment-text { max-width: 520px; }
.payment-card #paymentResult { margin-top: 14px; }
