/* ═══════════════════════════════════════════════════════════════════════════════════════════════════
   PONT SUR L'HORIZON DU BP (Shared/PontHorizonVue.razor) — préfixe `ph-`, 12/11/2026.
   Vue « Pont » du Pilotage (à côté de Tableau, Graphiques, Comparer). Maquette validée par Arthur :
   docs/maquettes/pont-horizon-bp.html. Réglages, phrase, ligne de chiffres, puis le graphique (js/pont-horizon.js).
   ═══════════════════════════════════════════════════════════════════════════════════════════════════ */
.ph {
    --ph-up: #3dd7b0; --ph-down: #F0A595; --ph-tot: #0AACA5;
    --ph-p1: #38BDF8; --ph-p2: #A99BFF; --ph-p3: #F3B24A; --ph-p4: #7FA7C9; --ph-p5: #E87BB0; --ph-p6: #C9D46B; --ph-p7: #D9B38C; --ph-p8: #8FD3E0;
    display: flex; flex-direction: column; gap: 0; min-height: 0; overflow-y: auto; height: 100%;
    color: var(--tx2, #c8d3da); font-family: var(--font-family); font-size: 13px; line-height: 1.45;
}
html[data-theme="light"] .ph {
    --ph-up: #118a6b; --ph-down: #c8443f; --ph-tot: #0a8f89;
    --ph-p1: #0284c7; --ph-p2: #6b5bd6; --ph-p3: #b7791f; --ph-p4: #4a6f91; --ph-p5: #b8457f; --ph-p6: #7d8a1e; --ph-p7: #9a6b3f; --ph-p8: #2a8fa3;
}
.ph .num, .ph-graphe { font-variant-numeric: tabular-nums; }
.ph .t-up { color: var(--ph-up); } .ph .t-down { color: var(--ph-down); }

/* Réglages */
.ph-ctrl { display: flex; flex-direction: column; gap: 10px; padding: 10px 16px 12px; border-bottom: 1px solid var(--o8); }
.ph-onglets { display: flex; gap: 18px; border-bottom: 1px solid var(--o8); }
.ph-onglets button {
    padding: 6px 0 8px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none;
    font: inherit; font-size: 13.5px; font-weight: 700; color: var(--color-text-muted); cursor: pointer;
}
.ph-onglets button.on { color: var(--tx1); border-bottom-color: var(--brand); }
.ph-aggs { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.ph-fam { display: flex; align-items: center; gap: 7px; }
.ph-fam > span:first-child { font-size: 10.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--color-text-muted); }
.ph-seg { display: inline-flex; flex-wrap: wrap; padding: 3px; gap: 2px; border-radius: 9px; background: var(--o4); border: 1px solid var(--o8); max-width: 100%; }
.ph-seg button {
    border: 0; background: none; padding: 4px 9px; border-radius: 6px; font: inherit; font-size: 12px; font-weight: 600;
    color: var(--color-text-muted); cursor: pointer; white-space: nowrap;
}
.ph-seg button:hover { color: var(--tx1); }
.ph-seg button.on { background: var(--brand); color: var(--brand-contrast, #06141a); }
.ph-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ph-champ { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--color-text-muted); }
.ph-fleche { color: var(--color-text-muted); font-weight: 700; }

/* La réponse */
.ph-tete { padding: 14px 16px 12px; border-bottom: 1px solid var(--o8); background: radial-gradient(90% 160% at 0% 0%, color-mix(in srgb, var(--brand) 12%, transparent), transparent 62%); }
.ph-titre { margin: 0; font-size: 18px; line-height: 1.28; font-weight: 800; letter-spacing: -.015em; color: var(--tx1); text-wrap: balance; }
.ph-resume { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 6px 0; font-size: 13px; color: var(--color-text-muted); }
.ph-resume b { font-size: 15px; font-weight: 800; color: var(--tx1); }
.ph-resume .ec { font-size: 15px; font-weight: 800; }
.ph-suite { margin: 0; max-width: 90ch; font-size: 13px; color: var(--tx2, #c8d3da); }

/* Le pont */
.ph-zone { padding: 10px 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.ph-outils { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; }
.ph-sourcil { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-strong, var(--brand)); }
.ph-graphe { position: relative; width: 100%; min-height: 120px; }
.ph-graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.ph-grille line { stroke: var(--o8); }
.ph-grille text, .ph-x text { fill: var(--color-text-muted); font-size: 11px; }
.ph-x text.fort { fill: var(--tx1); font-weight: 700; }
.ph-x text.sous { font-size: 10.5px; font-style: italic; opacity: .85; }
.ph-axe0 { stroke: var(--o12); }
.ph-lien { stroke: var(--color-text-muted); stroke-dasharray: 3 3; opacity: .55; }
.ph-bande { fill: var(--o4); }
.ph-coupure { stroke: var(--surf-1, #06141d); stroke-width: 3; }
.ph-barre.tot rect { fill: var(--ph-tot); } .ph-barre.up rect { fill: var(--ph-up); } .ph-barre.down rect { fill: var(--ph-down); }
.ph-barre text { font-size: 11.5px; font-weight: 700; fill: var(--tx1); }
.ph-barre.up text.v { fill: var(--ph-up); } .ph-barre.down text.v { fill: var(--ph-down); }
.ph-barre.muet { cursor: default; }
.ph-barre.muet:hover rect { filter: brightness(1.15); }
.ph-bulle {
    position: absolute; transform: translate(-50%, calc(-100% - 8px)); pointer-events: none; z-index: 2;
    display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 10px; border-radius: 8px;
    border: 1px solid var(--o12); background: var(--surf-pop, var(--surf-1, #0f1c25)); box-shadow: 0 6px 18px rgba(0, 0, 0, .28);
    font-size: 12px; white-space: nowrap; color: var(--tx1);
}
.ph-bulle[hidden] { display: none; }
.ph-bulle small { font-size: 10.5px; color: var(--color-text-muted); } .ph-bulle b { font-weight: 600; } .ph-bulle span { font-weight: 800; }
.ph-bulle .haut { color: var(--ph-up); } .ph-bulle .bas { color: var(--ph-down); }

/* Téléphone : une ligne par marche */
.ph-rangs { display: flex; flex-direction: column; gap: 2px; }
.ph-rang { display: grid; grid-template-columns: minmax(0, 1fr) 84px; gap: 2px 10px; padding: 5px 0; }
.ph-rang .l b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--tx1); }
.ph-rang .l small { display: block; font-size: 11.5px; color: var(--color-text-muted); }
.ph-rang .v { text-align: right; font-size: 13px; font-weight: 700; white-space: nowrap; color: var(--tx1); }
.ph-rang .v.haut { color: var(--ph-up); } .ph-rang .v.bas { color: var(--ph-down); }
.ph-rang .piste { grid-column: 1 / -1; position: relative; height: 12px; border-radius: 3px; background: var(--o4); }
.ph-rang .piste i { position: absolute; top: 1px; bottom: 1px; border-radius: 3px; min-width: 3px; }
.ph-rang.tot { border-top: 1px solid var(--o8); border-bottom: 1px solid var(--o8); }
.ph-rang.tot .l b, .ph-rang.tot .v { font-weight: 800; }
.ph-rang.tot .piste i { background: var(--ph-tot); } .ph-rang.up .piste i { background: var(--ph-up); } .ph-rang.down .piste i { background: var(--ph-down); }
.ph-rang.petit { padding: 2px 0 2px 12px; } .ph-rang.petit .l b { font-size: 12.5px; font-weight: 500; }

.ph-legende { display: flex; flex-wrap: wrap; gap: 5px 14px; font-size: 12px; }
.ph-legende span { display: inline-flex; align-items: center; gap: 6px; }
.ph-legende i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ph-legende b { font-weight: 700; }
.ph-indice { margin: 0; font-size: 11.5px; color: var(--color-text-muted); }
.ph-calme { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 7px; font-size: 12px; color: var(--color-text-muted); }
.ph-calme b { color: var(--tx2, #c8d3da); }
.ph-calme span { padding: 2px 9px; border-radius: 99px; background: var(--o4); border: 1px solid var(--o8); color: var(--tx2, #c8d3da); }
.ph-vide { margin: 16px; color: var(--color-text-muted); }

details.ph-tab { border-radius: 11px; border: 1px solid var(--o8); background: var(--o4); }
details.ph-tab summary { padding: 9px 12px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--tx1); }
.ph-tab-in { padding: 0 12px 11px; overflow-x: auto; }
.ph-tab-in table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ph-tab-in th, .ph-tab-in td { padding: 5px 8px; text-align: right; border-top: 1px solid var(--o8); white-space: nowrap; }
.ph-tab-in th:first-child, .ph-tab-in td:first-child { text-align: left; }
.ph-tab-in th { border-top: 0; font-weight: 600; color: var(--color-text-muted); }
.ph-tab-in tr.total td { font-weight: 800; border-top: 1px solid var(--o12); color: var(--tx1); }
.ph-seg button:focus-visible, .ph-onglets button:focus-visible, details.ph-tab summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

@media (max-width: 640px) {
    .ph-ctrl, .ph-zone { padding-left: 12px; padding-right: 12px; }
    .ph-tete { padding: 12px; } .ph-titre { font-size: 16px; }
}

/* BP from scratch (Pages/CreationPlanView, vue « Pont » du panneau des états) : une carte, hauteur libre (le panneau défile). */
.crea-pont { border: 1px solid var(--o8); border-radius: 12px; overflow: hidden; background: var(--o4); }
.crea-pont .ph { height: auto; overflow: visible; }
.crea-pont .ph-ctrl, .crea-pont .ph-zone { padding-left: 12px; padding-right: 12px; }
.crea-pont .ph-tete { padding: 12px; }
.crea-pont .ph-titre { font-size: 16px; }

/* Lecture « Par hypothèse » (12/11/2026) : l'attente du rejeu, puis le détail de chaque hypothèse par poste. */
.ph-attente { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border-radius: 50%; border: 2px solid var(--o12); border-top-color: var(--brand); animation: ph-tourne .8s linear infinite; }
@keyframes ph-tourne { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ph-attente { animation: none; } }
.ph-hyps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.ph-hyps li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; padding: 7px 10px; border-radius: 9px; background: var(--o4); border: 1px solid var(--o8); font-size: 12.5px; }
.ph-hyps li b { color: var(--tx1); font-weight: 700; }
.ph-hyps li .num { font-weight: 800; }
.ph-hyps li small { color: var(--color-text-muted); font-size: 11.5px; }
.ph-hyps-d { flex-basis: 100%; color: var(--tx2, #c8d3da); font-size: 12px; }

/* Plan rouvert depuis un PDF (CreationPlanView, lecture) : la grille de la page a une hauteur fixe ; un bloc en overflow caché y
   tombait à 1 px (hauteur minimale automatique = 0). Il garde sa hauteur de contenu. */
.crea-lec-corps > .crea-lec-bloc.is-plat.crea-lec-pont { overflow: clip; min-width: 0; }   /* plus précis que .crea-lec-bloc.is-plat (creation.css, chargé après) */
/* Partout : le graphique ne réclame jamais plus que la largeur qu'on lui donne (le SVG dessiné large gonflait la colonne d'une grille). */
.ph, .ph-zone, .ph-graphe { min-width: 0; }
.ph-graphe svg { max-width: 100%; }
