/* هم‌نفس — استایل نسخه‌ی نهایی (موبایل‌محور، راست‌به‌چپ) */
:root {
  --wine: #6E1F2F; --wine2: #4A1520; --ink: #2A1A1C; --mute: #8A7570; --cream: #F6EEE6; --paper: #FFFAF4;
  --line: #E6D6C9; --gold: #E0C08A; --ok: #2F6B5B; --okbg: #DDEBE6; --warnbg: #F7E2CF; --bad: #B23A3A; --badbg: #F6D9D5;
  --r: 16px; --sh: 0 6px 24px rgba(42, 26, 28, .08);
  --serif: 'Noto Naskh Arabic', 'Vazirmatn', Tahoma, serif; --sans: 'Vazirmatn', 'IRANSans', Tahoma, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: #241417; color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.7; }
button, input, textarea, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
#app { max-width: 480px; min-height: 100vh; min-height: 100dvh; margin: 0 auto; background: var(--cream); position: relative; overflow-x: hidden; }
.page { padding: 18px 18px 110px; }
.page.nopad { padding: 0 0 90px; }
h1, h2, h3 { font-family: var(--serif); color: var(--wine); margin: 0 0 6px; line-height: 1.5; }
h1 { font-size: 28px; } h2 { font-size: 23px; } h3 { font-size: 17px; color: var(--ink); font-family: var(--sans); font-weight: 700; }
p { margin: 0 0 10px; }
.mute { color: var(--mute); font-size: 13px; }
.small { font-size: 12.5px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.sp { height: 14px; }
.hide { display: none !important; }

/* دکمه‌ها */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; border-radius: 14px; padding: 14px 16px; background: var(--wine); color: var(--paper); font-weight: 700; font-size: 16px; cursor: pointer; transition: transform .1s, opacity .2s; }
.btn:active { transform: scale(.98); }
.btn:disabled, .btn.dis { opacity: .45; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--wine); border: 1.5px solid var(--line); }
.btn.light { background: var(--paper); color: var(--wine); border: 1.5px solid var(--line); }
.btn.sm { padding: 9px 12px; font-size: 14px; border-radius: 12px; width: auto; }
.btn.danger { background: var(--bad); }
.btn.gold { background: var(--gold); color: var(--ink); }
.foot { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; padding: 12px 18px calc(14px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--cream) 70%, rgba(246, 238, 230, 0)); z-index: 20; }
.foot .row .btn { flex: 1; }
.link { background: none; border: 0; color: var(--wine); font-weight: 700; cursor: pointer; padding: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--ink); flex: none; }
.icon-btn:active { background: rgba(0, 0, 0, .06); }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* فرم */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.inp { width: 100%; border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 12px 14px; outline: none; font-size: 16px; }
.inp:focus { border-color: var(--wine); }
textarea.inp { min-height: 90px; resize: vertical; }
.inp.ltr { direction: ltr; text-align: center; letter-spacing: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1.5px solid var(--line); background: var(--paper); border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; white-space: nowrap; }
.chip.on { background: var(--wine); color: var(--paper); border-color: var(--wine); }
.chip.sm { padding: 4px 10px; font-size: 12.5px; }
.scale { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; }
.scale .chip { padding: 7px 0; text-align: center; border-radius: 10px; }
.err { background: var(--badbg); color: var(--bad); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }
.note { background: var(--warnbg); border-radius: 12px; padding: 10px 12px; font-size: 13.5px; margin: 8px 0; }
.okbox { background: var(--okbg); color: var(--ok); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin: 8px 0; }

/* کارت */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 12px; box-shadow: var(--sh); }
.card.dark { background: var(--wine2); color: var(--paper); border: 0; }
.card.dark h2, .card.dark h3 { color: var(--paper); }
.badge { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 700; background: var(--okbg); color: var(--ok); }
.badge.w { background: var(--warnbg); color: #8A5A2B; }
.badge.r { background: var(--badbg); color: var(--bad); }
.badge.g { background: #EEE4DA; color: var(--mute); }
.dot { min-width: 20px; height: 20px; border-radius: 10px; background: var(--wine); color: #fff; font-size: 11.5px; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; font-weight: 700; }
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 8px; cursor: pointer; }
.av { width: 52px; height: 52px; border-radius: 50%; background: #D9C3B0 center/cover; flex: none; display: flex; align-items: center; justify-content: center; color: var(--paper); font-weight: 700; overflow: hidden; }
.av.sm { width: 38px; height: 38px; }
.reason { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; padding: 6px 10px; border-radius: 10px; margin-bottom: 6px; }
.reason.ok { background: var(--okbg); } .reason.w { background: var(--warnbg); } .reason.r { background: var(--badbg); }

/* بالای صفحه */
.top { display: flex; align-items: center; gap: 8px; padding: 10px 10px 4px; position: sticky; top: 0; background: var(--cream); z-index: 15; }
.top .t { flex: 1; font-weight: 700; font-size: 16px; }
.prog { height: 5px; background: #EADCCF; border-radius: 3px; overflow: hidden; flex: 1; }
.prog i { display: block; height: 100%; background: var(--wine); border-radius: 3px; transition: width .3s; }

/* خوش‌آمد */
.welcome { min-height: 100vh; min-height: 100dvh; background: var(--wine2); color: var(--paper); display: flex; flex-direction: column; padding: 70px 26px 30px; }
.welcome h1 { color: var(--paper); font-size: 46px; text-align: center; margin-top: 18px; }
.welcome .tag { text-align: center; opacity: .8; }
.welcome ul { list-style: none; padding: 0; margin: auto 0 26px; }
.welcome li { padding: 6px 0; display: flex; gap: 10px; align-items: center; }
.welcome li::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; }
.logo { display: flex; justify-content: center; }

/* ناوبری پایین */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: var(--paper); border-top: 1px solid var(--line); display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.nav button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 11.5px; color: var(--mute); cursor: pointer; position: relative; padding: 4px 0; }
.nav button.on { color: var(--wine); font-weight: 700; }
.nav .dot { position: absolute; top: 0; right: calc(50% - 22px); }

/* کارت کشف */
.deck { position: relative; height: calc(100vh - 240px); height: calc(100dvh - 240px); min-height: 430px; margin: 4px 14px 0; }
.swc { position: absolute; inset: 0; border-radius: 22px; overflow: hidden; background: #D8CEC2; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); touch-action: pan-y; user-select: none; transition: transform .28s ease; }
.swc.back { transform: scale(.95) translateY(10px); filter: brightness(.96); }
.swc .ph { position: absolute; inset: 0; background: center/cover no-repeat #CBBBAE; }
.swc .bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; z-index: 2; }
.swc .bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .45); }
.swc .bars i.on { background: #fff; }
.swc .info { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 16px 14px; color: #fff; background: linear-gradient(to top, rgba(20, 10, 12, .92), rgba(20, 10, 12, .55) 60%, transparent); }
.swc .info h2 { color: #fff; font-family: var(--sans); font-size: 24px; margin: 0; }
.swc .stamp { position: absolute; top: 34px; padding: 4px 14px; border: 3px solid; border-radius: 10px; font-weight: 800; font-size: 24px; opacity: 0; z-index: 3; transform: rotate(-12deg); }
.swc .stamp.like { left: 18px; color: #7FD3A9; border-color: #7FD3A9; }
.swc .stamp.nope { right: 18px; color: #F28B82; border-color: #F28B82; transform: rotate(12deg); }
.swc.fly-like { transform: translateX(140%) rotate(24deg) !important; }
.swc.fly-pass { transform: translateX(-140%) rotate(-24deg) !important; }
.acts { display: flex; justify-content: center; gap: 22px; padding: 14px 0 0; }
.acts button { width: 62px; height: 62px; border-radius: 50%; border: 0; background: var(--paper); box-shadow: var(--sh); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.acts button.like { background: var(--wine); color: #fff; }
.acts button.info { width: 50px; height: 50px; margin-top: 6px; }
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 4px 14px 8px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }

/* پروفایل کامل */
.gal { position: relative; aspect-ratio: 4/5; background: #CBBBAE center/cover; }
.gal .bars { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 4px; }
.gal .bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .45); }
.gal .bars i.on { background: #fff; }
.gal .nav-l, .gal .nav-r { position: absolute; top: 0; bottom: 0; width: 50%; }
.gal .nav-l { left: 0; } .gal .nav-r { right: 0; }
.kv { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.kv:last-child { border: 0; }
.meter { height: 6px; background: #EADCCF; border-radius: 3px; overflow: hidden; width: 90px; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--wine); }

/* عکس‌ها در ثبت‌نام */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pcell { aspect-ratio: 3/4; border-radius: 14px; background: #E9DDD2 center/cover; position: relative; border: 1.5px dashed #D5C2B3; display: flex; align-items: center; justify-content: center; color: var(--mute); font-size: 13px; overflow: hidden; }
.pcell.has { border: 0; }
.pcell .x { position: absolute; top: 6px; left: 6px; width: 28px; height: 28px; border-radius: 50%; background: rgba(42, 26, 28, .75); color: #fff; border: 0; cursor: pointer; font-size: 15px; }
.pcell .main { position: absolute; bottom: 6px; right: 6px; background: var(--gold); color: var(--ink); border-radius: 8px; font-size: 11px; padding: 1px 6px; font-weight: 700; }
.pcell .mk { position: absolute; bottom: 6px; right: 6px; background: rgba(255, 250, 244, .9); border: 0; border-radius: 8px; font-size: 11px; padding: 2px 6px; cursor: pointer; }
.upl { position: relative; overflow: hidden; }
.upl input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* پرسشنامه */
.opt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: right; border: 1.5px solid var(--line); background: var(--paper); border-radius: 14px; padding: 13px 14px; margin-bottom: 9px; cursor: pointer; font-size: 15px; }
.opt::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #CDB9AA; flex: none; }
.opt.on { background: var(--wine); color: var(--paper); border-color: var(--wine); }
.opt.on::before { border-color: #fff; background: #fff; box-shadow: inset 0 0 0 3px var(--wine); }
.qsec { display: inline-block; background: #F1E4C8; color: #7A5A20; border-radius: 999px; padding: 1px 12px; font-size: 12.5px; font-weight: 700; margin-bottom: 8px; }
.qtext { font-family: var(--serif); font-size: 22px; line-height: 1.7; margin: 4px 0 16px; color: var(--ink); }
.why { background: #EFE4D9; border-radius: 12px; padding: 8px 12px; font-size: 13px; color: #6B5550; margin-bottom: 14px; }

/* نتیجه و مچ */
.ring { width: 120px; height: 120px; margin: 6px auto 10px; position: relative; }
.ring svg { width: 120px; height: 120px; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 30px; color: var(--wine); font-family: var(--serif); }
.pair { display: flex; justify-content: center; margin: 20px 0; }
.pair .av { width: 96px; height: 96px; border: 4px solid var(--cream); box-shadow: var(--sh); }
.pair .av + .av { margin-right: -18px; }
.spin { width: 34px; height: 34px; border: 3px solid #E6D6C9; border-top-color: var(--wine); border-radius: 50%; animation: sp 1s linear infinite; margin: 18px auto; }
@keyframes sp { to { transform: rotate(360deg); } }

/* چت */
.chat { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.chat .top { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.msgs { flex: 1; overflow-y: auto; padding: 12px 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.bub { max-width: 80%; padding: 8px 12px; border-radius: 16px; font-size: 15px; white-space: pre-wrap; word-wrap: break-word; }
.bub.me { align-self: flex-start; background: var(--wine); color: #fff; border-bottom-left-radius: 4px; }
.bub.th { align-self: flex-end; background: var(--paper); border: 1px solid var(--line); border-bottom-right-radius: 4px; }
.bub .tm { font-size: 10.5px; opacity: .6; margin-top: 2px; text-align: left; }
.bub.sys { align-self: center; background: #EFE4D9; color: #6B5550; font-size: 12.5px; text-align: center; border-radius: 12px; max-width: 92%; }
.bub.warn { align-self: center; background: var(--badbg); color: var(--bad); font-size: 13px; border-radius: 12px; max-width: 92%; }
.plan-card { align-self: stretch; background: var(--paper); border: 1.5px solid var(--gold); border-radius: 16px; padding: 12px 14px; }
.bar { display: flex; gap: 8px; padding: 8px 10px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--paper); align-items: flex-end; }
.bar textarea { flex: 1; resize: none; border: 1.5px solid var(--line); border-radius: 20px; padding: 9px 14px; max-height: 120px; min-height: 42px; outline: none; background: var(--cream); font-size: 16px; line-height: 1.5; }
.bar .send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--wine); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.clue { margin: 8px 12px 0; background: #F1E4C8; border-radius: 14px; padding: 10px 12px; font-size: 14px; }
.clue p { margin: 4px 0 8px; line-height: 1.7; }
.clue .row { gap: 8px; align-items: center; }
.qopt { display: grid; grid-template-columns: 18px 1fr; column-gap: 12px; align-items: start; }
.qopt::before { grid-row: 1 / span 4; margin-top: 3px; }
.qopt > * { grid-column: 2; }
.qopt .badge { justify-self: start; margin: 0 0 4px !important; }
.qopt .link { justify-self: start; }
.qopt b { display: block; font-weight: 600; line-height: 1.7; }
.qopt .qo { display: block; font-size: 12px; opacity: .7; margin-top: 4px; line-height: 1.6; }
.typing { font-size: 12.5px; color: var(--mute); padding: 0 14px 4px; min-height: 18px; }

/* شیت و پیغام */
.sheet-bg { position: fixed; inset: 0; background: rgba(20, 10, 12, .5); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--cream); width: 100%; max-width: 480px; border-radius: 22px 22px 0 0; padding: 18px 18px calc(20px + env(safe-area-inset-bottom)); max-height: 88vh; overflow-y: auto; }
.sheet .btn { margin-top: 8px; }
#toast { position: fixed; top: 14px; left: 50%; transform: translateX(-50%) translateY(-120px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 14px; font-size: 14px; z-index: 90; transition: transform .3s, opacity .3s; opacity: 0; pointer-events: none; max-width: 92%; text-align: center; box-shadow: var(--sh); }
#toast.on { transform: translateX(-50%) translateY(0); opacity: 1; }
.stars { display: flex; gap: 6px; direction: ltr; justify-content: flex-end; }
.stars button { border: 0; background: none; font-size: 26px; cursor: pointer; color: #D9C8B9; padding: 0; }
.stars button.on { color: #D9A441; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 22px; color: var(--wine); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.code { direction: ltr; font-family: ui-monospace, monospace; font-weight: 700; letter-spacing: 1px; }
.empty { text-align: center; padding: 50px 20px; color: var(--mute); }
.empty svg.i { width: 48px; height: 48px; color: #CDB9AA; margin: 0 auto 8px; display: block; }

@media (min-width: 520px) {
  #app { margin-top: 0; box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
}

/* سوشال */
.sav { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 50%; background: #F1E4C8; font-size: 18px; flex: none; }
.sav.big { width: 64px; height: 64px; font-size: 34px; }
.spost { cursor: pointer; }

