/* BASCULE À CHAUD web ⇄ mobile (02/12/2026) : hors mode mobile (classe « mb » retirée quand la fenêtre
   repasse au-dessus de 720 px), les éléments créés par la coque mobile sont masqués — la version web
   s'affiche exactement comme avant, sans rechargement. */
html:not(.mb) #mbnav, html:not(.mb) #mbbook, html:not(.mb) #mbsheet, html:not(.mb) #mbBookHead,
html:not(.mb) #mbDisc, html:not(.mb) .mb-step, html:not(.mb) #mbZoomPill, html:not(.mb) #mbMaxClose,
html:not(.mb) #mbLogout, html:not(.mb) .mb-hero { display: none !important; }
/* ============================================================================
   MOBILE BÊTA — habillage fidèle à la maquette (téléphone ≤ 720 px uniquement)
   Chargé SEULEMENT pour la bêta privée (cookie mpp_beta). Affichage seul :
   aucune donnée, simulation, carnet ni logique de jeu n'est modifiée.
   Tout est préfixé html.mb ; la mise en page mobile actuelle reste intacte
   pour les autres joueurs.
   Valeurs de la maquette : sombre fond #0a0f1c / carte #111a2e / bordure #1b2744 /
   ask #2b2335 / bid #142e3b / barre #2d4299 / bleu #2f5bea ;
   clair fond #f3f2f8 / carte #fff / ask #f8e9e9 / bid #e5f1ee / barre #8495d9 / bleu #2450cc.
   ============================================================================ */
@media (max-width: 720px) {
  html.mb {
    --mb-bg:#0a0f1c; --mb-card:#111a2e; --mb-line:#1b2744; --mb-text:#e8ecf8; --mb-mut:#8d9bbb;
    --mb-ask:#2b2335; --mb-bid:#142e3b; --mb-bar:#2d4299; --mb-blue:#2f5bea; --mb-gold:#f2b632;
    --mb-up:#25c39a; --mb-dn:#f2575d; --mb-btnbg:#111a2e; --mb-cur:#f2b632;
  }
  html.mb body.theme-light {
    --mb-bg:#f3f2f8; --mb-card:#ffffff; --mb-line:#e3e1ee; --mb-text:#16213d; --mb-mut:#6b7494;
    --mb-ask:#f8e9e9; --mb-bid:#e5f1ee; --mb-bar:#8495d9; --mb-blue:#2450cc; --mb-gold:#8a6100;
    --mb-up:#0f7d5f; --mb-dn:#c43b3b; --mb-btnbg:#ffffff; --mb-cur:#8a6100;
  }
  html.mb body { background: var(--mb-bg) !important; color: var(--mb-text); padding-bottom: calc(200px + env(safe-area-inset-bottom,0px)) !important; }
  html.mb #app { background: var(--mb-bg) !important; }

  /* ---- bandeaux inutiles sur mobile : on garde le jeu, on retire le bruit ---- */
  html.mb #ticker, html.mb #tabbar { display: none !important; }

  /* ---- EN-TÊTE : logo + titre + pastilles, puis cours en grand ---- */
  html.mb #topbar { display: grid !important; grid-template-columns: 1fr auto auto; align-items: center; gap: 6px 6px;
    padding: 14px 16px 6px !important; background: transparent !important; border: 0 !important; height: auto !important; box-shadow: none !important; }
  html.mb #topbar .brand { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
  html.mb #topbar .brand > div { min-width: 0; }
  html.mb #topbar .brand-logo { width: 34px !important; height: 34px !important; border-radius: 50%; flex: none; object-fit: contain; }
  html.mb #topbar .brand-name { font: 800 clamp(10px, 3.2vw, 13px)/1 var(--sans); letter-spacing: .2px; color: var(--mb-text); white-space: nowrap; overflow: visible; text-overflow: clip; }
  html.mb #topbar .brand-name b { color: var(--mb-gold); }
  html.mb #topbar .brand-copy, html.mb #topbar .brand-sub { display: none !important; }
  html.mb #topbar .topright { display: contents !important; }
  html.mb #topbar .topright > * { display: none !important; }
  html.mb #topbar #btnLang, html.mb #topbar .rank-badge, html.mb #topbar #liveBadge { display: inline-flex !important; }
  html.mb #btnLang { grid-column: 2 / 4; grid-row: 2; align-self: start; justify-self: end; z-index: 2; margin-top: 2px; height: 28px; min-width: 34px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--mb-line); background: var(--mb-card); color: var(--mb-text); font: 800 11px/1 var(--sans); justify-content: center; align-items: center; }
  html.mb .rank-badge { grid-column: 3; grid-row: 1; height: 28px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--mb-gold); background: transparent; align-items: center; }
  html.mb .rank-badge small { display: none; }
  html.mb .rank-badge #rankTitle { color: var(--mb-gold); font: 700 10px/1 var(--sans); letter-spacing: .2px; white-space: nowrap; }
  html.mb #liveBadge { grid-column: 2; grid-row: 1; height: 28px; padding: 0 9px; max-width: 62px; overflow: hidden; border-radius: 999px; border: 1px solid var(--mb-up); background: transparent; color: var(--mb-up); font: 700 12px/1 var(--sans); align-items: center; }
  html.mb #liveBadge .dot-live { display: none; }
  html.mb #liveBadge #liveText { display: inline !important; font: 700 11px/1 var(--sans); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
  html.mb #topbar .pricebox { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 0 8px; padding: 2px 0 0; }
  html.mb #topbar .pricebox::before { content: 'PRO INDEX 500 FUTURES'; grid-column: 1 / -1; font: 700 11px/1.8 var(--sans); letter-spacing: 1.4px; color: var(--mb-mut); }
  html.mb #hdrPrice { grid-column: 1; grid-row: 2; font: 800 36px/1.05 var(--sans) !important; color: var(--mb-text) !important; letter-spacing: -.5px; }
  html.mb #hdrChange { grid-column: 2; grid-row: 2; justify-self: end; align-self: start; font: 800 16px/1 var(--sans) !important; margin-top: 30px; }
  html.mb #hdrSession { grid-column: 2; grid-row: 2; justify-self: end; align-self: end; font: 700 11px/1 var(--sans); letter-spacing: 1.2px; color: var(--mb-mut); margin-bottom: 5px; }
  html.mb #hdrPhase { display: none !important; }

  /* ---- ZONE JEU : colonne unique, cartes arrondies ---- */
  html.mb #main { display: flex !important; flex-direction: column; gap: 10px; padding: 4px 16px 0 !important; height: auto !important; overflow: visible !important; grid-template: none !important; }
  html.mb .resizer-v, html.mb #quizResize, html.mb .quiz-drag, html.mb #bookResize { display: none !important; }
  html.mb #chart-panel { order: 1; }
  html.mb #orderbook-panel { order: 3; display: contents !important; }
  html.mb .quiz-area { order: 5; }

  /* carte graphique */
  html.mb #chart-panel { background: var(--mb-card) !important; border: 1px solid var(--mb-line) !important; border-radius: 22px !important; overflow: hidden; padding: 0 !important; min-height: 0 !important; height: auto !important; flex: none !important; }
  html.mb #chart-title { padding: 10px 12px 0 !important; min-height: 0 !important; height: 44px !important; margin-bottom: 0; background: transparent !important; border: 0 !important; display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
  html.mb #btnAddChart, html.mb #btnPopChart { display: none !important; }
  html.mb #chart-title .ct-title, html.mb #chart-title .chart-tools, html.mb #btnTheme2 { display: none !important; }
  html.mb #rankLiveChip { display: none !important; }
  html.mb #btnMaxChart { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--mb-line); background: transparent; color: var(--mb-mut); }
  html.mb #chartWrap { height: 184px !important; min-height: 184px !important; position: relative; }
  html.mb #tf-selector { position: absolute !important; top: -38px; left: 10px; right: 54px; justify-content: space-between; display: flex; gap: 2px; z-index: 5; background: transparent !important; border: 0 !important; }
  html.mb #tf-selector button { min-width: 0; height: 30px; padding: 0 9px; border: 0 !important; border-radius: 10px; background: transparent !important; color: var(--mb-mut) !important; font: 700 13px/1 var(--sans); }
  html.mb #tf-selector button.active { background: var(--mb-blue) !important; color: #fff !important; }
  html.mb #setup-box { top: auto !important; bottom: 30px !important; left: 46px !important; right: auto !important; transform: scale(.56); transform-origin: bottom left; opacity: .88; }
  html.mb #newsflow, html.mb #chartDrag, html.mb #minisDrag, html.mb #minis, html.mb .ob-tune, html.mb .ob-grip { display: none !important; }
  html.mb body:not(.quiz-on) .quiz-area { display: none !important; }
  html.mb body.quiz-on #chart-panel { order: 1; }
  /* en-tête de la carte carnet (créé par mobile-beta.js) */
  html.mb #mbBookHead { order: 3; display: flex; align-items: center; justify-content: space-between; background: var(--mb-card); border: 1px solid var(--mb-line); border-bottom: 0; border-radius: 22px 22px 0 0; padding: 10px 10px 0 18px; }
  html.mb #mbBookHead span { font: 700 12px/1 var(--sans); letter-spacing: 1.3px; color: var(--mb-mut); text-transform: uppercase; }
  html.mb #mbBookHead button { width: 36px; height: 36px; border: 0; background: none; color: var(--mb-mut); display: inline-flex; align-items: center; justify-content: center; margin-left: 6px; }
  html.mb #mbBookHead svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

  /* carte SOLDE / SCORE / DISCIPLINE (les vraies statistiques du jeu) */
  html.mb #ob-foot { display: contents !important; }
  html.mb .ob-foot-right { display: contents !important; }
  html.mb #ob-foot .ob-stats { order: 2; flex: none; display: grid !important; grid-template-columns: 1.25fr .9fr 1fr 1fr; gap: 6px; background: var(--mb-card); border: 1px solid var(--mb-line); border-radius: 22px; padding: 10px 18px; }
  html.mb #ob-foot .ob-stats .st { display: flex; flex-direction: column; gap: 4px; background: none !important; border: 0 !important; padding: 0 !important; }
  html.mb #ob-foot .ob-stats .st small { font: 700 11px/1 var(--sans); letter-spacing: 1.3px; color: var(--mb-mut); }
  html.mb #ob-foot .ob-stats .st b { font: 800 19px/1.1 var(--sans); color: var(--mb-text); }
  html.mb #ob-foot .ob-stats .st.discipline b { color: var(--mb-up); }
  html.mb #ob-foot .ob-stats .st.level, html.mb #ob-foot .ob-stats .st.streak { display: none !important; }
  html.mb #ob-foot .ob-stats .st.rankpos { order: 2; } html.mb #ob-foot .ob-stats .st.rankpos b { color: var(--mb-gold); }
  html.mb #ob-foot .ob-stats .st.balance { order: 1; } html.mb #ob-foot .ob-stats .st.score { order: 2; } html.mb #ob-foot .ob-stats .st.discipline { order: 3; }

  /* carte CARNET */
  html.mb #ob-head { order: 3; margin: -10px 0 0; background: var(--mb-card) !important; border: 1px solid var(--mb-line); border-bottom: 0; border-radius: 0; padding-top: 6px !important; }
  html.mb #ob-traders { display: none !important; }
  html.mb #orderbook { order: 4; background: var(--mb-card) !important; border: 1px solid var(--mb-line); border-top: 0; border-radius: 0 0 22px 22px; overflow-x: hidden !important; overflow-y: auto !important; overscroll-behavior: contain; touch-action: pan-y !important; scrollbar-width: none; -webkit-overflow-scrolling: touch; height: var(--mb-book-h,161px) !important; min-height: var(--mb-book-h,161px) !important; max-height: var(--mb-book-h,161px) !important; flex: none !important; margin: -10px 0 0; }
  html.mb .mkt-veil#mktVeilBook { order: 4; }


  /* ---- TICKET : lots (− 1 lot +), FLAT, ACHAT / VENTE MARCHÉ ---- */
  html.mb #ob-foot .ob-trade-ctl { order: 6; display: grid !important; grid-template-columns: repeat(12, 1fr); gap: 8px; align-items: center; position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom,0px)); z-index: 940; padding: 10px 16px 8px; background: var(--mb-bg); }
  html.mb .ob-trade-ctl > label { display: none; }
  html.mb .ob-trade-ctl #lotInput { grid-column: 3 / 11; grid-row: 1; text-align: center; background: transparent !important; border: 0 !important; color: var(--mb-text); font: 800 18px/1 var(--sans); height: 44px; width: 100%; -moz-appearance: textfield; }
  html.mb .ob-trade-ctl #btnFlat { grid-column: 11 / 13; grid-row: 2; height: 48px; padding: 0 !important; min-width: 0; border-radius: 14px; background: var(--mb-btnbg) !important; border: 1px solid var(--mb-line) !important; color: var(--mb-mut) !important; font: 800 14px/1 var(--sans); letter-spacing: .6px; }
  html.mb .ob-trade-ctl #btnMarketBuy { grid-column: 1 / 6; grid-row: 2; }
  html.mb .ob-trade-ctl #btnMarketSell { grid-column: 6 / 11; grid-row: 2; }
  html.mb .ob-trade-ctl .mkt-btn { height: 48px; min-width: 0; width: 100%; padding: 0 4px !important; white-space: nowrap; border-radius: 16px !important; border: 0 !important; font: 800 14px/1 var(--sans); letter-spacing: .8px; text-transform: uppercase; }
  html.mb .ob-trade-ctl .mkt-btn.buy { background: var(--mb-up) !important; color: #06251d !important; }
  html.mb .ob-trade-ctl .mkt-btn.sell { background: var(--mb-dn) !important; color: #2a0709 !important; }
  html.mb body.theme-light .ob-trade-ctl .mkt-btn { color: #fff !important; }
  html.mb .mb-step { height: 40px; width: 100%; border-radius: 14px; border: 1px solid var(--mb-line); background: var(--mb-btnbg); color: var(--mb-text); font: 800 22px/1 var(--sans); display: flex; align-items: center; justify-content: center; }
  html.mb #mbMinus { grid-column: 1 / 3; grid-row: 1; }
  html.mb .ob-trade-ctl #lotInput { padding: 0 !important; }
  html.mb .ob-trade-ctl #btnFollow svg, html.mb .ob-trade-ctl #btnMaxBook svg, html.mb .ob-trade-ctl #btnFollow::before, html.mb .ob-trade-ctl #btnMaxBook::before { display: none !important; } html.mb #mbPlus { grid-column: 11 / 13; grid-row: 1; }
  html.mb #orders-display { display: none !important; }
  html.mb .ob-legend-open, html.mb .vp-note, html.mb .ob-touch-note { display: none !important; } html.mb .ob-btns { display: contents !important; }
  html.mb #btnBookSide, html.mb #btnPopBook, html.mb .pop-book-btn { display: none !important; }   /* « Détacher » = version web seulement */


  /* ---- BOT IA : taille et place connues (petit, au-dessus du ticket, jamais sur le carnet) ---- */
  html.mb #chatFab { width: 46px !important; height: 54px !important; z-index: 930; touch-action: none; }

  /* ---- MODE QUIZ : carte question en haut, carnet figé, boutons en bas, explication en feuille ---- */
  html.mb body.quiz-on .quiz-area { display: block !important; order: 0; position: relative; height: auto !important; min-height: 0 !important; background: var(--mb-card) !important; border: 1px solid var(--mb-line) !important; border-left: 4px solid var(--mb-gold) !important; border-radius: 22px !important; padding: 14px 16px !important; margin: 0 !important; overflow: visible !important; }
  html.mb .quiz-area, html.mb .quiz-body, html.mb .quiz-text, html.mb .quiz-actions { contain: none !important; max-height: none !important; }
  html.mb body.quiz-on .quiz-area, html.mb body.quiz-on .quiz-body { height: auto !important; overflow: visible !important; }
  html.mb .quiz-head { display: flex; align-items: center; justify-content: space-between; padding: 0 !important; margin: 0 0 8px !important; background: none !important; border: 0 !important; }
  html.mb .quiz-title { font: 800 12px/1 var(--sans) !important; letter-spacing: 1.3px; color: var(--mb-mut) !important; text-transform: uppercase; }
  html.mb .quiz-lock-tip, html.mb #quizLockTip { font: 700 12px/1 var(--sans); }
  html.mb #btnMaxQuiz, html.mb .quiz-split, html.mb #quizDrag { display: none !important; }
  html.mb .quiz-body { display: block !important; height: auto !important; padding: 0 !important; background: none !important; }
  html.mb .quiz-text { max-height: none !important; overflow: visible !important; padding: 0 !important; }
  html.mb #question-text { font: 700 17px/1.35 var(--sans) !important; color: var(--mb-text) !important; }
  html.mb #q-timer { height: 4px; border-radius: 3px; background: var(--mb-line); margin: 10px 0 0; overflow: hidden; }
  html.mb #feedback-text { font: 800 15px/1.3 var(--sans); color: var(--mb-up); margin-top: 8px; }
  html.mb #explain-text { font: 500 14.5px/1.5 var(--sans); color: var(--mb-text); margin-top: 8px; }
  html.mb #feedback-text:empty, html.mb #explain-text:empty { display: none; }
  html.mb body.quiz-on .ob-trade-ctl { display: none !important; }
  html.mb body:not(.mb-trading) #ob-foot .ob-trade-ctl { display: none !important; }
  html.mb body.quiz-on { padding-bottom: calc(110px + env(safe-area-inset-bottom,0px)) !important; }
  html.mb body.quiz-on .quiz-actions { display: flex !important; flex-wrap: wrap; gap: 8px; padding: 12px 0 0 !important; margin: 0 !important; background: none !important; position: static !important; }
  html.mb body.quiz-on .quiz-actions .btn { flex: 1 1 auto; min-height: 42px; height: auto; border-radius: 14px !important; font: 800 13px/1.15 var(--sans); border: 1px solid var(--mb-line) !important; background: var(--mb-btnbg) !important; color: var(--mb-text) !important; padding: 8px 12px; white-space: normal; text-align: center; }
  html.mb body.quiz-on .quiz-actions #btnNew, html.mb body.quiz-on .quiz-actions #btnNextQ { background: var(--mb-blue) !important; border-color: var(--mb-blue) !important; color: #fff !important; }
  html.mb body.quiz-on .quiz-actions #btnNextQ[hidden] { display: none !important; }
  html.mb .rep-row { display: flex; gap: 8px; margin-top: 10px; }
  html.mb .rep-row input { flex: 1; height: 44px; border-radius: 12px; border: 1px solid var(--mb-line); background: var(--mb-bg); color: var(--mb-text); padding: 0 12px; font: 600 15px var(--sans); }
  html.mb .rep-row.hidden { display: none; }
  /* explication : feuille du bas (comme la maquette) */
  html.mb body.mb-explain.quiz-on .quiz-area { position: fixed !important; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom,0px)); z-index: 945; border-radius: 24px 24px 0 0 !important; border-left: 1px solid var(--mb-line) !important; border-bottom: 0 !important; max-height: 58vh; overflow: auto !important; box-shadow: 0 -10px 30px rgba(0,0,0,.25); scrollbar-width: none; }
  html.mb body.mb-explain.quiz-on .quiz-area::-webkit-scrollbar { display: none; }

  /* ---- BARRE DU BAS ---- */
  html.mb #mbnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 950; display: flex; padding: 8px 6px calc(10px + env(safe-area-inset-bottom,0px));
    background: var(--mb-card); border-top: 1px solid var(--mb-line); }
  html.mb #mbnav button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 2px 0; color: var(--mb-mut); font: 700 12px/1.1 var(--sans); min-height: 48px; cursor: pointer; }
  html.mb #mbnav button svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  html.mb #mbnav button.on { color: var(--mb-blue); }
  html.mb body:not(.theme-light) #mbnav button.on { color: var(--mb-gold); }

  html.mb #mbsheet { display: none; position: fixed; inset: 0; z-index: 960; background: rgba(8,12,24,.55); align-items: flex-end; }
  html.mb #mbbook { display: none; position: fixed; inset: 0; z-index: 960; background: rgba(8,12,24,.55); align-items: flex-end; }
  html.mb #mbsheet.open { display: flex; }
  html.mb #mbbook.open { display: flex; }
  html.mb #mbsheet .mb-box { width: 100%; max-height: 84vh; overflow: auto; background: var(--mb-card); color: var(--mb-text); border-radius: 24px 24px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom,0px)); border-top: 1px solid var(--mb-line); scrollbar-width: none; }
  html.mb #mbbook .mb-box { width: 100%; max-height: 84vh; overflow: auto; background: var(--mb-card); color: var(--mb-text); border-radius: 24px 24px 0 0; padding: 8px 16px calc(20px + env(safe-area-inset-bottom,0px)); border-top: 1px solid var(--mb-line); scrollbar-width: none; }
  html.mb #mbsheet .mb-box::-webkit-scrollbar { display: none; }
  html.mb #mbbook .mb-box::-webkit-scrollbar { display: none; }
  html.mb #mbsheet .mb-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--mb-line); margin: 4px auto 12px; }
  html.mb #mbbook .mb-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--mb-line); margin: 4px auto 12px; }
  html.mb #mbsheet .mb-h { font: 800 12px/1 var(--sans); letter-spacing: 1.3px; color: var(--mb-mut); margin: 14px 0 8px; text-transform: uppercase; }
  html.mb #mbbook .mb-h { font: 800 12px/1 var(--sans); letter-spacing: 1.3px; color: var(--mb-mut); margin: 14px 0 8px; text-transform: uppercase; }
  html.mb #mbsheet .mb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  html.mb #mbbook .mb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  html.mb #mbsheet .mb-it { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px; min-height: 50px; border-radius: 14px; background: var(--mb-bg); border: 1px solid var(--mb-line); color: inherit; font: 700 14px/1.2 var(--sans); }
  html.mb #mbsheet .mb-it span { font-size: 19px; }
}
  /* Quiz : la bulle d accueil du bot ne doit pas masquer les boutons du scénario */
@media (max-width: 720px) {
  /* Quiz : on répond EN CLIQUANT le carnet → il passe juste sous la question, le graphique descend */
  html.mb body.quiz-on #mbBookHead, html.mb body.quiz-on #ob-head { order: 1; }
  html.mb body.quiz-on #orderbook { order: 2; }
  html.mb body.quiz-on #chart-panel { order: 3; }
  html.mb body.quiz-on #ob-foot .ob-stats { order: 4; }
}

@media (max-width: 720px) {
  html.mb #mbsheet .mb-chips, html.mb #mbbook .mb-chips { display: flex; flex-wrap: wrap; gap: 8px; }
  html.mb #mbsheet .mb-chip, html.mb #mbbook .mb-chip { padding: 10px 14px; min-height: 42px; border-radius: 999px; background: var(--mb-bg); border: 1px solid var(--mb-line); color: var(--mb-mut); font: 700 14px/1 var(--sans); }
  html.mb #mbsheet .mb-chip.on, html.mb #mbbook .mb-chip.on { background: var(--mb-blue); border-color: var(--mb-blue); color: #fff; }
}

@media (max-width: 720px) {
  /* Écran de connexion : pas de barre du bas ni de ticket avant d'être connecté ; la carte défile depuis le haut (logo visible) */
  html.mb body.mb-login #mbnav, html.mb body.mb-login #ob-foot .ob-trade-ctl, html.mb body.mb-login #chatFab, html.mb body.mb-login #chatNudge { display: none !important; }
  html.mb #login-screen { align-items: flex-start !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch; padding-bottom: 24px; }
  html.mb #login-screen .login-layout { min-height: 0 !important; height: auto !important; margin: 0 auto; }
}
@media (max-width: 720px) { html.mb #login-screen { background: #0a0f1c !important; } html.mb body.mb-login > footer, html.mb body.mb-login .site-footer { visibility: hidden; } }
@media (max-width: 720px) { html.mb body.mb-login #appFoot { display: none !important; } }

/* carnet mobile : défilement tactile sans barre visible */
html.mb #orderbook::-webkit-scrollbar { display: none; width: 0; }

/* ===== Barre d'outils du graphique (mobile) : bande défilante sous le graphique ===== */
html.mb #chart-panel > .chart-tools.mb-ct { display: none !important; }
html.mb #chart-panel.mb-tools-on > .chart-tools.mb-ct { display: flex !important; flex-wrap: nowrap !important; align-items: center; gap: 8px; padding: 8px 12px 10px; margin: 0; overflow-x: auto; overflow-y: hidden; border-top: 1px solid var(--mb-line); scrollbar-width: none; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
html.mb #chart-panel > .chart-tools.mb-ct::-webkit-scrollbar { display: none; }
html.mb .mb-ct .ct-grp { display: flex; flex: none; align-items: center; gap: 6px; padding-right: 8px; border-right: 1px solid var(--mb-line); }
html.mb .mb-ct .ct-grp:last-child { border-right: 0; padding-right: 0; }
html.mb .mb-ct .tbtn { flex: none; min-width: 40px; height: 36px; padding: 0 10px !important; border-radius: 11px !important; border: 1px solid var(--mb-line) !important; background: var(--mb-btnbg) !important; color: var(--mb-text) !important; font: 700 15px/1 var(--sans) !important; display: inline-flex; align-items: center; justify-content: center; }
html.mb .mb-ct .tbtn::before { content: none !important; }
html.mb .mb-ct .tbtn.on, html.mb .mb-ct .tbtn[aria-pressed="true"] { border-color: var(--mb-gold) !important; color: var(--mb-gold) !important; background: rgba(255,215,0,.14) !important; }
html.mb body.theme-light .mb-ct .tbtn.on, html.mb body.theme-light .mb-ct .tbtn[aria-pressed="true"] { border-color: var(--mb-blue) !important; color: var(--mb-blue) !important; background: rgba(37,99,235,.10) !important; }
html.mb .mb-ct .ct-danger { color: var(--mb-dn) !important; }

/* ===== Ascenseur à droite : fin, discret, discret au repos (mobile + fenêtre réduite) ===== */
html.mb, html.mb body, html.mb .tabpanel, html.mb .quiz-area { scrollbar-width: thin; scrollbar-color: rgba(140,152,175,.38) transparent; }
html.mb ::-webkit-scrollbar { width: 4px; height: 4px; background: transparent; }
html.mb ::-webkit-scrollbar-track { background: transparent; }
html.mb ::-webkit-scrollbar-thumb { background: rgba(140,152,175,.38); border-radius: 4px; }
html.mb ::-webkit-scrollbar-thumb:hover { background: rgba(140,152,175,.7); }
html.mb ::-webkit-scrollbar-corner { background: transparent; }

/* l'ancienne barre mobile « Trading · Quiz · Compte · Offres · Plus » (#m2nav) est remplacée par #mbnav : jamais affichée en bêta (surtout pas sur l'écran de connexion) */
html.mb #m2nav, html.mb .m2nav { display: none !important; }

/* − / + à côté du graphique + « ⋯ » (le reste des outils s'ouvre en dessous) */
html.mb #mbZoomPill { position: absolute; left: 70px; bottom: 30px; z-index: 6; display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 13px; background: color-mix(in srgb, var(--mb-card) 82%, transparent); border: 1px solid var(--mb-line); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
html.mb #mbZoomPill > button { min-width: 34px; height: 30px; padding: 0 !important; border: 0 !important; border-radius: 9px !important; background: transparent !important; color: var(--mb-text) !important; font: 700 17px/1 var(--sans) !important; display: inline-flex; align-items: center; justify-content: center; }
html.mb #mbZoomPill > button + button { border-left: 1px solid var(--mb-line) !important; border-radius: 0 !important; }
html.mb #mbZoomPill > #mbToolsBtn.on { color: var(--mb-gold) !important; }
html.mb #mbZoomPill > button::before { content: none !important; }

/* quantité : la valeur occupe toute la case centrale → « − » et « + » aux deux bouts, symétriques */
html.mb .ob-trade-ctl #lotInput { justify-self: stretch !important; width: 100% !important; max-width: none !important; min-width: 0 !important; box-sizing: border-box; text-align: center !important; }
html.mb #mbMinus, html.mb #mbPlus { justify-self: stretch; }

/* ===== Drapeaux FR / EN à côté du bouton langue ===== */
html.mb #btnLang::before { content: ''; display: inline-block; width: 18px; height: 12px; margin-right: 5px; border-radius: 2px; vertical-align: -1px; background-size: cover; background-position: center; box-shadow: 0 0 0 1px rgba(128,140,160,.35); }
html.mb #btnLang.mb-fr::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 3 2'><rect width='1' height='2' fill='%230055A4'/><rect x='1' width='1' height='2' fill='%23fff'/><rect x='2' width='1' height='2' fill='%23EF4135'/></svg>"); }
html.mb #btnLang.mb-en::before { background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 40'><rect width='60' height='40' fill='%23012169'/><path d='M0 0L60 40M60 0L0 40' stroke='%23fff' stroke-width='8'/><path d='M0 0L60 40M60 0L0 40' stroke='%23C8102E' stroke-width='3'/><path d='M30 0V40M0 20H60' stroke='%23fff' stroke-width='12'/><path d='M30 0V40M0 20H60' stroke='%23C8102E' stroke-width='7'/></svg>"); }

/* poignée de la pastille − + ⋯ */
html.mb #mbZoomGrip { width: 22px; height: 30px; display: inline-flex; align-items: center; justify-content: center; color: var(--mb-mut); font-size: 15px; touch-action: none; cursor: grab; user-select: none; }

/* ===== Carnet / graphique AGRANDIS (plein écran mobile) ===== */
html.mb #orderbook-panel.maxed { display: flex !important; flex-direction: column; position: fixed !important; inset: 0 0 calc(76px + 128px + env(safe-area-inset-bottom,0px)) 0 !important; z-index: 920 !important; width: auto !important; height: auto !important; background: var(--mb-bg) !important; padding: 8px 10px 0; gap: 6px; }
html.mb #orderbook-panel.maxed #orderbook { order: 4; flex: 1 1 auto !important; height: auto !important; min-height: 0 !important; max-height: none !important; margin: 0 !important; border-radius: 16px; border-top: 1px solid var(--mb-line); }
html.mb #orderbook-panel.maxed #ob-head { display: none; }
html.mb #chart-panel.maxed { display: flex !important; flex-direction: column; position: fixed !important; inset: 0 0 calc(76px + 128px + env(safe-area-inset-bottom,0px)) 0 !important; z-index: 920 !important; width: auto !important; height: auto !important; background: var(--mb-bg) !important; border-radius: 0 !important; }
html.mb #chart-panel.maxed #chartWrap { flex: 1 1 auto; height: auto !important; min-height: 0 !important; }
html.mb #chart-panel.maxed > .chart-tools.mb-ct { flex: none; }

/* ============================================================================
   BÊTA v3 — barre du bas : Graphique | DOM | Classement | Compét. | Prop Firm | Chat | Plus
   Deux vues du même onglet Trading (classes mbv-chart / mbv-dom sur <html>) :
   - Graphique : graphique + 2 mini-graphiques + ticket + rang + statistiques
   - DOM : carnet + ticket + statistiques + Quiz Mode en dessous
   Aucune donnée ni logique de simulation n'est modifiée (affichage seulement).
   ============================================================================ */
@media (max-width: 720px) {
  /* ---- barre du bas : 7 entrées lisibles ---- */
  html.mb #mbnav { padding: 6px 2px calc(8px + env(safe-area-inset-bottom,0px)); box-shadow: 0 -8px 24px rgba(8,12,24,.10); }
  html.mb #mbnav button { gap: 3px; font: 700 10px/1.1 var(--sans); min-width: 0; min-height: 46px; position: relative; letter-spacing: .1px; }
  html.mb #mbnav button svg { width: 23px; height: 23px; }
  html.mb #mbnav button.on::before { content: ''; position: absolute; top: -7px; left: 22%; right: 22%; height: 3px; border-radius: 0 0 3px 3px; background: var(--mb-blue); }
  html.mb body:not(.theme-light) #mbnav button.on::before { background: var(--mb-gold); }

  /* ---- EN-TÊTE : marque + pastilles, puis carte du cours ---- */
  html.mb #topbar { grid-template-columns: 1fr auto auto auto; padding: 12px 14px 4px !important; gap: 8px 6px; }
  html.mb #topbar .brand-name { font-size: clamp(9px, 3vw, 12.5px); letter-spacing: .4px; }
  html.mb #liveBadge { grid-column: 2; max-width: none; }
  html.mb .rank-badge { grid-column: 3; }
  html.mb #btnLang { grid-column: 4; grid-row: 1; margin: 0; width: 30px; min-width: 30px; height: 28px; padding: 0 !important; font-size: 0 !important; justify-self: end; align-self: center; }
  html.mb #btnLang::before { margin: 0 !important; width: 20px !important; height: 13px !important; }
  html.mb #topbar .pricebox { grid-row: 2; grid-template-columns: 1fr auto; gap: 0 10px; margin: 2px 0 0; padding: 10px 14px 12px; border-radius: 18px; background: var(--mb-card); border: 1px solid var(--mb-line); box-shadow: 0 6px 18px rgba(8,12,24,.06); }
  html.mb #topbar .pricebox::before { grid-row: 1; grid-column: 1; align-self: center; content: 'PRO INDEX 500 · SIMULATED'; font: 700 10px/1.6 var(--sans); letter-spacing: 1.3px; }
  html.mb #hdrPrice { font: 800 34px/1.05 var(--sans) !important; font-variant-numeric: tabular-nums; letter-spacing: -.4px; }
  html.mb #hdrChange { grid-column: 2; grid-row: 2; align-self: center; margin: 0; padding: 6px 11px; border-radius: 999px; background: color-mix(in srgb, currentColor 13%, transparent); font: 800 15px/1 var(--sans) !important; }
  html.mb #hdrSession { display: none !important; }
  html.mb #hdrPhase { display: inline-flex !important; grid-column: 2; grid-row: 1; justify-self: end; align-self: center; margin: 0; padding: 4px 10px; border-radius: 999px; font: 700 11px/1 var(--sans); letter-spacing: .4px; }

  /* ---- zone de jeu ---- */
  html.mb #main { padding: 6px 14px 0 !important; gap: 10px; }
  html.mb #mlRank, html.mb #ob-foot #mlRank { margin: 0; }
  html.mb #ob-foot .ob-touch-note { display: none !important; }
  
  html.mb #ob-foot .ob-stats { grid-template-columns: repeat(5, 1fr); padding: 10px 12px; gap: 4px; }
  html.mb #ob-foot .ob-stats .st.level { display: none !important; } html.mb #ob-foot .ob-stats .st.streak { display: flex !important; }
  html.mb #ob-foot .ob-stats .st { align-items: center; text-align: center; min-width: 0; }
  html.mb #ob-foot .ob-stats .st small { font-size: 8.5px; letter-spacing: .8px; white-space: nowrap; }
  html.mb #ob-foot .ob-stats .st b { font-size: 15px; white-space: nowrap; }
  html.mb #ob-foot .ob-stats .st.level { order: 0; } html.mb #ob-foot .ob-stats .st.balance { order: 1; } html.mb #ob-foot .ob-stats .st.score { order: 2; }
  html.mb #ob-foot .ob-stats .st.streak { order: 3; } html.mb #ob-foot .ob-stats .st.discipline { order: 4; } html.mb #ob-foot .ob-stats .st.rankpos { order: 5; }

  /* ---- ticket (dock) : − lots + / ACHAT · VENTE · FLAT ---- */
  html.mb #ob-foot .ob-trade-ctl { bottom: calc(68px + env(safe-area-inset-bottom,0px)); padding: 10px 14px 10px; gap: 8px; border-top: 1px solid var(--mb-line); box-shadow: 0 -8px 20px rgba(8,12,24,.08); }
  html.mb .ob-trade-ctl #btnMarketBuy { grid-column: 1 / 6; } html.mb .ob-trade-ctl #btnMarketSell { grid-column: 6 / 11; }
  html.mb .ob-trade-ctl #btnFlat { grid-column: 11 / 13; width: 100%; font-size: 12px !important; letter-spacing: 0 !important; padding: 0 !important; }
  html.mb .ob-trade-ctl #btnFlat svg, html.mb .ob-trade-ctl #btnFlat .ico { display: none !important; }
  
  html.mb .ob-trade-ctl .mkt-btn { font-size: 13px; letter-spacing: .5px; box-shadow: 0 4px 12px rgba(8,12,24,.12); }
  html.mb .ob-trade-ctl #lotInput { border: 1px solid var(--mb-line) !important; border-radius: 14px; height: 40px; background: var(--mb-btnbg) !important; grid-column: 3 / 11; }
  html.mb .mb-step { height: 40px; }
  html.mb body { padding-bottom: calc(212px + env(safe-area-inset-bottom,0px)) !important; }

  /* ---- VUE GRAPHIQUE ---- */
  html.mb.mbv-chart #mbBookHead, html.mb.mbv-chart #ob-head, html.mb.mbv-chart #orderbook, html.mb.mbv-chart #mktVeilBook, html.mb.mbv-chart .quiz-area { display: none !important; }
  html.mb.mbv-chart #chart-panel { order: 1; }
  html.mb.mbv-chart #ob-foot .ob-stats { order: 3; }
  html.mb.mbv-chart #ob-foot #mlRank { order: 4; }
  html.mb.mbv-chart #chartWrap { height: 218px !important; min-height: 218px !important; }
  html.mb.mbv-chart #tf-selector { top: -38px; }
  html.mb.mbv-chart #minis { display: flex !important; gap: 8px; height: 104px !important; min-height: 104px !important; padding: 8px 10px 10px; border-top: 1px solid var(--mb-line); }
  html.mb.mbv-chart #minis > * { flex: 1 1 0; min-width: 0; }
  html.mb.mbv-chart #minisDrag { display: none !important; }

  /* ---- VUE DOM ---- */
  html.mb.mbv-dom #chart-panel { display: none !important; }
  html.mb.mbv-dom #mbBookHead { order: 3; } html.mb.mbv-dom #ob-head { order: 3; } html.mb.mbv-dom #orderbook { order: 4; }
    html.mb.mbv-dom #ob-foot .ob-stats { order: 6; }
  html.mb.mbv-dom #ob-foot #mlRank { order: 7; }
  html.mb.mbv-dom .quiz-area { order: 7; display: block !important; }
  html.mb.mbv-dom body .quiz-area { display: block !important; order: 7; position: relative; height: auto !important; min-height: 0 !important; background: var(--mb-card) !important; border: 1px solid var(--mb-line) !important; border-left: 4px solid var(--mb-gold) !important; border-radius: 22px !important; padding: 14px 16px !important; margin: 0 !important; overflow: visible !important; }
  html.mb.mbv-dom body .quiz-area, html.mb.mbv-dom body .quiz-body { height: auto !important; overflow: visible !important; }
  html.mb.mbv-dom body .quiz-actions { display: flex !important; flex-wrap: wrap; gap: 8px; padding: 12px 0 0 !important; margin: 0 !important; background: none !important; position: static !important; }
  html.mb.mbv-dom body .quiz-actions .btn { flex: 1 1 auto; min-height: 42px; height: auto; border-radius: 14px !important; font: 800 13px/1.15 var(--sans); border: 1px solid var(--mb-line) !important; background: var(--mb-btnbg) !important; color: var(--mb-text) !important; padding: 8px 12px; white-space: normal; text-align: center; }
  html.mb.mbv-dom body .quiz-actions #btnNew, html.mb.mbv-dom body .quiz-actions #btnNextQ { background: var(--mb-blue) !important; border-color: var(--mb-blue) !important; color: #fff !important; }
  html.mb.mbv-dom body .quiz-actions #btnNextQ[hidden] { display: none !important; }
}

@media (max-width: 720px) {
  /* ---- en-tête v3.1 : marque + drapeau + déconnexion ; puces LIVE / niveau sur la 2e ligne ; carte du cours ---- */
  html.mb #topbar { grid-template-columns: auto auto minmax(0,1fr) auto auto; }
  html.mb #topbar .brand { grid-column: 1 / 4; grid-row: 1; }
  html.mb #btnLang { grid-column: 4; grid-row: 1; }
  html.mb #mbLogout { grid-column: 5; grid-row: 1; width: 30px; height: 28px; border-radius: 999px; border: 1px solid var(--mb-line); background: var(--mb-card); color: var(--mb-mut); display: inline-flex; align-items: center; justify-content: center; padding: 0; }
  html.mb #mbLogout svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  html.mb #liveBadge { grid-column: 1; grid-row: 2; justify-self: start; max-width: none; }
  html.mb .rank-badge { grid-column: 2 / 6; grid-row: 2; justify-self: start; max-width: 100%; overflow: hidden; }
  html.mb .rank-badge #rankTitle { overflow: hidden; text-overflow: ellipsis; }
  html.mb #topbar .pricebox { grid-row: 3; }
  html.mb #liveBadge #liveText { overflow: visible; }
  /* ---- bot : au-dessus de tous les onglets, jamais caché ---- */
  html.mb #chatFab, html.mb #chatNudge, html.mb .chat-nudge { z-index: 3000 !important; }
  /* ---- flèche « descendre » discrète, au-dessus du ticket ---- */
  html.mb #mlDown { right: 10px; bottom: calc(196px + env(safe-area-inset-bottom,0px)); z-index: 940; width: 34px; height: 34px; opacity: .78; background: color-mix(in srgb, var(--mb-card) 92%, transparent) !important; color: var(--mb-mut) !important; border-color: var(--mb-line) !important; box-shadow: 0 3px 10px rgba(8,12,24,.14); }
  html.mb body:not(.mb-trading) #mlDown { bottom: calc(84px + env(safe-area-inset-bottom,0px)); }
}

@media (max-width: 720px) {
  /* panneaux d'onglets : fond opaque (le jeu ne transparaît plus) + bandeau illustré */
  html.mb .tabpanel { background: var(--mb-bg) !important; }
  html.mb .tabpanel .panel-head { background: var(--mb-card) !important; border-bottom: 1px solid var(--mb-line) !important; }
  html.mb .mb-hero { display: flex; align-items: center; gap: 14px; margin: 4px 0 14px; padding: 16px 16px; border-radius: 20px; border: 1px solid var(--mb-line);
    background: linear-gradient(135deg, color-mix(in srgb, var(--mb-blue) 14%, var(--mb-card)) 0%, var(--mb-card) 70%); box-shadow: 0 6px 18px rgba(8,12,24,.07); }
  html.mb body:not(.theme-light) .mb-hero { background: linear-gradient(135deg, color-mix(in srgb, var(--mb-gold) 16%, var(--mb-card)) 0%, var(--mb-card) 70%); }
  html.mb .mb-hero-ic { flex: none; width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center; background: var(--mb-blue); color: #fff; box-shadow: 0 6px 14px rgba(36,80,204,.28); }
  html.mb body:not(.theme-light) .mb-hero-ic { background: var(--mb-gold); color: #1b1300; box-shadow: 0 6px 14px rgba(242,182,50,.25); }
  html.mb .mb-hero-ic svg { width: 28px; height: 28px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  html.mb .mb-hero b { display: block; font: 800 17px/1.2 var(--sans); color: var(--mb-text); }
  html.mb .mb-hero small { display: block; margin-top: 3px; font: 600 12.5px/1.35 var(--sans); color: var(--mb-mut); }
}

@media (max-width: 720px) {
  /* ---- boutons d'origine rétablis dans le ticket : − lots + · SUIVRE · AGRANDIR · infos d'ordres ---- */
  html.mb #mbMinus { grid-column: 1 / 3; grid-row: 1; }
  html.mb .ob-trade-ctl #lotInput { padding: 0 !important; }
  html.mb .ob-trade-ctl #btnFollow svg, html.mb .ob-trade-ctl #btnMaxBook svg, html.mb .ob-trade-ctl #btnFollow::before, html.mb .ob-trade-ctl #btnMaxBook::before { display: none !important; } html.mb #mbPlus { grid-column: 5 / 7; grid-row: 1; }
  html.mb .ob-trade-ctl #lotInput { grid-column: 3 / 5 !important; grid-row: 1; }
  html.mb .ob-trade-ctl #btnFollow { display: inline-flex !important; grid-column: 7 / 10; grid-row: 1; height: 40px; min-width: 0; width: 100%; padding: 0 !important; justify-content: center; align-items: center; font: 800 11px/1 var(--sans) !important; letter-spacing: 0 !important; border-radius: 14px !important; position: relative; gap: 4px; }
  html.mb .ob-trade-ctl #btnMaxBook { display: inline-flex !important; grid-column: 10 / 13; grid-row: 1; height: 40px; min-width: 0; width: 100%; padding: 0 !important; justify-content: center; align-items: center; font: 800 11px/1 var(--sans) !important; letter-spacing: 0 !important; border-radius: 14px !important; gap: 4px; }
  html.mb .ob-trade-ctl #btnFollow svg, html.mb .ob-trade-ctl #btnMaxBook svg { width: 20px; height: 20px; display: block !important; }
  html.mb .ob-trade-ctl #btnFollow .dot { position: absolute; top: 7px; right: 8px; }
  html.mb .ob-trade-ctl #orders-display { display: block !important; grid-column: 1 / -1; grid-row: 3; text-align: center; font: 600 11px/1.2 var(--sans) !important; color: var(--mb-mut); margin: 0; min-height: 0; }
  html.mb .ob-trade-ctl .mkt-btn, html.mb .ob-trade-ctl #btnFlat { grid-row: 2; }
  html.mb body { padding-bottom: calc(232px + env(safe-area-inset-bottom,0px)) !important; }
  html.mb #mlDown { bottom: calc(214px + env(safe-area-inset-bottom,0px)); }
  /* aide « Comment jouer ? / Légende » visible dans la vue DOM */
  html.mb.mbv-dom #ob-foot .ob-touch-note { display: block !important; order: 6; text-align: center; font: 600 12px/1.4 var(--sans); color: var(--mb-mut); }
  html.mb.mbv-dom #ob-foot .ob-stats { order: 5; }
  html.mb.mbv-dom #ob-foot #mlRank { order: 6; }
  html.mb.mbv-dom #ob-foot .ob-touch-note { order: 7; }
  html.mb.mbv-dom .quiz-area { order: 8; }
  /* barre newsletter : pas de bandeau en bas du jeu mobile ; on l'ouvre à la demande depuis « Plus » */
  html.mb #nlBar { display: none !important; }
  html.mb #nlBar.mb-show:not([hidden]) { display: block !important; z-index: 975; bottom: calc(68px + env(safe-area-inset-bottom,0px)); border-radius: 20px 20px 0 0; }
  /* mentions © et réseaux sociaux (menu « Plus ») */
  html.mb #mbsheet .mb-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--mb-line); text-align: center; color: var(--mb-mut); font: 600 12px/1.5 var(--sans); }
  html.mb #mbsheet .mb-foot .mpp-foot { display: flex; flex-direction: column; align-items: center; gap: 8px; }
  html.mb #mbsheet .mb-foot a { color: inherit; margin: 0 6px; text-decoration: underline; }
  html.mb #mbsheet .mb-foot .mpp-soc { display: inline-flex; gap: 8px; margin: 0; }
  html.mb #mbsheet .mb-foot .mpp-soc a { width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; margin: 0; border-radius: 12px; border: 1px solid var(--mb-line); background: var(--mb-bg); text-decoration: none; }
  html.mb #mbsheet .mb-foot .mpp-soc svg { width: 18px; height: 18px; fill: var(--mb-mut); }
}

@media (max-width: 720px) {
  html.mb #mbDisc { margin: 2px 14px 0; padding: 0; text-align: center; font: 600 10.5px/1.3 var(--sans); letter-spacing: .3px; color: var(--mb-mut); opacity: .85; }
  html.mb #mbDisc::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--mb-gold); vertical-align: 1px; }
  html.mb body.mb-login #mbDisc { display: none; }
}

@media (max-width: 720px) {
  /* libellé du cours suivant la langue (FR/EN) */
  html.mb[lang^="fr"] #topbar .pricebox::before { content: 'PRO INDEX 500 · SIMULÉ'; }
}

/* ===== Bandeaux illustrés v2 : illustration vectorielle à droite du titre (décor) ===== */
html.mb .mb-hero { position: relative; overflow: hidden; min-height: 104px; padding-right: 138px; }
html.mb .mb-hero-ic { display: none; }
html.mb .mb-hero-tx { position: relative; z-index: 1; min-width: 0; }
html.mb .mb-hero-art { position: absolute; right: 8px; bottom: 6px; top: 6px; height: calc(100% - 12px); width: 128px; pointer-events: none; }
html.mb .mb-hero-art .a1 { fill: var(--mb-blue); } html.mb .mb-hero-art .a2 { fill: var(--mb-gold); } html.mb .mb-hero-art .a3 { fill: #1fa971; }
html.mb .mb-hero-art .a4 { fill: #d6453d; } html.mb .mb-hero-art .a5 { fill: color-mix(in srgb, var(--mb-mut) 38%, transparent); }
html.mb .mb-hero-art .tx { fill: #fff; font: 800 14px var(--sans); }
html.mb .mb-hero-art .ln, html.mb .mb-hero-art .ln2, html.mb .mb-hero-art .ln3, html.mb .mb-hero-art .ln4, html.mb .mb-hero-art .ln5 { fill: none; stroke-linecap: round; stroke-linejoin: round; }
html.mb .mb-hero-art .ln { stroke: #1fa971; stroke-width: 3; } html.mb .mb-hero-art .ln2 { stroke: #1b1300; stroke-width: 2.4; }
html.mb .mb-hero-art .ln3 { stroke: var(--mb-gold); stroke-width: 3; } html.mb .mb-hero-art .ln4 { stroke: #fff; stroke-width: 4; } html.mb .mb-hero-art .ln5 { stroke: var(--mb-mut); stroke-width: 2.2; }
html.mb body:not(.theme-light) .mb-hero-art .a1 { fill: #3d6bff; }

/* ===== Zones vides illustrées (classements, journal) ===== */
html.mb .lead .empty, html.mb #journalList .empty { text-align: center; padding: 14px 12px 16px !important; }
html.mb .lead .empty::before, html.mb #journalList .empty::before { content: ''; display: block; height: 78px; margin: 0 auto 8px; background: center / contain no-repeat; }
html.mb #accountLeaderboard .empty::before, html.mb #compLeaderboard .empty::before, html.mb #challengeLeaderboard .empty::before { background-image: url("data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 84"%3E%3Crect x="12" y="46" width="30" height="32" rx="3" fill="%239aa6bd"/%3E%3Crect x="45" y="28" width="30" height="50" rx="3" fill="%23f2b632"/%3E%3Crect x="78" y="56" width="30" height="22" rx="3" fill="%232450cc"/%3E%3Ctext x="27" y="66" text-anchor="middle" font-family="Arial" font-weight="800" font-size="16" fill="%23fff"%3E2%3C/text%3E%3Ctext x="60" y="58" text-anchor="middle" font-family="Arial" font-weight="800" font-size="18" fill="%23fff"%3E1%3C/text%3E%3Ctext x="93" y="72" text-anchor="middle" font-family="Arial" font-weight="800" font-size="14" fill="%23fff"%3E3%3C/text%3E%3Cpath d="M50 6h20v9a10 10 0 0 1-20 0z" fill="%23f2b632"/%3E%3Cpath d="M60 25v3" stroke="%23f2b632" stroke-width="3"/%3E%3C/svg%3E"); }
html.mb #challengeLeaderboard .empty::before { background-image: url("data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 84"%3E%3Ccircle cx="60" cy="44" r="32" fill="%239aa6bd" opacity=".5"/%3E%3Ccircle cx="60" cy="44" r="23" fill="%232450cc"/%3E%3Ccircle cx="60" cy="44" r="14" fill="%23fff"/%3E%3Ccircle cx="60" cy="44" r="6" fill="%23d6453d"/%3E%3Cpath d="M60 44L102 8" stroke="%23f2b632" stroke-width="3" stroke-linecap="round"/%3E%3Cpath d="M98 4l14-2-2 14-5-5z" fill="%23f2b632"/%3E%3C/svg%3E"); }
html.mb #fundedLeaderboard .empty::before { background-image: url("data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 84"%3E%3Cellipse cx="46" cy="66" rx="26" ry="8" fill="%23f2b632"/%3E%3Crect x="20" y="52" width="52" height="14" fill="%23f2b632"/%3E%3Cellipse cx="46" cy="52" rx="26" ry="8" fill="%23ffd566"/%3E%3Cellipse cx="46" cy="38" rx="26" ry="8" fill="%23f2b632"/%3E%3Crect x="20" y="38" width="52" height="14" fill="%23f2b632"/%3E%3Cellipse cx="46" cy="38" rx="26" ry="8" fill="%23ffd566"/%3E%3Ccircle cx="92" cy="30" r="16" fill="%232450cc"/%3E%3Cpath d="M84 30l6 6 11-12" stroke="%23fff" stroke-width="4" fill="none" stroke-linecap="round" stroke-linejoin="round"/%3E%3C/svg%3E"); }
html.mb #journalList .empty::before { background-image: url("data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 120 84"%3E%3Crect x="26" y="8" width="68" height="70" rx="8" fill="%239aa6bd" opacity=".55"/%3E%3Crect x="34" y="4" width="52" height="12" rx="5" fill="%232450cc"/%3E%3Crect x="38" y="28" width="44" height="6" rx="3" fill="%23fff"/%3E%3Crect x="38" y="42" width="34" height="6" rx="3" fill="%23fff"/%3E%3Crect x="38" y="56" width="40" height="6" rx="3" fill="%23fff"/%3E%3Ccircle cx="96" cy="64" r="12" fill="%23f2b632"/%3E%3Cpath d="M90 64h12M96 58v12" stroke="%231b1300" stroke-width="3" stroke-linecap="round"/%3E%3C/svg%3E"); }
/* ===== Marge basse dynamique : mesurée sur le vrai ticket (contenu jamais caché sous les boutons) ===== */
html.mb body, html.mb body.quiz-on { padding-bottom: calc(var(--mb-dock, 232px) + env(safe-area-inset-bottom,0px)) !important; }
/* ===== Graphique principal : le sélecteur d'unité de temps ne doit couvrir QUE sa ligne (il bloquait glissement, zoom et curseur) ===== */
html.mb #tf-selector { bottom: auto !important; height: 30px !important; width: auto; }

/* ===== Panneau agrandi : le carnet/quiz restent visibles même depuis l'onglet Graphique + croix Fermer toujours présente ===== */
html.mb.mbv-chart #orderbook-panel.maxed #orderbook, html.mb.mbv-chart #orderbook-panel.maxed #mbBookHead { display: block !important; }
html.mb.mbv-chart .quiz-area.maxed { display: block !important; }
html.mb #mbMaxClose { position: fixed; top: calc(10px + env(safe-area-inset-top,0px)); right: 10px; z-index: 3200; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--mb-line); background: var(--mb-card); color: var(--mb-text); font: 800 14px var(--sans); box-shadow: 0 8px 22px rgba(0,0,0,.28); }
html.mb #mbMaxClose[hidden] { display: none !important; }
/* ===== Drapeau : rond régulier, aligné sur le bouton de déconnexion (plus d'ovale étiré) ===== */
html.mb #topbar #btnLang { min-height: 0 !important; width: 32px !important; min-width: 32px !important; height: 32px !important; max-height: 32px !important; align-self: center !important; border-radius: 50% !important; padding: 0 !important; }
html.mb #mbLogout { width: 32px; height: 32px; }
/* cibles tactiles confortables pour les croix (newsletter, popups) + réactivité immédiate (pas de délai de double-tap) */
html.mb #nlBarClose { min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
html.mb button, html.mb [role=button], html.mb .tab, html.mb .close-panel, html.mb #mbnav button { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* ===== Ticket (Achat / Vente / Flat…) : COLLANT au lieu de fixe =====
   Il reste en bas de l'écran pendant qu'on fait défiler, mais en fin de page il se pose APRÈS le classement
   (Graphique) ou APRÈS le Quiz (DOM) au lieu de les recouvrir. La marge basse ne sert plus qu'à la barre du bas. */
html.mb #ob-foot .ob-trade-ctl { position: sticky !important; left: auto !important; right: auto !important; bottom: calc(68px + env(safe-area-inset-bottom,0px)) !important; order: 99 !important; margin: 6px -14px 0 !important; z-index: 940; }
html.mb body, html.mb body.quiz-on { padding-bottom: calc(84px + env(safe-area-inset-bottom,0px)) !important; }
/* ===== Mode AGRANDIR : le ticket redevient fixe sous le panneau agrandi (qui lui réserve la place) ===== */
html.mb:has(.maxed) #ob-foot .ob-trade-ctl { position: fixed !important; left: 0 !important; right: 0 !important; margin: 0 !important; bottom: calc(68px + env(safe-area-inset-bottom,0px)) !important; }
html.mb #orderbook-panel.maxed, html.mb #chart-panel.maxed { inset: 0 0 calc(214px + env(safe-area-inset-bottom,0px)) 0 !important; }
/* ===== AGRANDIR : vraiment plus grand. Le ticket se réduit à une seule rangée (Achat · Vente · Flat) ===== */
html.mb:has(#chart-panel.maxed, #minis.maxed, .quiz-area.maxed) .ob-trade-ctl > :not(#btnMarketBuy):not(#btnMarketSell):not(#btnFlat) { display: none !important; }
html.mb:has(#chart-panel.maxed, #minis.maxed, .quiz-area.maxed) .ob-trade-ctl { padding: 8px 14px 8px !important; box-shadow: none; }
html.mb:has(#chart-panel.maxed, #minis.maxed, .quiz-area.maxed) .ob-trade-ctl #btnMarketBuy, html.mb:has(#chart-panel.maxed, #minis.maxed, .quiz-area.maxed) .ob-trade-ctl #btnMarketSell, html.mb:has(#chart-panel.maxed, #minis.maxed, .quiz-area.maxed) .ob-trade-ctl #btnFlat { grid-row: 1 !important; height: 42px !important; }
html.mb #orderbook-panel.maxed, html.mb #chart-panel.maxed { inset: 0 0 calc(136px + env(safe-area-inset-bottom,0px)) 0 !important; }
/* Carnet agrandi : le ticket est positionné par rapport au panneau → collé en bas du panneau, qui s'arrête juste au-dessus de la barre */
html.mb #orderbook-panel.maxed { inset: 0 0 calc(68px + env(safe-area-inset-bottom,0px)) 0 !important; padding-bottom: 70px !important; }
html.mb #orderbook-panel.maxed .ob-trade-ctl { bottom: 0 !important; }
/* Moins d'espace sous le ticket : la marge basse = juste la hauteur de la barre du bas */
html.mb body, html.mb body.quiz-on { padding-bottom: calc(64px + env(safe-area-inset-bottom,0px)) !important; }
html.mb #ob-foot .ob-trade-ctl { padding-bottom: 8px !important; }
html.mb #ob-foot .ob-trade-ctl #orders-display:empty { display: none !important; }
html.mb #app { padding-bottom: 0 !important; }
/* Le « bottom » du collant se compte à l'intérieur du padding du body (= hauteur de la barre) : 0 = pile au-dessus de la barre */
html.mb #ob-foot .ob-trade-ctl { bottom: 0 !important; }
html.mb #ob-foot .vp-note, html.mb #ob-foot .ob-touch-note, html.mb #ob-foot .ob-legend-open { order: 90 !important; }
/* ===== CHAT : la barre de saisie est TOUJOURS visible (au-dessus de la barre du bas, et au-dessus du clavier) ===== */
html.mb #panel-chat { bottom: calc(64px + env(safe-area-inset-bottom,0px)) !important; height: auto !important; max-height: none !important; flex-direction: column !important; overflow: hidden !important; }
html.mb #panel-chat.open { display: flex !important; }
html.mb #panel-chat .chat-body { flex: 1 1 auto !important; min-height: 0 !important; display: flex !important; flex-direction: column !important; overflow: hidden !important; padding-bottom: 6px !important; }
html.mb #panel-chat #chatLog { flex: 1 1 auto !important; min-height: 60px !important; overflow-y: auto !important; }
html.mb #panel-chat .cx-chips { flex: 0 0 auto !important; max-height: 76px; overflow-y: auto; }
html.mb #panel-chat .chat-input-row { flex: 0 0 auto !important; position: relative; z-index: 2; }
/* Clavier ouvert : barre du bas masquée, chat calé sur la zone visible de l'écran */
html.mb.mb-kb #mbnav { display: none !important; }
html.mb.mb-kb #panel-chat { top: var(--mb-vvt, 0px) !important; bottom: auto !important; height: var(--mb-vvh, 100dvh) !important; }
html.mb.mb-kb #panel-chat .chat-warn, html.mb.mb-kb #panel-chat .tab-hero, html.mb.mb-kb #panel-chat .mb-hero { display: none !important; }
/* ===== AGRANDIR DU CARNET (mobile) — v3 : agrandi DANS la page, rien ne recouvre rien =====
   Le carnet devient grand (presque tout l'écran), le Quiz Mode, les stats et le classement restent
   juste en dessous (on les voit en faisant défiler). Le ticket garde son comportement normal. */
html.mb #orderbook-panel.maxed { display: contents !important; position: static !important; inset: auto !important; padding: 0 !important; background: none !important; z-index: auto !important; }
html.mb #orderbook-panel.maxed #orderbook { order: 4 !important; flex: none !important; height: max(380px, calc(100dvh - 330px)) !important; min-height: max(380px, calc(100dvh - 330px)) !important; max-height: none !important; margin: -10px 0 0 !important; border-radius: 0 0 22px 22px !important; border-top: 0 !important; }
html.mb #orderbook-panel.maxed #ob-head { display: revert; }
html.mb:has(#orderbook-panel.maxed) #ob-foot .ob-trade-ctl { position: sticky !important; left: auto !important; right: auto !important; margin: 6px -14px 0 !important; bottom: 0 !important; }
html.mb:has(#orderbook-panel.maxed) #ob-foot .ob-trade-ctl { display: grid !important; }
html.mb:has(#orderbook-panel.maxed) #mbMaxClose { display: none !important; }
html.mb #btnMaxBook.on { background: var(--mb-gold, #c9a227) !important; color: #111 !important; }
html.mb #panel-chat.open { top: calc(env(safe-area-inset-top,0px) + 6px) !important; }
html.mb.mb-kb #panel-chat.open { top: var(--mb-vvt, 0px) !important; }
/* ===== Chevauchements (mobile) ===== */
/* Pastille de zoom du graphique : par défaut en bas AU CENTRE (elle couvrait l'encart « Market Levels » et l'étiquette LVN à gauche) */
html.mb #mbZoomPill { left: 50%; bottom: 6px; transform: translateX(-50%); }
/* Pied de page © + réseaux : il était FIXE sous la barre du bas (invisible). Il redevient une ligne normale en fin de page. */
html.mb #appFoot { position: static !important; inset: auto !important; margin: 10px 0 0 !important; padding: 8px 12px 12px !important; }
html.mb #appFoot { padding-right: 60px !important; }
/* ===== ZOOM / SÉLECTION (mobile) =====
   · Saisie à 16 px minimum : en dessous, iPhone ZOOME tout seul à chaque champ (login, chat, Quiz Mode),
     puis dézoome à la sortie → c'est ce qui faisait « grandir puis rétrécir » la fenêtre de connexion.
   · Sélection de texte désactivée dans le jeu (appui long), sauf dans les champs de saisie. */
html.mb input, html.mb textarea, html.mb select, body.mb-login input, body.mb-login select { font-size: 16px !important; }
html.mb body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
html.mb input, html.mb textarea, html.mb [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }
/* Bouton ✕ du panneau « Plus » */
#mbsheet .mb-box { position: relative; }
#mbsheet .mb-sheet-x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--mb-line, rgba(140,152,175,.35)); background: var(--mb-card, rgba(255,255,255,.06)); color: inherit; font-size: 16px; line-height: 1; display: grid; place-items: center; cursor: pointer; z-index: 3; }
/* Case « Se souvenir de moi » du login */
.remember-me { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.35; opacity: .85; margin: 2px 0 6px; text-align: left; cursor: pointer; }
.remember-me input { width: 18px !important; height: 18px; min-height: 0 !important; margin: 1px 0 0 !important; flex: none; }

/* ===== CHAT DU BOT (mobile) : suggestions sur UNE ligne défilante, jamais par-dessus les messages ni la saisie ===== */
html.mb #panel-chat .cx-chips { flex-wrap: nowrap !important; overflow-x: auto !important; overflow-y: hidden !important; max-height: none !important; padding: 4px 2px 6px !important; gap: 6px !important; -webkit-overflow-scrolling: touch; }
html.mb #panel-chat .cx-chip { flex: 0 0 auto !important; white-space: nowrap !important; font-size: 12.5px !important; padding: 7px 12px !important; }
html.mb #panel-chat #chatLog { padding-bottom: 8px !important; scroll-padding-bottom: 8px; }
html.mb #panel-chat .cx-card { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
html.mb #panel-chat .cx-card input { flex: 1 1 160px; min-width: 0; }
html.mb #panel-chat .cx-card small { flex: 1 1 100%; line-height: 1.35; }
/* ===== QUIZ MODE (mobile) : l'explication ne recouvre plus tout l'écran ; bouton pour voir la réponse sur le carnet ===== */
html.mb #explain-text { max-height: 30vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
html.mb #chatFab { width: 40px !important; height: 44px !important; }
html.mb #chatFab svg { width: 100% !important; height: 100% !important; }

/* Mobile : le bouton ⇆ (changer de côté) n'a pas de sens en plein écran → masqué.
   Réduire (–) replie le chat en simple barre d'en-tête au-dessus de la navigation. */
html.mb #cxDock { display: none !important; }
html.mb #panel-chat.open.cx-min { top: auto !important; height: auto !important; }
html.mb #panel-chat.cx-min .cx-body { display: none !important; }

/* Mobile : ⛶ des miniatures — avant, la classe « maxed » était posée mais la hauteur restait bloquée à 104 px
   (rien ne se passait). Agrandies : les deux graphiques s'empilent en pleine largeur, ~40 % de l'écran chacun. */
html.mb.mbv-chart #minis.maxed { flex-direction: column !important; height: auto !important; min-height: 0 !important; gap: 10px; }
html.mb.mbv-chart #minis.maxed > .mini { flex: 0 0 auto !important; height: 40vh !important; min-height: 220px; width: 100% !important; }
