:root {
  color-scheme: dark;
  --background: #10101c;
  --text: #fbf8ff;
  --muted: #b9b5ca;
  --surface: #191827;
  --border: #353247;
  --purple: #bda7ff;
  --cyan: #91d7ff;
  --pink: #ffa0b9;
  --shadow: 0 16px 40px #09081355;
  --radius: 20px;
  --ease-out: cubic-bezier(.22, .61, .36, 1);
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
  font: 16px/1.5 Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--background);
}

.telegram-mini-app {
  --safe-top: max(env(safe-area-inset-top), calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px)));
  --safe-bottom: max(env(safe-area-inset-bottom), calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px)));
  --safe-left: max(env(safe-area-inset-left), calc(var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px)));
  --safe-right: max(env(safe-area-inset-right), calc(var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px)));
}

* { box-sizing: border-box; }
body {
  min-height: 100vh;
  margin: 0;
  background: radial-gradient(ellipse at 50% 0%, #211932, transparent 70%) var(--background);
}
#app {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  --nav-space: max(8px, var(--safe-bottom));
}
.telegram-mini-app #app { height: min(100dvh, var(--tg-viewport-stable-height, 100dvh)); }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); line-height: 1.12; letter-spacing: -.045em; }
h2 { font-size: 1.15rem; line-height: 1.3; }
button, input, select, textarea { font: inherit; }
button, a { touch-action: manipulation; }
button { border: 0; background: none; color: inherit; cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; object-fit: cover; }
.icon { vertical-align: middle; flex: none; }
:where(button,a,input,textarea,select):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 60;
  background: #131934;
  padding: 12px 20px;
  border-radius: 12px;
}
.skip-link:focus { top: 8px; }

.topbar {
  grid-area: 1 / 1;
  z-index: 20;
  padding-top: var(--safe-top);
  background: #141320;
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1200px;
  min-height: 68px;
  margin: auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.brand { justify-self: start; }
.brand[href] { display: grid; align-items: center; min-height: 44px; }
.brand img { width: 116px; height: auto; }
.toolbar-title { display: none; font-size: .95rem; font-weight: 700; }
.topbar-right { grid-column: 3; display: flex; align-items: center; gap: 10px; justify-self: end; }
.icon-button, .avatar-button {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border-radius: 14px;
  background: #232033;
  border: 1px solid var(--border);
  position: relative;
}
.icon-button:hover, .avatar-button:hover { background: rgba(124, 92, 255, .24); }
.avatar-button img { width: 32px; height: 32px; border-radius: 50%; }
.notification i, .match-avatar i {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  top: 5px;
  right: 5px;
  box-shadow: 0 0 0 2px #12182f;
}

main {
  grid-area: 2 / 1;
  width: 100%;
  min-width: 0;
  max-width: 1200px;
  margin: 0 auto;
  padding: 27px 28px 24px;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
}
main:focus { outline: none; }
.page-enter > :is(.discover-layout, .messenger, .profile-layout, .empty-state, .settings-card) {
  animation: content-in .22s var(--ease-out) both;
}
@keyframes content-in {
  from { opacity: .65; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.auth-page {
  display: grid;
  grid-auto-rows: max-content;
  align-content: safe center;
  max-width: 1110px;
  padding-block: clamp(22px, 5dvh, 54px);
}
.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.auth-visual {
  display: grid;
  align-content: end;
  padding: clamp(24px, 4vw, 54px);
  background:
    linear-gradient(180deg, #16122400 32%, #161224ee 100%),
    center 43% / cover no-repeat url('assets/lovio-sign-in.webp'),
    #302345;
}
.auth-visual p {
  color: #fff;
  font-size: clamp(1.65rem, 3.75vw, 3.25rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.055em;
}
.auth-panel {
  align-self: center;
  width: 100%;
  max-width: 470px;
  margin: auto;
  padding: clamp(24px, 4vw, 52px);
}
.auth-intro { margin-top: 10px; color: var(--muted); font-size: .9rem; }
.auth-panel form { margin-top: 23px; }
.auth-phone-row { display: grid; grid-template-columns: minmax(104px, 118px) minmax(0, 1fr); gap: 10px; align-items: end; }
.auth-phone-row label { margin: 0; }
.auth-panel :is(input, select) { height: 48px; }
.auth-select { position: relative; display: block; }
.auth-select select { appearance: none; min-width: 0; padding-inline-end: 32px; }
.auth-select > .icon {
  position: absolute;
  top: 50%;
  inset-inline-end: 10px;
  width: 16px;
  height: 16px;
  color: var(--muted);
  transform: translateY(-50%) rotate(90deg);
  pointer-events: none;
}
.auth-country select { color: transparent; }
.auth-country select option { color: var(--text); }
.auth-country-value {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 10px;
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: .9rem;
  font-weight: 500;
  pointer-events: none;
}
.auth-telegram-hint { display: none; margin: -6px 0 12px; font-size: .8rem; }
.auth-telegram-hint a { text-decoration: underline; }
#connect-form:has(select[name="channel"] option[value="telegram"]:checked) .auth-telegram-hint { display: block; }
.auth-panel .primary { min-height: 48px; }
.auth-panel .telegram-login { min-height: 46px; color: #a8e1ff; }
.auth-panel .app-footer { margin-top: 14px; }
.auth-back { display: block; margin: 10px auto 0; }
.profile-setup { width: min(100%, 680px); margin-inline: auto; }
.profile-setup > :is(form, section) { margin-block: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.setup-photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 128px), 1fr)); gap: 12px; padding: 0; list-style: none; }
.setup-photos img { width: 100%; aspect-ratio: 4 / 5; border-radius: 12px; }
.setup-preview { width: min(100%, 190px); aspect-ratio: 4 / 5; border-radius: 12px; margin-block: 10px; }
.setup-checkbox { display: inline-block; width: auto; min-height: 0; }
selfie-camera { display: block; }
selfie-camera :is(video, canvas) {
  display: block;
  width: min(100%, 420px);
  max-height: 44dvh;
  margin-block: 12px;
  border-radius: 14px;
  background: var(--surface);
  object-fit: contain;
}
selfie-camera .selfie-actions { justify-content: flex-start; margin-top: 10px; }
selfie-camera [role="status"]:empty { display: none; }
.message [data-report-message] { display: block; min-height: 28px; color: var(--muted); font-size: .72rem; }
.button .icon, .text-link .icon { width: 16px; height: 16px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-discover > .page-heading {
  width: min(100%, 1040px);
  margin-inline: auto;
}
.glass-panel, .settings-card, .own-profile, .form-card, .messenger, dialog, .empty-state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 8px;
  padding: 9px 17px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #262237;
  font-size: .84rem;
  font-weight: 600;
  line-height: 1.3;
}
.button:hover { background: rgba(124, 92, 255, .24); }
.primary {
  background: #6b45c7;
  border-color: #9a7be6;
  color: #fff;
}
.primary:hover { background: #774fd8; }
.text-link { color: var(--purple); min-height: 44px; font-size: .87rem; font-weight: 600; padding: 4px 0; }
.muted, .form-hint { color: var(--muted); }
.form-hint { font-size: .82rem; line-height: 1.6; margin-top: 12px; }

.discover-layout {
  display: grid;
  grid-template-columns: minmax(195px, 1fr) minmax(0, 444px) minmax(195px, 1fr);
  align-items: start;
  gap: clamp(16px, 3vw, 32px);
  max-width: 1040px;
  margin-inline: auto;
}
.discovery-filters, .right-rail { padding: 17px; }
.filter-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.filter-button { padding-inline: 11px; }
.section-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #13121f;
}
.section-tabs button {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 5px 3px;
  border-radius: 10px;
  color: var(--muted);
  font-size: .79rem;
  font-weight: 600;
}
.section-tabs button:hover, .section-tabs button[aria-pressed=true] {
  background: rgba(124, 92, 255, .24);
  color: var(--text);
}
.interest-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.chip, .person-interests span, .compatibility {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid rgba(199, 208, 255, .22);
  border-radius: 999px;
  background: rgba(199, 208, 255, .09);
  font-size: .78rem;
}
.chip { min-height: 44px; max-width: 100%; padding: 5px 11px; color: var(--muted); overflow-wrap: anywhere; }
.chip:hover, .chip[aria-pressed=true], .compatibility {
  border-color: rgba(31, 216, 255, .45);
  background: rgba(31, 216, 255, .11);
  color: #b8efff;
}
.filter-summary {
  display: flex;
  justify-content: space-between;
  padding-top: 13px;
  border-top: 1px solid var(--border);
  font-size: .8rem;
  color: var(--muted);
}
.filter-summary strong { color: var(--text); }
.discovery-content { min-width: 0; }
.deck { width: 100%; margin: auto; }
.deck-controls { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: 12px; margin-bottom: 10px; }
.deck-controls .icon-button { border-radius: 12px; }
.deck-count { text-align: center; font-size: .83rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tinder-card {
  container-type: size;
  width: 100%;
  height: clamp(280px, calc(100dvh - 301px), 560px);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 24px;
  background: #201a32;
  box-shadow: var(--shadow);
}
.tinder-photo, .person-photo {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  padding: 0;
  text-align: left;
}
.tinder-photo:focus-visible, .person-photo:focus-visible { outline-offset: -4px; }
.tinder-photo img, .person-photo img { width: 100%; height: 100%; object-position: center 33%; }
[data-swipe-surface] {
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
}
[data-swipe-surface].dragging { cursor: grabbing; }
[data-swipe-surface] img { -webkit-user-drag: none; }
.photo-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #0f0b1f33, transparent 28%, #0f0b1fd9 75%, #0f0b1ff7);
}
.tinder-caption, .photo-caption { position: absolute; inset: auto 0 0; color: #fff; }
.tinder-caption { display: grid; gap: 8px; padding: 18px clamp(15px, 5vw, 24px) 24px; }
.person-name { display: block; overflow-wrap: anywhere; font-size: 1.3rem; font-weight: 800; line-height: 1.2; }
.tinder-caption .person-name { font-size: clamp(1.75rem, 5vw, 2.15rem); }
.tinder-caption .person-name, .tinder-caption .person-location span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.person-location { display: flex; align-items: center; gap: 4px; font-size: .86rem; color: #e4e9f8; }
.person-location, .card-bio { overflow-wrap: anywhere; }
.person-location .icon { width: 15px; height: 15px; }
.card-bio {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: #eef1fd;
  font-size: .86rem;
}
.person-interests { display: flex; flex-wrap: wrap; gap: 6px; }
.person-interests span { max-width: 100%; overflow-wrap: anywhere; padding: 4px 9px; }
.tinder-caption .person-interests { flex-wrap: nowrap; overflow: hidden; }
.tinder-caption .person-interests span { display: block; min-width: 0; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.compatibility { width: fit-content; padding: 4px 9px; }
.compatibility .icon { width: 13px; height: 13px; }
.status-pills {
  position: absolute;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}
.status-pill, .online-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(12, 18, 42, .86);
  color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  font-size: .73rem;
}
.status-pill .icon { width: 14px; height: 14px; }
.verified, .detail-verified { color: #67e9c2; }
.online-dot, .online-label i { width: 6px; height: 6px; background: #32e6b7; border-radius: 50%; }
.deck-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.deck-action {
  min-height: 59px;
  min-width: 0;
  padding: 7px 3px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  border-radius: 13px;
  border: 1px solid;
  box-shadow: 0 12px 24px rgba(4, 10, 30, .4);
}
.deck-action:not(:disabled):hover { transform: translateY(-2px); filter: brightness(1.22); }
.deck-action span { color: var(--text); font-size: .73rem; font-weight: 600; line-height: 1.15; overflow-wrap: anywhere; }
.deck-action .icon { width: 20px; height: 20px; }
.deck-action.pass { color: var(--muted); background: #231f30; border-color: #4b435e; }
.deck-action.details { color: var(--purple); background: #2a2140; border-color: #584577; }
.deck-action.like { color: #ffe1ee; background: #72305a; border-color: #b2678f; }
.deck-action.is-liked { opacity: .85; }
.is-liked .icon { fill: currentColor; }
.right-rail h2 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.right-rail h2 span { color: #beadff; font-size: .82rem; }
.match-avatars { display: flex; gap: 8px; margin: 19px 0; min-width: 0; }
.match-avatars button { display: grid; gap: 6px; justify-items: center; min-width: 0; flex: 1; padding: 0; }
.match-avatars b { max-width: 100%; font-size: .76rem; overflow: hidden; text-overflow: ellipsis; }
.match-avatar { display: block; position: relative; border: 1px solid #8974ee; padding: 2px; border-radius: 50%; }
.match-avatar img { width: 46px; height: 46px; border-radius: 50%; }
.match-avatar i { top: auto; bottom: 1px; right: 1px; }
.matches-link { width: 100%; justify-content: space-between; }
.load-more { display: flex; margin: 15px auto 0; }
.empty-state { min-height: 240px; padding: 28px; display: grid; gap: 14px; place-content: center; justify-items: center; text-align: center; }
.empty-state > .icon { width: 34px; height: 34px; color: var(--purple); }
.empty-state p { color: var(--muted); }
.skeleton { height: clamp(280px, calc(100dvh - 301px), 560px); border: 1px solid var(--border); border-radius: 24px; background: linear-gradient(110deg, #1c192b 20%, #2c2543 40%, #1c192b 60%); background-size: 200% 100%; animation: shimmer 1.5s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

.main-nav {
  grid-area: 1 / 1;
  z-index: 25;
  align-self: center;
  justify-self: center;
  margin-top: var(--safe-top);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: #1b1929;
}
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 6px 13px;
  color: var(--muted);
  border-radius: 10px;
  font-size: .83rem;
  font-weight: 600;
}
.nav-item:hover, .nav-item[aria-current=page] { background: #34284e; color: #fff; }
.nav-item[aria-current=page] .nav-icon { color: #d0baff; }
.nav-item .icon { width: 19px; height: 19px; }
.avatar-button[aria-current=page] { border-color: var(--purple); }
.nav-count {
  position: absolute;
  right: 2px;
  top: 2px;
  min-width: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #aa345c;
  color: #fff;
  text-align: center;
  font-size: .68rem;
}
.app-footer { margin: 22px 0 0; text-align: center; }
.app-footer button { min-height: 44px; padding: 4px 10px; color: var(--muted); font-size: .78rem; }
.app-footer .icon { width: 14px; height: 14px; }

.page-likes .section-tabs { width: min(100%, 390px); margin-bottom: 20px; }
.likes-hint { margin: 0 0 15px; }
.list-status { padding: 24px 0; color: var(--muted); }
.profile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 16px; }
.person-card { position: relative; border: 1px solid var(--border); border-radius: 18px; overflow: hidden; background: var(--surface); }
.person-photo { height: auto; aspect-ratio: 3/4; }
.photo-caption { padding: 12px; }
.photo-caption .person-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.photo-caption .person-location { font-size: .75rem; margin-top: 5px; }
.photo-caption .verified .icon { width: 15px; height: 15px; }
.online-label { position: absolute; top: 10px; left: 10px; }
.like-button { position: absolute; top: 8px; right: 8px; width: 44px; height: 44px; border-radius: 50%; background: #1a1430dc; color: #d2bfff; border: 1px solid #997cdd; }
.like-button.is-liked { opacity: .85; }
.person-details { padding: 12px; }
.person-intent { margin-bottom: 8px; color: var(--cyan); font-size: .75rem; }
.person-intent .icon { width: 14px; height: 14px; }

.messenger { display: grid; grid-template-columns: minmax(220px, 29%) minmax(0, 1fr); overflow: hidden; }
.page-messages { display: flex; flex-direction: column; }
.page-messages .messenger { flex: 1; min-height: 300px; }
.page-messages .app-footer { display: none; }
.conversation-list { min-height: 0; padding: 18px; overflow: auto; border-right: 1px solid var(--border); }
.conversation-list h2 { margin: 0 4px 14px; font-size: 1rem; }
.conversation-list h2 span { color: var(--purple); margin-left: 4px; }
.conversation-list .empty-state { min-height: 210px; padding: 14px; background: transparent; border: 0; box-shadow: none; }
.conversation { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 13px; text-align: left; }
.conversation:hover, .conversation.selected { background: #7c5cff28; }
.conversation img, .chat-header img, .notification-row img { width: 42px; height: 42px; border-radius: 50%; flex: none; }
.conversation > span { flex: 1; min-width: 0; }
.conversation b, .conversation small, .chat-header small, .notification-row small { display: block; }
.conversation b, .chat-header b, .notification-row b, .own-profile h2 { overflow-wrap: anywhere; }
.conversation small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.conversation i { font-size: .74rem; font-style: normal; color: #f3d7ff; }

.chat-panel {
  --chat-ink: var(--text);
  --chat-background: #141320;
  --chat-border: var(--border);
  --chat-muted: var(--muted);
  --chat-accent: #6743b3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--chat-background);
  color: var(--chat-ink);
}
.chat-header { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--surface); border-bottom: 1px solid var(--chat-border); }
.chat-back { display: none; }
.chat-header > div { min-width: 0; }
.chat-header small, .chat-panel .muted, .chat-intro { color: var(--chat-muted); }
.chat-back .icon { color: var(--purple); }
.chat-messages { display: flex; flex-direction: column; align-items: flex-start; flex: 1 1 0; gap: 12px; min-height: 100px; padding: 18px 20px; overflow: auto; overscroll-behavior: contain; }
.chat-messages > * { flex: none; }
.message { background: #272337; border: 1px solid var(--chat-border); border-radius: 18px 18px 18px 6px; padding: 9px 14px; max-width: 88%; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.outgoing { align-self: flex-end; background: var(--chat-accent); color: #fff; border-color: transparent; border-radius: 18px 18px 6px 18px; }
.message-photo { max-height: 220px; border-radius: 12px; }
.chat-intro { margin: auto; text-align: center; }
.chat-intro .button { margin-top: 10px; }
.message-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; border-top: 1px solid var(--chat-border); padding: 12px 18px; background: var(--surface); }
.message-form input { min-width: 0; margin: 0; color: var(--chat-ink); background: var(--chat-background); }
.send-button { width: 44px; height: 44px; border-radius: 13px; background: var(--chat-accent); color: white; }
.chat-placeholder { display: grid; flex: 1; gap: 12px; place-content: center; justify-items: center; padding: 16px; color: var(--muted); }
.chat-placeholder .icon { width: 32px; height: 32px; color: var(--purple); }

.profile-layout { display: grid; grid-template-columns: minmax(240px, .8fr) minmax(0, 1fr); align-items: start; gap: 24px; }
.own-profile { overflow: hidden; text-align: center; padding: 0 20px 23px; }
.profile-cover { height: 136px; margin: 0 -20px; background: radial-gradient(ellipse at 20% 5%, #8050e2, transparent 80%), linear-gradient(135deg, #172452, #176783); }
.own-photo { width: 104px; height: 104px; border-radius: 50%; border: 4px solid #12162a; position: relative; margin: -52px auto 12px; }
.own-profile .icon { width: 15px; height: 15px; }
.own-profile > p { color: var(--muted); margin-top: 8px; }
.profile-status { display: inline-block; color: #beadff; font-size: .8rem; margin-top: 9px; }
.profile-description { line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.own-profile .person-interests { justify-content: center; margin-top: 12px; }
.profile-settings { display: block; margin: 10px auto 0; }
.form-card, .settings-card { padding: 24px; }
.form-card .primary, .settings-card .button { margin-top: 12px; }
.settings-card { display: flex; gap: 14px; margin-bottom: 16px; max-width: 720px; }
.settings-icon { color: var(--cyan); }
.settings-card p { margin: 8px 0 14px; overflow-wrap: anywhere; color: var(--muted); }

label { display: block; margin: 15px 0; font-weight: 600; font-size: .86rem; }
input, textarea, select {
  display: block;
  width: 100%;
  min-height: 46px;
  border: 1px solid #655c79;
  border-radius: 12px;
  margin-top: 7px;
  padding: 10px 13px;
  color: var(--text);
  background: #151421;
  font-size: 1rem;
  font-weight: 400;
}
@media (forced-colors: active) {
  .auth-select select { appearance: auto; }
  .auth-select > .icon { display: none; }
  .auth-country select { color: FieldText; }
  .auth-country-value { display: none; }
}
textarea { resize: vertical; }
dialog { color: var(--text); width: min(480px, calc(100% - 28px)); max-height: calc(100dvh - 24px); overflow: hidden; padding: 0; background: var(--surface); }
dialog[open] { display: flex; flex-direction: column; }
dialog[open] { animation: dialog-in .2s var(--ease-out) both; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(8px) scale(.985); }
  to { opacity: 1; transform: none; }
}
.modal-content { min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 24px; }
dialog::backdrop { background: #030518bb; backdrop-filter: blur(8px); }
dialog h2 { font-size: 1.45rem; margin: 0 48px 10px 0; overflow-wrap: anywhere; }
.error-dialog { border-color: #78536e; }
.error-dialog h2 { margin-right: 0; }
.error-dialog p { overflow-wrap: anywhere; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.modal-close { position: absolute; top: 10px; right: 10px; z-index: 1; background: #141a34; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; }
.checkbox-label { min-height: 44px; }
.checkbox-label input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: #957fff; }
.form-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 9px; margin-top: 20px; }
.full-width { width: 100%; margin-top: 15px; }
.profile-modal .modal-content { padding: 0; }
.detail-media { position: relative; }
.detail-photo { width: 100%; height: clamp(160px, 35dvh, 280px); object-position: 50% 30%; }
.detail-nav {
  position: absolute;
  inset: auto 12px 10px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  justify-items: center;
  pointer-events: none;
}
.detail-nav .icon-button, .detail-nav span { background: #141a34ed; }
.detail-nav .icon-button { pointer-events: auto; }
.detail-nav span { padding: 4px 10px; border-radius: 999px; font-size: .8rem; }
.detail-body { padding: 22px; }
.detail-body > p { margin-bottom: 10px; }
.detail-body { overflow-wrap: anywhere; }
.profile-intent { color: #c7b9ff; font-size: .85rem; }
.subtle-button { display: block; margin: 14px auto 0; padding: 8px; color: var(--muted); font-size: .8rem; }
.advice { display: grid; gap: 12px; margin: 16px 0; }
.advice p, .notification-row { display: flex; align-items: flex-start; gap: 10px; }
.advice .icon { color: var(--cyan); }
.notification-row { align-items: center; width: 100%; text-align: left; padding: 10px 0; border-bottom: 1px solid var(--border); }
.notification-row span { flex: 1; min-width: 0; }
.notification-row small { color: var(--muted); overflow-wrap: anywhere; }
.toast {
  position: fixed;
  z-index: 50;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  width: max-content;
  max-width: calc(100% - 24px);
  transform: translateX(-50%);
  padding: 11px 16px;
  background: #20264c;
  border: 1px solid #7973c8;
  border-radius: 16px;
  color: var(--text);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s;
}
.toast.show { opacity: 1; }
:is(.button, .icon-button, .avatar-button, .chip, .section-tabs button, .deck-action, .nav-item, .conversation, .send-button) {
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, transform .16s var(--ease-out);
}
:is(.button, .icon-button, .avatar-button, .chip, .deck-action, .send-button):not(:disabled):active {
  transform: scale(.96);
}

@media (max-width: 1000px) {
  .discover-layout { grid-template-columns: minmax(200px, 1fr) minmax(0, 444px); justify-content: center; }
  .right-rail { display: none; }
}
@media (min-width: 701px) {
  .page-likes, .page-messages, .page-profile, .page-settings { max-width: 1090px; }
}
@media (max-width: 700px) {
  .topbar-inner { min-height: 58px; padding: 0 max(14px, var(--safe-right)) 0 max(14px, var(--safe-left)); gap: 6px; }
  .brand img { width: clamp(69px, 21vw, 95px); }
  .toolbar-title { display: block; text-align: center; }
  .topbar-right { gap: 4px; }
  .topbar-right .icon-button, .avatar-button { border-radius: 12px; }
  .avatar-button img { width: 28px; height: 28px; }
  main { padding: 10px max(14px, var(--safe-right)) 18px max(14px, var(--safe-left)); scrollbar-gutter: auto; }
  .main-nav {
    grid-area: 3 / 1;
    align-self: end;
    justify-self: stretch;
    margin: 0;
    padding: 5px max(10px, var(--safe-right)) var(--nav-space) max(10px, var(--safe-left));
    border-top: 1px solid var(--border);
    border-radius: 0;
    background: #141320;
  }
  .nav-item { min-height: 47px; flex-direction: column; gap: 2px; padding: 4px 2px; font-size: .7rem; }
  .nav-count { right: calc(50% - 25px); }
  .auth-page { align-content: start; padding-block: 14px 20px; }
  .auth-layout { grid-template-columns: minmax(0, 1fr); min-height: 0; width: min(100%, 440px); margin-inline: auto; border-radius: 22px; }
  .auth-visual { min-height: clamp(128px, 24dvh, 200px); padding: 17px 20px; background-position: center, center 9%; }
  .auth-visual p { font-size: clamp(1.65rem, 6vw, 2.35rem); }
  .auth-panel { padding: 20px; }
  .auth-panel form { margin-top: 17px; }
  .auth-panel .app-footer { margin-top: 8px; }
  .page-heading { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .page-discover > .page-heading { width: 1px; }
  .discover-layout { display: block; max-width: 480px; }
  .discovery-filters {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
    align-items: center;
    margin: 0 0 10px;
    padding: 6px;
    border-radius: 14px;
  }
  .filter-heading { grid-area: 1 / 2; margin: 0; }
  .filter-heading h2 { display: none; }
  .filter-button { padding-inline: 8px; }
  .discovery-filters .section-tabs { grid-area: 1 / 1; padding: 0; border: 0; background: transparent; }
  .section-tabs button { padding-inline: 4px; }
  .interest-chips { grid-column: 1 / -1; flex-wrap: nowrap; margin: 0; padding: 4px; overflow-x: auto; }
  .chip { flex: none; max-width: 85%; }
  .filter-summary { grid-area: 1 / 1; justify-content: start; gap: 6px; padding: 0 0 0 6px; border: 0; }
  .discovery-filters:has(.section-tabs) .filter-summary { display: none; }
  .deck-controls { margin-bottom: 7px; }
  .tinder-card, .skeleton { height: clamp(185px, calc(100dvh - 378px - var(--safe-bottom, 0px)), 525px); }
  .discovery-filters:has(.interest-chips) + .discovery-content :is(.tinder-card, .skeleton) { height: clamp(170px, calc(100dvh - 434px - var(--safe-bottom, 0px)), 525px); }
  .tinder-caption { padding-block: 14px 17px; gap: 6px; }
  .card-bio { -webkit-line-clamp: 2; font-size: .8rem; }
  .person-interests span, .compatibility { font-size: .71rem; padding: 3px 8px; }
  .deck-actions { margin-top: 9px; }
  .deck-action { min-height: 53px; }
  .profile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .photo-caption .person-name { font-size: 1.1rem; }
  .profile-layout { grid-template-columns: 1fr; gap: 14px; }
  .messenger { grid-template-columns: minmax(0, 1fr); }
  .conversation-list { border-right: 0; }
  .messenger:not(.chat-open) .chat-panel, .chat-open .conversation-list { display: none; }
  .chat-back { display: inline-grid; }
  .page-messages:has(.chat-open) { padding: 0; }
  .chat-open { border: 0; border-radius: 0; }
  .chat-messages { min-height: 82px; padding: 12px; }
  .chat-header, .message-form { padding-inline: 12px; }
  .modal-content, .form-card, .settings-card { padding: 18px; }
  .toast { bottom: calc(68px + max(8px, var(--safe-bottom))); }
}
@media (max-width: 360px) {
  .toolbar-title { font-size: .83rem; }
  .discovery-filters .section-tabs button { font-size: .7rem; }
  .filter-button { gap: 4px; }
  .auth-visual { min-height: 128px; }
  .auth-panel { padding-inline: 16px; }
  .auth-phone-row { grid-template-columns: 106px minmax(0, 1fr); gap: 8px; }
}
@container (max-height: 320px) {
  .tinder-caption { gap: 4px; padding: 12px 14px; }
  .tinder-caption .person-name { font-size: 1.45rem; }
  .tinder-caption .person-location span { -webkit-line-clamp: 1; }
  .tinder-caption .card-bio { -webkit-line-clamp: 1; }
  .status-pills { top: 10px; left: 10px; }
}
@container (max-height: 230px) {
  .tinder-caption .card-bio, .tinder-caption .person-interests { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* Touch targets: language links meet the 44px minimum. */
.form-actions a[lang] { display: inline-flex; align-items: center; min-height: 44px; padding-inline: 8px; }
