/* Mobile app: presentation stage (nav · device · notes), device frame and in-app components. */

body.app { background: var(--stage-bg); overflow: hidden; height: 100vh; }

/* ── stage ─────────────────────────────────────────── */
.stage { display: grid; grid-template-columns: 272px minmax(0, 1fr) 340px; height: 100vh; background: var(--stage-bg); color: var(--stage-ink); font-family: var(--font-ui); }
.stage-nav, .stage-notes { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.stage-nav { padding: 20px 14px 40px; border-right: 1px solid var(--stage-line); }
.stage-notes { padding: 28px 26px 60px; border-left: 1px solid var(--stage-line); }
.stage-center { position: relative; display: grid; place-items: center; overflow: hidden; }
.stage-center::before { content: ""; position: absolute; inset: 0; background-image: var(--motif-light); opacity: .22; pointer-events: none; }
body.app.is-embed { background: var(--c-bg); }
body.is-embed .phone-screen { max-width: none; }

.sn-brand { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 8px 18px; }
.sn-brand .logo { height: 34px; width: auto; color: var(--stage-ink); }
.brand-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--stage-panel); border-radius: 12px; margin: 0 4px 16px; }
.brand-switch button { height: 34px; border-radius: 9px; font-size: 12.5px; font-weight: 700; color: var(--stage-muted); transition: background .2s, color .2s; }
.brand-switch button[aria-pressed="true"] { background: var(--stage-ink); color: var(--stage-bg); }
.sn-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 4px 18px; }
.sn-quick a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: var(--stage-panel); font-size: 12.5px; font-weight: 600; color: var(--stage-ink-2); }
.sn-quick a:hover { color: var(--stage-ink); }
.sn-quick .ic { width: 16px; height: 16px; color: var(--stage-accent); }
.sn-group { margin-top: 6px; }
.sn-group-title { display: flex; align-items: center; gap: 8px; padding: 10px 8px 6px; font-size: 10.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--stage-muted); }
.sn-group-title .ic { width: 14px; height: 14px; }
.sn-link { display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 30px; border-radius: 9px; font-size: 13px; color: var(--stage-ink-2); line-height: 1.3; }
.sn-link:hover { background: var(--stage-panel); color: var(--stage-ink); }
.sn-link.is-current { background: var(--stage-panel); color: var(--stage-ink); font-weight: 700; box-shadow: inset 3px 0 0 var(--stage-accent); }
.sn-link .phase-badge { margin-left: auto; height: 17px; font-size: 9px; padding: 0 6px; }

.notes-kicker { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--stage-accent); }
.notes-title { font-family: var(--font-display); font-size: 30px; line-height: 1.1; margin: 10px 0 16px; color: var(--stage-ink); }
.notes-body { font-size: 14.5px; line-height: 1.6; color: var(--stage-ink-2); }
.notes-body p + p, .notes-body p + ul, .notes-body ul + p { margin-top: 12px; }
.notes-body ul { display: flex; flex-direction: column; gap: 9px; }
.notes-body li { position: relative; padding-left: 18px; }
.notes-body li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--stage-accent); }
.notes-body strong, .notes-body b { color: var(--stage-ink); }
.notes-sep { height: 1px; background: var(--stage-line); margin: 26px 0 18px; }
.notes-h { font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--stage-muted); margin-bottom: 10px; }
.notes-tours { display: flex; flex-direction: column; gap: 6px; }
.notes-tours a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--stage-panel); font-size: 13px; font-weight: 600; color: var(--stage-ink-2); }
.notes-tours a:hover { color: var(--stage-ink); }
.notes-tours .ic { width: 16px; height: 16px; color: var(--stage-accent); }

/* ── device ────────────────────────────────────────── */
.device { position: relative; flex: none; width: 414px; height: 868px; padding: 12px; border-radius: 64px; background: #0B0B0B; box-shadow: 0 0 0 1.5px #2C2C2C, 0 0 0 7px #151515, 0 50px 100px -20px rgba(0, 0, 0, .7); transform-origin: center center; }
.device-island { position: absolute; top: 23px; left: 50%; transform: translateX(-50%); width: 122px; height: 35px; border-radius: 20px; background: #000; z-index: 200; }
.device-screen { position: relative; width: 390px; height: 844px; border-radius: 52px; overflow: hidden; background: var(--c-bg); isolation: isolate; display: flex; flex-direction: column; }
.statusbar { position: absolute; top: 0; left: 0; right: 0; height: 50px; z-index: 150; display: flex; align-items: center; justify-content: space-between; padding: 8px 32px 0 40px; font: 600 15.5px/1 var(--font-ui); color: var(--c-ink); pointer-events: none; }
.statusbar svg { height: 12px; width: auto; }
.statusbar .sb-icons { display: flex; gap: 6px; align-items: center; }
body[data-statusbar="light"] .statusbar { color: #fff; }
.home-indicator { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); width: 136px; height: 5px; border-radius: 3px; background: var(--c-ink); opacity: .9; z-index: 150; pointer-events: none; }
body[data-statusbar="light"] .home-indicator { background: #fff; }

/* the screen itself (works standalone without core.js too) */
.phone-screen { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: 50px; background: var(--c-bg); color: var(--c-ink); overflow: hidden; }
body[data-bleed] .phone-screen { padding-top: 0; }
body:not(.has-stage) .phone-screen { max-width: 430px; height: 100vh; margin: 0 auto; }

.appbar { flex: none; position: relative; z-index: 20; display: flex; align-items: center; gap: 4px; min-height: 54px; padding: 4px 10px; background: var(--c-bg); }
.appbar-title { flex: 1; min-width: 0; text-align: center; font-family: var(--font-display); font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .btn-icon, .icon-btn { width: 44px; height: 44px; min-height: 44px; display: grid; place-items: center; border-radius: var(--r-pill); color: var(--c-ink); position: relative; flex: none; }
.appbar .btn-icon .ic, .icon-btn .ic { width: 22px; height: 22px; }
.appbar-spacer { width: 44px; flex: none; }
.appbar.is-transparent { position: absolute; top: 50px; left: 0; right: 0; background: transparent; }
.appbar.is-on-dark .btn-icon, .appbar.is-on-dark .appbar-title { color: #fff; }
.dot-badge { position: absolute; top: 7px; right: 7px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--c-primary); color: var(--c-on-primary); font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--c-bg); }
.appbar-large { flex: none; padding: 6px 20px 14px; background: var(--c-bg); }
.appbar-large h1 { font-size: 32px; line-height: 1.05; }
.appbar-large p { margin-top: 6px; color: var(--c-ink-2); font-size: 14px; }

.screen-body { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; padding-bottom: 28px; }
.screen-body::-webkit-scrollbar { display: none; }
.screen-footer { flex: none; padding: 12px 20px 30px; background: var(--c-bg); border-top: 1px solid var(--c-line); position: relative; z-index: 15; }

.section { margin-top: 26px; }
.section:first-child { margin-top: 8px; }
.section > .section-head, .section > .pad { padding: 0 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 0 20px; }
.section-head h2 { font-size: 21px; }
.section-head a, .section-head .link { font-size: 13px; color: var(--c-accent); font-weight: 600; white-space: nowrap; }
.pad { padding-left: 20px; padding-right: 20px; }
.hscroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 20px 6px; scroll-snap-type: x mandatory; scroll-padding-inline: 20px; scrollbar-width: none; }
.mcard-points b, .points-hero b.big, .stat b { font-variant-numeric: lining-nums tabular-nums; }
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; flex: none; }

/* ── tab bar ───────────────────────────────────────── */
.tabbar { flex: none; position: relative; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); align-items: start; height: 86px; padding: 6px 6px 0; background: var(--c-elevated); border-top: 1px solid var(--c-line); }
.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding-top: 6px; font-size: 10.5px; font-weight: 600; color: var(--c-muted); letter-spacing: .01em; }
.tab .ic { width: 24px; height: 24px; }
.tab.is-active { color: var(--c-ink); }
.tab.is-active .ic { color: var(--c-primary); }
.tab-center { position: relative; top: -20px; }
.tab-center .tab-center-btn { width: 60px; height: 60px; border-radius: var(--r-pill); background: var(--c-primary); color: var(--c-on-primary); display: grid; place-items: center; box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .35); border: 4px solid var(--c-elevated); transition: transform .2s var(--ease-spring); }
.tab-center .tab-center-btn .ic { width: 26px; height: 26px; color: var(--c-on-primary); }
.tab-center:active .tab-center-btn { transform: scale(.94); }

/* ── member card ───────────────────────────────────── */
.mcard { position: relative; aspect-ratio: 1.586; border-radius: var(--r-card); padding: 18px 20px; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; color: var(--mc-ink); background: var(--mc-bg); box-shadow: var(--shadow-3); isolation: isolate; }
.mcard, .mcard[data-tier="standard"] { --mc-bg: var(--tier-standard); --mc-ink: var(--tier-standard-ink); --mc-motif: var(--motif-dark); }
.mcard[data-tier="gold"] { --mc-bg: var(--tier-gold); --mc-ink: var(--tier-gold-ink); --mc-motif: var(--motif-dark); }
.mcard[data-tier="platinum"] { --mc-bg: var(--tier-platinum); --mc-ink: var(--tier-platinum-ink); --mc-motif: var(--motif-light); }
.mcard::before { content: ""; position: absolute; inset: 0; background-image: var(--mc-motif); z-index: -1; }
[data-brand="lappartement"] .mcard::after { content: ""; position: absolute; inset: 9px; border: 1px solid currentColor; opacity: .28; pointer-events: none; }
.mcard-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mcard-logo { height: 30px; color: var(--mc-ink); }
.mcard-logo svg { height: 100%; width: auto; }
.mcard-tier { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; font-weight: 800; }
.mcard-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.mcard-name { font-family: var(--font-display); font-size: 21px; line-height: 1.1; }
.mcard-no { font: 600 12.5px/1 var(--font-ui); letter-spacing: .14em; opacity: .75; margin-top: 6px; font-variant-numeric: tabular-nums; }
.mcard-points { text-align: right; }
.mcard-points b { display: block; font-family: var(--font-display); font-size: 28px; line-height: 1; font-weight: var(--display-weight); }
.mcard-points span { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; opacity: .75; }

/* ── heroes & media ────────────────────────────────── */
.hero { position: relative; height: 230px; border-radius: var(--r-hero); overflow: hidden; background: var(--c-surface-2); isolation: isolate; }
.hero > svg, .hero-media > svg, .media-cover > svg { width: 100%; height: 100%; }
.hero-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 20px; color: #fff; background: linear-gradient(to top, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0)); }
.hero-caption h2, .hero-caption h3 { color: #fff; }
[data-brand="lappartement"] .hero::after { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255, 255, 255, .6); pointer-events: none; }
.media-cover { overflow: hidden; background: var(--c-surface-2); }

/* ── product card ──────────────────────────────────── */
.pcard { display: flex; flex-direction: column; gap: 8px; width: 158px; }
.pcard-media { position: relative; aspect-ratio: 1; background: var(--c-surface); border-radius: var(--r-md); overflow: hidden; display: grid; place-items: center; }
[data-brand="hamam"] .pcard-media { background: var(--c-surface-2); }
.pcard-media > svg { width: 86%; height: 86%; }
.pcard-fav { position: absolute; top: 8px; right: 8px; width: 34px; height: 34px; border-radius: 50%; background: rgba(255, 255, 255, .9); display: grid; place-items: center; color: var(--c-ink); }
.pcard-fav .ic { width: 17px; height: 17px; }
.pcard-fav.is-on { color: var(--c-danger); }
.pcard-fav.is-on svg path { fill: currentColor; }
.pcard-badges { position: absolute; top: 8px; left: 8px; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pcard-name { font-size: 13.5px; line-height: 1.3; color: var(--c-ink); }
.pcard-price { font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums; }
.pcard-old { text-decoration: line-through; color: var(--c-muted); font-size: 12px; margin-left: 6px; font-weight: 400; }
.pcard-pts { font-size: 11.5px; color: var(--c-accent); font-weight: 700; display: flex; align-items: center; gap: 4px; }
.pcard-pts .ic { width: 13px; height: 13px; }
.pgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; padding: 0 20px; }
.pgrid .pcard { width: auto; }

/* ── campaign card ─────────────────────────────────── */
.ccard { position: relative; display: block; width: 300px; border-radius: var(--r-card); overflow: hidden; background: var(--c-elevated); border: 1px solid var(--c-line); color: var(--c-ink); }
.ccard-media { height: 150px; overflow: hidden; background: var(--c-surface-2); position: relative; }
.ccard-media > svg { width: 100%; height: 100%; }
.ccard-media .badge, .ccard-media .tier-badge { position: absolute; top: 10px; left: 10px; }
.ccard-body { padding: 14px 16px 16px; }
.ccard-title { font-family: var(--font-display); font-size: 20px; line-height: 1.15; }
.ccard-sub { font-size: 13px; color: var(--c-ink-2); margin-top: 4px; }
.ccard-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--c-muted); margin-top: 10px; }
.ccard-meta .ic { width: 14px; height: 14px; }
.ccard.is-wide { width: auto; }

/* ── stats, rings, receipts, timeline ──────────────── */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--c-surface); border-radius: var(--r-md); padding: 12px; }
[data-brand="hamam"] .stat { background: var(--c-elevated); border: 1px solid var(--c-line); }
.stat b { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1.1; font-weight: var(--display-weight); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11.5px; color: var(--c-muted); }
.ring { display: block; }
.ring-wrap { position: relative; display: inline-grid; place-items: center; }
.ring-wrap > .ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }

.points-hero { position: relative; overflow: hidden; border-radius: var(--r-card); padding: 22px 20px; background: var(--c-primary); color: var(--c-on-primary); isolation: isolate; }
.points-hero::before { content: ""; position: absolute; inset: 0; background-image: var(--motif-light); z-index: -1; }
.points-hero b.big { display: block; font-family: var(--font-display); font-size: 46px; line-height: 1; font-weight: var(--display-weight); font-variant-numeric: tabular-nums; }

.receipt { background: var(--c-elevated); border: 1px solid var(--c-line); border-radius: var(--r-md); padding: 18px; }
.receipt-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 5px 0; }
.receipt-row.total { font-weight: 700; font-size: 15px; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 18px; padding-left: 26px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--c-line); }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -26px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--c-elevated); border: 2px solid var(--c-line-strong); }
.timeline li.is-done::before { background: var(--c-accent); border-color: var(--c-accent); box-shadow: inset 0 0 0 3px var(--c-elevated); }
.timeline li.is-current::before { border-color: var(--c-accent); box-shadow: 0 0 0 5px var(--c-accent-soft); }

.qr-box { width: 232px; height: 232px; padding: 14px; margin: 0 auto; background: #fff; border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.barcode-box { background: #fff; padding: 14px 16px 10px; border-radius: var(--r-md); box-shadow: var(--shadow-1); }
.barcode-box svg { width: 100%; height: 70px; }

.otp { display: flex; gap: 10px; justify-content: center; }
.otp input { width: 50px; height: 58px; text-align: center; font-size: 24px; font-weight: 600; border: 1px solid var(--c-line-strong); border-radius: var(--r-sm); background: var(--c-elevated); }
.otp input:focus { outline: none; border-color: var(--c-ink); box-shadow: 0 0 0 3px var(--c-accent-soft); }

.dots { display: flex; gap: 6px; justify-content: center; }
.dots span { width: 7px; height: 7px; border-radius: 4px; background: var(--c-line-strong); transition: width .3s var(--ease-out), background .3s; }
.dots span.is-active { width: 22px; background: var(--c-primary); }

.info-box { display: flex; gap: 12px; padding: 14px; border-radius: var(--r-md); background: var(--c-accent-soft); color: var(--c-ink); font-size: 13px; line-height: 1.45; }
.info-box > .ic { color: var(--c-accent); margin-top: 1px; }

/* ── bottom sheet (place as a direct child of .phone-screen) ── */
.phone-screen > .backdrop { position: absolute; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 70; max-height: 86%; overflow-y: auto; padding: 10px 20px 34px; background: var(--c-elevated); border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(105%); transition: transform .38s var(--ease-out); box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); scrollbar-width: none; }
.sheet.is-open { transform: none; }
.sheet-grip { width: 40px; height: 5px; border-radius: 3px; background: var(--c-line-strong); margin: 0 auto 16px; }
.sheet-title { font-family: var(--font-display); font-size: 23px; line-height: 1.15; margin-bottom: 8px; }
.phone-screen > .toast-wrap { position: absolute; bottom: 104px; }

/* ── responsive stage ──────────────────────────────── */
@media (max-width: 1240px) { .stage { grid-template-columns: 240px minmax(0, 1fr) 300px; } }
@media (max-width: 1080px) { .stage { grid-template-columns: minmax(0, 1fr) 300px; } .stage-nav { display: none; } }
@media (max-width: 820px) { .stage { grid-template-columns: minmax(0, 1fr); } .stage-notes { display: none; } }
@media (max-width: 520px) {
  body.app { background: var(--c-bg); }
  .device { width: 100vw; height: 100dvh; padding: 0; border-radius: 0; box-shadow: none; transform: none !important; }
  .device-screen { width: 100%; height: 100%; border-radius: 0; }
  .device-island { display: none; }
}
