:root {
  --bg: #f6f4f9;
  --surface: #ffffff;
  --surface-2: #f1edf6;
  --surface-3: #e3dcec;
  --line: #e7e1ef;
  --text: #01040a;
  --heading: #2a0b45;
  --muted: #6b6378;
  --brand: #7b2cbf;
  --brand-2: #9d4edd;
  --brand-dark: #3c096c;
  --brand-tint: #f1e6fb;
  --accent: #e8414b;
  --accent-tint: #fde8ea;
  --on-brand: #ffffff;
  --danger: #d93644;
  --ok: #22b573;
  --bubble-out: #ebdcf9;
  --bubble-in: #ffffff;
  --shadow: 0 2px 10px rgba(42, 11, 69, .07);
  --shadow-lg: 0 10px 30px rgba(42, 11, 69, .14);
  --radius: 14px;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  /* aliases kept for inline styles in app.js */
  --gold: var(--brand);
  --gold-2: var(--brand-2);
  --gold-ink: var(--on-brand);
  color-scheme: light;
}

/* Dark theme: the original charcoal + gold look */
:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #151517;
  --surface-2: #1d1d20;
  --surface-3: #2e2e33;
  --line: #29292e;
  --text: #f3f1ea;
  --heading: #f6f3ea;
  --muted: #a19d94;
  --brand: #d4af37;
  --brand-2: #f2cf5b;
  --brand-dark: #2a220a;
  --brand-tint: rgba(212, 175, 55, .13);
  --accent: #ff5b6e;
  --accent-tint: rgba(255, 91, 110, .13);
  --on-brand: #1a1405;
  --danger: #ff5b6e;
  --ok: #3ddc84;
  --bubble-out: #3a2f0c;
  --bubble-in: #1f1f23;
  --shadow: 0 0 0 1px #1f1f23;
  --shadow-lg: 0 12px 34px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
:root[data-theme="dark"] .btn.primary:hover { background: var(--brand-2); }
:root[data-theme="dark"] .btn.dark { background: var(--surface-3); color: var(--text); }
:root[data-theme="dark"] .lp-hero::before { background: radial-gradient(closest-side, rgba(212,175,55,.32), rgba(212,175,55,.12) 55%, transparent 75%); }
:root[data-theme="dark"] .lp-band,
:root[data-theme="dark"] .balance { background: radial-gradient(120% 120% at 100% 0%, rgba(242,207,91,.28), transparent 55%), linear-gradient(135deg, #2a220a, #121110); border: 1px solid rgba(212,175,55,.35); color: var(--text); }
:root[data-theme="dark"] .lp-band h2 { color: var(--brand-2); }
:root[data-theme="dark"] .balance .num { color: var(--brand-2); }
:root[data-theme="dark"] .lp-foot { background: #070708; border-top: 1px solid var(--line); }
:root[data-theme="dark"] .lp-foot .brand b { color: var(--brand); }
:root[data-theme="dark"] .thread-head { background: var(--surface); border-bottom: 1px solid var(--line); color: var(--text); }
:root[data-theme="dark"] .thread-head .icon-btn { background: var(--surface-2); color: var(--brand); }
:root[data-theme="dark"] .thread-head .who .muted { color: var(--muted); }
:root[data-theme="dark"] .thread-head .av-wrap .dot { border-color: var(--surface); }
:root[data-theme="dark"] .thread-body { background: radial-gradient(circle at 20% 10%, rgba(212,175,55,.05), transparent 40%), #0e0e10; }
:root[data-theme="dark"] .bubble .meta { color: rgba(243,241,234,.55); }
:root[data-theme="dark"] .bubble.gift { background: linear-gradient(160deg, #3b2f0b, #1f1a09); border-color: rgba(212,175,55,.45); }
:root[data-theme="dark"] .bubble.gift .gname { color: var(--brand); }
:root[data-theme="dark"] .composer, :root[data-theme="dark"] .topbar, :root[data-theme="dark"] .nav { border-color: var(--line); }
:root[data-theme="dark"] .topbar { box-shadow: 0 1px 0 var(--line); }
:root[data-theme="dark"] .nav { box-shadow: 0 -1px 0 var(--line); }
:root[data-theme="dark"] .call { background: #000; }
:root[data-theme="dark"] .toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--line); }
:root[data-theme="dark"] .toast.err { border-color: var(--danger); background: var(--surface-3); }
:root[data-theme="dark"] .overlay { background: rgba(0,0,0,.65); }
:root[data-theme="dark"] .gift.cant { opacity: .35; }
:root[data-theme="dark"] .badge { color: var(--brand); }
:root[data-theme="dark"] code { color: var(--brand); }
@media (min-width: 520px) { :root[data-theme="dark"] body { background: #060607; } }

.theme-btn svg { width: 20px; height: 20px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body {
  font: 500 15px/1.5 'Figtree', 'Circular Std', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); }
img { display: block; }
.hidden { display: none !important; }
svg.inline { width: 14px; height: 14px; vertical-align: -2px; display: inline; }
code { font-size: 12px; color: var(--brand-dark); }

#app { max-width: 480px; margin: 0 auto; min-height: 100%; position: relative; background: var(--bg); }
.screen { padding: calc(16px + var(--safe-t)) 16px calc(var(--nav-h) + 24px + var(--safe-b)); min-height: 100dvh; }
.screen.no-nav { padding-bottom: calc(24px + var(--safe-b)); }

/* ---------- typography & brand */
.brand { font-weight: 800; letter-spacing: -.3px; color: var(--heading); display: inline-flex; align-items: center; gap: 6px; }
.brand b { color: var(--brand); font-weight: 800; }
.brand .mark { width: 1.15em; height: 1.15em; color: #c41e1e; fill: currentColor; flex: none; } /* solid dark red heart, same in both themes */h1, h2, h3 { margin: 0; line-height: 1.2; color: var(--heading); font-weight: 700; }
h1 { font-size: 26px; } h2 { font-size: 20px; } h3 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.gold { color: var(--brand); }

.topbar { display: flex; align-items: center; gap: 12px; margin: -16px -16px 16px; padding: calc(12px + var(--safe-t)) 16px 12px; background: var(--surface); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 15; }
.topbar .grow { flex: 1; }
.topbar h1 { font-size: 22px; }

/* ---------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 20px; border-radius: 6px; font-weight: 700; font-size: 14px;
  text-transform: uppercase; letter-spacing: .4px;
  background: var(--surface-2); color: var(--heading); transition: transform .12s, background .12s, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.dark { background: var(--brand-dark); color: #fff; }
.btn.accent { background: var(--accent); color: #fff; }
.btn.ghost { background: transparent; border: 1.5px solid var(--surface-3); }
.btn.block { width: 100%; }
.btn.sm { height: 36px; padding: 0 14px; font-size: 12px; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--heading); flex: none; text-decoration: none; }
.icon-btn.gold { color: var(--brand); background: var(--brand-tint); }
.icon-btn svg, .btn svg { width: 20px; height: 20px; }
.link-btn { color: var(--brand); font-weight: 700; padding: 4px; }

/* ---------- forms */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.input, textarea.input, select.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 8px;
  background: var(--surface); border: 1.5px solid var(--surface-3); outline: none;
}
textarea.input { height: 96px; padding: 12px 14px; resize: none; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.seg label { flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 11px 12px; border-radius: 8px; background: var(--surface); border: 1.5px solid var(--surface-3); font-weight: 600; font-size: 14px; color: var(--heading); }
.seg input:checked + span { border-color: var(--brand); color: var(--on-brand); background: var(--brand); }
.seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.error { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 10px; font-weight: 600; }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; margin: 0; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-3); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + i { background: var(--brand); }
.switch input:checked + i::after { transform: translateX(18px); }

/* ---------- cards & lists */
.card { background: var(--surface); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card + .card { margin-top: 12px; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; background: var(--surface); border: 1.5px solid var(--surface-3); font-size: 13px; font-weight: 600; white-space: nowrap; color: var(--heading); }
.chip svg { width: 15px; height: 15px; }
.chip.on { color: var(--on-brand); border-color: var(--brand); background: var(--brand); }
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; padding: 3px 8px; border-radius: 99px; background: var(--brand-tint); color: var(--brand-dark); }
.badge.warn { background: var(--accent-tint); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(34,181,115,.18); flex: none; }

/* ---------- landing (signed out) */
.landing { min-height: 100dvh; background: var(--bg); }
.lp-head { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + var(--safe-t)) 18px 14px; position: relative; z-index: 2; }
.lp-head .brand { font-size: 20px; }
.lp-hero { position: relative; padding: 18px 20px 40px; overflow: hidden; }
.lp-hero::before { content: ''; position: absolute; right: -90px; top: -60px; width: 360px; height: 420px; z-index: 0;
  background: radial-gradient(closest-side, rgba(244,153,170,.55), rgba(244,153,170,.25) 55%, transparent 75%),
              radial-gradient(closest-side at 30% 70%, rgba(240,120,140,.35), transparent 70%);
  filter: blur(6px); border-radius: 46% 54% 40% 60%; }
.lp-hero > * { position: relative; z-index: 1; }
.lp-hero h1 { font-size: 34px; line-height: 1.15; max-width: 12ch; }
.lp-hero p { color: var(--muted); font-weight: 600; font-size: 16px; margin: 14px 0 22px; max-width: 30ch; }
.phone { width: 210px; height: 400px; margin: 30px auto 0; border-radius: 34px; background: #2d2233; padding: 9px; box-shadow: var(--shadow-lg); position: relative; }
.phone::before { content: ''; position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 64px; height: 18px; border-radius: 10px; background: #000; z-index: 2; }
.phone .scr { width: 100%; height: 100%; border-radius: 26px; overflow: hidden; position: relative; background: var(--brand-dark); }
.phone .scr img { width: 100%; height: 100%; object-fit: cover; }
.phone .scr .pinfo { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 62px 14px 14px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.7)); }
.phone .scr .pinfo b { font-size: 18px; }
.phone .scr .like { position: absolute; right: 12px; bottom: 16px; width: 42px; height: 42px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: #fff; }
.phone .scr .like svg { width: 20px; height: 20px; }
.scroll-cue { width: 46px; height: 46px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: -23px auto 0; position: relative; z-index: 3; box-shadow: var(--shadow-lg); }
.scroll-cue svg { width: 22px; height: 22px; transform: rotate(90deg); }
.lp-band { background: linear-gradient(160deg, var(--brand), var(--brand-dark)); color: #fff; padding: 40px 20px 34px; margin-top: -23px; }
.lp-band h2 { color: #fff; font-size: 26px; text-align: center; margin: 10px 0 26px; }
.feat { display: grid; grid-template-columns: 1fr 1fr; gap: 22px 16px; }
.feat > div { display: flex; gap: 10px; align-items: flex-start; }
.feat .sh { width: 38px; height: 42px; flex: none; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.14); border: 2px solid rgba(255,255,255,.7); border-radius: 10px 10px 18px 18px; }
.feat .sh svg { width: 18px; height: 18px; }
.feat b { display: block; font-size: 15px; }
.feat span { font-size: 13px; opacity: .85; }
.lp-section { padding: 36px 20px; text-align: center; }
.lp-section h2 { font-size: 26px; margin-bottom: 18px; }
.carousel { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -20px; padding: 4px 20px 10px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel .mcard { flex: 0 0 150px; scroll-snap-align: start; border-radius: 10px; overflow: hidden; background: var(--brand); box-shadow: var(--shadow); text-align: left; position: relative; }
.carousel .mcard img { width: 150px; height: 170px; object-fit: cover; }
.carousel .mcard div { padding: 8px 10px; background: var(--surface); }
.carousel .mcard b { color: var(--heading); }
.lp-cta { background: var(--surface-2); }
.lp-foot { padding: 26px 20px calc(30px + var(--safe-b)); background: var(--brand-dark); color: rgba(255,255,255,.8); font-size: 13px; text-align: center; }
.lp-foot .brand { color: #fff; font-size: 18px; margin-bottom: 8px; }
.lp-foot .brand b { color: #d7b8f5; }
.lp-foot nav { display: flex; justify-content: center; gap: 16px; margin: 10px 0; flex-wrap: wrap; }
.lp-foot a { color: #fff; text-decoration: none; }
.tabs { display: flex; background: var(--surface-2); border-radius: 8px; padding: 4px; margin-bottom: 18px; }
.tabs button { flex: 1; height: 40px; border-radius: 6px; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--heading); box-shadow: var(--shadow); }
.legal { font-size: 12px; color: var(--muted); text-align: center; margin-top: 14px; }

/* ---------- onboarding */
.steps { display: flex; gap: 6px; margin: 8px 0 22px; }
.steps i { flex: 1; height: 5px; border-radius: 4px; background: var(--surface-3); }
.steps i.on { background: var(--brand); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.photo-slot { aspect-ratio: 3/4; border-radius: 10px; background: var(--surface); border: 2px dashed var(--surface-3); display: grid; place-items: center; position: relative; overflow: hidden; color: var(--brand); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.photo-slot .rm svg { width: 14px; height: 14px; }
.photo-slot .main-tag { position: absolute; left: 6px; bottom: 6px; background: var(--brand); color: var(--on-brand); }
.photo-slot input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- gate */
.gate { min-height: calc(100dvh - var(--nav-h) - 100px); display: grid; place-items: center; }
.gate .card { text-align: center; padding: 30px 22px; border-top: 5px solid var(--brand); }
.gate .shield { width: 72px; height: 80px; margin: 0 auto 16px; border-radius: 16px 16px 34px 34px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); border: 3px solid var(--brand); }
.gate .shield svg { width: 34px; height: 34px; }
.gate p { color: var(--muted); margin: 10px 0 22px; font-weight: 600; }
.vendor-row { display: flex; justify-content: center; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ---------- discovery */
.hscroll { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px 4px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.status-bar { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 14px; }
.status-bar .grow { flex: 1; }
.status-bar b { color: var(--heading); }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pcard { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pcard .phwrap { position: relative; aspect-ratio: 1/1.05; background: var(--brand); }
.pcard img.ph { width: 100%; height: 100%; object-fit: cover; }
.pcard .top { position: absolute; top: 8px; left: 8px; right: 8px; display: flex; justify-content: space-between; }
.pcard .tonight { font-size: 10px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 4px 8px; border-radius: 99px; background: var(--accent); color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.pcard .tonight .dot { width: 6px; height: 6px; box-shadow: none; background: #fff; }
.pcard .info { padding: 9px 10px 4px; }
.pcard .info b { font-size: 15px; color: var(--heading); }
.pcard .info .small { color: var(--muted); display: flex; align-items: center; gap: 3px; }
.pcard .acts { display: flex; gap: 6px; padding: 6px 8px 9px; }
.pcard .acts button { flex: 1; height: 34px; border-radius: 6px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; }
.pcard .acts .msg { background: var(--brand); color: var(--on-brand); }
.pcard .acts .gift { background: var(--accent-tint); color: var(--accent); flex: 0 0 38px; }
.pcard .acts svg { width: 15px; height: 15px; }
.pcard .open { position: absolute; inset: 0; }

/* swipe */
.swipe-wrap { position: relative; height: min(62dvh, 540px); }
.swipe-card { position: absolute; inset: 0; border-radius: 18px; overflow: hidden; background: var(--brand); touch-action: none; user-select: none; transition: transform .25s ease; box-shadow: var(--shadow-lg); }
.swipe-card.dragging { transition: none; }
.swipe-card img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.swipe-card .shade { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(42,11,69,.92)); }
.swipe-card .info { position: absolute; left: 18px; right: 18px; bottom: 18px; color: #fff; }
.swipe-card .info h2 { font-size: 26px; color: #fff; }
.swipe-card .info .badge { background: var(--accent); color: #fff; }
.swipe-card .stamp { position: absolute; top: 28px; padding: 6px 14px; border: 3px solid; border-radius: 8px; font-weight: 800; font-size: 22px; letter-spacing: 1px; opacity: 0; transform: rotate(-12deg); background: rgba(255,255,255,.85); }
.swipe-card .stamp.yes { left: 22px; color: var(--brand); }
.swipe-card .stamp.no { right: 22px; color: var(--danger); transform: rotate(12deg); }
.swipe-card.behind { transform: scale(.95) translateY(12px); filter: brightness(.8); }
.swipe-actions { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 18px; }
.round { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); box-shadow: var(--shadow-lg); color: var(--brand); }
.round svg { width: 26px; height: 26px; }
.round.no { color: var(--muted); }
.round.yes { background: var(--accent); color: #fff; width: 68px; height: 68px; }
.round.gift { color: var(--accent); }
.empty { text-align: center; padding: 48px 12px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--surface-3); margin-bottom: 10px; }
.empty h3 { margin-bottom: 6px; }

/* ---------- chats list */
.search { position: relative; margin-bottom: 8px; }
.search input { padding-left: 40px; }
.search svg { position: absolute; left: 12px; top: 14px; width: 20px; height: 20px; color: var(--muted); }
.chat-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; background: var(--surface-2); flex: none; }
.avatar.sm { width: 40px; height: 40px; }
.av-wrap { position: relative; flex: none; }
.av-wrap .dot { position: absolute; right: 1px; bottom: 1px; border: 2px solid var(--surface); box-shadow: none; width: 12px; height: 12px; }
.chat-row .mid { flex: 1; min-width: 0; }
.chat-row .mid b { display: block; color: var(--heading); }
.chat-row .prev { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row time { font-size: 12px; color: var(--muted); align-self: flex-start; margin-top: 4px; }

/* ---------- chat thread */
.thread { display: flex; flex-direction: column; height: 100dvh; }
.thread-head { display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 10px 10px; background: var(--brand-dark); color: #fff; }
.thread-head .icon-btn { background: rgba(255,255,255,.12); color: #fff; }
.thread-head .who { flex: 1; min-width: 0; }
.thread-head .who b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thread-head .who .muted { color: rgba(255,255,255,.75); }
.thread-head .av-wrap .dot { border-color: var(--brand-dark); }
.thread-body { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); }
.day { align-self: center; font-size: 12px; color: var(--muted); background: var(--surface); padding: 4px 10px; border-radius: 8px; margin: 10px 0 6px; box-shadow: var(--shadow); font-weight: 600; }
.bubble { max-width: 78%; padding: 7px 10px 6px; border-radius: 10px; position: relative; word-wrap: break-word; white-space: pre-wrap; animation: pop .18s ease; box-shadow: 0 1px 1.5px rgba(42,11,69,.12); }
.bubble.out { align-self: flex-end; background: var(--bubble-out); border-top-right-radius: 3px; }
.bubble.in { align-self: flex-start; background: var(--bubble-in); border-top-left-radius: 3px; }
.bubble .meta { float: right; margin: 6px 0 -2px 10px; font-size: 11px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.bubble .meta svg { width: 15px; height: 15px; color: var(--brand); }
.bubble.gift { text-align: center; padding: 14px 18px 8px; white-space: normal; background: linear-gradient(160deg, #fff, var(--accent-tint)); border: 1.5px solid #f6b8be; }
.bubble.gift .emo { font-size: 42px; line-height: 1; }
.bubble.gift .gname { font-weight: 800; color: var(--accent); margin-top: 6px; }
.bubble.gift .meta { float: none; justify-content: center; margin: 6px 0 0; }
.typing { align-self: flex-start; background: var(--bubble-in); padding: 10px 14px; border-radius: 10px; display: flex; gap: 4px; }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 60%, 100% { opacity: .3 } 30% { opacity: 1 } }
@keyframes pop { from { transform: scale(.96); opacity: 0 } }
.composer { display: flex; align-items: flex-end; gap: 8px; padding: 8px 10px calc(8px + var(--safe-b)); background: var(--surface-2); }
.composer .box { flex: 1; display: flex; align-items: center; background: var(--surface); border-radius: 22px; padding: 0 6px 0 14px; min-height: 44px; box-shadow: var(--shadow); }
.composer textarea { flex: 1; border: 0; background: transparent; outline: none; resize: none; padding: 11px 0; max-height: 120px; height: 44px; }
.composer .send { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; flex: none; }
.composer .send svg { width: 20px; height: 20px; }
.composer .lock { color: var(--accent); display: grid; place-items: center; width: 32px; }
.composer .lock svg { width: 18px; height: 18px; }
.composer .attach { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); border-radius: 50%; flex: none; }
.composer .attach:hover { color: var(--brand); }
.composer .attach svg { width: 21px; height: 21px; }
.composer .send:disabled { opacity: .55; }
.composer .emo-btn { margin-left: -8px; margin-right: 2px; }
.composer .emo-btn.on { color: var(--brand); }

.bubble.jumbo { background: transparent; box-shadow: none; font-size: 40px; line-height: 1.15; padding: 2px 4px; }
.bubble.jumbo .meta { font-size: 11px; display: flex; float: none; justify-content: flex-end; margin: 2px 0 0; background: var(--surface); border-radius: 8px; padding: 1px 6px; width: max-content; margin-left: auto; }

/* emoji picker */
.emoji-panel { background: var(--surface); border-top: 1px solid var(--line); display: flex; flex-direction: column; height: 260px; animation: up .18s ease; }
.emo-tabs { display: flex; gap: 2px; padding: 6px 8px 0; border-bottom: 1px solid var(--line); flex: none; overflow-x: auto; }
.emo-tabs button { font-size: 20px; line-height: 1; padding: 6px 10px 8px; border-bottom: 2.5px solid transparent; opacity: .6; flex: none; }
.emo-tabs button[aria-selected="true"] { border-color: var(--brand); opacity: 1; }
.emo-grid { flex: 1; overflow-y: auto; padding: 6px 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); align-content: start; }
.emo-grid button { font-size: 26px; line-height: 1; height: 44px; border-radius: 10px; }
.emo-grid button:hover, .emo-grid button:focus-visible { background: var(--surface-2); }

/* photo messages */
.bubble.img { padding: 4px 4px 5px; white-space: normal; }
.bubble.img .ph { display: block; padding: 0; border: 0; background: var(--surface-3); border-radius: 7px; overflow: hidden; cursor: zoom-in; }
.bubble.img img { display: block; width: 240px; max-width: 100%; max-height: 320px; min-height: 120px; object-fit: cover; }
.bubble.img .cap { padding: 6px 6px 0; white-space: pre-wrap; }
.bubble.img .meta { margin-right: 4px; }
.bubble.img.broken .ph { cursor: default; }
.bubble.img.broken img { visibility: hidden; }
.attach-prev { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border-top: 1px solid var(--line); }
.attach-prev img { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; flex: none; }
.attach-prev.busy { opacity: .6; pointer-events: none; }
.attach-prev.busy .grow::after { content: ' Sending…'; }
.photo-view { position: relative; max-width: 100%; max-height: 100%; display: grid; place-items: center; }
.photo-view img { max-width: min(92vw, 900px); max-height: 86dvh; border-radius: 10px; box-shadow: var(--shadow-lg); }
.photo-view .icon-btn { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.55); color: #fff; }

/* ---------- wallet */
.balance { padding: 22px; border-radius: 16px; color: #fff; margin-bottom: 18px; box-shadow: var(--shadow-lg);
  background: radial-gradient(120% 120% at 100% 0%, rgba(255,255,255,.18), transparent 55%), linear-gradient(135deg, var(--brand), var(--brand-dark)); }
.balance .num { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.balance .muted { color: rgba(255,255,255,.8); }
.bundles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0 22px; }
.bundle { padding: 16px 8px 14px; border-radius: 12px; background: var(--surface); text-align: center; position: relative; box-shadow: var(--shadow); border: 1.5px solid transparent; }
.bundle:hover { border-color: var(--brand); }
.bundle b { display: block; font-size: 22px; color: var(--heading); }
.bundle .price { margin-top: 8px; font-weight: 800; color: var(--brand); }
.bundle .tag { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); font-size: 10px; font-weight: 800; background: var(--accent); color: #fff; padding: 2px 8px; border-radius: 99px; white-space: nowrap; text-transform: uppercase; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin: 22px 0 10px; }
.plan { display: flex; align-items: center; gap: 12px; }
.plan .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); flex: none; }
.plan .ic svg { width: 22px; height: 22px; }
.plan .grow { flex: 1; min-width: 0; }
.plan b { color: var(--heading); }
.tx-amt { font-weight: 800; white-space: nowrap; }
.tx-amt.pos { color: var(--ok); } .tx-amt.neg { color: var(--danger); }

/* ---------- profile */
.me-head { display: flex; gap: 16px; align-items: center; margin-bottom: 18px; }
.me-head img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; border: 3px solid var(--brand); }
.setting { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; font-weight: 600; }
.setting > svg:first-child { color: var(--brand); width: 22px; height: 22px; }
.setting:last-child { border-bottom: 0; }
.setting .grow { flex: 1; }
.setting svg.chev { width: 18px; height: 18px; color: var(--muted); }

/* ---------- nav */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: flex; background: var(--surface); box-shadow: 0 -2px 12px rgba(42,11,69,.08); z-index: 20; }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 700; position: relative; }
.nav a svg { width: 24px; height: 24px; }
.nav a.on { color: var(--brand); }
.nav a.on::before { content: ''; position: absolute; top: 0; width: 32px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

/* ---------- modal / sheet */
.overlay { position: fixed; inset: 0; background: rgba(42,11,69,.45); backdrop-filter: blur(3px); z-index: 50; display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease; }
.overlay.center { align-items: center; padding: 20px; }
.sheet { width: 100%; max-width: 480px; background: var(--surface); border-radius: 20px 20px 0 0; padding: 10px 18px calc(22px + var(--safe-b)); animation: up .25s ease; max-height: 90dvh; overflow-y: auto; }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--surface-3); margin: 0 auto 16px; }
.modal { width: 100%; max-width: 400px; background: var(--surface); border-radius: 16px; padding: 26px 22px 20px; text-align: center; animation: zoom .2s ease; box-shadow: var(--shadow-lg); border-top: 5px solid var(--brand); }
.modal .ic { width: 64px; height: 64px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }
.modal .ic svg { width: 30px; height: 30px; }
.modal h2 { margin-bottom: 8px; }
.modal .price { font-size: 36px; font-weight: 800; color: var(--heading); margin: 14px 0 2px; }
.modal ul { text-align: left; padding: 0; list-style: none; margin: 16px 0 20px; }
.modal li { display: flex; gap: 10px; padding: 6px 0; font-weight: 600; }
.modal li svg { width: 18px; height: 18px; color: var(--brand); flex: none; margin-top: 2px; }
.modal .btn + .btn { margin-top: 8px; }
.gift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
.gift { padding: 16px 10px; border-radius: 12px; background: var(--surface-2); border: 1.5px solid transparent; text-align: center; }
.gift:hover { border-color: var(--accent); }
.gift:active { transform: scale(.97); }
.gift .emo { font-size: 38px; }
.gift b { display: block; margin-top: 6px; color: var(--heading); }
.gift .cost { color: var(--accent); font-weight: 800; font-size: 13px; }
.gift.cant { opacity: .45; }
@keyframes fade { from { opacity: 0 } }
@keyframes up { from { transform: translateY(100%) } }
@keyframes zoom { from { transform: scale(.94); opacity: 0 } }

.kyc-step { display: flex; align-items: center; gap: 12px; padding: 10px 0; text-align: left; font-weight: 600; }
.kyc-step .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 800; font-size: 13px; flex: none; color: var(--heading); }
.kyc-step .n svg { width: 16px; height: 16px; }
.kyc-step.done .n { background: var(--brand); color: var(--on-brand); }
.kyc-step.active .n { box-shadow: 0 0 0 3px var(--brand-tint); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--surface-3); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* video call (stays dark, like a camera UI) */
.call { position: fixed; inset: 0; z-index: 60; background: var(--brand-dark); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.call h2 { color: #fff; }
.call .muted { color: rgba(255,255,255,.75); }
.call video { position: absolute; right: 16px; top: calc(16px + var(--safe-t)); width: 110px; height: 150px; object-fit: cover; border-radius: 12px; border: 2px solid #fff; background: #000; transform: scaleX(-1); }
.call .remote { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; animation: ring 1.6s infinite; }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.5) } 100% { box-shadow: 0 0 0 30px rgba(255,255,255,0) } }
.call .end { position: absolute; bottom: calc(40px + var(--safe-b)); width: 64px; height: 64px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; color: #fff; }
.call .end svg { width: 28px; height: 28px; }

.toast { position: fixed; left: 50%; top: calc(14px + var(--safe-t)); transform: translateX(-50%); z-index: 80; background: var(--brand-dark); color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; font-weight: 600; max-width: calc(100% - 32px); animation: zoom .2s ease; box-shadow: var(--shadow-lg); }
.toast.err { background: var(--danger); }
.demo-pill { position: fixed; top: calc(4px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 30; font-size: 10px; font-weight: 800; letter-spacing: .6px; padding: 3px 8px; border-radius: 99px; background: var(--accent); color: #fff; pointer-events: none; opacity: .85; }

.splash { min-height: 100dvh; display: grid; place-items: center; }

@media (min-width: 520px) {
  body { background: #ebe6f1; }
  #app { box-shadow: 0 0 40px rgba(42,11,69,.08); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
