:root {
  --bg: var(--tg-theme-bg-color, #0f1014);
  --surface: var(--tg-theme-secondary-bg-color, #191a20);
  --surface-2: var(--tg-theme-section-bg-color, #22232a);
  --text: var(--tg-theme-text-color, #f5f5f7);
  --muted: var(--tg-theme-hint-color, #92939c);
  --accent: var(--tg-theme-button-color, #ff4567);
  --accent-text: var(--tg-theme-button-text-color, #ffffff);
  --line: color-mix(in srgb, var(--text) 10%, transparent);
  --safe-top: var(--tg-content-safe-area-inset-top, 0px);
  --safe-bottom: var(--tg-content-safe-area-inset-bottom, 0px);
  color-scheme: var(--tg-color-scheme, dark);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Myanmar", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overscroll-behavior: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.hidden { display: none !important; }

.startup-screen { position: fixed; z-index: 200; inset: 0; min-height: 100vh; padding: calc(28px + var(--safe-top)) 25px calc(28px + var(--safe-bottom)); display: grid; place-content: center; justify-items: center; text-align: center; background: var(--bg); }
.startup-logo { width: 76px; height: 76px; margin-bottom: 24px; display: grid; place-items: center; border-radius: 24px; background: var(--accent); color: var(--accent-text); box-shadow: 0 18px 55px color-mix(in srgb, var(--accent) 25%, transparent); font: italic 900 38px Georgia, serif; animation: startupFloat 1.8s ease-in-out infinite; }
.startup-spinner { width: 24px; height: 24px; margin-bottom: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: startupSpin .8s linear infinite; }
.startup-screen h1 { margin: 0 0 8px; font-size: 23px; letter-spacing: -.5px; }
.startup-screen > p:not(.eyebrow) { max-width: 310px; margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.startup-retry { max-width: 190px; margin-top: 18px; }
.channel-logo { margin-bottom: 17px; background: color-mix(in srgb, #42c782 18%, var(--surface)); color: #42c782; box-shadow: none; font: 900 28px/1 Inter, sans-serif; animation: none; }
.channel-actions { width: min(100%, 330px); margin-top: 24px; display: grid; gap: 9px; }
.channel-status { margin-top: 13px; color: var(--muted); font-size: 9px; }
.channel-status.checking { color: var(--accent); }
@keyframes startupSpin { to { transform: rotate(360deg); } }
@keyframes startupFloat { 50% { transform: translateY(-5px); } }

.app-shell { width: min(100%, 620px); min-height: var(--tg-viewport-stable-height, 100vh); margin: 0 auto; }
.topbar { height: calc(62px + var(--safe-top)); padding: calc(10px + var(--safe-top)) 18px 8px; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 850; letter-spacing: -.5px; }
.brand-mark { width: 31px; height: 31px; display: grid; place-items: center; border-radius: 10px; background: var(--accent); color: var(--accent-text); font: italic 850 17px Georgia, serif; }
.icon-button, .avatar-button { width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.icon-button { font-size: 25px; }
.avatar-button { overflow: hidden; background: var(--accent); color: var(--accent-text); font-size: 14px; font-weight: 850; }
.avatar-button img, .profile-avatar-wrap img { width: 100%; height: 100%; object-fit: cover; }
.avatar-button:active, .icon-button:active { transform: scale(.94); }

.mode-switch { width: calc(100% - 36px); height: 43px; margin: 4px auto 15px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 13px; background: transparent; }
.mode-tab { border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 750; transition: background .2s ease, color .2s ease; }
.mode-tab.active { background: var(--surface-2); color: var(--text); }

.main-content { padding: 0 18px calc(88px + var(--safe-bottom)); }
.view { display: none; animation: viewIn .22s ease-out; }
.view.active { display: block; }
@keyframes viewIn { from { opacity: 0; transform: translateY(5px); } }

.section-bar { min-height: 51px; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 1px 12px; }
.section-bar h1 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.6px; }
.section-subtitle { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: 1.3px; }
h1, h2, h3, p { margin-top: 0; }
.counter, .preview-badge { min-height: 28px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 750; }

.profile-card { height: clamp(340px, calc(var(--tg-viewport-stable-height, 100vh) - 360px), 510px); min-height: 340px; position: relative; overflow: hidden; border-radius: 22px; background: #35363d; animation: cardEnter .3s cubic-bezier(.16,1,.3,1); transform-origin: center bottom; will-change: transform, opacity; }
.profile-photo { width: 100%; height: 100%; display: block; object-fit: cover; background: linear-gradient(150deg, #555861, #2c2d34); }
.profile-gradient { position: absolute; inset: 38% 0 0; background: linear-gradient(transparent, rgba(8,8,11,.92)); }
.profile-badges { position: absolute; z-index: 3; top: 13px; left: 13px; right: 13px; display: flex; justify-content: space-between; pointer-events: none; }
.profile-badge { min-height: 28px; padding: 6px 9px; border-radius: 999px; background: rgba(10,10,14,.55); color: #fff; backdrop-filter: blur(10px); font-size: 10px; font-weight: 750; }
.profile-copy { position: absolute; z-index: 2; inset: auto 0 0; padding: 25px 19px 18px; color: #fff; }
.profile-copy h2 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.7px; }
.profile-copy p { max-width: 94%; margin: 0 0 11px; color: rgba(255,255,255,.78); font-size: 12px; line-height: 1.45; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { padding: 6px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(0,0,0,.18); color: rgba(255,255,255,.9); font-size: 10px; }

.profile-actions { display: grid; grid-template-columns: .85fr 1.15fr; gap: 9px; margin-top: 11px; }
.action-button { min-height: 52px; border: 0; border-radius: 15px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; font-weight: 800; transition: transform .15s ease; }
.action-button span { font-size: 21px; line-height: 1; }
.action-button:active { transform: scale(.96); }
.action-button:disabled { opacity: .45; }
.action-button.skip { border: 1px solid var(--line); background: transparent; color: var(--muted); }
.action-button.like { background: var(--accent); color: var(--accent-text); }

.empty-state { min-height: 340px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); }
.empty-state > span { font-size: 39px; color: var(--accent); }
.empty-state h2 { margin: 10px 0 4px; color: var(--text); font-size: 19px; }
.empty-state p { margin: 0; font-size: 12px; }
.empty-state .retry-button { width: auto; min-width: 130px; margin-top: 16px; padding-inline: 18px; }
.profile-skeleton { height: clamp(340px, calc(var(--tg-viewport-stable-height, 100vh) - 360px), 510px); min-height: 340px; position: relative; overflow: hidden; border-radius: 22px; background: var(--surface); }
.profile-skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.06), transparent 70%); animation: skeleton 1.2s infinite; }
.profile-skeleton i, .profile-skeleton b { position: absolute; left: 19px; border-radius: 8px; background: var(--surface-2); }
.profile-skeleton i { width: 42%; height: 17px; bottom: 62px; }
.profile-skeleton i + i { width: 65%; height: 10px; bottom: 38px; }
.profile-skeleton b { right: 19px; height: 8px; bottom: 17px; }
@keyframes skeleton { to { transform: translateX(100%); } }

.anonymous-card { padding: 8px 0 0; text-align: center; }
.anon-symbol { width: 66px; height: 66px; margin: 0 auto 15px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--text); font: 39px Georgia, serif; }
.anonymous-card h1 { margin-bottom: 8px; font-size: 26px; }
.anon-copy { max-width: 390px; margin: 0 auto 21px; color: var(--muted); line-height: 1.55; font-size: 12px; }
.choice-list { display: grid; gap: 8px; }
.choice-row { width: 100%; min-height: 68px; padding: 10px 12px; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 11px; text-align: left; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); transition: transform .15s ease; }
.choice-row:active { transform: scale(.98); }
.choice-row > span:nth-child(2) { display: grid; gap: 2px; }
.choice-row small { color: var(--muted); font-size: 10px; }
.choice-row b:last-child { color: var(--muted); font-size: 20px; }
.choice-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: var(--accent); color: var(--accent-text); }
.choice-icon.neutral { background: var(--surface-2); color: var(--text); }
.privacy-note { margin-top: 12px; padding: 11px 13px; display: flex; gap: 10px; align-items: flex-start; text-align: left; border-radius: 14px; background: var(--surface); color: var(--muted); }
.privacy-note > span { color: #4dbc7a; font-weight: 900; }
.privacy-note p { margin: 0; font-size: 10px; line-height: 1.55; }
.privacy-note strong { color: var(--text); }
.status-panel { padding: 23px 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.status-panel p { margin: 7px auto 14px; color: var(--muted); font-size: 11px; }
.pulse-dot { width: 10px; height: 10px; margin: 0 auto 12px; display: block; border-radius: 50%; background: var(--accent); animation: pulse 1.3s infinite; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.8); } }

.likes-pill { min-height: 44px; padding: 7px 12px; border: 1px solid color-mix(in srgb, var(--accent) 36%, transparent); border-radius: 999px; background: transparent; color: var(--accent); font-size: 11px; font-weight: 800; }
.section-note { margin: -3px 1px 14px; color: var(--muted); font-size: 11px; }
.list-stack { display: grid; gap: 8px; }
.match-row { min-height: 74px; padding: 9px; display: grid; grid-template-columns: 55px 1fr 44px; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); animation: rowIn .25s ease-out both; }
.match-row:nth-child(2) { animation-delay: .04s; }
.match-row:nth-child(3) { animation-delay: .08s; }
.match-thumb { width: 55px; height: 55px; border-radius: 50%; object-fit: cover; background: #35363d; }
.match-row h3 { margin: 0 0 3px; font-size: 14px; }
.match-row p { margin: 0; color: var(--muted); font-size: 10px; }
.mini-action { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface-2); }
.mini-action:active { transform: scale(.92); }
@keyframes rowIn { from { opacity: 0; transform: translateX(8px); } }

.notice-card { margin-top: 16px; padding: 34px 22px; text-align: center; border: 1px solid var(--line); border-radius: 18px; }
.notice-icon { width: 56px; height: 56px; margin: 0 auto 15px; display: grid; place-items: center; border-radius: 50%; background: var(--surface); color: var(--accent); font-size: 24px; }
.notice-card h2 { margin-bottom: 7px; font-size: 20px; }
.notice-card p { color: var(--muted); line-height: 1.55; font-size: 11px; }

.profile-summary { min-height: 92px; margin: 3px 0 18px; padding: 11px 0; display: grid; grid-template-columns: 68px 1fr auto; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.profile-avatar-wrap { width: 68px; height: 68px; display: grid; place-items: center; overflow: hidden; border-radius: 50%; background: var(--accent); color: var(--accent-text); font-weight: 850; }
.profile-summary h1 { margin: 0; font-size: 20px; }
.profile-summary p:last-child { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.profile-completeness { margin: -5px 0 20px; }
.profile-completeness > div { display: flex; justify-content: space-between; margin-bottom: 7px; color: var(--muted); font-size: 10px; font-weight: 750; }
.profile-completeness b { color: var(--accent); }
.profile-completeness > i { height: 4px; display: block; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.profile-completeness > i > span { width: 0; height: 100%; display: block; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
.profile-form { display: grid; gap: 13px; }
.form-section-label { margin: 4px 0 -2px; color: var(--text); font-size: 13px; font-weight: 850; }
.profile-form label { display: grid; gap: 6px; position: relative; color: var(--muted); font-size: 10px; font-weight: 750; }
.profile-form input, .profile-form textarea, .profile-form select { width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: var(--surface); color: var(--text); resize: vertical; }
.profile-form input:focus, .profile-form textarea:focus, .profile-form select:focus { border-color: var(--accent); }
.profile-form label > small { position: absolute; right: 10px; bottom: 8px; font-weight: 500; }
.form-row { display: grid; grid-template-columns: .7fr 1.3fr; gap: 9px; }
fieldset { margin: 0; padding: 1px 0 0; border: 0; }
legend { margin-bottom: 8px; color: var(--muted); font-size: 10px; font-weight: 750; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 7px; }
.chip { min-height: 38px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; background: transparent; font-size: 10px; }
.chip.selected { border-color: var(--accent); background: var(--accent); color: var(--accent-text); }

.primary-button, .secondary-button { width: 100%; min-height: 48px; padding: 11px 16px; border: 0; border-radius: 14px; font-weight: 800; }
.primary-button { background: var(--accent); color: var(--accent-text); }
.secondary-button { background: var(--surface-2); color: var(--text); }
.text-button { min-height: 44px; padding: 8px 15px; border: 0; background: transparent; font-weight: 750; }
.danger { color: #ff5570; }
body.telegram .web-save { display: none; }

.bottom-nav { position: fixed; z-index: 30; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 620px); padding: 5px 34px calc(7px + var(--safe-bottom)); display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 95%, transparent); backdrop-filter: blur(16px); }
.nav-item { min-height: 56px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 2px; }
.nav-item span { font-size: 20px; line-height: 1; }
.nav-item small { font-size: 9px; font-weight: 750; }
.nav-item.active { color: var(--accent); }
.nav-item.active span { animation: navPop .25s ease-out; }
@keyframes navPop { 50% { transform: scale(1.2); } }

.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(78px + var(--safe-bottom)); transform: translateX(-50%); max-width: calc(100% - 36px); padding: 10px 15px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: 11px; font-weight: 750; animation: toastIn .2s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.connection-banner { position: fixed; z-index: 120; top: 8px; left: 50%; transform: translateX(-50%); min-height: 36px; padding: 9px 15px; border-radius: 999px; background: #2a2b31; color: #fff; font-size: 11px; font-weight: 800; }

.profile-card.card-exit-like { animation: cardLike .38s ease-in forwards; }
.profile-card.card-exit-skip { animation: cardSkip .38s ease-in forwards; }
.action-stamp { position: absolute; z-index: 5; top: 23px; padding: 7px 12px; border: 3px solid currentColor; border-radius: 10px; font-size: 17px; font-weight: 950; letter-spacing: 1px; opacity: 0; }
.action-stamp.like { right: 18px; color: #ff5570; transform: rotate(8deg); animation: stampLike .2s ease-out forwards; }
.action-stamp.skip { left: 18px; color: #fff; transform: rotate(-8deg); animation: stampSkip .2s ease-out forwards; }
@keyframes cardEnter { from { opacity: 0; transform: translateY(12px) scale(.98); } }
@keyframes cardLike { to { opacity: 0; transform: translateX(110%) rotate(9deg); } }
@keyframes cardSkip { to { opacity: 0; transform: translateX(-110%) rotate(-8deg); } }
@keyframes stampLike { to { opacity: 1; } }
@keyframes stampSkip { to { opacity: 1; } }
.motion-layer { position: fixed; z-index: 100; inset: 0; pointer-events: none; overflow: hidden; }
.love-particle { --x: 0px; --r: 0deg; position: absolute; left: 50%; top: 54%; color: var(--accent); font-size: 21px; opacity: 0; animation: loveBurst .85s ease-out forwards; }
@keyframes loveBurst { 0% { opacity: 0; transform: translate(-50%, 0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--x)), -170px) rotate(var(--r)); } }

.telegram-gate { min-height: 100vh; padding: 34px 24px; display: grid; place-content: center; justify-items: center; text-align: center; }
.gate-logo { width: 78px; height: 78px; margin-bottom: 18px; display: grid; place-items: center; border-radius: 24px; background: var(--accent); color: var(--accent-text); font: italic 900 40px Georgia, serif; }
.telegram-gate h1 { margin-bottom: 9px; }
.telegram-gate > p:not(.eyebrow) { max-width: 330px; margin-bottom: 22px; color: var(--muted); line-height: 1.55; font-size: 12px; }
.telegram-gate .primary-button { max-width: 290px; }

@media (min-width: 560px) { .main-content { padding-inline: 26px; }.mode-switch { width: calc(100% - 52px); }.topbar { padding-inline: 26px; } }
@media (max-height: 700px) { .profile-card, .profile-skeleton { height: 330px; min-height: 330px; }.anonymous-card { padding-top: 0; }.anon-symbol { width: 58px; height: 58px; font-size: 34px; } }
@media (prefers-color-scheme: light) {
  :root:not([style*="color-scheme: dark"]) { --bg: var(--tg-theme-bg-color, #f7f7f8); --surface: var(--tg-theme-secondary-bg-color, #ffffff); --surface-2: var(--tg-theme-section-bg-color, #ececf0); --text: var(--tg-theme-text-color, #17171a); --muted: var(--tg-theme-hint-color, #74747c); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; } }
body.low-performance *, body.low-performance *::before, body.low-performance *::after { animation-duration: .01ms !important; backdrop-filter: none !important; filter: none !important; }
