/* Pixel Booster — écran d'accueil de l'application (actif seulement quand le site est installé : classe « is-app »).
   Prévisualisation dans un navigateur : ajoutez ?app=1 à l'adresse. */

/* Hors application : l'écran d'accueil de l'app et la barre du bas n'existent pas. */
html:not(.is-app) #appHome{display:none!important}

/* ---------- Dans l'application : le site d'accueil classique laisse la place ---------- */
html.is-app .pb-hero, html.is-app .pb-trust, html.is-app .home-extra, html.is-app #supportClient, html.is-app .pb-reseller,
html.is-app .pb-goals, html.is-app .site-footer, html.is-app #publishedBlog{display:none!important}
html.is-app .pb-header-in{height:60px;gap:8px;flex-wrap:nowrap}
html.is-app .pb-actions{margin-left:auto;gap:8px;flex-wrap:nowrap}
html.is-app .pb-walletbox, html.is-app .logged .pb-wallet.when-in, html.is-app .logged .pb-topup.when-in, html.is-app .pb-user-meta, html.is-app .pb-user>i, html.is-app .pb-user .cur-chev{display:none!important}
html.is-app .pb-user{padding:0!important;border:0!important;background:none!important;min-width:0}
html.is-app .pb-tools{gap:6px;flex-wrap:nowrap}
html.is-app .cur-toggle{padding:0 9px}
html.is-app .pb-brand-name{font-size:17px}

/* ---------- Écran d'accueil ---------- */
.app-home{--ah-navy:#050a3a;--ah-navy2:#0b1470;max-width:560px;margin:0 auto;padding:16px 16px 8px}
.app-home[hidden]{display:none!important}
.ah-card{position:relative;background:var(--card);border:1px solid var(--line);border-radius:26px;box-shadow:var(--sh);padding:18px}

/* Connecté : carte compte */
.ah-top{display:flex;align-items:center;gap:12px}
.ah-av{flex:none;width:52px;height:52px;border-radius:50%;display:grid;place-items:center;font-weight:800;font-size:21px;color:#fff;background:linear-gradient(135deg,var(--brand),var(--accent,#00d8ff));box-shadow:0 0 0 3px var(--card),0 0 0 5px color-mix(in srgb,var(--brand) 55%,transparent)}
.ah-id{min-width:0;flex:1;display:grid;gap:1px}
.ah-id small{font-size:12px;color:var(--mute)}
.ah-id b{font-size:18px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ah-tier{display:inline-flex;align-items:center;gap:5px;padding:5px 10px;border-radius:999px;background:var(--gold-bg,#fef3c7);color:var(--gold,#b45309);font-size:12px;font-weight:700}
.ah-tier svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ah-eye{flex:none;width:42px;height:42px;border-radius:50%;border:0;display:grid;place-items:center;background:var(--pill);color:var(--brand);cursor:pointer}
.ah-eye svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* Solde : panneau sombre */
.ah-panel{position:relative;overflow:hidden;margin-top:16px;padding:20px 20px 22px;border-radius:20px;color:#fff;background:radial-gradient(120% 140% at 100% 0,rgba(0,216,255,.38),transparent 55%),linear-gradient(135deg,var(--ah-navy),var(--ah-navy2) 70%,#1a2bd6)}
.ah-panel small{display:block;font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:rgba(255,255,255,.7);font-weight:600}
.ah-balance{display:block;margin-top:8px;font-size:32px;line-height:1.1;font-weight:800;letter-spacing:-.01em;word-break:break-word}
.ah-mark{display:none}
.ah-panel::after{content:"";position:absolute;right:-30px;bottom:-60px;width:170px;height:170px;border-radius:50%;border:26px solid rgba(255,255,255,.07);pointer-events:none}

/* Œil : masque les montants */
.ah-hide .ah-val{font-size:0!important}
.ah-hide .ah-val::after{content:"••••••";font-size:20px;letter-spacing:.12em}
.ah-hide .ah-balance::after{font-size:30px}

/* Statistiques */
.ah-stats{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:12px}
.ah-stat:nth-child(2){grid-column:1/-1;order:3;display:flex;align-items:center;justify-content:space-between;gap:10px}
.ah-stat:nth-child(2) b{margin:0;font-size:16px}
.ah-stat{min-width:0;padding:12px;border-radius:16px;background:var(--bg);border:1px solid var(--line)}
.ah-stat small{display:flex;align-items:center;gap:5px;font-size:11px;color:var(--mute);font-weight:600}
.ah-stat small svg{width:14px;height:14px;flex:none;fill:none;stroke:var(--brand);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ah-stat b{display:block;margin-top:5px;font-size:15px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Actions rapides */
.ah-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:12px}
.ah-act{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-height:68px;padding:10px 4px;border-radius:16px;border:1px solid var(--line);background:var(--card);color:var(--ink);font:inherit;font-size:12px;font-weight:700;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.ah-act svg{width:22px;height:22px;fill:none;stroke:var(--brand);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.ah-act.primary{background:var(--brand);border-color:var(--brand);color:#fff;box-shadow:0 10px 22px color-mix(in srgb,var(--brand) 38%,transparent)}
.ah-act.primary svg{stroke:#fff}
.ah-act:active{transform:scale(.96)}

/* Titres de section */
.ah-sec{display:flex;align-items:baseline;justify-content:space-between;gap:10px;margin:24px 4px 12px}
.ah-sec h2{margin:0;font-size:18px;font-weight:800}
.ah-more{font-size:13px;font-weight:700;color:var(--brand);text-decoration:none}

/* Plateformes */
.ah-plats{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
.ah-plat{display:flex;flex-direction:column;align-items:center;gap:8px;padding:14px 4px 12px;border-radius:18px;background:var(--card);border:1px solid var(--line);color:var(--ink);text-decoration:none;font-size:12px;font-weight:700;text-align:center;box-shadow:var(--sh);-webkit-tap-highlight-color:transparent}
.ah-plat i{display:grid;place-items:center;width:44px;height:44px;border-radius:14px;color:var(--pc,var(--brand));background:color-mix(in srgb,var(--pc,var(--brand)) 11%,transparent)}
.ah-plat i svg{width:24px;height:24px}
.ah-plat span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ah-plat:active{transform:scale(.96)}

/* Objectifs */
.ah-goals{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.ah-goal{display:flex;flex-direction:column;gap:3px;padding:14px 12px;border-radius:18px;color:var(--ink);text-decoration:none;background:var(--card);border:1px solid var(--line);box-shadow:var(--sh)}
.ah-goal .gi{display:grid;place-items:center;width:38px;height:38px;margin-bottom:6px;border-radius:12px;background:var(--pill);color:var(--brand)}
.ah-goal .gi svg{width:20px;height:20px}
.ah-goal b{font-size:14px;font-weight:800}
.ah-goal small{font-size:11px;color:var(--mute);line-height:1.35}
.ah-goal small i{font-style:normal;font-weight:800;color:var(--brand)}

/* Dernière commande */
.ah-last{display:flex;align-items:center;gap:12px;margin-top:20px;padding:14px;border-radius:18px;background:var(--card);border:1px solid var(--line);box-shadow:var(--sh);color:var(--ink);text-decoration:none}
.ah-last-ico{flex:none;display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--pill);color:var(--brand)}
.ah-last-ico svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.ah-last-txt{min-width:0;flex:1;display:grid;gap:2px}
.ah-last-txt small{font-size:11.5px;color:var(--mute);font-weight:600}
.ah-last-txt b{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ah-last em{font-style:normal;font-size:11.5px;color:var(--mute);white-space:nowrap}
.ah-chev{flex:none;width:18px;height:18px;fill:none;stroke:var(--mute);stroke-width:2;stroke-linecap:round;stroke-linejoin:round}

/* Non connecté : bienvenue */
.ah-welcome{overflow:hidden;text-align:center;padding:34px 22px 26px}
.ah-glow{position:absolute;inset:-40% -20% auto;height:80%;background:radial-gradient(closest-side,color-mix(in srgb,var(--brand) 22%,transparent),transparent);pointer-events:none}
.ah-logo{position:relative;width:84px;height:84px;object-fit:contain;margin-bottom:8px}
.ah-welcome h1{position:relative;margin:0 0 8px;font-size:26px}
.ah-welcome p{position:relative;margin:0 auto 20px;max-width:330px;color:var(--mute);font-size:14.5px;line-height:1.55}
.ah-cta{position:relative;display:grid;gap:10px}
.ah-cta .btn{width:100%;justify-content:center}


@media (min-width:700px){.app-home{padding-top:26px}}
@media (max-width:360px){.ah-balance{font-size:27px}.ah-actions{gap:6px}.ah-stat{padding:10px}.ah-plats{gap:8px}}
@media (prefers-reduced-motion:no-preference){.ah-act,.ah-plat{transition:transform .12s}}

/* Correctifs d'affichage mobile */
html.is-app .pb-account>.when-out{display:none!important}
html.is-app .pb-account{flex:none}
.ah-cta .btn.o{color:var(--brand);background:var(--card);border:1.5px solid var(--brand)}
.ah-cta .btn.p{color:#fff}

/* Écrans étroits et iPhone (Dynamic Island, coins arrondis, 16 / 16 Pro / 16 Pro Max) : rien ne doit dépasser */
html.is-app, html.is-app body{max-width:100%;overflow-x:hidden}
html.is-app .pb-header-in{padding-left:max(12px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px));max-width:100%;box-sizing:border-box}
html.is-app .pb-brand{flex:none;min-width:0}
html.is-app .pb-tools,html.is-app .pb-actions{min-width:0}
.app-home{box-sizing:border-box;width:100%;padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px))}
.app-home *{box-sizing:border-box;min-width:0}
@media (max-width:540px){html.is-app .pb-header .pb-brand .pb-brand-name{display:none!important}}

/* Sections d'accueil vides (annonces, pages publiées…) : on n'affiche pas leur titre seul */
html.is-app section.section-wrap[data-page="accueil"]:empty, html.is-app #publicAnnouncements:has(#publicAnnouncementList:empty){display:none!important}
