:root {
  --bg: #2a1218;
  --bg-2: #3a1822;
  --card: #4a1f2c;
  --card-2: #5a2836;
  --line: rgba(255, 210, 220, 0.16);
  --text: #fff4f7;
  --muted: #e7b8c4;
  --rose: #ff6b9d;
  --rose-2: #ff9bb8;
  --violet: #f2a0b6;
  --gold: #e8c48a;
  --ok: #5ee0b5;
  --danger: #ff6b6b;
  --shadow: 0 18px 50px rgba(80, 20, 40, 0.4);
  --radius: 22px;
  --nav-h: 76px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bot: env(safe-area-inset-bottom, 0px);
  --font: "Outfit", system-ui, sans-serif;
  --serif: "Fraunces", Georgia, serif;
}
html[data-theme="light"] {
  --bg: #fff0f4;
  --bg-2: #ffd6e2;
  --card: #ffffff;
  --card-2: #ffe8ef;
  --line: rgba(180, 60, 90, 0.14);
  --text: #4a1424;
  --muted: #a05d72;
  --shadow: 0 18px 40px rgba(180, 60, 90, 0.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { overflow: hidden; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
img { max-width: 100%; display: block; }

.app { height: 100%; height: 100dvh; display: flex; flex-direction: column; position: relative; }
.screen { display: none; flex: 1; min-height: 0; flex-direction: column; }
.screen.active { display: flex; }
#screen-splash { display: flex; }
body.app-booted #screen-splash:not(.active) { display: none; }

.splash {
  align-items: center; justify-content: center; text-align: center;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255, 107, 157, 0.35), transparent 55%),
    radial-gradient(800px 500px at 80% 110%, rgba(255, 180, 200, 0.18), transparent 50%),
    var(--bg);
  padding: calc(24px + var(--safe-top)) 28px calc(28px + var(--safe-bot));
}
.logo-img {
  width: 196px; height: 196px; border-radius: 36px; margin: 0 auto 22px;
  display: block; object-fit: cover;
  box-shadow: 0 24px 50px rgba(80, 10, 36, 0.45);
}
.sr-only { position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0); }
.splash h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(34px, 9vw, 46px); margin: 0 0 8px; letter-spacing: -0.03em; line-height: 1.05; }
.splash p { color: var(--muted); margin: 0 0 36px; font-size: 16px; line-height: 1.5; }
.brand-pill { display: inline-flex; gap: 8px; align-items: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 22px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 20px; border-radius: 16px; font-weight: 600;
  transition: transform .15s ease, filter .15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(90deg, #ff5a8a, #ff8fb3); color: #fff; width: 100%; box-shadow: 0 10px 24px rgba(255, 90, 138, 0.32); }
.btn-ghost { width: 100%; background: rgba(127,127,127,0.08); border: 1px solid var(--line); }
.btn-gold { background: linear-gradient(90deg, #c9923d, var(--gold)); color: #2a1608; width: 100%; font-weight: 700; }
.btn-sm { min-height: 40px; padding: 0 14px; border-radius: 12px; font-size: 14px; width: auto; }
.btn-danger { background: rgba(255,107,107,.12); color: var(--danger); width: 100%; }
.row-btns { display: flex; gap: 10px; }
.row-btns .btn { flex: 1; }

.wrap { padding: calc(16px + var(--safe-top)) 18px 18px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.topbar h2 { margin: 0; font-family: var(--serif); font-size: 26px; font-weight: 560; }
.icon-btn { width: 42px; height: 42px; border-radius: 14px; background: rgba(127,127,127,0.08); border: 1px solid var(--line); display: grid; place-items: center; font-size: 18px; flex: none; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.profile-hero {
  text-align: center; padding: 22px 16px 18px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255,90,138,.22), var(--card));
  border: 1px solid var(--line); margin-bottom: 8px;
}
.profile-hero .avatar { width: 96px; height: 96px; border-radius: 32px; margin: 0; font-size: 32px; }
.avatar-wrap { position: relative; width: 96px; height: 96px; margin: 0 auto 12px; }
.verify-pip {
  position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px;
  border-radius: 50%; background: #2ecc8a; color: #fff; display: grid; place-items: center;
  font-size: 14px; font-weight: 700; border: 3px solid var(--card);
}
.verify-pip[hidden] { display: none !important; }
#verify-now-wrap { margin: 12px auto 8px; max-width: 240px; }
.offscreen-file { position: fixed; left: -200vw; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.tight-toggles .toggle { padding: 10px 0; }
.profile-hero h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 26px; }
.profile-hero #me-bio { font-size: 14px; margin: 8px 0 0; }
.section-label {
  margin: 18px 4px 8px; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 600;
}
.muted { color: var(--muted); }
.tiny { font-size: 12px; letter-spacing: 0.04em; }
.center { text-align: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

label.field { display: block; margin: 0 0 12px; }
label.field span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input[type="text"], input[type="number"], input[type="search"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"], input[type="time"], textarea, select {
  width: 100%; background: color-mix(in srgb, var(--bg) 80%, black 10%); border: 1px solid var(--line); border-radius: 14px;
  padding: 13px 14px; outline: none;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: rgba(255, 77, 115, 0.55); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(127,127,127,0.06); font-size: 13px;
}
.chip.on { background: rgba(255, 77, 115, 0.18); border-color: rgba(255, 77, 115, 0.5); }

.slides { flex: 1; display: flex; overflow: hidden; }
.slide { min-width: 100%; padding: 12px 6px 20px; display: flex; flex-direction: column; justify-content: flex-end; }
.slide-art {
  flex: 1; border-radius: 28px; margin-bottom: 22px; min-height: 180px;
  display: grid; place-items: center; font-size: 64px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255,77,115,.35), transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(155,109,255,.28), transparent 42%),
    var(--card);
  border: 1px solid var(--line);
}
.slide h3 { font-family: var(--serif); font-size: 28px; margin: 0 0 8px; }
.dots { display: flex; gap: 6px; justify-content: center; margin: 8px 0 16px; }
.dot { width: 7px; height: 7px; border-radius: 99px; background: #5a3540; }
.dot.on { width: 18px; background: var(--rose-2); }

.main { position: relative; padding-bottom: calc(var(--nav-h) + var(--safe-bot)); }
.tab { display: none; flex: 1; min-height: 0; overflow: auto; flex-direction: column; }
.tab.on { display: flex; }

.nav {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: calc(var(--nav-h) + var(--safe-bot));
  padding: 6px 6px var(--safe-bot);
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 88%, black 8%); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.nav button { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 10px; font-weight: 600; }
.nav button.on { color: var(--text); }
.nav .n-ic { font-size: 18px; }

.deck-wrap { flex: 1; position: relative; margin: 6px 4px 10px; min-height: 300px; }
.deck { position: absolute; inset: 0; }
.person-card {
  position: absolute; inset: 0; border-radius: 28px; overflow: hidden;
  background: var(--card); box-shadow: var(--shadow); touch-action: none;
  border: 1px solid var(--line);
}
.person-card .photo {
  height: 58%; background-size: cover; background-position: center;
  display: flex; align-items: flex-end; padding: 16px; position: relative;
}
.person-card .meta { padding: 12px 16px 14px; overflow: auto; }
.person-card h3 { margin: 0 0 4px; font-size: 24px; font-family: var(--serif); }
.badge-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.badge { font-size: 11px; padding: 4px 8px; border-radius: 999px; background: rgba(127,127,127,0.12); }
.badge.date { background: rgba(255,77,115,.22); }
.badge.friends { background: rgba(155,109,255,.22); }
.badge.family { background: rgba(232,184,109,.18); color: #c9923d; }
.badge.gold { background: rgba(232,184,109,.25); color: #c9923d; }
.badge.ok { background: rgba(94,224,181,.18); }
.stamp {
  position: absolute; top: 24px; font-weight: 800; letter-spacing: 0.12em;
  padding: 6px 12px; border: 3px solid; border-radius: 10px; opacity: 0; transform: rotate(-12deg);
}
.stamp.like { left: 18px; color: var(--ok); border-color: var(--ok); }
.stamp.nope { right: 18px; color: var(--danger); border-color: var(--danger); }
.actions { display: flex; justify-content: center; gap: 14px; padding: 4px 0 8px; }
.fab {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 20px;
  background: var(--card-2); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.fab.yes { color: var(--ok); }
.fab.no { color: var(--danger); }
.fab.star { color: var(--gold); }

.empty {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 24px; color: var(--muted);
}

.list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 16px; }
.item {
  display: flex; gap: 12px; align-items: center; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; text-align: left; width: 100%;
}
.avatar {
  width: 50px; height: 50px; border-radius: 16px; flex: none;
  display: grid; place-items: center; font-weight: 700;
  background-size: cover; background-position: center;
  background-color: #3a2030;
}
.item .grow { flex: 1; min-width: 0; }
.item h4 { margin: 0 0 2px; font-size: 16px; }
.item p { margin: 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.thread { display: flex; flex-direction: column; height: 100%; }
.msgs { flex: 1; overflow: auto; padding: 10px 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble {
  max-width: 78%; padding: 10px 12px; border-radius: 16px; line-height: 1.35; font-size: 15px;
}
.bubble.me { margin-left: auto; background: linear-gradient(180deg, #ff4d73, #d9365e); color: #fff; }
.bubble.them { margin-right: auto; background: var(--card-2); border: 1px solid var(--line); }
.bubble .when { display: block; font-size: 10px; opacity: 0.75; margin-top: 4px; }
.bubble img, .bubble video { border-radius: 12px; margin-top: 4px; max-height: 220px; }
.composer { display: flex; gap: 6px; padding: 8px 10px calc(10px + var(--safe-bot)); border-top: 1px solid var(--line); background: var(--bg); align-items: center; }
.composer input { flex: 1; }
.composer .send { min-width: 44px; height: 44px; border-radius: 14px; background: var(--rose); color: #fff; }
.composer .tool { width: 40px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }

.overlay {
  position: absolute; inset: 0; background: var(--bg); z-index: 20;
  display: none; flex-direction: column;
}
.overlay.show { display: flex; }

.install-banner {
  display: none; margin: 0 0 12px; padding: 14px 16px; border-radius: 18px;
  background: linear-gradient(135deg, #ff5a8a, #ff8fb3);
  color: #fff; align-items: center; gap: 12px;
  box-shadow: 0 10px 24px rgba(255, 90, 138, 0.28);
}
.install-banner.show { display: flex; }
.install-banner p { margin: 0; flex: 1; font-size: 14px; font-weight: 600; line-height: 1.35; color: #fff; }
.install-banner .btn { background: #fff; color: #c2185b; width: auto; min-height: 40px; font-weight: 700; }
.install-how { display: grid; gap: 10px; }
.install-step { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.install-step b { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #ff5a8a; color: #fff; flex: none; }

.code-box {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.14em; font-size: 20px; text-align: center;
  padding: 14px; border-radius: 16px; background: color-mix(in srgb, var(--bg) 80%, black 10%); border: 1px dashed var(--gold);
  color: #c9923d;
}
.notice {
  font-size: 12px; color: var(--muted); line-height: 1.45; padding: 10px 12px;
  border-radius: 12px; background: rgba(127,127,127,0.06); border: 1px solid var(--line);
}
#qr { display: grid; place-items: center; background: #fff; border-radius: 16px; padding: 12px; margin: 12px auto; width: fit-content; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #665; display: inline-block; margin-right: 6px; }
.status-dot.live { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

.photo-pick {
  width: 92px; height: 92px; border-radius: 28px; margin: 0 auto 14px;
  background-size: cover; background-position: center; display: grid; place-items: center;
  border: 1px solid var(--line); font-size: 28px; overflow: hidden;
}
.sheet-hint { font-size: 13px; color: var(--muted); margin-top: 8px; line-height: 1.4; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.toggle:last-child { border-bottom: 0; }
.switch {
  width: 44px; height: 26px; border-radius: 99px; background: #5a3540; position: relative; flex: none;
}
.switch.on { background: var(--rose); }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on i { left: 21px; }

.stories { display: flex; gap: 10px; overflow-x: auto; padding: 0 2px 12px; }
.story-add, .story-dot {
  width: 64px; flex: none; text-align: center; font-size: 11px; color: var(--muted);
}
.story-ring {
  width: 64px; height: 64px; border-radius: 50%; padding: 3px; margin-bottom: 4px;
  background: linear-gradient(135deg, var(--rose), var(--gold), var(--violet));
}
.story-ring span {
  display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%;
  background: var(--bg); background-size: cover; font-size: 22px;
}
.prompt { font-size: 13px; margin-top: 8px; padding: 8px 10px; border-radius: 12px; background: rgba(127,127,127,0.06); }
.prompt b { display: block; color: var(--muted); font-weight: 500; font-size: 11px; }

.call-ui { background: #0a0608; color: #fff; }
.call-ui video { width: 100%; background: #000; border-radius: 16px; }
#remote-video { height: 46%; object-fit: cover; }
#local-video { height: 22%; object-fit: cover; margin-top: 8px; }

.album { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.album img { height: 96px; width: 100%; object-fit: cover; border-radius: 10px; }

.tree-node { padding: 10px 12px; border-left: 3px solid var(--gold); margin: 8px 0; background: var(--card); border-radius: 0 12px 12px 0; }

.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid .tile {
  aspect-ratio: 1; border-radius: 14px; background: var(--card-2) center/cover no-repeat;
  border: 1px solid var(--line);
}
.photo-grid .tile.main { outline: 2px solid #ff5a8a; }
.avatar-wrap { border: 0; background: none; padding: 0; color: inherit; }
.person-photos { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 12px; }
.person-photos img { width: 72%; max-width: 280px; height: 320px; object-fit: cover; border-radius: 18px; flex: none; }

.ig-stats { display:flex; justify-content:space-around; margin:14px 0 6px; gap:6px; }
.ig-stat { background:none; border:0; color:inherit; text-align:center; }
.ig-stat b { display:block; font-size:18px; }
.ig-stat span { font-size:11px; color:var(--muted); letter-spacing:.04em; }

.nav-badge { margin-left: 4px; background:#ff5a8a; color:#fff; border-radius:999px; font-size:10px; padding:1px 5px; }
.prompt.big { font-size:15px; padding:12px; margin-top:10px; }

.place-search { display:flex; gap:8px; margin:0 0 8px; align-items:center; }
.place-search input { flex:1; min-height:44px; border-radius:14px; border:1px solid var(--line); background:var(--card); padding:0 14px; }
.place-suggest { background:var(--card); border:1px solid var(--line); border-radius:14px; margin:0 0 10px; overflow:hidden; }
.place-suggest button { display:block; width:100%; text-align:left; padding:12px 14px; border-bottom:1px solid var(--line); }
.place-suggest button:last-child { border-bottom:0; }

.pin-ai{border:1px solid rgba(255,90,138,.35);background:rgba(255,90,138,.08);margin-bottom:8px}
