/* ============ SoulSathi Styles ============ */
:root {
  --primary: #c2185b;
  --primary-dark: #8e0e3d;
  --primary-light: #fce4ec;
  --accent: #ff9800;
  --gold: #f5b301;
  --green: #2e7d32;
  --red: #c62828;
  --bg: #faf7f8;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #757575;
  --border: #eee0e6;
  --shadow: 0 2px 10px rgba(140, 20, 70, .08);
  --radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: 'Segoe UI', system-ui, sans-serif; background: #e9dfe4; color: var(--text); }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

#app { max-width: 430px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; box-shadow: 0 0 30px rgba(0,0,0,.15); }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: linear-gradient(135deg, var(--primary-dark), var(--primary)); color: #fff; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.topbar .logo { font-size: 20px; font-weight: 700; letter-spacing: .3px; }
.topbar .logo span { color: var(--gold); }
.topbar .scope-tag { font-size: 10px; background: rgba(255,255,255,.22); border-radius: 8px; padding: 1px 8px; display: inline-block; font-weight: 700; margin-top: 2px; letter-spacing: .3px; }
.topbar-actions { display: flex; gap: 6px; align-items: center; }
.icon-btn { background: rgba(255,255,255,.15); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 17px; position: relative; }
.badge-dot { position: absolute; top: 2px; right: 2px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; border-radius: 10px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 3px; }

/* ---------- Bottom nav ---------- */
.bottomnav { position: sticky; bottom: 0; z-index: 50; background: #fff; border-top: 1px solid var(--border); display: flex; }
.bottomnav button { flex: 1; background: none; border: none; padding: 8px 0 10px; font-size: 11px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 2px; position: relative; }
.bottomnav button .nav-ico { font-size: 20px; }
.bottomnav button.active { color: var(--primary); font-weight: 700; }
.bottomnav .nav-badge { position: absolute; top: 3px; right: calc(50% - 22px); background: var(--red); color: #fff; font-size: 10px; border-radius: 9px; min-width: 15px; height: 15px; line-height: 15px; }

/* ---------- Screens ---------- */
.screen { display: none; padding-bottom: 70px; min-height: calc(100vh - 60px); }
.screen.active { display: block; }
.section { padding: 14px 16px 4px; }
.section h3 { font-size: 16px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.section h3 .link { font-size: 12px; color: var(--primary); font-weight: 600; cursor: pointer; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.profile-card { display: flex; gap: 12px; padding: 12px; margin-bottom: 12px; cursor: pointer; }
.avatar { width: 74px; height: 74px; min-width: 74px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 700; color: #fff; position: relative; }
.avatar.blurred::after { content: "🔒"; position: absolute; inset: 0; background: rgba(255,255,255,.55); backdrop-filter: blur(6px); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.avatar .online-dot { position: absolute; bottom: 4px; right: 4px; width: 11px; height: 11px; background: #4caf50; border: 2px solid #fff; border-radius: 50%; }
.avatar-sm { width: 46px; height: 46px; min-width: 46px; border-radius: 50%; font-size: 17px; }
.pc-info { flex: 1; min-width: 0; }
.pc-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.vbadge { color: #1976d2; font-size: 13px; }
.tag-premium { background: linear-gradient(90deg, var(--gold), #ffd54f); color: #6d4c00; font-size: 9px; font-weight: 800; padding: 1px 6px; border-radius: 8px; }
.tag-new { background: var(--green); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 8px; }
.pc-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.match-score { margin-left: auto; text-align: center; min-width: 52px; }
.score-ring { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; margin: 0 auto; }
.score-lbl { font-size: 9px; color: var(--muted); margin-top: 2px; display: block; }
.pc-actions { display: flex; gap: 8px; margin-top: 8px; }
.chip-btn { border: 1px solid var(--border); background: #fff; border-radius: 20px; padding: 5px 12px; font-size: 12px; font-weight: 600; color: var(--text); }
.chip-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip-btn.done { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.chip-btn:disabled { opacity: .55; cursor: default; }

/* Carousel */
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 4px 16px 12px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.mini-card { min-width: 120px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 12px 8px; text-align: center; cursor: pointer; }
.mini-card .avatar { margin: 0 auto 8px; width: 60px; height: 60px; min-width: 60px; border-radius: 50%; font-size: 20px; }
.mini-card .mc-name { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-card .mc-sub { font-size: 10px; color: var(--muted); }
.mini-card .mc-score { font-size: 11px; color: var(--green); font-weight: 700; margin-top: 3px; }

/* Banners */
.banner { margin: 10px 16px; border-radius: var(--radius); padding: 14px; color: #fff; display: flex; justify-content: space-between; align-items: center; gap: 10px; cursor: pointer; }
.banner.premium { background: linear-gradient(120deg, #7b1fa2, var(--primary)); }
.banner.complete { background: linear-gradient(120deg, #00695c, #26a69a); }
.banner b { font-size: 14px; }
.banner p { font-size: 11.5px; opacity: .9; margin-top: 2px; }
.banner .cta { background: #fff; color: var(--primary); border: none; border-radius: 18px; padding: 7px 14px; font-size: 12px; font-weight: 800; white-space: nowrap; }

/* Stats strip */
.stats-strip { display: flex; gap: 8px; padding: 12px 16px 2px; }
.stat-box { flex: 1; background: #fff; border-radius: 12px; box-shadow: var(--shadow); padding: 10px 6px; text-align: center; cursor: pointer; }
.stat-box b { display: block; font-size: 17px; color: var(--primary); }
.stat-box span { font-size: 10px; color: var(--muted); }

/* ---------- Search ---------- */
.filter-panel { padding: 12px 16px; }
.frow { display: flex; gap: 10px; margin-bottom: 10px; }
.fcol { flex: 1; }
.fcol label { font-size: 11px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 4px; }
.fcol select, .fcol input { width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.btn-full { width: 100%; background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 700; }
.btn-outline { width: 100%; background: #fff; color: var(--primary); border: 1.5px solid var(--primary); border-radius: 12px; padding: 12px; font-size: 14px; font-weight: 700; }
.result-count { padding: 10px 16px 0; font-size: 13px; color: var(--muted); }

/* ---------- Tabs ---------- */
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 60px; z-index: 40; }
.tabs button { flex: 1; background: none; border: none; padding: 12px 4px; font-size: 13px; font-weight: 600; color: var(--muted); border-bottom: 2.5px solid transparent; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Chat ---------- */
.chat-list-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: #fff; cursor: pointer; align-items: center; }
.cli-info { flex: 1; min-width: 0; }
.cli-name { font-weight: 700; font-size: 14px; }
.cli-last { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 230px; }
.chat-screen { display: flex; flex-direction: column; height: calc(100vh - 60px); }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #fff; border-bottom: 1px solid var(--border); }
.chat-body { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--primary-light); }
.msg { max-width: 78%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.4; }
.msg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.msg.them { align-self: flex-start; background: #fff; border-bottom-left-radius: 4px; box-shadow: var(--shadow); }
.msg .mt { display: block; font-size: 9.5px; opacity: .65; margin-top: 3px; text-align: right; }
.icebreaker-row { display: flex; gap: 8px; overflow-x: auto; padding: 8px 12px; background: #fff; scrollbar-width: none; }
.icebreaker-row button { white-space: nowrap; border: 1px solid var(--primary); color: var(--primary); background: #fff; border-radius: 16px; padding: 6px 12px; font-size: 12px; }
.chat-input { display: flex; gap: 8px; padding: 10px 12px; background: #fff; border-top: 1px solid var(--border); }
.chat-input input { flex: 1; padding: 11px 14px; border: 1px solid var(--border); border-radius: 22px; }
.chat-input button { background: var(--primary); color: #fff; border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 17px; }

/* ---------- Profile detail ---------- */
.detail-hero { background: linear-gradient(160deg, var(--primary-dark), var(--primary)); color: #fff; padding: 20px 16px 24px; text-align: center; position: relative; }
.detail-hero .avatar { width: 96px; height: 96px; min-width: 96px; margin: 0 auto 10px; border-radius: 50%; font-size: 34px; border: 3px solid rgba(255,255,255,.6); }
.detail-hero h2 { font-size: 20px; display: flex; align-items: center; justify-content: center; gap: 6px; }
.detail-hero .dh-sub { font-size: 13px; opacity: .9; margin-top: 4px; }
.back-btn { position: absolute; left: 12px; top: 12px; background: rgba(255,255,255,.2); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 17px; }
.detail-actions { display: flex; gap: 10px; padding: 14px 16px; }
.detail-actions button { flex: 1; padding: 12px 4px; border-radius: 12px; font-size: 13px; font-weight: 700; border: none; }
.da-interest { background: var(--primary); color: #fff; }
.da-shortlist { background: #fff; color: var(--primary); border: 1.5px solid var(--primary) !important; }
.da-kundli { background: linear-gradient(90deg, #ff6f00, var(--gold)); color: #fff; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px 12px; }
.info-item { background: #fff; border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; }
.info-item label { font-size: 10px; color: var(--muted); font-weight: 700; text-transform: uppercase; display: block; }
.info-item span { font-size: 13.5px; font-weight: 600; }
.about-box { margin: 0 16px 12px; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; font-size: 13.5px; line-height: 1.6; }
.hobby-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px 14px; }
.hobby-chips span { background: var(--primary-light); color: var(--primary); font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 16px; }
.ai-insight { margin: 0 16px 14px; background: linear-gradient(135deg, #ede7f6, #e3f2fd); border-radius: var(--radius); padding: 14px; font-size: 13px; line-height: 1.6; border-left: 4px solid #5e35b1; }
.ai-insight b { color: #4527a0; }
.danger-row { display: flex; gap: 10px; padding: 0 16px 20px; }
.danger-row button { flex: 1; background: #fff; border: 1px solid #e0c4cf; color: var(--red); border-radius: 10px; padding: 10px; font-size: 12px; font-weight: 600; }

/* ---------- Forms / Onboarding ---------- */
.onboard { padding: 26px 22px; }
.onboard .brand { text-align: center; margin-bottom: 8px; }
.onboard .brand .big { font-size: 34px; }
.onboard .brand h1 { font-size: 26px; color: var(--primary); }
.onboard .brand h1 span { color: var(--gold); }
.onboard .brand p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.wizard-steps { display: flex; gap: 6px; margin: 18px 0; }
.wizard-steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.wizard-steps i.on { background: var(--primary); }
.form-group { margin-bottom: 13px; }
.form-group label { font-size: 12px; font-weight: 700; color: var(--muted); display: block; margin-bottom: 5px; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.form-group textarea { min-height: 80px; resize: vertical; }
.seg { display: flex; gap: 8px; }
.seg button { flex: 1; padding: 11px 4px; border: 1.5px solid var(--border); background: #fff; border-radius: 11px; font-size: 13px; font-weight: 600; }
.seg button.on { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.demo-link { text-align: center; margin-top: 14px; font-size: 13px; color: var(--muted); }
.demo-link button { background: none; border: none; color: var(--primary); font-weight: 700; font-size: 13px; text-decoration: underline; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(30,5,18,.55); z-index: 100; display: none; align-items: flex-end; justify-content: center; }
.modal-wrap.open { display: flex; }
.modal { background: #fff; width: 100%; max-width: 430px; border-radius: 20px 20px 0 0; max-height: 88vh; overflow-y: auto; padding: 20px 18px 26px; animation: slideUp .25s ease; }
@keyframes slideUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.modal h3 .x { background: var(--border); border: none; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; }

/* Kundli */
.guna-total { text-align: center; margin-bottom: 14px; }
.guna-total .gt-num { font-size: 42px; font-weight: 800; color: var(--primary); }
.guna-total .gt-verdict { font-size: 14px; font-weight: 700; margin-top: 2px; }
.guna-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 4px; border-bottom: 1px dashed var(--border); font-size: 13px; }
.guna-row .gr-bar { flex: 1; height: 6px; background: var(--border); border-radius: 6px; margin: 0 12px; overflow: hidden; }
.guna-row .gr-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--primary)); }
.guna-note { font-size: 11px; color: var(--muted); margin-top: 12px; text-align: center; }

/* Plans */
.plan-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; position: relative; }
.plan-card.popular { border-color: var(--gold); background: #fffdf4; }
.plan-card .pop-tag { position: absolute; top: -10px; right: 14px; background: var(--gold); color: #6d4c00; font-size: 10px; font-weight: 800; padding: 2px 10px; border-radius: 10px; }
.plan-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.plan-head b { font-size: 17px; }
.plan-price { font-size: 18px; font-weight: 800; color: var(--primary); }
.plan-price small { font-size: 11px; color: var(--muted); font-weight: 500; }
.plan-card ul { list-style: none; margin-bottom: 12px; }
.plan-card li { font-size: 12.5px; padding: 3px 0; color: #444; }
.plan-card li::before { content: "✓ "; color: var(--green); font-weight: 700; }

/* Notifications drawer */
.notif-item { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; background: #fff; }
.notif-item .n-ico { font-size: 20px; }
.notif-item .n-time { font-size: 10.5px; color: var(--muted); margin-top: 2px; }

/* Settings */
.set-row { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 14px 16px; border-bottom: 1px solid var(--border); font-size: 14px; cursor: pointer; }
.set-row .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.toggle { width: 44px; height: 24px; border-radius: 24px; background: #ccc; border: none; position: relative; transition: .2s; }
.toggle.on { background: var(--primary); }
.toggle::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; }
.toggle.on::after { left: 22px; }

/* Completeness */
.meter { background: var(--border); height: 8px; border-radius: 8px; overflow: hidden; margin: 6px 0; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--green)); }

/* Story cards */
.story-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; margin: 0 16px 12px; }
.story-card b { color: var(--primary); }
.story-card p { font-size: 13px; color: #555; margin-top: 6px; line-height: 1.55; }
.story-card .sc-meta { font-size: 11px; color: var(--muted); margin-top: 6px; }

.empty-state { text-align: center; padding: 50px 30px; color: var(--muted); }
.empty-state .es-ico { font-size: 44px; margin-bottom: 10px; }
.empty-state p { font-size: 13px; line-height: 1.6; }

/* Toast */
#toast { position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%) translateY(20px); background: #333; color: #fff; padding: 11px 20px; border-radius: 24px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 200; max-width: 90%; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
