/* Jauges « Tendance du marché » et « Sentiment global » (partials/market_gauges.html + algo-gauges.js) */
.mg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 270px), 1fr)); gap: 14px; margin: 14px 0; }
.mg-card { background: var(--algo-surface); border: 1px solid var(--algo-border); border-radius: var(--algo-radius-card, 20px); padding: 16px 16px 14px; text-align: center; color: var(--algo-ink); }
.mg-card [data-mg="title"] { margin: 0 0 6px; font-family: var(--algo-font-display); font-size: .95rem; font-weight: 600; letter-spacing: .01em; }
.mg-dial { max-width: 230px; margin: 0 auto; color: var(--algo-ink); }
.mg-svg { display: block; width: 100%; height: auto; overflow: visible; }
.mg-needle { transform-origin: 100px 100px; transition: transform .8s cubic-bezier(.2, .8, .2, 1); }
.mg-level { margin: 2px 0 0; font-family: var(--algo-font-display); font-size: 1.15rem; font-weight: 700; }
.mg-value { margin: 0; font-size: .85rem; color: var(--algo-muted); min-height: 1.2em; }
.mg-note { margin: 8px 0 0; font-size: .76rem; line-height: 1.45; color: var(--algo-muted); }
.mg-card[data-state="empty"] .mg-level { color: var(--algo-muted); font-weight: 500; font-size: 1rem; }
.mg-foot { margin: 0; font-size: .74rem; color: var(--algo-muted); text-align: center; }
.mg-foot a { color: inherit; text-decoration: underline; }
@media (prefers-reduced-motion: reduce) { .mg-needle { transition: none; } }

/* Page « Jauges » (product/templates/gauges_page.html + algo-gauges-more.js) */
.gp-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; padding: 14px 16px; margin-bottom: 8px; }
.gp-field { display: grid; gap: 4px; }
.gp-current { margin-inline-start: auto; }
.gp-sec { margin: 24px 0 4px; font-family: var(--algo-font-display); font-size: 1.1rem; }
.mg-card h3 { margin: 0 0 6px; font-family: var(--algo-font-display); font-size: .95rem; font-weight: 600; letter-spacing: .01em; }
.mg-card[data-state="off"] { opacity: .6; }
.mg-card[data-state="off"] .mg-level { color: var(--algo-muted); font-weight: 500; font-size: 1rem; }
.mg-card[data-state="off"] .mg-dial { min-height: 40px; }
.gp-warn { flex-basis: 100%; margin: 0; color: #F59E0B; }
.gp-basis { margin: 4px 2px 0; }

/* Turbine 3D (algo-gauges-3d.js) : un canvas transparent sur la zone des cartes ; la jauge simple (SVG) reste en secours */
#gp-root { position: relative; }
.gp-dialwrap { position: relative; }
.gp-big { display: none; }
.gp-3d-canvas { position: absolute; left: 0; top: 0; pointer-events: none; z-index: 2; visibility: hidden; }
#gp-root.gp-3d .mg-dial { height: 210px; max-width: none; display: flex; align-items: center; justify-content: center; border-radius: 18px;
  background: radial-gradient(120% 100% at 50% 40%, #0d1d3d 0%, #050b18 70%); border: 1px solid rgba(96, 140, 255, .18); }
#gp-root.gp-3d .mg-card[data-pos] .mg-dial svg { visibility: hidden; }
#gp-root.gp-3d .mg-dial svg { max-width: 190px; }
#gp-root.gp-3d .gp-big { display: block; position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-62%); z-index: 3; text-align: center; pointer-events: none;
  font-family: var(--algo-font-display); font-weight: 800; font-size: 2.1rem; line-height: 1; color: #fff; text-shadow: 0 0 16px rgba(120, 170, 255, .75); }
#gp-root.gp-3d .mg-card[data-state="empty"] .gp-big, #gp-root.gp-3d .mg-card[data-state="off"] .gp-big { display: none; }
.gp-3d-btn { margin-inline-start: auto; padding: 8px 16px; font-size: .88rem; }
.gp-3d-btn + .gp-current { margin-inline-start: 0; }
#gp-root.gp-3d .mg-card[data-state="off"] .mg-dial, #gp-root.gp-3d .mg-card[data-state="off"] .gp-dialwrap { display: none; }

/* Page Futures (product/templates/futures_page.html + algo-futures.js) */
.fu-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: end; padding: 14px 16px; margin-bottom: 8px; }
.fu-field { display: grid; gap: 4px; }
.fu-upd { margin-inline-start: auto; }
.fu-warn { color: #F59E0B; margin: 0 2px 8px; }
.fu-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; margin: 10px 0; }
.fu-card { background: var(--algo-surface); border: 1px solid var(--algo-border); border-radius: var(--algo-radius-card, 20px); padding: 14px 16px; color: var(--algo-ink); }
.fu-card h3 { margin: 0 0 6px; font-size: .78rem; font-weight: 600; color: var(--algo-muted); text-transform: uppercase; letter-spacing: .05em; }
.fu-big { font-family: var(--algo-font-display); font-size: 1.65rem; font-weight: 800; line-height: 1.1; }
.fu-sub { font-size: .8rem; color: var(--algo-muted); margin-top: 4px; }
.fu-spark { width: 100%; height: 46px; display: block; margin-top: 8px; }
.fu-lsbar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; margin-top: 10px; background: rgba(148, 163, 184, .2); }
.fu-lsbar i { display: block; } .fu-lsbar i:first-child { background: var(--algo-positive, #22c55e); } .fu-lsbar i:last-child { background: var(--algo-negative, #ef4444); }
.fu-sec { margin: 24px 0 8px; font-family: var(--algo-font-display); font-size: 1.1rem; }
.fu-tag { font-size: .68rem; border: 1px solid var(--algo-positive, #22c55e); color: var(--algo-positive, #22c55e); border-radius: 99px; padding: 2px 8px; margin-inline-start: 6px; vertical-align: middle; }
.fu-tw { overflow-x: auto; padding: 8px 12px; }
.fu-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.fu-table th, .fu-table td { padding: 8px; text-align: end; border-bottom: 1px solid var(--algo-border); white-space: nowrap; }
.fu-table th:first-child, .fu-table td:first-child { text-align: start; }
.fu-table th { color: var(--algo-muted); font-weight: 600; font-size: .74rem; text-transform: uppercase; }
.fu-pick { cursor: pointer; } .fu-pick:hover td, .fu-pick.sel td { background: rgba(79, 140, 255, .12); }
.fu-hot { color: #F59E0B; }
.fu-card .up, .fu-table .up, .lq-stats .up, .lq-r .up { color: var(--algo-positive, #22c55e); }
.fu-card .down, .fu-table .down, .lq-stats .down, .lq-r .down { color: var(--algo-negative, #ef4444); }
.lq-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); gap: 10px; margin-bottom: 12px; }
.lq-stats div { background: rgba(148, 163, 184, .12); border-radius: 12px; padding: 9px 11px; }
.lq-stats span { display: block; font-size: .7rem; color: var(--algo-muted); text-transform: uppercase; letter-spacing: .04em; }
.lq-stats b { display: block; font-size: 1.2rem; margin-top: 2px; } .lq-stats em { font-style: normal; font-size: .72rem; color: var(--algo-muted); }
.lq-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 10px; } @media (max-width: 860px) { .lq-grid { grid-template-columns: 1fr; } }
.lq-c { width: 100%; height: 120px; display: block; }
.lq-leg { font-size: .74rem; color: var(--algo-muted); } .lq-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 4px 0 8px; vertical-align: -1px; }
.lq-leg i.d { background: #ef4444; margin-inline-start: 0; } .lq-leg i.u { background: #22c55e; }
.fu-mini { width: 100%; border-collapse: collapse; } .fu-mini td { padding: 5px 4px; font-size: .82rem; } .fu-mini td:last-child { text-align: end; }
.lq-tools { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 6px 0 8px; }
.lq-list { max-height: 360px; overflow: auto; font-size: .84rem; }
.lq-r { display: grid; grid-template-columns: 78px 1fr 130px 90px 110px; gap: 8px; padding: 7px 4px; border-bottom: 1px solid var(--algo-border); align-items: center; }
.lq-r > span:nth-child(n+3) { text-align: end; }
.lq-r.big { background: rgba(245, 158, 11, .12); border-inline-start: 3px solid #F59E0B; } .lq-r.huge { background: rgba(239, 68, 68, .16); border-inline-start: 3px solid #ef4444; font-weight: 700; }
@media (max-width: 700px) { .lq-r { grid-template-columns: 70px 1fr 100px; } .lq-r > span:nth-child(n+4) { display: none; } }

/* Scanner de marchés (product/templates/scanner_page.html + algo-scanner.js) */
.sc-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.sc-tabs .is-on { background: linear-gradient(135deg, #1d4ed8, #4f8cff); color: #fff; border-color: transparent; }
.sc-upd { margin-inline-start: auto; }
.sc-tools { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin-bottom: 10px; }
.sc-map { position: relative; width: 100%; height: 520px; border-radius: 14px; overflow: hidden; background: #07101f; direction: ltr; }
@media (max-width: 700px) { .sc-map { height: 430px; } }
.sc-cell { position: absolute; overflow: hidden; border: 1px solid rgba(5, 11, 24, .9); border-radius: 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: #fff; text-decoration: none; transition: filter .15s; }
.sc-cell:hover { filter: brightness(1.25); z-index: 3; outline: 2px solid #fff; }
.sc-cell b { line-height: 1.1; } .sc-cell i { font-style: normal; font-size: .8em; opacity: .95; }
.sc-leg { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .78rem; color: var(--algo-muted); flex-wrap: wrap; }
.sc-leg .bar { flex: 1; max-width: 360px; min-width: 120px; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #b91c1c, #7f1d1d 35%, #1f2937 50%, #14532d 65%, #15803d); }
.sc-legtxt { margin-inline-start: auto; }
.sc-pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .74rem; font-weight: 700; }
.sc-os { background: rgba(34, 197, 94, .18); color: #22c55e; } .sc-ob { background: rgba(239, 68, 68, .18); color: #ef4444; } .sc-n { background: rgba(148, 163, 184, .18); color: var(--algo-muted); }
.sc-tf { font-size: .62rem; border: 1px solid #3b82f6; color: #93c5fd; border-radius: 99px; padding: 1px 6px; margin-inline-start: 4px; }
.fu-table th[data-k] { cursor: pointer; } .fu-table th.sc-sorted::after { content: " ▾"; }
a.sc-cell, a.sc-cell:visited, a.sc-cell:hover, a.sc-cell b, a.sc-cell i { color: #fff !important; }
.sc-tabs .algo-btn:not(.is-on) { background: transparent; color: var(--algo-ink); border: 1px solid var(--algo-border); box-shadow: none; }

/* Application installable (product/templates/app_page.html, algo-app-3d.js, algo-app-install.js) */
@media (display-mode: standalone) { .algo-install-link { display: none !important; } }
.app-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); grid-template-areas: "hero stage" "feat stage" "steps stage"; gap: 18px 36px; align-items: start; }
.app-hero { grid-area: hero; } .app-feat { grid-area: feat; } .app-steps { grid-area: steps; }
.app-stage { grid-area: stage; position: sticky; top: 96px; align-self: start; }
.app-stage #c3 { width: 100%; height: min(680px, calc(100vh - 150px)); min-height: 430px; display: block; cursor: grab; touch-action: pan-y; }
.app-stage-bar { text-align: center; margin: 4px 0; } .app-illu { text-align: center; margin: 4px 0 0; }
.app-lead { font-size: 1.05rem; max-width: 560px; }
.app-cta { margin: 16px 0 6px; } .app-install-btn { padding: 13px 22px; font-size: 1.02rem; font-weight: 800; animation: appPulse 2.4s infinite; }
@keyframes appPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(79, 140, 255, .55); } 50% { box-shadow: 0 0 0 14px rgba(79, 140, 255, 0); } }
.app-installed { color: var(--algo-positive, #22c55e); font-weight: 700; margin: 6px 0 0; }
.app-badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; } .app-badges span { border: 1px solid var(--algo-border); border-radius: 99px; padding: 5px 12px; font-size: .8rem; background: var(--algo-surface); }
.app-fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.app-fc { background: var(--algo-surface); border: 1px solid var(--algo-border); border-radius: 18px; padding: 14px 16px; }
.app-fc i { font-style: normal; font-size: 1.5rem; display: block; margin-bottom: 4px; } .app-fc b { display: block; margin-bottom: 3px; } .app-fc span { font-size: .84rem; color: var(--algo-muted); }
.app-ptabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.app-ptabs button { background: var(--algo-surface); color: var(--algo-ink); border: 1px solid var(--algo-border); border-radius: 99px; padding: 9px 16px; font-weight: 700; cursor: pointer; }
.app-ptabs button.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.app-page .stp { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--algo-border); border-radius: 14px; margin-bottom: 9px; background: var(--algo-surface); cursor: pointer; transition: .25s; }
.app-page .stp.on { border-color: #4f8cff; background: rgba(59, 130, 246, .14); transform: translateX(6px); }
.app-page .stp .n { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #334155; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem; } .app-page .stp.on .n { background: #1d4ed8; }
.app-page .stp b { display: block; font-size: .92rem; } .app-page .stp span { font-size: .82rem; color: var(--algo-muted); }
.app-no3d .app-stage { display: none; }
@media (max-width: 900px) {
  .app-grid { display: block; }                                  /* bloc simple : la scène « collante » peut alors rester visible pendant tout le défilement */
  .app-hero, .app-feat, .app-steps { margin-bottom: 18px; }
  /* sur téléphone la scène 3D reste collée en haut de l'écran pendant qu'on lit les étapes : on voit toujours l'animation de l'étape en cours */
  .app-stage { position: sticky; top: 74px; z-index: 4; background: var(--algo-bg, #02040B); padding-bottom: 6px; border-bottom: 1px solid var(--algo-border); }
  .app-stage #c3 { height: min(46vh, 400px); min-height: 280px; }
  .app-stage .app-illu { display: none; }
  .app-stage-bar { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; padding-top: 4px; }
  .app-stage-bar .app-ptabs { margin: 0; justify-content: center; gap: 6px; }
  .app-stage-bar .app-ptabs button { padding: 7px 11px; font-size: 13px; }
  .app-stage-bar #flipbtn { padding: 7px 11px; font-size: 13px; }
}

/* Page Alertes (product/templates/alerts_page.html + algo-alerts.js) */
.al-card { margin-bottom: 14px; } .al-card h3 { margin-bottom: 8px; }
.al-grid2, .al-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; } @media (max-width: 900px) { .al-grid2, .al-cols { grid-template-columns: 1fr; } } .al-cols[hidden] { display: none; }
.al-tg { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: rgba(148, 163, 184, .1); border: 1px solid var(--algo-border); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; font-size: .9rem; }
.al-tg small { display: block; color: var(--algo-muted); font-size: .74rem; margin-top: 2px; font-weight: 400; max-width: 44ch; }
.al-sw { position: relative; flex: none; width: 42px; height: 24px; border-radius: 99px; background: #334155; cursor: pointer; display: inline-block; vertical-align: middle; }
.al-sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; } .al-sw.on { background: var(--algo-positive, #22c55e); } .al-sw.on::after { left: 21px; }
[dir="rtl"] .al-sw::after { left: auto; right: 3px; } [dir="rtl"] .al-sw.on::after { right: 21px; left: auto; }
.al-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; } .al-tabs button { background: var(--algo-surface); color: var(--algo-ink); border: 1px solid var(--algo-border); border-radius: 12px; padding: 10px 18px; font-weight: 700; cursor: pointer; }
.al-tabs button.on { background: linear-gradient(135deg, #1d4ed8, #4f8cff); border-color: transparent; color: #fff; }
.al-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.al-chip { padding: 7px 12px; border-radius: 99px; border: 1px solid var(--algo-border); background: rgba(148, 163, 184, .12); font-size: .82rem; cursor: pointer; user-select: none; } .al-chip.on { background: #1d4ed8; border-color: #1d4ed8; color: #fff; font-weight: 700; }
.al-addrow { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; } .al-addrow .algo-input { flex: 1 1 180px; min-width: 0; }
.al-count { background: rgba(29, 78, 216, .18); border-radius: 10px; padding: 9px 12px; font-size: .85rem; margin: 8px 0 10px; }
.al-item { padding: 11px 12px; border: 1px solid var(--algo-border); border-radius: 12px; margin-bottom: 8px; background: rgba(148, 163, 184, .08); }
.al-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .al-top b { font-size: .92rem; } .al-s { display: block; font-size: .76rem; color: var(--algo-muted); margin-top: 2px; }
.al-act { display: flex; align-items: center; gap: 10px; flex: none; } .al-link { font-size: .78rem; color: #8fb2ff; cursor: pointer; } .al-red { color: #ef4444; }
.al-tags { margin-top: 6px; } .al-tag { display: inline-block; font-size: .66rem; border: 1px solid var(--algo-border); border-radius: 99px; padding: 1px 8px; margin: 2px 4px 0 0; color: var(--algo-muted); } .al-tag.b { color: var(--algo-positive, #22c55e); border-color: var(--algo-positive, #22c55e); } .al-tag.s { color: var(--algo-negative, #ef4444); border-color: var(--algo-negative, #ef4444); }
.al-edit { margin-top: 10px; border-top: 1px solid var(--algo-border); padding-top: 10px; } .al-edit[hidden] { display: none; } .al-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: .86rem; } .al-btns { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.al-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.al-h { display: flex; justify-content: space-between; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--algo-border); font-size: .86rem; } .al-h i { font-style: normal; display: block; } .al-h em { font-style: normal; color: var(--algo-muted); font-size: .76rem; white-space: nowrap; }

/* page Application : le conteneur ne doit pas couper le défilement, sinon la scène 3D « collante » disparaît */
body.app-page .algo-container { overflow: visible; overflow-x: clip; }

/* en-tête : tous les boutons du menu sur une seule ligne, même hauteur */
.algo-nav a, .algo-nav .algo-menu > button { white-space: nowrap; line-height: 1.2; min-height: 38px; display: inline-flex; align-items: center; box-sizing: border-box; }
.algo-nav { flex-wrap: nowrap; }
.algo-header-actions .algo-btn, .algo-header-actions .algo-iconbtn { white-space: nowrap; min-height: 38px; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; }
