:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --elev: #e8e8ed;
  --line: #e5e5ea;
  --line-soft: rgba(0,0,0,.06);
  --txt: #1c1c1e;
  --muted: #6b6b76;
  --muted-2: #8e8e9a;
  --accent: #ec4899;
  --accent-soft: rgba(236,72,153,.12);
  --accent-2: #f472b6;
  --pink: #ff4d8d;
  --pink-deep: #e11d6e;
  --ok: #22c55e;
  --danger: #ef4444;
  --bubble-me: linear-gradient(135deg, #ec4899 0%, #f472b6 55%, #fb7185 100%);
  --glow: 0 8px 28px rgba(236,72,153,.28);
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow: 0 8px 30px rgba(0,0,0,.08);
  font-size: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  padding-top: env(safe-area-inset-top, 0);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 1rem; color: var(--txt); }
a { color: var(--accent); }
::placeholder { color: var(--muted-2); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-weight: 600; font-size: .95rem;
  padding: .9rem 1.25rem; border-radius: var(--radius-sm);
  transition: transform .12s ease, filter .15s, background .15s, box-shadow .15s;
}
.btn.primary {
  background: var(--bubble-me); color: #fff;
  box-shadow: var(--glow);
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.primary:active { transform: scale(.98); }
.btn.ghost {
  background: var(--surface-2); color: var(--txt);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: var(--elev); }
.btn.tiny { padding: .45rem .85rem; font-size: .82rem; border-radius: 999px; font-weight: 600; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center;
  color: var(--txt); background: var(--surface-2);
  border: 1px solid var(--line); transition: background .12s;
}
.icon-btn:hover { background: var(--elev); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn.ghost:hover { background: var(--surface-2); }
.icon-btn.call {
  background: var(--bubble-me); border: none; box-shadow: var(--glow); color: #fff;
}
.icon-btn.call:disabled {
  background: var(--surface-2); box-shadow: none; color: var(--muted); border: 1px solid var(--line);
}
.icon-btn svg { width: 20px; height: 20px; }

.field { margin-bottom: 1rem; }
.field label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--muted); margin-bottom: .4rem; letter-spacing: .02em;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .field-icon {
  position: absolute; left: .95rem; width: 18px; height: 18px;
  color: var(--muted-2); pointer-events: none;
}
.input-wrap input {
  width: 100%; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .9rem 1rem .9rem 2.75rem;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.input-wrap .eye {
  position: absolute; right: .55rem; padding: .4rem;
  color: var(--muted); border-radius: 8px;
}
.input-wrap .eye:hover { color: var(--txt); }
.field textarea, .field select, .field > input {
  width: 100%; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: .85rem 1rem; transition: border-color .15s;
}
.field textarea:focus, .field select:focus, .field > input:focus {
  border-color: var(--accent); outline: none;
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.err { color: #e11d48; font-size: .85rem; min-height: 1.15rem; margin: .15rem 0 .4rem; }

.badge-vip {
  display: inline-flex; align-items: center;
  background: var(--bubble-me); color: #fff;
  font-size: .6rem; font-weight: 800; padding: .15rem .4rem;
  border-radius: 6px; letter-spacing: .04em; vertical-align: middle;
}

/* AUTH */
#auth {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: 1.25rem;
  background: linear-gradient(160deg, #fff 0%, #fce7f3 45%, #f5f5f7 100%);
}
.auth-bg { display: none; }
.auth-card {
  position: relative; width: 100%; max-width: 400px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 2rem 1.75rem 1.85rem;
  box-shadow: var(--shadow), 0 0 0 1px rgba(236,72,153,.06);
}
.auth-logo { text-align: center; margin-bottom: 1.75rem; }
.auth-logo .logo-mark {
  width: 60px; height: 60px; border-radius: 18px;
  background: var(--bubble-me);
  display: grid; place-items: center;
  margin: 0 auto .85rem;
  box-shadow: var(--glow);
}
.auth-logo .logo-mark svg { width: 28px; height: 28px; }
.auth-logo h1 {
  font-size: 1.85rem; font-weight: 800; letter-spacing: -.04em;
}
.auth-logo p {
  color: var(--muted); font-size: .9rem; margin-top: .3rem; font-weight: 500;
}
.auth-tabs {
  display: flex; gap: .3rem;
  background: var(--surface-2);
  padding: .3rem; border-radius: 14px; margin-bottom: 1.4rem;
}
.auth-tabs button {
  flex: 1; padding: .7rem; border-radius: 11px;
  color: var(--muted); font-weight: 600; font-size: .9rem;
  transition: all .18s ease;
}
.auth-tabs button.active {
  background: #fff; color: var(--txt);
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

/* APP */
#app { position: fixed; inset: 0; display: flex; }

.sidebar {
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-right: 1px solid var(--line);
}

.side-head {
  display: flex; align-items: center; gap: .75rem;
  padding: 1rem 1.1rem .85rem;
}
.side-head .me {
  display: flex; align-items: center; gap: .7rem;
  flex: 1; min-width: 0; cursor: pointer;
  border-radius: 14px; padding: .35rem .4rem;
  transition: background .12s;
}
.side-head .me:hover { background: var(--surface-2); }
.me-info { min-width: 0; }
.side-head .name {
  font-weight: 700; font-size: .95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-head .sub { font-size: .75rem; color: var(--muted); }

.avatar {
  border-radius: 50%; background: var(--elev);
  object-fit: cover; flex: none;
  display: grid; place-items: center;
  font-weight: 700; color: #fff; overflow: hidden;
  background-image: linear-gradient(135deg, #f9a8d4, #ec4899);
}
.avatar.sm { width: 42px; height: 42px; font-size: .9rem; }
.avatar.md { width: 52px; height: 52px; font-size: 1.05rem; }
.avatar.lg { width: 100px; height: 100px; font-size: 2.1rem; }
.av-wrap { position: relative; flex: none; }
.av-wrap .status {
  position: absolute; right: 0; bottom: 0;
  width: 12px; height: 12px; border-radius: 50%;
  background: #c4c4cc;
  border: 2.5px solid var(--surface);
}
.av-wrap .status.on { background: var(--ok); box-shadow: 0 0 0 2px rgba(34,197,94,.25); }

.side-tabs {
  display: flex; gap: .35rem; padding: 0 .9rem .5rem;
}
.side-tabs button {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .6rem .4rem; border-radius: 12px;
  color: var(--muted); font-weight: 600; font-size: .82rem;
  position: relative; transition: all .15s;
}
.side-tabs button svg { width: 16px; height: 16px; flex: none; }
.side-tabs button.active {
  background: var(--accent-soft); color: var(--pink-deep);
}
.side-tabs .count {
  position: absolute; top: .15rem; right: .25rem;
  background: var(--pink); color: #fff;
  font-size: .58rem; font-weight: 800;
  min-width: 15px; height: 15px; border-radius: 8px;
  display: grid; place-items: center; padding: 0 3px;
}

.active-strip {
  display: none; gap: .7rem; padding: .4rem 1rem .75rem;
  overflow-x: auto; scrollbar-width: none;
}
.active-strip::-webkit-scrollbar { display: none; }
.active-strip.has-items { display: none; }
.active-strip .story {
  flex: none; width: 64px; text-align: center; cursor: pointer;
}
.active-strip .story .ring {
  width: 56px; height: 56px; border-radius: 50%;
  padding: 2px;
  background: linear-gradient(135deg, #ec4899, #f472b6);
  margin: 0 auto .35rem;
}
.active-strip .story .ring .inner {
  width: 100%; height: 100%; border-radius: 50%;
  background: #fff; padding: 2px;
  display: grid; place-items: center;
}
.active-strip .story .ring .inner .avatar {
  width: 100%; height: 100%; font-size: .85rem;
  display: none;
}
.active-strip .story .sname {
  font-size: .68rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 64px; margin: 0 auto;
}

.search { position: relative; padding: 0 1rem .75rem; }
.search .search-icon {
  position: absolute; left: 1.65rem; top: 50%; transform: translateY(-55%);
  width: 16px; height: 16px; color: var(--muted-2); pointer-events: none;
}
.search input {
  width: 100%; background: var(--surface-2);
  border: 1px solid transparent; border-radius: 999px;
  padding: .75rem 1rem .75rem 2.5rem;
  transition: border-color .15s, background .15s;
}
.search input:focus {
  border-color: var(--accent); outline: none;
  background: #fff;
}

.side-body {
  flex: 1; overflow-y: auto; padding: 0 .5rem .8rem;
  -webkit-overflow-scrolling: touch;
}
.side-body::-webkit-scrollbar,
.messages::-webkit-scrollbar { width: 5px; }
.side-body::-webkit-scrollbar-thumb,
.messages::-webkit-scrollbar-thumb {
  background: var(--elev); border-radius: 5px;
}

.section-label {
  color: var(--muted-2); font-size: .68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: .85rem .85rem .35rem;
}

.row {
  display: flex; align-items: center; gap: .8rem;
  padding: .7rem .8rem; border-radius: 16px;
  cursor: pointer; transition: background .12s;
}
.row:hover { background: var(--surface-2); }
.row.active { background: var(--accent-soft); }
.row .grow { flex: 1; min-width: 0; }
.row .top {
  display: flex; justify-content: space-between; gap: .5rem;
  align-items: baseline;
}
.row .rname {
  font-weight: 600; font-size: .95rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.row .time { font-size: .7rem; color: var(--muted-2); flex: none; }
.row .preview {
  font-size: .84rem; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-top: .1rem;
}
.row .unread {
  background: var(--pink); color: #fff;
  font-size: .68rem; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px;
  display: grid; place-items: center; padding: 0 5px; flex: none;
}
.row .acts { display: flex; gap: .35rem; flex: none; }

.empty {
  color: var(--muted); text-align: center;
  padding: 2.5rem 1.25rem; font-size: .9rem; line-height: 1.55;
}
.empty strong { color: var(--txt); font-weight: 600; }

/* CHAT */
.chat {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg); min-width: 0;
}
.chat.welcome {
  align-items: center; justify-content: center; text-align: center; padding: 2rem;
}
.welcome-inner { max-width: 340px; }
.welcome-icon {
  width: 72px; height: 72px; border-radius: 22px;
  background: var(--bubble-me);
  display: grid; place-items: center;
  box-shadow: var(--glow); margin: 0 auto 1.25rem;
}
.chat.welcome h2 {
  font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em;
  margin-bottom: .45rem;
}
.chat.welcome p { color: var(--muted); line-height: 1.55; font-size: .95rem; }

.chat-head {
  display: flex; align-items: center; gap: .7rem;
  padding: .8rem 1rem;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.chat-head .back {
  display: none; padding: .35rem; border-radius: 10px;
  color: var(--txt);
}
.chat-head .back:hover { background: var(--surface-2); }
.chat-head .grow { flex: 1; min-width: 0; cursor: pointer; }
.chat-head .rname {
  font-weight: 700; font-size: .98rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-head .sub { font-size: .75rem; color: var(--muted); }
.chat-head .sub.typing { color: var(--pink); font-weight: 500; }

.messages {
  flex: 1; overflow-y: auto; padding: 1.1rem 1rem;
  display: flex; flex-direction: column; gap: .35rem;
}
.day {
  align-self: center;
  background: #fff; color: var(--muted);
  font-size: .7rem; font-weight: 500;
  padding: .3rem .85rem; border-radius: 999px;
  margin: .55rem 0;
  border: 1px solid var(--line);
}
.msg {
  max-width: 78%; padding: .7rem .95rem;
  border-radius: 18px; font-size: .95rem; line-height: 1.45;
  word-wrap: break-word; position: relative;
  animation: msgIn .2s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.msg .meta {
  font-size: .62rem; margin-top: .28rem; text-align: right;
  display: flex; align-items: center; justify-content: flex-end; gap: .2rem;
}
.msg.them {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  color: var(--txt);
}
.msg.them .meta { color: var(--muted-2); }
.msg.me {
  align-self: flex-end;
  background: var(--bubble-me); color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 14px rgba(236,72,153,.2);
}
.msg.me .meta { color: rgba(255,255,255,.85); }

.composer {
  display: flex; gap: .55rem; align-items: flex-end;
  padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0));
  background: #fff;
  border-top: 1px solid var(--line);
}
.composer textarea {
  flex: 1; resize: none; max-height: 120px;
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: 22px; padding: .8rem 1.15rem; line-height: 1.4;
}
.composer textarea:focus {
  border-color: var(--accent); outline: none; background: #fff;
}
.composer .send {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--bubble-me);
  display: grid; place-items: center; flex: none;
  box-shadow: var(--glow);
}
.composer .send:hover { filter: brightness(1.05); }
.composer .send:active { transform: scale(.95); }
.composer .send svg { width: 20px; height: 20px; }

/* MODALS */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 40; padding: 1rem;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 420px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px; padding: 1.5rem;
  max-height: 90vh; overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow);
  animation: slideUp .25s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.modal h3 { margin-bottom: 1.1rem; font-size: 1.2rem; font-weight: 700; }
.modal .close {
  position: absolute; top: 1rem; right: 1rem;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center; color: var(--muted);
}
.modal .close:hover { background: var(--surface-2); color: var(--txt); }

.profile-view { text-align: center; }
.profile-view .avatar { margin: 0 auto 1rem; box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.profile-view h2 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.profile-view .uname { color: var(--muted); margin: .25rem 0 .7rem; font-size: .9rem; }
.chips {
  display: flex; flex-wrap: wrap; gap: .4rem;
  justify-content: center; margin: .7rem 0;
}
.chip {
  background: var(--accent-soft); color: var(--pink-deep);
  border: none; padding: .35rem .75rem;
  border-radius: 999px; font-size: .8rem; font-weight: 600;
}
.profile-view .bio {
  color: var(--muted); font-size: .9rem; line-height: 1.55;
  margin: .6rem 0 1.1rem;
}
.avatar-edit { position: relative; width: 100px; margin: 0 auto 1.1rem; }
.avatar-edit .cam {
  position: absolute; right: 0; bottom: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--bubble-me);
  display: grid; place-items: center;
  box-shadow: var(--glow); cursor: pointer; color: #fff;
}
.avatar-edit .cam svg { width: 16px; height: 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }

/* CALL */
#call {
  position: fixed; inset: 0; z-index: 60;
  background: #1a1a1e; display: flex; flex-direction: column;
}
#call video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #1a1a1e;
}
#remoteVideo { z-index: 1; }
#localVideo {
  z-index: 2; position: absolute;
  width: 110px; height: 160px;
  right: 1rem; top: calc(1rem + env(safe-area-inset-top, 0));
  border-radius: 16px; border: 2px solid rgba(255,255,255,.25);
  object-fit: cover; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.call-top {
  position: absolute; z-index: 3;
  top: calc(1rem + env(safe-area-inset-top, 0)); left: 1rem;
  display: flex; align-items: center; gap: .7rem; color: #fff;
}
.call-top .cname { font-weight: 700; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.call-top .cstat { font-size: .8rem; color: rgba(255,255,255,.8); }
.call-ctrls {
  position: absolute; z-index: 3; left: 0; right: 0;
  bottom: calc(1.8rem + env(safe-area-inset-bottom, 0));
  display: flex; justify-content: center; gap: 1.2rem;
}
.call-btn {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18); backdrop-filter: blur(10px); color: #fff;
}
.call-btn:active { transform: scale(.92); }
.call-btn svg { width: 26px; height: 26px; }
.call-btn.off { background: #fff; color: #111; }
.call-btn.hang { background: var(--danger); }
.call-btn.hang svg { transform: rotate(135deg); }

.incoming {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(16px);
  display: grid; place-items: center;
}
.incoming .card { text-align: center; padding: 2rem; }
.incoming .avatar { margin: 0 auto 1.1rem; }
.avatar.pulse { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(236,72,153,.45); }
  50% { box-shadow: 0 0 0 20px rgba(236,72,153,0); }
}
.incoming h2 { font-size: 1.5rem; font-weight: 800; }
.incoming p { color: var(--muted); margin-top: .35rem; }
.incoming .ring-btns {
  display: flex; gap: 2.5rem; justify-content: center; margin-top: 2.2rem;
}
.incoming .rb {
  display: flex; flex-direction: column; align-items: center;
  gap: .45rem; font-size: .8rem; color: var(--muted); font-weight: 500;
}
.incoming .rb .b {
  width: 66px; height: 66px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
}
.incoming .accept .b { background: var(--ok); box-shadow: 0 6px 20px rgba(34,197,94,.3); }
.incoming .decline .b { background: var(--danger); box-shadow: 0 6px 20px rgba(239,68,68,.3); }
.incoming .decline .b svg { transform: rotate(135deg); }

#toast {
  position: fixed; left: 50%; top: calc(1rem + env(safe-area-inset-top, 0));
  transform: translateX(-50%); z-index: 90;
  display: flex; flex-direction: column; gap: .5rem; align-items: center;
  pointer-events: none;
}
.toast {
  background: #fff; border: 1px solid var(--line);
  padding: .75rem 1.2rem; border-radius: 14px;
  box-shadow: var(--shadow);
  font-size: .9rem; font-weight: 500;
  animation: drop .25s ease;
}
.toast.good { border-color: rgba(34,197,94,.4); }
.toast.bad { border-color: rgba(239,68,68,.4); }
@keyframes drop {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: none; }
}

/* MESSAGE NOTIFICATIONS (bottom) */
#notif {
  position: fixed; left: 50%; bottom: calc(1rem + env(safe-area-inset-bottom, 0));
  transform: translateX(-50%); z-index: 95;
  display: flex; flex-direction: column; gap: .5rem; align-items: stretch;
  width: min(360px, calc(100vw - 1.5rem));
  pointer-events: none;
}
.notif {
  pointer-events: auto; cursor: pointer;
  display: flex; align-items: center; gap: .7rem;
  background: #fff; border: 1px solid var(--line);
  padding: .65rem .85rem; border-radius: 14px;
  box-shadow: var(--shadow);
  animation: notifIn .25s ease;
}
.notif:active { transform: scale(.99); }
.notif .av-wrap { flex: 0 0 auto; position: relative; }
.notif-body { min-width: 0; flex: 1 1 auto; }
.notif-title { font-weight: 600; font-size: .9rem; line-height: 1.2; }
.notif-preview {
  font-size: .85rem; opacity: .7; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@keyframes notifIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* Gender signup link banner + locked-field hint */
.ref-note {
  background: rgba(236,72,153,.10);
  border: 1px solid rgba(236,72,153,.35);
  color: #be185d;
  padding: .6rem .8rem; border-radius: 12px;
  font-size: .85rem; font-weight: 600;
  margin-bottom: .9rem;
}
.field .hint {
  font-size: .78rem; opacity: .65; margin-top: .35rem;
}

/* ONLINE GRID */
.online-hero { padding: .5rem 1rem 1rem; }
.online-hero h2 {
  font-size: 1.35rem; font-weight: 800; letter-spacing: -.03em; margin-bottom: .25rem;
}
.online-hero p { color: var(--muted); font-size: .88rem; line-height: 1.4; }

.online-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .75rem;
  padding: 0 .75rem 1.25rem;
}

.online-card {
  position: relative;
  display: block;
  width: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  padding: 0;
  font-family: inherit;
  color: inherit;
  box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.online-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(0,0,0,.1);
}
.online-card:active { transform: scale(.98); }

.online-card .photo {
  aspect-ratio: 3 / 4;
  width: 100%;
  background: linear-gradient(145deg, #fce7f3, #f5f5f7);
  overflow: hidden;
  position: relative;
}
.online-card .photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.online-card .photo .ph {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-size: 2.4rem; font-weight: 800;
  color: rgba(236,72,153,.35);
  background: linear-gradient(135deg, #fce7f3, #fdf2f8);
}

.online-card .badge-online {
  position: absolute;
  left: .55rem; bottom: 3.4rem;
  display: inline-flex; align-items: center; gap: .35rem;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(8px);
  color: #16a34a;
  font-size: .62rem; font-weight: 800;
  letter-spacing: .04em;
  padding: .28rem .55rem;
  border-radius: 999px;
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}
.online-card .badge-online .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.25);
  animation: livePulse 1.6s ease-in-out infinite;
}
.online-card .badge-online.offline { color: var(--muted); }
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(34,197,94,.3); }
  50% { box-shadow: 0 0 0 5px rgba(34,197,94,.08); }
}

.online-card .meta {
  display: flex; align-items: center; gap: .4rem;
  padding: .5rem .55rem .55rem .65rem;
  background: #fff;
}
.online-card .cname {
  font-weight: 700; font-size: .85rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}
.online-card .age {
  font-size: .75rem; color: var(--muted); font-weight: 600; flex: none;
}

/* Pink call button on card */
.online-card .card-call {
  flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #ff4d8d, #ec4899);
  color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(236,72,153,.4);
  border: none;
  cursor: pointer;
  transition: transform .12s, filter .12s;
}
.online-card .card-call:hover { filter: brightness(1.08); transform: scale(1.06); }
.online-card .card-call:active { transform: scale(.94); }
.online-card .card-call:disabled {
  opacity: .45; cursor: not-allowed; transform: none; filter: grayscale(.3);
}
.online-card .card-call svg { width: 16px; height: 16px; }

/* ADMIN */
.admin-panel { padding: .5rem .75rem 1.5rem; }
.admin-panel h2 {
  font-size: 1.2rem; font-weight: 800; margin-bottom: .35rem;
}
.admin-panel .hint {
  color: var(--muted); font-size: .85rem; margin-bottom: 1rem;
}
.admin-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .75rem; border-radius: 14px;
  background: var(--surface-2); margin-bottom: .5rem;
}
.admin-row .grow { flex: 1; min-width: 0; }
.admin-row .aname { font-weight: 600; font-size: .92rem; }
.admin-row .ameta { font-size: .75rem; color: var(--muted); }
.admin-row .vip-toggle {
  padding: .4rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 700;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  transition: all .15s;
}
.admin-row .vip-toggle.on {
  background: var(--bubble-me); color: #fff; border-color: transparent;
  box-shadow: var(--glow);
}

@media (max-width: 820px) {
  .sidebar { max-width: 100%; }
  .chat {
    position: absolute; inset: 0; z-index: 20;
    transform: translateX(100%);
    transition: transform .25s cubic-bezier(.32,.72,0,1);
  }
  #app.chat-open .chat { transform: translateX(0); }
  #app.chat-open .sidebar { pointer-events: none; }
  .chat-head .back { display: grid; }
  #localVideo { width: 96px; height: 140px; }
}
@media (min-width: 821px) {
  .sidebar { max-width: 420px; box-shadow: 4px 0 24px rgba(0,0,0,.04); }
}

/* ========== WhatsApp-style video call ========== */
#call {
  position: fixed; inset: 0; z-index: 60;
  background: #0b141a;
  display: flex; flex-direction: column;
  color: #fff;
}
#call.hidden { display: none !important; }

.call-stage {
  position: absolute; inset: 0;
  background: #0b141a;
}
#remoteVideo {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  background: #0b141a;
  z-index: 1;
}
.call-remote-fallback {
  position: absolute; inset: 0;
  z-index: 2;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, #1f2c34 0%, #0b141a 70%);
  pointer-events: none;
}
.call-remote-fallback.hide { opacity: 0; transition: opacity .3s; }
#localVideo {
  position: absolute;
  z-index: 5;
  width: 110px; height: 160px;
  right: 14px;
  bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  border-radius: 12px;
  object-fit: cover;
  background: #1f2c34;
  box-shadow: 0 4px 20px rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.15);
  transform: scaleX(-1); /* mirror selfie */
  -webkit-transform: scaleX(-1);
}
@media (max-width: 480px) {
  #localVideo {
    width: 96px; height: 140px;
    right: 12px;
    bottom: calc(100px + env(safe-area-inset-bottom, 0px));
  }
}

.call-top {
  position: absolute; z-index: 10;
  top: 0; left: 0; right: 0;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
  text-align: center;
  pointer-events: none;
}
.call-top-inner { pointer-events: auto; }
.call-top .cname {
  font-size: 1.25rem; font-weight: 600;
  text-shadow: 0 1px 4px rgba(0,0,0,.6);
}
.call-top .cstat, .call-top .ctimer {
  font-size: .9rem; color: rgba(255,255,255,.85);
  margin-top: .2rem;
}

.call-ctrls {
  position: absolute; z-index: 10;
  left: 0; right: 0;
  bottom: 0;
  padding: 20px 24px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex; justify-content: center; align-items: center; gap: 18px;
  background: linear-gradient(to top, rgba(0,0,0,.6), transparent);
}
.call-btn {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #fff;
  border: none;
  transition: transform .12s, background .15s;
}
.call-btn:active { transform: scale(.92); }
.call-btn svg { width: 24px; height: 24px; }
.call-btn.off {
  background: #fff; color: #111;
}
.call-btn.hang {
  width: 64px; height: 64px;
  background: #e53935;
  box-shadow: 0 4px 16px rgba(229,57,53,.4);
}
.call-btn.hang svg { transform: rotate(135deg); width: 28px; height: 28px; }

/* Incoming call dark overlay WhatsApp-ish */
.incoming {
  background: rgba(11,20,26,.92) !important;
  color: #fff;
}
.incoming h2 { color: #fff; }
.incoming p { color: rgba(255,255,255,.7); }



/* ========== CALL UI — forced WhatsApp layout (overrides) ========== */
#call {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100 !important;
  background: #0b141a !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
#call.hidden { display: none !important; }

#call .call-stage {
  position: absolute !important;
  inset: 0 !important;
  background: #0b141a;
}

#call #remoteVideo {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  background: #0b141a !important;
  z-index: 1 !important;
}

#call .call-remote-fallback {
  position: absolute !important;
  inset: 0 !important;
  z-index: 2 !important;
  display: grid !important;
  place-items: center !important;
  background: radial-gradient(ellipse at center, #1f2c34 0%, #0b141a 70%) !important;
  transition: opacity .25s ease;
}
#call .call-remote-fallback.hide {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* LOCAL PiP — always visible, bottom-right */
#call #localVideo {
  position: absolute !important;
  z-index: 20 !important;
  width: 120px !important;
  height: 180px !important;
  max-width: 36vw !important;
  max-height: 28vh !important;
  right: 16px !important;
  bottom: calc(120px + env(safe-area-inset-bottom, 0px)) !important;
  left: auto !important;
  top: auto !important;
  border-radius: 14px !important;
  object-fit: cover !important;
  background: #1f2c34 !important;
  box-shadow: 0 6px 24px rgba(0,0,0,.55) !important;
  border: 2px solid rgba(255,255,255,.25) !important;
  transform: scaleX(-1) !important;
  -webkit-transform: scaleX(-1) !important;
}

#call .call-top {
  position: absolute !important;
  z-index: 25 !important;
  top: 0 !important; left: 0 !important; right: 0 !important;
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 24px !important;
  background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent) !important;
  text-align: center !important;
  color: #fff !important;
}
#call .cname { font-size: 1.3rem !important; font-weight: 600 !important; color: #fff !important; }
#call .cstat, #call .ctimer { font-size: .95rem !important; color: rgba(255,255,255,.9) !important; margin-top: 4px !important; }

#call .call-ctrls {
  position: absolute !important;
  z-index: 25 !important;
  left: 0 !important; right: 0 !important; bottom: 0 !important;
  padding: 16px 20px calc(32px + env(safe-area-inset-bottom, 0px)) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 16px !important;
  background: linear-gradient(to top, rgba(0,0,0,.7), transparent) !important;
}
#call .call-btn {
  width: 56px !important; height: 56px !important;
  border-radius: 50% !important;
  display: grid !important; place-items: center !important;
  background: rgba(255,255,255,.2) !important;
  color: #fff !important;
  border: none !important;
}
#call .call-btn.off { background: #fff !important; color: #111 !important; }
#call .call-btn.hang {
  width: 68px !important; height: 68px !important;
  background: #e53935 !important;
}
#call .call-btn.hang svg { transform: rotate(135deg); }

@media (max-width: 420px) {
  #call #localVideo {
    width: 100px !important;
    height: 150px !important;
    right: 12px !important;
    bottom: calc(110px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  margin: .75rem 0;
}
.gallery img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-2);
}
.gallery-edit {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .4rem;
  min-height: 40px;
}
.gallery-edit .g-item {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-2);
}
.gallery-edit .g-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.gallery-edit .g-item button {
  position: absolute; top: 4px; right: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 14px; line-height: 1;
  display: grid; place-items: center;
}

.badge-ban {
  display: inline-flex; background: #ef4444; color: #fff;
  font-size: .58rem; font-weight: 800; padding: .12rem .35rem;
  border-radius: 5px; margin-left: .25rem;
}
.badge-shadow {
  display: inline-flex; background: #78716c; color: #fff;
  font-size: .58rem; font-weight: 800; padding: .12rem .35rem;
  border-radius: 5px; margin-left: .25rem;
}
.admin-acts {
  display: flex; flex-wrap: wrap; gap: .35rem; flex: none;
}
.vip-toggle.ban.on { background: #ef4444; color: #fff; border-color: transparent; }
.vip-toggle.shadow.on { background: #78716c; color: #fff; border-color: transparent; }
.admin-tabs {
  display: flex; gap: .35rem; margin-bottom: .85rem;
}
.admin-tabs button {
  flex: 1; padding: .55rem; border-radius: 10px;
  background: var(--surface-2); font-weight: 600; font-size: .85rem;
  color: var(--muted);
}
.admin-tabs button.on {
  background: var(--accent-soft); color: var(--pink-deep);
}

/* Story viewer */
.story-viewer {
  margin: -1.5rem;
  background: #0b141a;
  border-radius: 22px;
  overflow: hidden;
  position: relative;
  min-height: 70vh;
  color: #fff;
}
.sv-bars {
  display: flex; gap: 3px; padding: 10px 10px 0;
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
}
.sv-bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,.3); overflow: hidden;
}
.sv-bar.done { background: #fff; }
.sv-bar.on::after {
  content: '';
  display: block; height: 100%; width: 0;
  background: #fff;
  animation: svFill 5s linear forwards;
}
.sv-bar.on.fill::after { width: 100%; }
@keyframes svFill { to { width: 100%; } }
.sv-head {
  position: absolute; top: 18px; left: 12px; right: 12px;
  z-index: 5; display: flex; align-items: center; gap: .5rem;
}
.sv-name { font-weight: 600; flex: 1; text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.sv-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,0,0,.35); color: #fff;
}
.sv-img {
  width: 100%; height: 70vh; object-fit: contain;
  background: #000; display: block;
}
.sv-cap {
  position: absolute; bottom: 20px; left: 16px; right: 16px;
  text-align: center; font-size: .95rem;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
}
.active-strip .story .ring.dim {
  background: linear-gradient(135deg, #d4d4d8, #a1a1aa);
}

/* ========== Public profile (OnlyFans-style) ========== */
#publicProfile {
  position: fixed; inset: 0; z-index: 50;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: #0a0a0c;
  color: #f5f5f7;
}
#publicProfile.hidden { display: none !important; }

.pp-wrap { max-width: 520px; margin: 0 auto; min-height: 100%; padding-bottom: 2rem; }

.pp-top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  background: rgba(10,10,12,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pp-brand {
  font-weight: 800; font-size: 1.15rem; color: #fff;
  text-decoration: none; letter-spacing: -.02em;
}
.pp-top-actions { display: flex; gap: .4rem; }
.pp-top-actions .btn.tiny { padding: .45rem .85rem; font-size: .8rem; }
.pp-left { display: flex; align-items: center; gap: .3rem; }
.pp-back {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,.08); border: none; color: #fff;
  cursor: pointer; flex: 0 0 auto; transition: background .15s;
}
.pp-back:hover { background: rgba(255,255,255,.16); }
.pp-back:active { transform: scale(.94); }

.pp-hero {
  position: relative;
  height: 220px;
  background: linear-gradient(135deg, #1a1a22, #2a1520);
  overflow: hidden;
}
.pp-hero-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: blur(2px) brightness(.75);
  transform: scale(1.08);
}
.pp-hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, transparent 30%, #0a0a0c 100%);
}

.pp-card {
  position: relative;
  margin: -64px 1rem 0;
  padding: 0 .25rem 1.5rem;
}
.pp-avatar-wrap {
  position: relative;
  width: 112px;
  margin-bottom: .75rem;
}
.pp-avatar-wrap .avatar {
  width: 112px; height: 112px; font-size: 2.4rem;
  border: 4px solid #0a0a0c;
  box-shadow: 0 8px 32px rgba(0,0,0,.45);
  background: linear-gradient(135deg, #ec4899, #a855f7);
}
.pp-online {
  position: absolute; bottom: 6px; right: -4px;
  display: inline-flex; align-items: center; gap: .3rem;
  background: rgba(0,0,0,.75); color: #4ade80;
  font-size: .65rem; font-weight: 800;
  padding: .25rem .5rem; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em;
}
.pp-online .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34,197,94,.3);
}

.pp-identity h1 {
  font-size: 1.65rem; font-weight: 800;
  letter-spacing: -.03em; margin-bottom: .15rem;
}
.pp-uname { color: #a1a1aa; font-size: .95rem; margin-bottom: .55rem; }
.pp-chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .75rem; }
.pp-chips .chip {
  background: rgba(236,72,153,.15); color: #f9a8d4;
  border: 1px solid rgba(236,72,153,.25);
  padding: .3rem .7rem; border-radius: 999px;
  font-size: .78rem; font-weight: 600;
}
.pp-bio {
  color: #d4d4d8; font-size: .95rem; line-height: 1.55;
  margin-bottom: 1rem; white-space: pre-wrap;
}
.pp-stats {
  display: flex; gap: 1.25rem;
  margin-bottom: 1.1rem;
  color: #a1a1aa; font-size: .85rem;
}
.pp-stats strong { color: #fff; font-weight: 700; }

.pp-cta {
  display: flex; flex-direction: column; gap: .55rem;
  margin-bottom: 1.5rem;
}
.pp-cta .btn.primary {
  background: linear-gradient(135deg, #ec4899, #f472b6);
  box-shadow: 0 8px 28px rgba(236,72,153,.35);
  font-size: 1rem; padding: 1rem;
}
.pp-cta .btn.ghost {
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
}

.pp-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .5rem;
}
.pp-gallery img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 14px;
  background: #18181b;
  cursor: pointer;
  transition: transform .15s;
}
.pp-gallery img:hover { transform: scale(1.02); }
.pp-gallery.empty-g {
  grid-column: 1 / -1;
  text-align: center;
  color: #71717a;
  padding: 2rem;
  font-size: .9rem;
}

.pp-foot {
  text-align: center;
  color: #52525b;
  font-size: .8rem;
  padding: 1.5rem 1rem;
}

/* lightbox */
.pp-lightbox {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0,0,0,.92);
  display: grid; place-items: center;
  padding: 1rem;
}
.pp-lightbox img {
  max-width: 100%; max-height: 90vh;
  border-radius: 12px; object-fit: contain;
}
.pp-lightbox .pp-lb-close {
  position: absolute; top: 1rem; right: 1rem;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 1.2rem;
}

/* Tip me button */
.btn.tip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  background: linear-gradient(135deg, #f59e0b, #fbbf24, #f97316) !important;
  color: #1c1917 !important;
  font-weight: 800 !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, .35);
  text-decoration: none !important;
  padding: .9rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  transition: filter .15s, transform .12s;
}
.btn.tip-btn:hover { filter: brightness(1.05); }
.btn.tip-btn:active { transform: scale(.98); }
.btn.tip-btn.block { width: 100%; }
.btn.tip-btn.hidden { display: none !important; }

.pp-brand {
  background: none; border: none; cursor: pointer;
  font-weight: 800; font-size: 1.15rem; color: #fff;
  letter-spacing: -.02em; font-family: inherit;
}

/* Ensure app header avatar never collapses */
.side-head .avatar.sm {
  width: 42px !important;
  height: 42px !important;
  min-width: 42px;
  flex: none;
}
.side-head .me {
  min-width: 0;
}

/* Clickable links in chat */
.msg-link {
  color: inherit;
  text-decoration: underline;
  font-weight: 600;
  word-break: break-all;
}
.msg.me .msg-link { color: #fff; }
.msg.them .msg-link { color: var(--pink-deep); }

/* Ad banner above online grid */
.ad-banner-slot {
  padding: .5rem .75rem 0;
}
.ad-banner-slot.hidden { display: none !important; }
.ad-banner {
  display: block;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: .5rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.ad-banner img {
  display: block;
  width: 100%;
  max-height: 100px;
  object-fit: cover;
}
.ad-banner .ad-fallback {
  display: block;
  padding: 1rem;
  text-align: center;
  font-weight: 700;
  color: var(--pink-deep);
}

.admin-panel input, .admin-panel textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: .55rem .75rem;
  font-size: .88rem;
}
.admin-panel textarea { resize: vertical; }


/* Tip me — force visibility when not hidden */
a.btn.tip-btn:not(.hidden),
button.btn.tip-btn:not(.hidden) {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: linear-gradient(135deg, #f59e0b, #fbbf24, #f97316) !important;
  color: #1c1917 !important;
  font-weight: 800 !important;
  text-decoration: none !important;
  border: none !important;
  box-shadow: 0 6px 20px rgba(245, 158, 11, .4) !important;
  padding: .9rem 1.25rem !important;
  border-radius: 14px !important;
  align-items: center !important;
  justify-content: center !important;
  gap: .4rem !important;
  margin: .35rem 0 !important;
}
a.btn.tip-btn.block:not(.hidden) { width: 100% !important; }
a.btn.tip-btn.hidden { display: none !important; }


.online-sentinel {
  display: flex; justify-content: center; align-items: center;
  padding: 1.25rem 1rem 2rem;
  min-height: 48px;
}
.online-sentinel.hidden { display: none; }
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.end-label { color: var(--muted); font-size: .8rem; font-weight: 500; }

/* Faster cards */
.online-card .photo img {
  content-visibility: auto;
  background: var(--surface-2);
}

/* =====================================================================
   SNAPCHAT DARK THEME — overrides everything above.
   Palette: yellow #FFFC00 · blue #0EADFF · red #F23C57 · purple #A05DCD
   ===================================================================== */
:root {
  --snap-yellow: #FFFC00;
  --snap-blue: #0EADFF;
  --snap-red: #F23C57;
  --snap-purple: #A05DCD;
  --snap-green: #1ED760;

  --bg: #000000;
  --surface: #121212;
  --surface-2: #1E1E1E;
  --elev: #2A2A2A;
  --line: #262626;
  --line-soft: rgba(255,255,255,.06);
  --txt: #FFFFFF;
  --muted: #A1A1A6;
  --muted-2: #7C7C82;
  --accent: var(--snap-yellow);
  --accent-soft: rgba(255,252,0,.10);
  --accent-2: var(--snap-blue);
  --pink: var(--snap-red);
  --pink-deep: #d42a45;
  --ok: var(--snap-green);
  --danger: var(--snap-red);
  --bubble-me: var(--snap-yellow);
  --glow: 0 6px 22px rgba(255,252,0,.18);
  --shadow: 0 10px 34px rgba(0,0,0,.55);
  color-scheme: dark;
}
body { background: var(--bg); color: var(--txt); }
a { color: var(--snap-blue); }
::selection { background: var(--snap-yellow); color: #000; }
input, textarea, select { color: var(--txt); }

/* --- Buttons: yellow pill CTA with black text, round grey icon buttons --- */
.btn { border-radius: 999px; font-weight: 700; }
.btn.primary, .pp-cta .btn.primary {
  background: var(--snap-yellow) !important; color: #000 !important;
  box-shadow: var(--glow);
}
.btn.primary:hover { filter: brightness(.96); }
.btn.ghost {
  background: var(--elev); color: var(--txt); border: 1px solid transparent;
}
.btn.ghost:hover { background: #333; }
.icon-btn {
  background: var(--elev); border-color: transparent; color: var(--txt);
  border-radius: 50%;
}
.icon-btn:hover { background: #363636; }
.icon-btn.ghost { background: var(--elev); }
.icon-btn.ghost:hover { background: #363636; }
.icon-btn.call { background: var(--snap-yellow); color: #000; }
.icon-btn.call:disabled { background: var(--elev); color: var(--muted-2); opacity: 1; }

/* --- Badges / counts --- */
.badge-vip { background: var(--snap-yellow) !important; color: #000 !important; font-weight: 800; }
.side-tabs .count, .row .unread { background: var(--snap-red); color: #fff; }

/* --- Auth --- */
#auth { background: radial-gradient(120% 80% at 50% 0%, #1b1b00 0%, #000 60%); }
.auth-card { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.auth-tabs { background: var(--elev) !important; border-radius: 999px; }
.auth-tabs button { border-radius: 999px; color: var(--muted); }
.auth-tabs button.active { background: var(--snap-yellow); color: #000; font-weight: 800; }
.field input, .field textarea, .field select,
.auth-card input, .modal input, .modal textarea, .modal select {
  background: var(--surface-2) !important; border: 1px solid var(--line) !important; color: var(--txt) !important;
}
.field input:focus, .field textarea:focus, .field select:focus,
.modal input:focus, .modal textarea:focus, .modal select:focus {
  border-color: var(--snap-yellow) !important; outline: none;
}
.err { color: var(--snap-red); }

/* --- Sidebar / header (Snapchat "Chat" screen) --- */
.sidebar { background: var(--bg); border-right: 1px solid var(--line); }
.side-head { background: var(--bg); border-bottom: none; }
.side-head .me:hover { background: var(--surface-2); }
.side-head .sub { color: var(--muted); }
.side-tabs { background: var(--bg); gap: .35rem; border-bottom: 1px solid var(--line); }
.side-tabs button { color: var(--txt); font-weight: 700; border-radius: 999px; background: transparent; }
.side-tabs button:hover { background: var(--surface-2); }
.side-tabs button.active { background: var(--elev); color: var(--txt); box-shadow: none; }
.active-strip .story .ring {
  background: conic-gradient(var(--snap-purple), var(--snap-blue), var(--snap-purple));
}
.active-strip .story .ring .inner { background: var(--bg); }

.search input {
  background: var(--elev) !important; border: 1px solid transparent !important;
  border-radius: 999px !important; color: var(--txt);
}
.search input:focus { background: var(--elev) !important; border-color: var(--snap-yellow) !important; }
.search .search-icon { color: var(--muted); }

/* Rows look like Snapchat chat list: big avatar, divider lines */
.row { border-bottom: 1px solid var(--line); border-radius: 0; }
.row:hover { background: var(--surface); }
.row.active { background: var(--surface-2); }
.row .rname { color: var(--txt); font-weight: 600; }
.row .preview, .row .time { color: var(--muted); }
.row .preview:not(:empty)::before { content: '▢ '; color: var(--snap-blue); font-weight: 700; }

/* Avatar placeholder + online dot */
.avatar { background-color: var(--elev); background-image: linear-gradient(135deg, #2e2e2e, #1a1a1a); color: var(--snap-yellow); }
.status.on, .status.online { background: var(--snap-green) !important; border-color: var(--bg) !important; }

/* --- Chat --- */
.chat { background: var(--bg); }
.chat.welcome h2 { color: var(--txt); }
.welcome-icon { background: var(--snap-yellow) !important; box-shadow: var(--glow) !important; }
.welcome-icon svg { stroke: #000 !important; }
.chat-head { background: var(--bg); border-bottom: 1px solid var(--line); }
.chat-head .back { background: var(--elev); border-radius: 50%; color: var(--txt); }
.chat-head .back:hover { background: #363636; }
.chat-head .sub { color: var(--muted); }
.chat-head .sub.typing { color: var(--snap-blue); }
.day { background: var(--surface-2); color: var(--muted); border-color: transparent; }

/* Snapchat-style messages: colored side bar (me = red, them = blue) */
.msg.them {
  background: var(--surface) !important; color: var(--txt) !important;
  border: none !important; border-left: 3px solid var(--snap-blue) !important;
  border-radius: 4px 14px 14px 4px !important;
}
.msg.me {
  background: var(--surface) !important; color: var(--txt) !important;
  border: none !important; border-right: 3px solid var(--snap-red) !important;
  border-radius: 14px 4px 4px 14px !important;
}
.msg.me .msg-link { color: var(--snap-blue); }
.msg .meta, .msg time { color: var(--muted-2) !important; }

.composer { background: var(--bg); border-top: 1px solid var(--line); }
.composer textarea {
  background: var(--elev) !important; border: 1px solid transparent !important;
  border-radius: 22px !important; color: var(--txt) !important;
}
.composer textarea:focus { border-color: var(--snap-yellow) !important; background: var(--elev) !important; }
.composer button[type="submit"], .composer .send, #sendBtn {
  background: var(--snap-yellow) !important; color: #000 !important; border-radius: 50% !important;
}

/* --- Modals, toasts, notifications --- */
.modal { background: var(--surface); border: 1px solid var(--line); color: var(--txt); box-shadow: var(--shadow); }
.modal-back, .modal-bg, #modalRoot > .overlay { background: rgba(0,0,0,.7) !important; }
.avatar-edit .cam { background: var(--snap-yellow); color: #000; }
.toast, .notif { background: var(--surface-2); border: 1px solid var(--line); color: var(--txt); }
.toast.good { border-color: rgba(30,215,96,.5); }
.toast.bad { border-color: rgba(242,60,87,.6); }
.notif { border-left: 3px solid var(--snap-blue); }
.notif-title { color: var(--txt); }
.ref-note {
  background: rgba(255,252,0,.08); border: 1px solid rgba(255,252,0,.35); color: var(--snap-yellow);
}

/* --- Online grid cards --- */
.online-card { background: var(--surface); border: 1px solid var(--line); }
.online-card .photo { background: linear-gradient(145deg, #1c1c1c, #0d0d0d); }
.online-card .photo .ph { color: rgba(255,252,0,.35); background: linear-gradient(135deg, #1c1c1c, #111); }
.online-card .badge-online { background: rgba(0,0,0,.72); color: var(--snap-green); }
.online-card .badge-online.offline { color: var(--muted); }
.online-card .meta { background: var(--surface); color: var(--txt); }
.online-card .card-call { background: var(--snap-yellow); color: #000; }
.online-card .card-call:disabled { background: var(--elev); color: var(--muted-2); }

/* --- Admin --- */
.admin-row .vip-toggle { background: var(--elev); border-color: transparent; color: var(--txt); }
.admin-row .vip-toggle.on { background: var(--snap-yellow); color: #000; }
.vip-toggle.ban.on { background: var(--snap-red); color: #fff; }
.admin-panel input, .admin-panel textarea { background: var(--surface-2); border-color: var(--line); color: var(--txt); }
.ad-banner { background: var(--surface-2); border-color: var(--line); }

/* --- Calls / stories keep dark, Snap accents --- */
#call { background: #000; }
.incoming { background: rgba(0,0,0,.94) !important; }
.story-viewer { background: #000; }

/* --- Public (OnlyFans-style) profile page --- */
#publicProfile { background: #000; color: var(--txt); }
.pp-top { background: rgba(0,0,0,.82); }
.pp-back { background: var(--elev); }
.pp-back:hover { background: #363636; }
.pp-avatar-wrap .avatar { border-color: #000; background: linear-gradient(135deg, var(--snap-purple), var(--snap-blue)); }
.pp-chips .chip { background: rgba(255,252,0,.08); color: var(--snap-yellow); border-color: rgba(255,252,0,.25); }
.pp-cta .btn.ghost { background: var(--elev); border-color: transparent; }

/* Scrollbars */
* { scrollbar-color: #333 transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 8px; }
#sendBtn svg, .composer .send svg { stroke: #000 !important; }
.status { border-color: var(--bg) !important; }
.modal { position: relative; }
.modal-back-btn {
  position: absolute; top: .75rem; left: .75rem; z-index: 3;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--elev); color: var(--txt); border: none; cursor: pointer;
}
.modal-back-btn:hover { background: #363636; }
.modal-back-btn:active { transform: scale(.94); }
/* leave room for the back button next to modal titles */
.modal > h2:first-of-type, .modal > h3:first-of-type { padding-left: 2.6rem; }
/* polish after screenshot review */
.msg.me, .msg.them { box-shadow: none !important; }
#notif { bottom: calc(5.4rem + env(safe-area-inset-bottom, 0)); }
.gallery-edit .empty { width: 100%; text-align: left; }

/* ---------- Composer: emoji + view-once photo ---------- */
.composer { position: relative; align-items: flex-end; gap: .45rem; }
.comp-btn {
  position: relative; flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--elev); color: var(--txt); border: none; cursor: pointer;
}
.comp-btn:hover { background: #363636; }
.comp-btn svg { width: 22px; height: 22px; }
.comp-btn .once-dot {
  position: absolute; right: 2px; bottom: 2px;
  min-width: 15px; height: 15px; border-radius: 50%;
  background: var(--snap-yellow); color: #000; font-size: .62rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}
.emoji-panel {
  position: absolute; left: .6rem; right: .6rem; bottom: calc(100% + .4rem); z-index: 20;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow); overflow: hidden;
  max-width: 420px;
}
.emoji-tabs { display: flex; gap: .2rem; padding: .4rem; border-bottom: 1px solid var(--line); }
.emoji-tabs button {
  font-size: 1.15rem; padding: .3rem .55rem; border-radius: 10px; background: none; border: none; cursor: pointer;
}
.emoji-tabs button.on { background: var(--elev); }
.emoji-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  max-height: 230px; overflow-y: auto; padding: .35rem;
}
.emoji-grid button {
  font-size: 1.5rem; line-height: 1; height: 40px; border: none; background: none;
  border-radius: 10px; cursor: pointer;
}
.emoji-grid button:hover { background: var(--elev); }

/* ---------- View-once photo bubbles ---------- */
.msg-photo {
  display: inline-flex; align-items: center; gap: .55rem;
  font-weight: 700; font-size: .92rem; color: var(--snap-purple);
  background: none; border: none; padding: .15rem 0; cursor: default; font-family: inherit;
}
.msg-photo.tap { color: var(--snap-red); cursor: pointer; }
.msg-photo.tap:hover span { text-decoration: underline; }
.msg-photo.opened { color: var(--muted); font-weight: 600; }
.msg-photo:disabled { opacity: .7; }

.once-viewer {
  position: fixed; inset: 0; z-index: 200; background: #000;
  display: flex; align-items: center; justify-content: center;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.once-viewer img {
  max-width: 100%; max-height: 100%; object-fit: contain; pointer-events: none;
}
.once-top {
  position: absolute; top: calc(.8rem + env(safe-area-inset-top, 0)); left: .8rem; right: .8rem;
  display: flex; justify-content: space-between; align-items: center; z-index: 2;
}
.once-badge {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(0,0,0,.6); color: #fff; padding: .35rem .75rem; border-radius: 999px;
  font-size: .85rem; font-weight: 700;
}
.once-badge svg { width: 18px; height: 18px; }
.once-close {
  width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,.15); color: #fff; font-size: 1.05rem;
}

/* ---------- Delete chat confirm ---------- */
.btn.danger { background: var(--snap-red); color: #fff; }
.btn.danger:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: default; }
.confirm-text { color: var(--muted); line-height: 1.5; margin-bottom: 1.2rem; }
.confirm-text strong { color: var(--txt); }
.confirm-actions { display: flex; gap: .6rem; }
.confirm-actions .btn { flex: 1; }
.chat-head #delChatBtn { flex: 0 0 auto; margin-right: .35rem; }
.row { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

/* ---------- sex1on1 branding ---------- */
.brand-name { font-weight: 900; letter-spacing: -.03em; }
.brand-name > span { color: var(--snap-yellow); }
.auth-logo h1.brand-name { font-size: 2.1rem; color: #fff; }
.logo-mark.brand-mark {
  display: flex; align-items: center; justify-content: center;
  background: var(--snap-yellow) !important; color: #000 !important;
  font-weight: 900; font-size: 1.55rem; letter-spacing: -.04em;
  font-family: Arial, Helvetica, system-ui, sans-serif;
  box-shadow: var(--glow);
}
.pp-brand.brand-name { font-size: 1.2rem; }
.chat.welcome h2 .brand-name { font-weight: 900; }
.welcome-icon.brand-mark {
  display: flex; align-items: center; justify-content: center;
  color: #000; font-weight: 900; font-size: 1.35rem; letter-spacing: -.04em;
  font-family: Arial, Helvetica, system-ui, sans-serif;
}
