/* ==========================================================================
   PaperTrade — Refonte ergonomie & expérience joueur (2026-09)
   Feuille de surcouche : chargée APRÈS styles.css. Elle ne supprime rien,
   elle corrige les jetons, la lisibilité, le mobile, la navigation et
   ajoute les composants d'aide. Retirer ce <link> annule toute la refonte.
   ========================================================================== */

/* --- 1. Police auto-hébergée (le réglage typographique n'était appliqué à rien) --- */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/inter-latin-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("/fonts/inter-latin-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/fonts/inter-latin-600.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("/fonts/inter-latin-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/fonts/jetbrains-mono-latin-400.woff2") format("woff2"); }

:root {
  /* --- échelle typographique : 7 tailles au lieu de 19 --- */
  --fs-xs: 11.5px;   /* libellés, unités, dates */
  --fs-sm: 12.5px;   /* texte secondaire, tableaux */
  --fs-md: 13.5px;   /* texte courant */
  --fs-lg: 15px;     /* titres de section, valeurs de tableau */
  --fs-xl: 18px;     /* titres de page */
  --fs-2xl: 26px;    /* chiffre principal */
  --fs-3xl: 32px;    /* chiffre héros (accueil) */

  /* --- contrastes corrigés (AA) --- */
  --text: #eaf0f8;
  --text-dim: #9fb0c4;
  --text-faint: #8b9aad;          /* était 3,2:1 — passe à ~5,4:1 */

  /* --- surface et formes : 2 rayons, 2 ombres --- */
  --radius: 8px;
  --radius-sm: 6px;
  --radius-pill: 999px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .3);
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);

  /* --- rythme vertical --- */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --tap: 44px;                    /* cible tactile minimale */
  --sans: "Inter", system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

/* --- 2. Base : plus de vide sous le pied de page, tailles plancher --- */
html, body { min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; font-size: var(--fs-md); }
#view { flex: 1 0 auto; }
.footer { flex: 0 0 auto; }

/* Aucun texte utile sous 11,5 px, nulle part. */
small, .faint, .muted, .sub, .hint, .jd-label, td .faint, th { font-size: var(--fs-xs); }
h1 { font-size: var(--fs-xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-md); }

/* Sur petit écran, les capitales espacées à 10,5 px sont illisibles : on les remplace. */
@media (max-width: 760px) {
  .nav-item, .sub-item, .panel-head h2, .kpi-label, th, .card-label, .btn {
    text-transform: none; letter-spacing: 0;
  }
  body { font-size: var(--fs-md); }
}

/* --- 3. Barre d'application compacte et navigation mobile au pouce --- */
@media (max-width: 760px) {
  .appbar { position: sticky; top: 0; z-index: 40; flex-wrap: wrap; row-gap: var(--sp-2); padding: 6px 10px; }
  .appbar .search { order: 3; flex-basis: 100%; }
  .appbar .brand-name { font-size: var(--fs-lg); }
  .appbar .sources { display: none; }          /* information de supervision : hors de l'écran du joueur */
  .icon-btn, .account-btn, .party-select { min-height: var(--tap); }
  #mainnav { display: none; }                  /* remplacée par la barre basse */
  .subnav { position: sticky; top: 0; z-index: 30; overflow-x: auto; scrollbar-width: none; }
  .subnav::-webkit-scrollbar { display: none; }
  .msbar { overflow-x: auto; }
  main.view { padding: 10px 10px calc(66px + env(safe-area-inset-bottom, 0px)); }
}

.bottomnav { display: none; }
@media (max-width: 760px) {
  .bottomnav {
    /* SIX entrées au pouce : la grille n'en prévoyait que cinq, donc « Plus »
       passait seul sur une deuxième rangée (barre de 115 px, 13,6 % de l'écran).
       Une seule rangée suffit, avec des libellés courts et tronqués proprement. */
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line-strong);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .bottomnav a {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 56px; font-size: var(--fs-xs); color: var(--text-dim); text-decoration: none;
    border-top: 2px solid transparent;
  }
  .bottomnav a.active { color: var(--text); border-top-color: var(--accent); background: rgba(56,189,248,.06); }
  .bottomnav .bn-ico { font-size: 16px; line-height: 1; }
  .bottomnav .nav-count { position: static; }
  /* le libellé est un élément à part : il peut être tronqué proprement au lieu de
     déborder (« Compétitions » était coupé en plein milieu du mot). */
  .bottomnav a, .bottomnav .bn-plus { white-space: nowrap; }
  .bottomnav .bn-libelle { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}

/* Indicateur de défilement (le débordement n'était signalé nulle part) */
.scroll-fade { position: relative; }
.scroll-fade::after {
  content: ""; position: absolute; top: 0; right: 0; width: 26px; height: 100%;
  background: linear-gradient(to right, transparent, var(--bg)); pointer-events: none;
}

/* --- 4. Cibles tactiles et champs : fin du zoom iOS et des clics de précision --- */
@media (max-width: 760px) {
  .btn, .tab, .auth-switch button, .range-btn, .admin-tri, .acc-item, .row-action {
    min-height: var(--tap);
  }
  input, select, textarea { font-size: 16px; min-height: var(--tap); }
  .range-btn { min-width: var(--tap); }
  /* « Ouvrir » et « Archiver » ne doivent plus être deux voisins de 26 px */
  td .btn + .btn, .row-actions .btn + .btn { margin-left: var(--sp-2); }
}

/* --- 5. Tableaux : en-têtes qui collent vraiment, première colonne figée, cartes sur mobile --- */
.table-scroll { overflow-x: auto; overflow-y: clip; }   /* « clip » laisse sticky fonctionner */
.table-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); }

@media (max-width: 760px) {
  /* Mode cartes : chaque ligne devient un bloc lisible, aucune donnée n'est supprimée */
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr {
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface-2); margin-bottom: var(--sp-2); padding: var(--sp-2) var(--sp-3);
  }
  .table-cards td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: var(--sp-3); }
  .table-cards td::before {
    content: attr(data-label); color: var(--text-faint); font-size: var(--fs-xs);
    flex: 0 0 auto; padding-right: var(--sp-2);
  }
  .table-cards td.card-title { font-size: var(--fs-lg); font-weight: 600; justify-content: flex-start; }
  .table-cards td.card-title::before { content: none; }
  .table-cards td.card-action { margin-top: var(--sp-2); }
  .table-cards td.card-action .btn { width: 100%; }
  .table-cards td[data-label=""]::before { content: none; }
  .hide-sm { display: none !important; }
}

/* --- 6. Panneaux, cartes, boutons : un seul vocabulaire --- */
.panel { border-radius: var(--radius); border: 1px solid var(--line); }
.panel-head { align-items: center; gap: var(--sp-2); }
.card, .mkt-card, .cp-card, .pp-card { border-radius: var(--radius); }
.btn { border-radius: var(--radius-sm); font-size: var(--fs-sm); padding: 8px 14px; border: 1px solid var(--line-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #06121d; font-weight: 600; }
.btn.ghost { background: transparent; }
.btn.danger { border-color: rgba(240,87,95,.5); color: #ffb4b8; }
input, select, textarea { border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line-strong); }

/* Le survol ne doit plus être identique partout : seul l'interactif réagit. */
tbody tr:hover { background: var(--surface-hover); }
tr:not(.clickable):hover { background: transparent; }
.mkt-card:hover, .card:hover { border-color: var(--line-strong); }

/* Signalétique fonctionnelle (statut, état de compétition), sobre et lisible */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-pill);
        font-size: var(--fs-xs); border: 1px solid var(--line-strong); color: var(--text-dim); }
.pill.ok { color: var(--up); border-color: rgba(33,201,122,.4); background: var(--up-dim); }
.pill.warn { color: var(--warn); border-color: rgba(240,161,58,.4); background: var(--warn-dim); }
.pill.off { color: var(--text-dim); }
.pill.info { color: var(--accent); border-color: rgba(56,189,248,.4); background: var(--accent-dim); }

/* --- 7. Graphique : la légende ne doit plus masquer le tracé --- */
.chart-wrap { position: relative; }
.chart-legend {
  position: static; margin: 0 0 var(--sp-2) 0; padding: 6px 9px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: var(--fs-xs); line-height: 1.45; white-space: pre-line; color: var(--text-dim);
  display: inline-block; min-width: 190px;
}
.chart-wrap canvas { border-radius: var(--radius-sm); }

/* --- 8. Aide contextuelle : une phrase au moment du geste, repliée par défaut --- */
.aide-puce {
  display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px;
  border-radius: 50%; border: 1px solid var(--line-strong); background: transparent;
  color: var(--text-dim); font-size: 11px; cursor: help; vertical-align: middle; margin-left: 5px;
}
.aide-puce:hover, .aide-puce:focus-visible { color: var(--accent); border-color: var(--accent); }
.aide-bulle {
  position: relative; display: none; margin-top: var(--sp-1); padding: 7px 10px;
  background: var(--surface-3); border: 1px solid var(--line-strong); border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm); font-size: var(--fs-xs); color: var(--text-dim); max-width: 46ch;
}
.aide-bulle.ouverte { display: block; }

.aide-panneau { max-width: 760px; }
.aide-panneau h3 { margin-top: var(--sp-4); }
.aide-panneau dt { font-weight: 600; color: var(--text); margin-top: var(--sp-3); }
.aide-panneau dd { margin: 2px 0 0 0; color: var(--text-dim); }
.aide-entree { color: var(--accent); cursor: pointer; background: none; border: 0; font-size: inherit; }
.footer .aide-entree { text-decoration: underline; }

/* --- 9. Tutoriel minimal : il montre, il ne fait pas à la place du joueur --- */
.tuto-voile { position: fixed; inset: 0; background: rgba(3,6,10,.72); z-index: 90; }
.tuto-carte {
  position: fixed; z-index: 91; max-width: 380px; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--sp-4);
}
.tuto-carte h3 { margin: 0 0 var(--sp-2) 0; font-size: var(--fs-lg); font-weight: 600; }
.tuto-carte p { margin: 0 0 var(--sp-3) 0; color: var(--text-dim); font-size: var(--fs-sm); }
.tuto-carte .tuto-pas { font-size: var(--fs-xs); color: var(--text-faint); }
.tuto-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.tuto-cible { position: relative; z-index: 92; box-shadow: 0 0 0 3px var(--accent), 0 0 0 9999px rgba(3,6,10,.72); border-radius: var(--radius-sm); }

/* --- 10. Accueil : un chiffre en grand, puis le reste par ordre d'importance --- */
.heros { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--sp-3); }
.heros .valeur { font-size: var(--fs-3xl); font-weight: 600; font-variant-numeric: tabular-nums; }
.heros .delta { font-size: var(--fs-lg); }
.depuis-visite { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.cmp-ligne { display: flex; justify-content: space-between; gap: var(--sp-3); font-size: var(--fs-sm);
             padding: 3px 0; border-bottom: 1px dashed var(--line); }
.cmp-ligne:last-child { border-bottom: 0; }

/* --- 11. Fiche instrument : niveau 1 lisible, niveau 2 replié --- */
.instr-head { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: flex-start; }
.instr-identite { display: flex; flex-direction: column; gap: 3px; }
.instr-identite .nom { font-size: var(--fs-xl); font-weight: 600; }
.instr-identite .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.instr-prix { margin-left: auto; text-align: right; }
.instr-prix .prix { font-size: var(--fs-2xl); font-weight: 600; font-variant-numeric: tabular-nums; }
details.repli { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
details.repli > summary {
  cursor: pointer; padding: var(--sp-3); font-size: var(--fs-sm); color: var(--text-dim);
  list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: var(--tap);
}
details.repli > summary::-webkit-details-marker { display: none; }
details.repli > summary::after { content: "▾"; color: var(--text-faint); }
details.repli[open] > summary::after { content: "▴"; }
details.repli > .repli-corps { padding: 0 var(--sp-3) var(--sp-3) var(--sp-3); }
@media (max-width: 760px) {
  .instr-prix { margin-left: 0; text-align: left; }
  .head-actions { width: 100%; }
  .head-actions .btn { width: 100%; }
}

/* --- 12. Compétitions : le sentiment de « partie commune », et l'état lisible --- */
.cp-bandeau { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center;
              padding: var(--sp-3); border: 1px solid var(--line-strong); border-radius: var(--radius);
              background: linear-gradient(180deg, rgba(56,189,248,.07), transparent); }
.cp-compte { font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.cp-moi { border-left: 3px solid var(--accent); }

/* --- 13. Archives : une histoire terminée, pas un portefeuille vivant --- */
.arch-head { border-left: 3px solid var(--warn); padding-left: var(--sp-3); }
.arch-head .statut { color: var(--warn); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .04em; }
.arch-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--sp-2); }
.arch-stat { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--sp-3); }
.arch-stat .valeur { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.arch-stat .label { font-size: var(--fs-xs); color: var(--text-faint); }

/* --- 14. Accessibilité : focus net, mouvement respecté, états vides utiles --- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
.empty { display: flex; flex-direction: column; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-4); color: var(--text-dim); }

/* --- 15. Desktop : la densité reste, on gagne de l'espace et de l'air --- */
@media (min-width: 1101px) {
  main.view { max-width: 1600px; margin: 0 auto; padding: var(--sp-4) var(--sp-5) var(--sp-6); }
  .panel-head { padding: var(--sp-3) var(--sp-4); }
  .footer { padding: var(--sp-3) var(--sp-5); }
}

/* --- 16. Informations de supervision : réservées à l'administration --- */
.supervision { display: none; }
body.admin .supervision { display: inline; }
body.admin .appbar .sources { display: inline-flex; }

/* --- 17. Feuille « Plus » (mobile) : secondaire, mais à un geste --- */
.bn-plus { background: none; border: 0; color: var(--text-dim); font: inherit; cursor: pointer; }
.bottomnav .bn-plus { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; font-size: var(--fs-xs); border-top: 2px solid transparent; }
.bottomnav .bn-plus.active { color: var(--text); border-top-color: var(--accent); background: rgba(56,189,248,.06); }
.plus-sheet {
  position: fixed; z-index: 60; right: 10px; bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  min-width: 210px; padding: 6px; display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.plus-sheet .acc-item { min-height: 44px; display: flex; align-items: center; justify-content: space-between; }

/* --- 18. Fiche instrument : sur mobile, l'action d'abord --- */
@media (max-width: 760px) {
  .split { display: flex; flex-direction: column; }
  .split > .stack:last-child { order: -1; }   /* le panneau d'achat/vente passe avant le graphique et les détails */
  .session-badge, .freshness { white-space: normal; }
  .instr-prix .prix { font-size: var(--fs-2xl); }
  .ranges { overflow-x: auto; }
}
/* En bureau, l'information secondaire ne doit jamais retarder l'opération.
   Le panneau d'ordre n'est PLUS collant : sur un portefeuille garni il mesure
   ~906 px pour un écran de 900 px, donc son bas restait hors de portée et il
   recouvrait le panneau « Ma position » placé dessous (audit du 16/09). */
@media (min-width: 761px) {
  .split { align-items: start; }
}

/* --- 19. Cibles tactiles : compléments mesurés (relevé du 15/09) --- */
@media (max-width: 760px) {
  .brand { min-width: var(--tap); min-height: var(--tap); justify-content: center; }
  .party-btn, #party-btn { min-height: var(--tap); }
  .icon-btn.mini, .star-btn { min-width: var(--tap); min-height: var(--tap); }
  .ms-link { min-height: var(--tap); display: inline-flex; align-items: center; }
  .ms-close { min-width: var(--tap); min-height: var(--tap); }
  .aide-entree { min-height: var(--tap); display: inline-flex; align-items: center; }
  .ms-pill { min-height: 32px; }        /* bandeau d'horaires : compact mais cliquable */
}
/* Zone cliquable de la puce d'aide : 24 px minimum (WCAG 2.5.8), sans grossir l'icône. */
.aide-puce { width: 24px; height: 24px; }

/* ==========================================================================
   21. Audit du 16/09/2026 — densité mobile, encart défilable, cartes compactes
   ========================================================================== */

/* 21.1 Un encart ou une modale ne doit JAMAIS cacher son contenu ni ses boutons.
   La cause était réelle : `.modal` n'avait pas de hauteur maximale et restait en
   `overflow: hidden` ; un glossaire long dépassait donc l'écran par le haut comme
   par le bas, sans qu'aucune zone ne défile. */
.modal {
  max-height: 85vh;                                  /* repli pour les navigateurs sans dvh */
  max-height: calc(100dvh - 2 * var(--sp-4));
  display: flex; flex-direction: column;
}
.modal > .panel-body, .modal > .modal-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.modal > .panel-head, .modal > .modal-head { flex: 0 0 auto; }
.modal-backdrop { overflow-y: auto; overscroll-behavior: contain; }

/* 21.2 Listes d'instruments : sur téléphone, des cartes compactes remplacent les
   tableaux empilés (154 à 264 px par ligne, un seul instrument visible à l'écran).
   Le bureau garde son tableau dense. */
.cartes-instruments { display: none; }

@media (max-width: 760px) {
  .liste-desktop { display: none; }
  .cartes-instruments { display: flex; flex-direction: column; gap: 6px; padding: var(--sp-2); }

  .ic {
    display: grid; grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "nom var" "sym prix" "spark delta";
    column-gap: var(--sp-3); row-gap: 2px; align-items: center;
    min-height: 82px; padding: 8px 10px;
    background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius);
    cursor: pointer;
  }
  /* Avec une action (étoile de watchlist), elle occupe une colonne à droite : la
     carte garde ses trois lignes au lieu de gagner une rangée de 38 px. */
  .ic-avec-action {
    grid-template-columns: minmax(0, 1fr) auto 44px;
    grid-template-areas: "nom var action" "sym prix action" "spark delta action";
  }
  .ic:active { background: var(--surface-3); }
  .ic-nom { grid-area: nom; font-weight: 600; font-size: var(--fs-md);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ic-var { grid-area: var; font-size: var(--fs-sm); font-weight: 600;
            font-variant-numeric: tabular-nums; }
  .ic-sym { grid-area: sym; font-size: var(--fs-xs); color: var(--text-faint);
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ic-prix { grid-area: prix; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
  .ic-spark { grid-area: spark; display: flex; align-items: center; min-height: 20px; }
  .ic-spark > * { width: 100%; height: 20px; display: block; }
  .ic-delta { grid-area: delta; font-size: var(--fs-xs); font-variant-numeric: tabular-nums;
              text-align: right; white-space: nowrap; }
  .ic-quand { margin-left: var(--sp-1); }
  .ic-action { grid-area: action; display: flex; align-items: center; justify-content: center; }
  .ic-action .star-btn { min-height: var(--tap); min-width: var(--tap); padding: 0; font-size: 17px; }

  /* 21.3 Cartes de compétition : mêmes informations, deux lignes au lieu de quatre. */
  .cp-carte-lien { padding: 10px 2px; }
  .cp-carte-tete b { font-size: var(--fs-md); }
  .cp-carte-meta { font-size: var(--fs-xs); margin-top: 2px; }
  .cp-carte-meta.faint { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
                         overflow: hidden; }
  .cp-liste + .cp-liste { margin-top: var(--sp-2); }

  /* 21.3bis Une rangée de cartes ne doit pas dépasser la largeur de l'écran : les
     actions passent à la ligne au lieu de pousser la ligne à 640 px (Parties,
     Positions, tableaux de bord), ce qui obligeait à défiler horizontalement. */
  .table-cards td.card-action { flex-direction: column; align-items: stretch; gap: var(--sp-2); }
  .table-cards .row-actions { white-space: normal; display: flex; flex-wrap: wrap; gap: var(--sp-2); }
  .table-cards .row-actions .btn { flex: 1 1 auto; }
  .table-cards td { min-width: 0; }
}

/* 21.4 Tutoriel actionnel : une barre discrète qui suit la navigation.
   L'ancien voile plein écran empêchait justement de faire les gestes demandés. */
.tuto-barre {
  position: fixed; z-index: 95; left: 10px; right: 10px;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  padding: var(--sp-3);
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 60vh; overflow-y: auto; overscroll-behavior: contain;
}
.tuto-barre h3 { margin: 2px 0 var(--sp-1); font-size: var(--fs-md); }
.tuto-barre p { margin: 0 0 var(--sp-2); font-size: var(--fs-sm); line-height: 1.5; color: var(--text-dim); }
.tuto-barre-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.tuto-passer { background: none; border: 0; color: var(--text-dim); font-size: var(--fs-xs);
               text-decoration: underline; cursor: pointer; min-height: 32px; }
.tuto-consigne { display: flex; align-items: center; gap: var(--sp-1); margin-bottom: var(--sp-2);
                 font-size: var(--fs-xs); color: var(--accent); }
.tuto-attente { animation: tuto-pulse 1.6s ease-in-out infinite; }
@keyframes tuto-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.tuto-barre-pied { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.tuto-barre .btn.small { min-height: 40px; }
@media (min-width: 761px) {
  .tuto-barre { left: var(--sp-5); right: auto; bottom: var(--sp-5); max-width: 420px; }
}
/* La surbrillance encadre l'élément visé sans assombrir le reste de l'écran. */
.tuto-cible { position: relative; z-index: 96; outline: 2px solid var(--accent); outline-offset: 2px;
              box-shadow: none; border-radius: var(--radius-sm); }
@media (prefers-reduced-motion: reduce) { .tuto-attente { animation: none; } }

/* ==========================================================================
   20. Corrections de l'audit de reprise (15/09/2026) — mesures au navigateur
   ========================================================================== */

/* 20.1 Débordement horizontal : le conteneur principal et les colonnes se
   dimensionnaient sur leur contenu (flex/min-width: auto) ; un tableau large
   faisait donc défiler TOUTE la page, sur téléphone comme sur bureau. */
main.view { width: 100%; min-width: 0; }
.stack, .panel { min-width: 0; }
@media (max-width: 760px) {
  /* `.split` passait en colonne mais gardait `align-items: start` : chaque
     enfant prenait la largeur de son contenu (650 px pour 390 px d'écran). */
  .split { align-items: stretch; }
  .split > * { width: 100%; min-width: 0; }
  .instr-head { row-gap: var(--sp-2); }
  .instr-prix { min-width: 0; }
  /* Le badge de séance gardait `nowrap` : 403 px de large pour un écran de 390 px. */
  .mkt-badge, .session-badge, .freshness { white-space: normal; }
  /* Les tableaux larges restent lisibles par défilement, mais dans leur cadre. */
  .table-scroll { max-width: 100%; }
}

/* 20.2 Plancher typographique : ces sélecteurs restaient sous les 11,5 px
   annoncés en tête de feuille (« aucun texte utile sous 11,5 px »). */
.nav .nav-count, .party-btn .pb-label, .party-menu .pm-head, .party-menu .pm-meta,
.kpi-label, thead th, .sub-name, .tag, .section-title, .field > label,
.panel-head h2 { font-size: var(--fs-xs); }
/* Un titre de panneau reste un titre : un cran au-dessus des étiquettes. */
@media (min-width: 761px) { .panel-head h2 { font-size: var(--fs-sm); } }
@media (max-width: 760px) { .panel-head h2 { font-size: var(--fs-md); } }

/* 20.3 Cibles tactiles mesurées sous 44 px sur téléphone : les deux onglets
   d'ordre (32 px), les puces de montant (26 px) et la puce d'aide (24 px). */
@media (max-width: 760px) {
  .chip { height: auto; min-height: var(--tap); padding: 0 14px; }
  .order-switch button { min-height: var(--tap); }
  .aide-puce { position: relative; }
  /* La puce garde son apparence (cercle de 24 px) mais son bouton mesure 44 px :
     la zone tactile est réelle, elle ne dépend pas d'un pseudo-élément. */
  .aide-puce { width: var(--tap); height: var(--tap); border: 0; background: transparent; }
  .aide-puce::before {
    content: ""; position: absolute; inset: 10px; border-radius: 50%;
    border: 1px solid var(--line-strong); background: transparent;
  }
  .aide-puce:hover::before, .aide-puce:focus-visible::before { border-color: var(--accent); }
}

/* ---------------------------------------------------------------------------
   20. Audit « Ma partie » / fiche instrument (16/09) — l'espace, pas le décor.
   ------------------------------------------------------------------------- */

/* 20.1 « Ma partie » : une seule colonne pleine largeur. Mesuré avant :
   colonne de gauche 739 px de contenu, colonne de droite 151 px (« Ordre
   rapide ») => 588 px de noir sous le formulaire et des tableaux bridés à
   764 px au lieu de 1118 px. Mêmes panneaux, même ordre, toute la largeur. */
.grille-partie { display: flex; flex-direction: column; gap: var(--sp-3); }

@media (min-width: 1081px) {
  /* Le formulaire d'ordre rapide tient sur deux colonnes au lieu de s'étirer. */
  #party-order-panel .order-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--sp-3) var(--sp-4);
    align-items: start;
  }
  #party-order-panel .order-body > #order-lines { grid-column: 2; }
  #party-order-panel .order-body > #order-message,
  #party-order-panel .order-body > #order-confirm-block,
  #party-order-panel .order-body > #order-actions,
  #party-order-panel .order-body > .hint { grid-column: 1 / -1; }
  #party-order-panel .order-actions { justify-content: flex-start; }
  #party-order-panel .order-actions .btn { min-width: 220px; }
}

/* 20.2 Fiche instrument : « Ma position » quitte la colonne du formulaire.
   Elle y était recouverte par le panneau d'ordre collant (906 px pour un écran
   de 900 px) : on la place sous le graphique, donc [ MA POSITION ] à gauche,
   [ ACHAT / VENTE ] à droite, sans superposition possible. */
@media (min-width: 1081px) {
  /* La colonne d'action est ÉLARGIE (380 → 440 px) : c'est elle qui porte le
     panneau d'achat/vente et « Ma position ». La place vient de la colonne de
     gauche, désormais plus dense : le bloc « Informations détaillées » est
     remonté juste sous le graphique (il était en bas de page, ce qui laissait
     une grande zone vide et obligeait à descendre très loin pour lire la fiche
     de l'instrument — refonte UX du 25/09).
     Une largeur FIXE est nécessaire : avec `minmax(380px, 460px)`, la colonne
     restait à son minimum (380 px) puisque c'est le `1fr` de gauche qui absorbe
     tout l'espace libre.
     DÉPLACEMENT du 25/09 : les OUTILS quittent cette colonne et passent en
     pleine largeur sous le graphique (`.instr-outils`, cf. paperpoints.css), et
     « Ma position » remonte sous l'ordre. Avant, elle occupait la colonne 1 /
     ligne 2 : dès que les outils (colonne 2) étaient plus hauts qu'elle, tout
     l'espace sous la courbe restait vide — c'est exactement ce qu'on voyait à
     l'écran. */
  .instr-split { grid-template-columns: minmax(0, 1fr) 440px; }
  .instr-split > #colonne-graphique { grid-column: 1; grid-row: 1; }
  .instr-split > #colonne-actions { grid-column: 2; grid-row: 1; }
}

@media (max-width: 1080px) {
  /* Ordre imposé par la refonte UX : instrument, graphique, informations
     détaillées repliables, puis achat/vente, position, et enfin les outils en
     pleine largeur (ils sont hors de `.instr-split`, donc ils suivent). */
  .instr-split { display: flex; flex-direction: column; gap: var(--sp-3); }
  .instr-split > * { width: 100%; min-width: 0; }
  .instr-split > #colonne-graphique { order: 1; }      /* graphique + fiche instrument */
  .instr-split > #colonne-actions { order: 2; }        /* achat/vente + ma position */
}

/* 20.3 « Aide et notions », en bas du rail : identifiable au repos, pas
   seulement au survol. L'effet de survol est conservé. */
.rail-pied #rail-aide {
  color: var(--texte);
  background: rgba(59, 130, 246, .10);
  box-shadow: inset 0 0 0 1px rgba(96, 165, 250, .22);
}
.rail-pied #rail-aide .ico {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(59, 130, 246, .20); color: var(--bleu-clair);
  font-size: 13px; font-weight: 700; opacity: 1;
}
.rail-pied #rail-aide:hover { background: rgba(59, 130, 246, .20); color: #fff; }

/* 20.4 Un `hidden` doit rester caché : `.line { display: flex }` battait
   l'attribut (les lignes « Cash disponible » / « Quantité détenue » s'affichaient
   dans le mode où elles ne servent pas). */
.quote-box .line[hidden] { display: none; }
