/* Pages maison hors Bubble : coins (#/coins) et panel admin (#/admin). Mêmes couleurs que l'app. */
.gm-custom { color-scheme: dark; min-height: 100dvh; background: #111D36; color: #F5F7FB; font-family: Poppins, sans-serif; padding: 16px 16px 40px; box-sizing: border-box; }
.gm-custom *, .gm-custom *::before, .gm-custom *::after { box-sizing: border-box; }
.gc-back { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #22304A; color: #F5F7FB; font-size: 26px; line-height: 1; cursor: pointer; }
.gc-title { font-size: 24px; margin: 14px 0 16px; }
.gc-card { background: #1A2742; border: 1px solid #34445F; border-radius: 20px; padding: 16px; margin-bottom: 14px; }
.gc-card h3 { margin: 0 0 10px; font-size: 16px; }
.gc-balance { display: flex; gap: 14px; align-items: center; background: linear-gradient(135deg, #22304A, #1A2742); }
.gc-balance small { color: #AAB6CA; } .gc-balance b { display: block; font-size: 24px; } .gc-balance p { margin: 4px 0 0; color: #AAB6CA; font-size: 13px; }
.gc-coin { flex: 0 0 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff; background: linear-gradient(to bottom, #FC8C15, #FA6E0C); }
.gc-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 14px; }
.gc-pack { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; margin: 0; position: relative; padding-top: 26px; }
.gc-pack b { font-size: 22px; color: #FC8C15; } .gc-pack b small { display: block; font-size: 12px; color: #37A7EE; }
.gc-tag { position: absolute; top: 8px; font-size: 11px; color: #AAB6CA; text-transform: uppercase; letter-spacing: .5px; }
.gc-price { font-weight: 600; }
.gc-btn { margin-top: 4px; width: 100%; border: 0; border-radius: 999px; padding: 10px; font: 600 14px Poppins, sans-serif; color: #fff; cursor: pointer; background: linear-gradient(to right, #37A7EE, #2E76EB); }
.gc-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #34445F; font-size: 14px; }
.gc-row:first-of-type { border-top: 0; }
.gc-row .pos { color: #4CD38A; } .gc-row .neg { color: #F35F6D; }
/* Historique des MateCoins : une seule ligne par opération (libellé, date, montant). */
.gc-row.gc-line { align-items: baseline; }
.gc-row.gc-line > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-row.gc-line > small { flex: none; white-space: nowrap; font-size: 12px; }
.gc-row.gc-line > b { flex: none; min-width: 44px; text-align: right; }
.gc-muted { color: #AAB6CA; font-size: 13px; } .gc-center { text-align: center; }
body.gm-desktop .gm-custom { padding: 32px 40px 60px; }
body.gm-desktop [data-page=coins] .gm-custom, body.gm-desktop .gm-custom:has(.cn-balance) { max-width: 1120px; }
body.gm-desktop .gm-custom:has(.cn-balance) .gc-back { display: none; }

/* Corrections de bugs d'affichage de Bubble (docs/audit-bubble.md, D25) :
   inscription, carte Max : « 60 photos personnalisées / mois » est un peu trop large, passe sous l'icône et
   chevauche la ligne suivante (même rendu dans Bubble). La ligne reste sur une seule rangée et grandit si besoin. */
[data-b^="bTKWn "] { flex-wrap: nowrap !important; height: auto !important; max-height: none !important; }
[data-b^="bTKWn "] > [data-b^="bTKWt "] { flex-shrink: 1 !important; min-width: 0 !important; }

/* D27 : conversation, le défilement automatique (script de Bubble et action « Scroll to ») aligne #chatBottom sur le
   bas de l'écran ; la barre de saisie (82 px) recouvre alors le dernier message (même défaut dans Bubble). */
#chatBottom { scroll-margin-bottom: 82px; }

/* D28 : conversation, le lecteur de la bulle vocale a une largeur fixe de 400 px dans une bulle limitée à 66 % :
   il passait à la ligne et débordait de l'écran. Il occupe la place restante à côté de l'icône Lecture. */
[data-b^="bTMqX "] { width: auto !important; min-width: 120px !important; max-width: none !important; flex: 1 1 0 !important; }
[data-b^="bTMpV "] { flex-wrap: nowrap !important; width: 66% !important; }

/* Panel admin */
.ad-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.ad-top h1 { margin: 0; font-size: 22px; flex: 1; }
body.gm-desktop .ad-top .gc-back { display: none; }
.ad-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: none; }
.ad-tabs button { flex: 0 0 auto; border: 1px solid #34445F; background: transparent; color: #AAB6CA; border-radius: 999px; padding: 8px 14px; font: 500 13px Poppins, sans-serif; cursor: pointer; }
.ad-tabs button.on { background: #2E76EB; border-color: #2E76EB; color: #fff; }
.ad-panel { background: #1A2742; border: 1px solid #34445F; border-radius: 16px; padding: 14px; margin-bottom: 14px; }
.ad-panel h3 { margin: 0 0 10px; font-size: 15px; }
.ad-muted { color: #AAB6CA; font-size: 12px; }
.ad-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.ad-kpi { background: #1A2742; border: 1px solid #34445F; border-radius: 14px; padding: 12px; }
.ad-kpi b { display: block; font-size: 22px; } .ad-kpi span { color: #AAB6CA; font-size: 12px; }
.ad-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.ad-search, .ad-type, .ad-form input, .ad-form select, .ad-form textarea, .ad-table input {
  background: #111D36; color: #F5F7FB; border: 1px solid #34445F; border-radius: 10px; padding: 8px 10px; font: 13px Poppins, sans-serif; min-width: 0;
}
.ad-search { flex: 1 1 200px; }
.ad-scroll { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ad-table th { text-align: left; color: #AAB6CA; font-weight: 500; padding: 6px 8px; white-space: nowrap; border-bottom: 1px solid #34445F; }
.ad-table td { padding: 7px 8px; border-bottom: 1px solid #22304A; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.ad-table tr[data-open] { cursor: pointer; } .ad-table tr[data-open]:hover td { background: #22304A; }
.ad-table td input { width: 100%; min-width: 70px; }
.ad-thumb { width: 30px; height: 30px; border-radius: 8px; object-fit: cover; vertical-align: middle; }
.ad-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ad-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #AAB6CA; }
.ad-texts label { background: #111D3655; border-radius: 10px; padding: 8px; }
.ad-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.ad-actions.left { justify-content: flex-start; }
.ad-btn { border: 1px solid #34445F; background: #22304A; color: #F5F7FB; border-radius: 999px; padding: 8px 16px; font: 600 13px Poppins, sans-serif; cursor: pointer; }
.ad-btn.primary { border: 0; background: linear-gradient(to right, #37A7EE, #2E76EB); }
.ad-btn.danger { border-color: #F35F6D; color: #F35F6D; background: transparent; }
.ad-drawer { position: fixed; z-index: 900; inset: 0; background: rgba(0, 0, 0, .55); display: flex; justify-content: flex-end; }
.ad-editor { width: min(560px, 100%); height: 100%; margin: 0; border-radius: 0; overflow-y: auto; }
.ad-editor .ad-form { grid-template-columns: 1fr; }
.ad-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ad-head small { display: block; color: #AAB6CA; font-weight: 400; font-size: 12px; }
.ad-x { border: 0; background: none; color: #F5F7FB; font-size: 28px; cursor: pointer; line-height: 1; }
.ad-toast { position: fixed; z-index: 2000; bottom: 24px; left: 50%; transform: translateX(-50%); background: #2E76EB; color: #fff; padding: 10px 18px; border-radius: 999px; font: 600 14px Poppins, sans-serif; }
.ad-denied { text-align: center; padding-top: 30vh; }
#gm-admin-fab { position: fixed; z-index: 950; left: 0; top: 40%; width: 26px; height: 40px; border: 0; border-radius: 0 10px 10px 0; background: rgba(46, 118, 235, .75); color: #fff; font-size: 15px; cursor: pointer; padding: 0; }
