/* Orle Edge : mise en page du tableau de bord et finition des graphes.
   S'appuie sur les jetons et composants de da.css, n'en invente aucun. */

/* ---------- Coque ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.app[data-replie="1"] { grid-template-columns: 64px minmax(0, 1fr); }

.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; gap: var(--s-2);
  border-right: 1px solid var(--border); background: var(--bg); padding: var(--s-3) var(--s-3) var(--s-3);
  overflow: hidden auto; scrollbar-width: none; z-index: 40;
}
.side::-webkit-scrollbar { display: none; }
.marque { display: flex; align-items: center; height: 44px; padding: 0 var(--s-2); border-radius: var(--r-md); color: var(--fg); }
.marque .oe-lockup { font-size: 25px; }

.nav-g { display: flex; flex-direction: column; gap: 1px; margin-top: var(--s-2); }
.nav-g > p { font-size: var(--t-11); font-weight: 500; color: var(--fg-3); padding: var(--s-2) var(--s-2) var(--s-1); letter-spacing: .01em; }
.nav-a {
  display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 var(--s-2); border-radius: var(--r-md);
  font-size: var(--t-13); color: var(--fg-2); text-decoration: none; white-space: nowrap;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.nav-a svg { width: 20px; height: 20px; flex: none; }
.nav-a:hover { background: var(--surface-2); color: var(--fg); }
.nav-a { position: relative; }
.nav-a svg { transition: color var(--dur-hover) var(--ease), transform var(--dur-enter) var(--ease); }
.nav-a .ic-f { fill: currentColor; stroke: none; opacity: 0; transition: opacity var(--dur-enter) var(--ease); }
.nav-a:hover .ic-f { opacity: .14; }
.nav-a:hover svg { color: var(--fg); }
.nav-a:active svg { transform: scale(.92); }
/* Page ouverte : bloc de verre à bord liquide, filet d'accent à gauche, icône pleine */
.nav-a[aria-current="page"] { background: var(--surface-2); color: var(--fg); font-weight: 500; }
.nav-a[aria-current="page"] svg { color: var(--accent-text); }
.nav-a[aria-current="page"] .ic-f { opacity: .24; }
.nav-a[aria-current="page"]::after {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0;
  background: var(--accent); box-shadow: 0 0 10px var(--glow);
}
.nav-a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-a .nav-n { margin-left: auto; font-family: var(--mono); font-size: var(--t-11); color: var(--fg-3); }
.nav-a .nav-n.crit { color: var(--red); }
.side-pied { margin-top: auto; display: flex; flex-direction: column; gap: var(--s-2); }
.plan { border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s-3); background: var(--surface); display: flex; flex-direction: column; gap: var(--s-2); }
.plan p { font-size: var(--t-12); color: var(--fg-2); line-height: 1.45; }
.plan b { font-size: var(--t-13); font-weight: 600; }
.moi { display: flex; align-items: center; gap: 10px; padding: var(--s-2); border-radius: var(--r-md); }
.moi:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; flex: none; border-radius: var(--r-full); display: grid; place-items: center; background: var(--surface-3); border: 1px solid var(--border-strong); font-size: var(--t-11); font-weight: 600; }
.moi-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.moi-t b { font-size: var(--t-13); font-weight: 500; }
.moi-t span { font-size: var(--t-12); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app[data-replie="1"] .marque-t, .app[data-replie="1"] .nav-g > p, .app[data-replie="1"] .nav-a span,
.app[data-replie="1"] .nav-n, .app[data-replie="1"] .plan, .app[data-replie="1"] .moi-t { display: none; }
.app[data-replie="1"] .nav-a, .app[data-replie="1"] .marque, .app[data-replie="1"] .moi { justify-content: center; padding: 0; }
.app[data-replie="1"] .nav-a svg { width: 22px; height: 22px; }
/* Menu replié : le compteur devient une pastille posée sur l'icône */
.app[data-replie="1"] .nav-a .nav-n:not(:empty) {
  display: block; position: absolute; top: 6px; right: 10px; width: 7px; height: 7px; margin: 0; padding: 0;
  border-radius: 50%; font-size: 0; background: var(--fg-3); box-shadow: 0 0 0 2px var(--bg);
}
.app[data-replie="1"] .nav-a .nav-n.crit { background: var(--red); }

/* ---------- Barre du haut ---------- */
.zone { min-width: 0; display: flex; flex-direction: column; }
.barre {
  position: sticky; top: 0; z-index: 30; height: 56px; display: flex; align-items: center; gap: var(--s-2);
  padding: 0 var(--s-6); border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(12px) saturate(1.4);
}
.fil { display: flex; align-items: center; gap: var(--s-2); font-size: var(--t-13); color: var(--fg-3); min-width: 0; white-space: nowrap; }
.fil b { color: var(--fg); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.fil .sep { width: 1px; height: 16px; background: var(--border-strong); }
.barre-d { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }
.barre-d .field { width: 260px; }
.direct { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-full); font-size: var(--t-12); color: var(--fg-2); white-space: nowrap; }
.cloche { position: relative; }
.cloche::after { content: ""; position: absolute; top: 7px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }

/* ---------- Contenu ---------- */
.contenu { padding: var(--s-6) var(--s-6) var(--s-12); display: flex; flex-direction: column; gap: var(--s-4); min-width: 0; }
.tete { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding-bottom: var(--s-2); }
.tete h1 { font-size: var(--t-24); font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.tete p { margin-top: 4px; font-size: var(--t-14); color: var(--fg-2); }
.tete-d { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

.grille { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--s-4); }
.c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c5 { grid-column: span 5; } .c6 { grid-column: span 6; }
.c7 { grid-column: span 7; } .c8 { grid-column: span 8; } .c12 { grid-column: span 12; }
.card { min-width: 0; }
.card-h { flex-wrap: wrap; }
.card-x { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }

/* Indicateurs */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s-4); }
/* Contenu masqué tant que les graphes ne sont pas dessinés (aucun décalage au chargement) */
.oe-charge .contenu { visibility: hidden; }
/* Place réservée avant le rendu des indicateurs (évite le décalage au chargement) */
.kpis:empty { min-height: 182px; }
@media (max-width: 1279px) { .kpis:empty { min-height: 448px; } }
@media (max-width: 767px) { .kpis:empty { min-height: 520px; } }
.kpi { padding: var(--s-5); display: flex; flex-direction: column; gap: var(--s-2); position: relative; overflow: hidden; }
/* overflow: hidden rogne le bord liquide posé à -1px : on le replace dans la boîte */
.kpi::before { inset: 0; }
.kpi-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); font-size: var(--t-13); color: var(--fg-2); }
.kpi-h svg { width: 16px; height: 16px; color: var(--fg-3); flex: none; }
.kpi-v { font-size: var(--t-32); font-weight: 600; letter-spacing: -.03em; line-height: 1.1; white-space: nowrap; }
.kpi-v small { font-size: var(--t-16); font-weight: 500; color: var(--fg-3); margin-left: 3px; letter-spacing: 0; }
.kpi-b { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); }
.kpi-d { font-size: var(--t-12); color: var(--fg-3); line-height: 1.4; }
.kpi-d p + p { margin-top: 2px; }
.kpi-d span:not(.delta) { color: var(--fg-3); }
.kpi-m { width: 96px; height: 36px; flex: none; }
.delta { font-family: var(--mono); font-size: var(--t-12); font-variant-numeric: tabular-nums; }
.delta.up { color: var(--accent-text); } .delta.dn { color: var(--fg-2); } .delta.mal { color: var(--red); }

/* Légende interactive (séries masquables) */
.leg-btn { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 10px; border-radius: var(--r-full); border: 1px solid var(--border); font-size: var(--t-12); color: var(--fg-2); background: transparent; cursor: pointer; transition: opacity var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease); }
.leg-btn:hover { border-color: var(--border-strong); color: var(--fg); }
.leg-btn[aria-pressed="false"] { opacity: .45; }
.leg-btn i { width: 10px; height: 3px; border-radius: 2px; flex: none; }
.leg-btn i.dash { background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px) !important; color: var(--ink-soft); }
.leg-btn b { font-family: var(--mono); font-weight: 500; color: var(--fg); }

/* Résumés chiffrés au-dessus d'un graphe */
.chiffres { display: flex; gap: var(--s-8); flex-wrap: wrap; padding: 0 0 var(--s-4); }
.chiffres > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chiffres span { font-size: var(--t-12); color: var(--fg-3); }
.chiffres b { font-size: var(--t-20); font-weight: 600; letter-spacing: -.02em; }
.chiffres b em { font-style: normal; font-size: var(--t-13); color: var(--fg-3); font-weight: 500; margin-left: 2px; }

/* ---------- Graphes (classes posées par charts.js) ---------- */
.oe-chart { position: relative; width: 100%; min-width: 0; }
.oe-svg { display: block; width: 100%; overflow: visible; user-select: none; }
.oe-axe { fill: var(--fg-3); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.oe-grid line { stroke: var(--grid); }
.oe-line { transition: opacity var(--dur-hover) var(--ease); }
.oe-seuil { fill: var(--fg-2); font-family: var(--mono); font-size: 11px; }
.oe-annot-t { fill: var(--fg); font-size: 11px; font-weight: 500; }
.oe-etq-n { fill: var(--fg-2); font-size: 11.5px; }
.oe-etq-v { fill: var(--fg); font-family: var(--mono); font-size: 11.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.oe-x { pointer-events: none; transition: opacity 80ms linear; }
.oe-hit { cursor: crosshair; }
.oe-col { transition: opacity var(--dur-hover) var(--ease); }
.oe-col.oe-dim { opacity: .32; }
.oe-band { opacity: .3; transition: opacity var(--dur-hover) var(--ease); cursor: default; }
.oe-band:hover { opacity: .62; }
.oe-fl-n { fill: var(--fg); font-size: 12px; font-weight: 500; }
.oe-fl-v { fill: var(--fg-3); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.oe-jour { transition: opacity var(--dur-hover) var(--ease); }
.oe-jour:hover { opacity: .55; }

.oe-rep { display: flex; gap: 3px; height: 8px; border-radius: var(--r-full); overflow: hidden; }
.oe-rep i { display: block; min-width: 3px; border-radius: 2px; }
.oe-rep-l { display: flex; flex-direction: column; gap: 2px; margin-top: var(--s-3); }
.oe-rep-l > div { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); height: 30px; font-size: var(--t-13); color: var(--fg-2); border-bottom: 1px dashed var(--border); }
.oe-rep-l > div:last-child { border-bottom: 0; }
.oe-rep-l span { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.oe-rep-l span i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.oe-rep-l b { font-weight: 500; color: var(--fg); font-size: var(--t-13); }
.oe-fl-leg { margin-top: var(--s-2); }

.oe-anneau { position: relative; flex: none; }
.oe-anneau svg { display: block; }
.oe-anneau-c { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.oe-anneau-c b { font-family: var(--font); font-variant-numeric: tabular-nums; font-size: var(--t-24); font-weight: 600; letter-spacing: -.02em; }
.oe-anneau-c span { font-size: var(--t-11); color: var(--fg-3); margin-top: 2px; }

.oe-globe { position: relative; width: 100%; }
.oe-globe canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; border-radius: var(--r-lg); }
.oe-globe canvas.oe-glisse { cursor: grabbing; }

.oe-tbl-wrap { width: 100%; overflow-x: auto; scrollbar-width: thin; }
.tbl { width: 100%; }
.tbl td.num, .tbl th.num { text-align: right; }

/* ---------- Blocs propres au tableau de bord ---------- */
.trafic-pied { display: flex; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; padding-top: var(--s-3); margin-top: var(--s-3); border-top: 1px solid var(--border); font-size: var(--t-12); color: var(--fg-3); }

.globe-l { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-5); align-items: stretch; }
.globe-z { position: relative; min-height: 420px; border-radius: var(--r-lg); background: radial-gradient(60% 60% at 50% 50%, var(--accent-soft), transparent 70%); }
.globe-z .oe-globe { position: absolute; inset: 0; }
.globe-leg { position: absolute; left: var(--s-3); bottom: var(--s-3); display: flex; gap: var(--s-4); flex-wrap: wrap; font-size: var(--t-12); color: var(--fg-3); pointer-events: none; }
.globe-leg span { display: inline-flex; align-items: center; gap: 6px; }
.globe-leg i { width: 8px; height: 8px; border-radius: 50%; }
.globe-aide { position: absolute; right: var(--s-3); top: var(--s-3); font-size: var(--t-11); color: var(--fg-3); pointer-events: none; display: flex; align-items: center; gap: 6px; }
.pops { display: flex; flex-direction: column; min-width: 0; }
.pop { display: grid; grid-template-columns: 42px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: 10px var(--s-2); margin: 0 calc(-1 * var(--s-2)); width: calc(100% + 2 * var(--s-2)); background: transparent; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; border-radius: 0; transition: background-color var(--dur-1, .15s) ease; }
.pop:hover { background: var(--surface-2, var(--muted)); }
.pop[aria-pressed="true"] .pop-c { color: var(--accent-text); border-color: var(--accent); }
.pop[aria-pressed="true"] .pop-v b { color: var(--accent-text); }
.pop:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: var(--r-md); }
.pop:last-child { border-bottom: 0; }
.pop-c { font-family: var(--mono); font-size: var(--t-12); font-weight: 500; height: 24px; display: grid; place-items: center; border: 1px solid var(--border-strong); border-radius: var(--r-sm); }
.pop-t { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pop-v { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); font-size: var(--t-13); }
.pop-v b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop-v span { color: var(--fg-3); font-size: var(--t-12); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pop-r { font-family: var(--mono); font-size: var(--t-12); color: var(--fg-2); text-align: right; white-space: nowrap; }
.meter { height: 4px; }

.defi { display: flex; align-items: center; gap: var(--s-6); flex-wrap: wrap; }
.defi-t { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-6); flex: 1; min-width: 160px; }
.defi-t span { display: block; font-size: var(--t-12); color: var(--fg-3); }
.defi-t b { font-size: var(--t-20); font-weight: 600; letter-spacing: -.02em; }

.inc { display: flex; flex-direction: column; }
.inc-l { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s-3); padding: var(--s-3) 0; border-bottom: 1px solid var(--border); align-items: start; }
.inc-l:last-child { border-bottom: 0; }
.inc-i { width: 28px; height: 28px; border-radius: var(--r-md); display: grid; place-items: center; border: 1px solid var(--border-strong); }
.inc-i svg { width: 14px; height: 14px; }
.inc-i.warn { color: var(--amber); } .inc-i.crit { color: var(--red); } .inc-i.ok { color: var(--fg-3); }
.inc-c { min-width: 0; }
.inc-c .badge { margin-top: 8px; }
.inc-l b { font-size: var(--t-13); font-weight: 500; display: block; }
.inc-l p { font-size: var(--t-12); color: var(--fg-3); line-height: 1.45; margin-top: 2px; }
.inc-l time { font-family: var(--mono); font-size: var(--t-11); color: var(--fg-3); white-space: nowrap; padding-top: 2px; }

.dispo { display: flex; flex-direction: column; gap: var(--s-4); }
.dispo-l { display: grid; grid-template-columns: 200px minmax(0, 1fr) 72px; gap: var(--s-4); align-items: center; }
.dispo-n { display: flex; align-items: center; gap: 8px; font-size: var(--t-13); min-width: 0; white-space: nowrap; }
.dispo-n span { color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; }
.dispo-p { font-family: var(--mono); font-size: var(--t-12); text-align: right; }
.dispo-b { height: 28px; min-width: 0; }
.dispo-x { display: flex; justify-content: space-between; font-family: var(--mono); font-size: var(--t-11); color: var(--fg-3); padding-left: calc(200px + var(--s-4)); padding-right: calc(72px + var(--s-4)); }

.journal { max-height: 440px; overflow: auto; scrollbar-width: thin; }
.journal .tbl tbody tr.neuf { animation: neuf 1.6s var(--ease); }
@keyframes neuf { from { background: var(--accent-soft); } to { background: transparent; } }
.journal .tbl thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.ip { font-family: var(--mono); font-size: var(--t-12); }
.chemin { font-family: var(--mono); font-size: var(--t-12); color: var(--fg-2); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.muet { color: var(--fg-3); }
.drap { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.drap i { font-style: normal; font-family: var(--mono); font-size: var(--t-11); color: var(--fg-3); width: 22px; }
.barre-pct { display: flex; align-items: center; gap: var(--s-2); justify-content: flex-end; }
.barre-pct .meter { width: 64px; }

/* Voile du tiroir mobile */
.voile { display: none; }

/* ---------- Adaptation ---------- */
@media (max-width: 1599px) {
  .kpis { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpi-m { display: none; }
  .barre-d .field { width: 220px; }
}
@media (max-width: 1439px) {
  .globe-l { grid-template-columns: minmax(0, 1fr) 260px; }
  .c4.r-lg6 { grid-column: span 6; }
  .c4.r-lg12 { grid-column: span 12; }
}
@media (max-width: 1279px) {
  .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-m { display: block; }
  .c7, .c5, .c8, .c6.r-md12 { grid-column: span 12; }
  .c4.r-md6 { grid-column: span 6; }
}
@media (max-width: 1023px) {
  .app, .app[data-replie="1"] { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 280px; transform: translateX(-100%); transition: transform var(--dur-enter) var(--ease); box-shadow: var(--pop-shadow); background: var(--surface); }
  .app[data-tiroir="1"] .side { transform: none; }
  .app[data-tiroir="1"] .voile { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .app[data-replie="1"] .marque-t, .app[data-replie="1"] .nav-g > p, .app[data-replie="1"] .nav-a span,
  .app[data-replie="1"] .nav-n, .app[data-replie="1"] .plan, .app[data-replie="1"] .moi-t { display: revert; }
  .barre-d .field { display: none; }
  .globe-l { grid-template-columns: minmax(0, 1fr); }
  .globe-z { min-height: 360px; }
  .c4, .c6, .c3, .c4.r-lg6, .c4.r-md6, .c4.r-lg12 { grid-column: span 12; }
}
@media (max-width: 767px) {
  .barre { padding: 0 var(--s-4); }
  .contenu { padding: var(--s-4) var(--s-4) var(--s-10); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3); }
  .kpis > :first-child { grid-column: span 2; }
  .kpi { padding: var(--s-4); }
  .kpi-v { font-size: var(--t-24); }
  .kpi-m { display: none; }
  .kpis > :first-child .kpi-m { display: block; }
  .grille { gap: var(--s-3); }
  .chiffres { gap: var(--s-5); }
  .direct .t { display: none; }
  .dispo-l { grid-template-columns: minmax(0, 1fr) 64px; gap: var(--s-2) var(--s-3); }
  .dispo-n { grid-column: 1 / -1; }
  .dispo-b { grid-column: 1; }
  .dispo-x { padding-left: 0; padding-right: calc(64px + var(--s-3)); }
  .globe-z { min-height: 320px; }
  .tete h1 { font-size: var(--t-20); }
  .tete-d { width: 100%; }
  .tete-d .seg { flex: 1; }
  .tete-d .seg button { flex: 1; }
  .chemin { max-width: 180px; }
  .fil > b, .fil > .sep { display: none; }
}

/* Intertitre d'une carte et colonne de part */
.sous-t { font-size: var(--t-12); font-weight: 500; color: var(--fg-3); margin: var(--s-6) 0 var(--s-2); letter-spacing: .01em; }
@media (min-width: 640px) { .tbl td.col-part { width: 38%; } }

/* Tableaux en cartes sous 640 px */
@media (max-width: 639px) {
  .tbl-cartes thead { display: none; }
  .tbl-cartes, .tbl-cartes tbody, .tbl-cartes tr, .tbl-cartes td { display: block; width: 100%; }
  .tbl-cartes tr { padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
  .tbl-cartes tr:last-child { border-bottom: 0; }
  .tbl-cartes td { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: 3px 0 !important; border: 0 !important; text-align: right; min-width: 0; }
  .tbl-cartes td::before { content: attr(data-label); color: var(--fg-3); font-size: var(--t-12); text-align: left; flex: none; }
  .tbl-cartes td:first-child { font-weight: 500; }
  .tbl-cartes td:first-child::before { display: none; }
  .tbl-cartes .chemin { max-width: 60vw; }

  /* Listes (pays, réseaux, robots) : deux lignes par entrée, nom à gauche, valeur et part à droite */
  .tbl-liste tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--s-3); row-gap: 2px; align-items: center; padding: 10px 0; }
  .tbl-liste td { display: block; padding: 0 !important; }
  .tbl-liste td::before { display: none; }
  .tbl-liste td:nth-child(1) { grid-row: 1 / 3; grid-column: 1; text-align: left; overflow: hidden; text-overflow: ellipsis; }
  .tbl-liste td:nth-child(2) { grid-row: 1; grid-column: 2; font-variant-numeric: tabular-nums; font-weight: 500; }
  .tbl-liste td:nth-child(3) { grid-row: 2; grid-column: 2; font-size: var(--t-12); color: var(--fg-2); }
  .tbl-liste .barre-pct .meter { width: 48px; }
  .tbl-liste .muet { font-weight: 400; font-size: var(--t-12); }

  /* Journal : motif et décision, puis heure, adresse, origine et requête sur une ligne */
  .tbl-journal tr { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 4px; padding: 10px 0; }
  .tbl-journal tr::after { content: ""; order: 3; flex-basis: 100%; height: 0; }
  .tbl-journal td { display: block; width: auto; padding: 0 !important; text-align: left; }
  .tbl-journal td::before { display: none; }
  .tbl-journal td:nth-child(3) { order: 1; flex: 1 1 0; min-width: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tbl-journal td:nth-child(3) br, .tbl-journal td:nth-child(3) .muet { display: none; }
  .tbl-journal td:nth-child(2) { order: 2; flex: none; }
  .tbl-journal td:nth-child(1), .tbl-journal td:nth-child(4), .tbl-journal td:nth-child(5) { order: 4; flex: none; color: var(--fg-3); font-weight: 400; }
  .tbl-journal td:nth-child(6) { order: 5; flex: 1 1 0; min-width: 0; }
  .tbl-journal .chemin { max-width: none; }
  .tbl-journal .drap i { width: auto; margin-right: 5px; }

  /* Moins de lignes sur téléphone */
  .tbl[data-mobile="5"] tbody tr:nth-child(n+6), .tbl[data-mobile="6"] tbody tr:nth-child(n+7) { display: none; }
  .tbl-plus { display: block; margin: var(--s-2) 0 0; font-size: var(--t-12); color: var(--fg-3); }
}
@media (min-width: 640px) { .tbl-plus { display: none; } }

/* Le globe remplit toute la hauteur de sa carte (la carte voisine fixe la hauteur de la rangée) */
@media (min-width: 900px) {
  .card:has(.globe-l) { display: flex; flex-direction: column; }
  .card:has(.globe-l) > .card-b { flex: 1; display: flex; flex-direction: column; }
  .card:has(.globe-l) .globe-l { flex: 1; }
}
/* Flux : étiquettes de la dernière colonne posées à gauche des nœuds, détourées sur la surface */
.oe-fl-rappel { fill: none; stroke: var(--fg-3); stroke-opacity: .45; stroke-width: 1; }
.oe-fl text { paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
/* Carte du globe moins large (1280 à 1599) : le globe prend toute la largeur, la liste passe dessous en deux colonnes */
@media (min-width: 1280px) and (max-width: 1599px) {
  .globe-l { grid-template-columns: minmax(0, 1fr); }
  .globe-z { min-height: 380px; }
  .pops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s-6); }
  .pop:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
}

/* Valeurs du flux : halo plus fin, sinon la chasse fixe paraît creuse */
.oe-fl text.oe-fl-v{stroke:none;fill:var(--fg-2)}

/* ---------- Sélecteur d'espace (service affiché) ---------- */
.espace { position: relative; min-width: 0; display: flex; }
.espace-b {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 32px; min-width: 0; max-width: 100%;
  padding: 0 var(--s-2) 0 5px; border: 1px solid transparent; border-radius: var(--r-md);
  background: transparent; color: var(--fg); font: inherit; font-size: var(--t-13); cursor: pointer;
  transition: background var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.espace-b:hover, .espace-b[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.espace-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.espace-m {
  flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--t-11); font-weight: 600; line-height: 1;
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.espace-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.espace-c { flex: none; width: 14px; height: 14px; color: var(--fg-3); transition: transform var(--dur-hover) var(--ease); }
.espace-b[aria-expanded="true"] .espace-c { transform: rotate(180deg); }

.espace-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; width: 340px; max-width: calc(100vw - 32px);
  display: flex; flex-direction: column; gap: var(--s-1); padding: var(--s-2); border-radius: var(--r-lg);
  /* La barre a déjà son propre flou : le menu, qui en déborde, prend un fond presque plein. */
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  white-space: normal; color: var(--fg); font-size: var(--t-13);
  opacity: 0; transform: translateY(-4px) scale(.985); transform-origin: top left;
  transition: opacity var(--dur-enter) var(--ease), transform var(--dur-enter) var(--ease);
}
.espace-menu.on { opacity: 1; transform: none; }
.espace-menu[hidden] { display: none; }
.espace-q { width: 100%; }
.espace-org { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); margin: var(--s-2) var(--s-2) 2px; }
.espace-l { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; }
.espace-o {
  display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 16px; align-items: center; gap: var(--s-3);
  min-height: 48px; padding: 6px var(--s-2); border-radius: var(--r-md); cursor: pointer;
  transition: background var(--dur-hover) var(--ease);
}
.espace-o:hover, .espace-o.actif { background: var(--surface-2); }
.espace-o.actif { box-shadow: inset 0 0 0 1px var(--border); }
.espace-t { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.espace-t b { font-weight: 500; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.espace-t span { font-size: var(--t-12); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.espace-o .badge { white-space: nowrap; }
.espace-k { width: 16px; height: 16px; color: var(--accent-text); opacity: 0; transition: opacity var(--dur-hover) var(--ease); }
.espace-o[aria-selected="true"] .espace-k { opacity: 1; }
.espace-o[aria-selected="true"] .espace-t b { font-weight: 600; }
.espace-vide { margin: var(--s-2); color: var(--fg-3); }
.espace-vide[hidden] { display: none; }
.espace-p { margin-top: var(--s-1); padding-top: var(--s-2); border-top: 1px solid var(--border); }
.espace-ajout {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 44px; padding: 0 var(--s-2);
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--fg); font: inherit; font-size: var(--t-13); font-weight: 500;
  cursor: pointer; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.espace-ajout svg { width: 16px; height: 16px; color: var(--accent-text); }
.espace-ajout:hover { background: var(--accent-soft); color: var(--accent-text); }
.espace-ajout:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.espace-ajout .kbd { margin-left: auto; }
@media (max-width: 767px) {
  .espace-menu { position: fixed; top: 64px; left: 16px; right: 16px; width: auto; max-width: none; }
  .espace-l { max-height: min(360px, 52dvh); }
  .espace-o { min-height: 52px; }
}

/* ---------- Assistant « Ajouter un service » ---------- */
body.assist-ouvert { overflow: hidden; }
.assist-voile {
  position: fixed; inset: 0; z-index: 70; background: rgba(4,4,6,.62);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity var(--dur-enter) var(--ease);
}
[data-theme="clair"] .assist-voile { background: rgba(9,9,11,.32); }
.assist-voile.on { opacity: 1; }
.assist-voile[hidden], .assist[hidden] { display: none; }
.assist {
  position: fixed; z-index: 72; left: 50%; top: 50%;
  width: min(780px, calc(100vw - 32px)); max-height: min(680px, calc(100dvh - 48px));
  display: flex; flex-direction: column; border-radius: var(--r-xl); overflow: hidden;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  opacity: 0; transform: translate(-50%, -48%) scale(.98);
  transition: opacity var(--dur-enter) var(--ease), transform var(--dur-enter) var(--ease);
}
.assist.on { opacity: 1; transform: translate(-50%, -50%); }
.assist-tete {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-6) var(--s-6) var(--s-4); border-bottom: 1px solid var(--border);
}
.assist-tete h2 { margin: 4px 0 4px; }
.assist-tete p { margin: 0; }
.assist-corps { flex: 1; min-height: 0; display: grid; grid-template-columns: 216px minmax(0, 1fr); }
.assist-rail {
  list-style: none; margin: 0; padding: var(--s-4) var(--s-3); display: flex; flex-direction: column; gap: 2px;
  border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 60%, transparent); overflow-y: auto;
}
.assist-rail li { position: relative; }
/* Fil entre deux pastilles */
.assist-rail li + li::before {
  content: ""; position: absolute; left: 23px; top: -9px; width: 1px; height: 16px; background: var(--border-strong);
}
.assist-pas {
  display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: var(--s-3); width: 100%;
  padding: 8px 10px; border: 0; border-radius: var(--r-md); background: transparent; color: var(--fg-2);
  font: inherit; text-align: left; cursor: pointer; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.assist-pas:hover:not([aria-disabled="true"]) { background: var(--surface-2); color: var(--fg); }
.assist-pas:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.assist-pas[aria-disabled="true"] { cursor: default; }
.assist-pas.avenir { color: var(--fg-3); }
.assist-pas.actif { background: var(--accent-soft); color: var(--fg); box-shadow: inset 0 0 0 1px var(--accent-ring); }
.assist-n {
  position: relative; z-index: 1; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--surface); font-size: var(--t-11); font-weight: 600; font-family: var(--mono);
  transition: background var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.assist-n svg { width: 13px; height: 13px; }
.assist-pas.fait .assist-n { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--accent-text); }
.assist-pas.actif .assist-n { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-soft); }
.assist-l { min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-top: 2px; }
.assist-l b { font-size: var(--t-13); font-weight: 500; }
.assist-l span { font-size: var(--t-12); color: var(--fg-3); line-height: 1.35; }

.assist-droite { min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.assist-prog { display: none; }
.assist-vue { padding: var(--s-6); }
.assist-vue.entre { animation: assist-entre var(--dur-enter) var(--ease) both; }
@keyframes assist-entre { from { opacity: 0; transform: translateX(8px); } to { opacity: 1; transform: none; } }
.assist-f { margin: 0; padding: 0; border: 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s-4); }
.assist-f > legend { padding: 0; margin: 0 0 4px; }
.assist-f > legend + p { margin: -8px 0 0; }
.assist-f p { margin: 0; }
.assist-champ { width: 100%; height: 44px; }
.assist-champ input, .assist-lab .field input { font-size: var(--t-14); }
.assist-err { color: var(--red); font-size: var(--t-12); display: flex; align-items: center; gap: 6px; margin: -8px 0 0 !important; }
.assist-err:empty { display: none; }
.assist-ligne {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-3) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
}
.assist-ligne > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.assist-ligne .switch-hit { flex: none; }
.assist-duo { display: grid; grid-template-columns: minmax(0, 1fr) 112px; gap: var(--s-3); }
.assist-lab { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.assist-lab .field { width: 100%; height: 40px; }
.assist-lab .seg { align-self: flex-start; }
.assist-test { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); }
.assist-test .btn svg { transition: transform var(--dur-hover) var(--ease); }
.assist-test .btn.charge svg { animation: assist-tourne .8s linear infinite; }
@keyframes assist-tourne { to { transform: rotate(360deg); } }
.assist-ok { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-text); }
.assist-ok svg { width: 15px; height: 15px; flex: none; }

.assist-tuiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); }
.assist-tuile {
  position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 104px; padding: var(--s-4);
  border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface-2); color: var(--fg);
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color var(--dur-hover) var(--ease), background var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.assist-tuile:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.assist-tuile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.assist-tuile[aria-checked="true"] {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: var(--liq-in), 0 0 0 3px var(--accent-soft), 0 10px 28px -14px var(--accent-ring);
}
.assist-tuile-h { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); flex-wrap: wrap; }
.assist-tuile-h b { font-size: var(--t-14); font-weight: 600; }
.assist-seuil { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.assist-seuil[hidden] { display: none; }

.assist-dns { display: flex; flex-direction: column; gap: var(--s-3); }
.assist-dns-l {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-2);
}
.assist-dns-l .badge { justify-self: start; }
.assist-dns-v { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; column-gap: var(--s-3); row-gap: 4px; }
.assist-dns-v code { min-width: 0; overflow-wrap: anywhere; }
.assist-note { display: flex; align-items: flex-start; gap: var(--s-2); color: var(--fg-2); }
.assist-note svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--fg-3); }

.assist-res { margin: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.assist-res > div { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto; align-items: center; gap: var(--s-3); padding: 10px var(--s-4); }
.assist-res > div + div { border-top: 1px solid var(--border); }
.assist-res dt { margin: 0; }
.assist-res dd { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: var(--t-13); }
.assist-chemin {
  display: flex; flex-direction: column; gap: 6px; padding: var(--s-3) var(--s-4);
  border: 1px dashed var(--border-strong); border-radius: var(--r-md);
}
.assist-chemin code { overflow-wrap: anywhere; }

.assist-pied {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-4) var(--s-6); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 50%, transparent);
}
.assist-pied .btn svg { width: 15px; height: 15px; }
.assist-pos { font-family: var(--mono); }

@media (max-width: 767px) {
  .assist {
    left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92dvh;
    border-radius: var(--r-xl) var(--r-xl) 0 0; transform: translateY(24px);
  }
  .assist.on { transform: none; }
  .assist-tete { padding: var(--s-5, 20px) var(--s-4) var(--s-3); }
  .assist-corps { display: flex; flex-direction: column; }
  .assist-rail { display: none; }
  .assist-prog { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4) 0; }
  .assist-prog .meter { flex: 1; }
  .assist-vue { padding: var(--s-4); }
  .assist-tuiles { grid-template-columns: minmax(0, 1fr); }
  .assist-tuile { min-height: 0; }
  .assist-duo { grid-template-columns: minmax(0, 1fr) 96px; }
  /* Type et « Copier » sur une ligne, valeurs en pleine largeur dessous : rien ne se coupe au milieu d'un nom. */
  .assist-dns-l { grid-template-columns: minmax(0, 1fr) auto; row-gap: var(--s-2); }
  .assist-dns-l .badge { grid-row: 1; grid-column: 1; }
  .assist-dns-l .btn { grid-row: 1; grid-column: 2; }
  .assist-dns-v { grid-row: 2; grid-column: 1 / -1; }
  .assist-pos { display: none; }
  .assist-res > div { grid-template-columns: minmax(0, 1fr) auto; }
  .assist-res dt { grid-column: 1 / -1; }
  .assist-pied { padding: var(--s-3) var(--s-4) calc(var(--s-3) + env(safe-area-inset-bottom)); }
  /* L'annonce se pose au-dessus du pied de la feuille, sinon elle cache « Continuer ». */
  body.assist-ouvert .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  .espace-menu, .assist, .assist-voile { transition: opacity var(--dur-hover) linear; transform: none !important; }
  .assist { transform: translate(-50%, -50%) !important; }
  .assist-vue.entre, .assist-test .btn.charge svg { animation: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 767px) { .assist { transform: none !important; } }

/* La période et les actions appartiennent à la vue, Orli à la barre globale. */
.contenu > .tete { padding-block: var(--s-2) var(--s-4); border-bottom: 1px solid var(--border); }
.contenu > .tete h1 { font-size: var(--t-32); letter-spacing: -.035em; }
.tete-d { align-items: center; }
.trafic-tete { align-items: end; }
.trafic-demo { color: var(--fg-3); font-size: var(--t-13); white-space: nowrap; }
.contenu-trafic { gap: var(--s-3); }
.orli-b { gap: var(--s-2); color: var(--fg); white-space: nowrap; min-height: 36px; }
.orli-b .orli-e { width: 22px; height: 22px; flex: none; }
.orli-dialog { box-sizing: border-box; padding: 0; width: min(480px, calc(100% - 24px)); color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--pop-shadow); }
.orli-dialog::backdrop { background: color-mix(in srgb, var(--zinc-950) 68%, transparent); }
.orli-head, .orli-identite, .orli-sujets { display: flex; align-items: center; gap: var(--s-3); }
.orli-head { padding: var(--s-4); justify-content: space-between; border-bottom: 1px solid var(--border); }
.orli-identite svg { width: 30px; height: 30px; flex: none; }
.orli-identite h2 { margin: 0; }
.orli-contenu { padding: var(--s-4); }
.orli-contenu > p { margin: 0 0 var(--s-3); }
.orli-sujets { flex-wrap: wrap; }
.orli-reponse { margin-top: var(--s-4); padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.orli-reponse h3 { margin: 0 0 var(--s-2); }
.orli-reponse p { margin: 0 0 var(--s-3); color: var(--fg-2); }
.orli-reponse a { color: var(--accent-text); }
@media (max-width: 767px) {
  .contenu > .tete h1 { font-size: var(--t-24); }
  .trafic-tete { align-items: start; }
  .barre .direct { display: none; }
  .barre .orli-b { min-height: 44px; }
  .orli-sujets .btn { min-height: 44px; }
}

/* Le panneau de catégorie prend la place du premier niveau. */
#nav [hidden] { display: none !important; }
#nav .nav-g > p { font-size: var(--t-12); font-weight: 400; color: var(--fg-3); margin: var(--s-2) 0 0; letter-spacing: 0; }
.nav-categorie, .nav-retour { width: 100%; border: 0; background: transparent; cursor: pointer; text-align: left; font-family: inherit; }
#nav .nav-categorie .nav-fleche { width: 14px; height: 14px; margin-left: auto; color: var(--fg-3); }
#nav .nav-retour .nav-fleche { width: 16px; height: 16px; }
#nav .nav-retour { color: var(--fg-2); margin-bottom: var(--s-2); }
#nav .nav-sous > a { font-size: var(--t-12); color: var(--fg-3); }
#nav .nav-sous > a:hover, #nav .nav-sous > a:focus-visible, #nav .nav-sous > a[aria-current="page"] { color: var(--fg); }
#nav .nav-sous > a svg { width: 18px; height: 18px; }
.app[data-replie="1"] #nav .nav-categorie .nav-fleche { display: none; }
.app[data-replie="1"] #nav .nav-sous > a svg { width: 22px; height: 22px; }
@media (pointer: coarse) { #nav .nav-a { min-height: 44px; } }

/* Les mesures se lisent sur un bandeau, puis par question opérationnelle. */
.kpis { overflow: hidden; gap: 1px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--border); }
.kpis > .kpi { border: 0; border-radius: 0; box-shadow: none; background: var(--surface); padding: var(--s-4); min-width: 0; }
.kpis > .kpi::before { display: none; }
.kpis .kpi-v { font-variant-numeric: tabular-nums; font-size: clamp(var(--t-24), 2.2vw, var(--t-32)); }
.kpis .kpi-m { display: block; width: clamp(35px, 4vw, 72px); height: 25px; }
.kpis .kpi-b { gap: var(--s-2); }
.kpis .kpi-h svg { opacity: .8; }
.data-section { display: grid; gap: var(--s-3); min-width: 0; margin-top: var(--s-3); }
.data-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s-1) var(--s-3); }
.data-head h2 { font-size: var(--t-16); font-weight: 620; margin: 0; }
.data-head p { font-size: var(--t-13); color: var(--fg-3); margin: 0; }
.data-dominant { min-width: 0; }
.data-card-foot { border-top: 1px solid var(--border); padding: var(--s-3) var(--s-5); }
.data-card-foot a { color: var(--accent-text); font-size: var(--t-13); text-decoration: none; }
.data-card-foot a:hover { text-decoration: underline; }
.data-events .orli { margin-top: var(--s-3); }
@media (min-width: 1200px) { .kpis { grid-template-columns: repeat(5, minmax(0,1fr)); } }
@media (max-width: 1199px) { .data-dominant, .data-events { grid-column: span 12; } }
@media (max-width: 767px) {
 .data-section { margin-top: var(--s-2); }
 .data-head { display: grid; gap: var(--s-1); }
 .kpis > .kpi { padding: var(--s-3); }
 .kpis .kpi-m { display: none; }
 .kpis > :first-child .kpi-m { display: block; width: 84px; }
}

.moi { color: var(--fg); text-decoration: none; }

/* ───────── Menu latéral v3 (menu.js) : sélecteur de site, pages et sous-pages, menu réduit à volets ───────── */
a.oe-lockup, .oe-lockup-lien { text-decoration: none; color: inherit; }
.marque a.oe-lockup { border-radius: var(--r-sm); }
.marque a.oe-lockup:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.side { gap: var(--s-1); }
.marque { margin-bottom: 2px; }

/* Sélecteur de site */
.sw { position: relative; margin-bottom: var(--s-2); }
.sw-b {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 8px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); color: var(--fg);
  font: inherit; text-align: left; cursor: pointer;
  transition: background var(--dur-hover) var(--ease), border-color var(--dur-hover) var(--ease);
}
.sw-b:hover, .sw-b[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border-strong); }
.sw-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sw-m {
  flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm);
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--t-12); font-weight: 650; line-height: 1;
  box-shadow: inset 0 0 0 1px var(--accent-ring);
}
.sw-m-org { background: var(--surface-3); color: var(--fg); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sw-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1; line-height: 1.25; }
.sw-t b { font-size: var(--t-13); font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-t small { display: flex; align-items: center; gap: 5px; font-size: var(--t-12); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sw-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.sw-c { flex: none; width: 16px; height: 16px; color: var(--fg-3); }

.sw-menu, .maq-menu {
  position: fixed; z-index: 60; width: 340px; max-width: calc(100vw - 16px);
  display: flex; flex-direction: column; gap: 2px; padding: var(--s-2); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 96%, transparent); color: var(--fg); font-size: var(--t-13);
  opacity: 0; transform: translateY(-4px) scale(.985); transform-origin: top left;
  transition: opacity var(--dur-enter) var(--ease), transform var(--dur-enter) var(--ease);
}
.maq-menu { width: 260px; transform-origin: bottom left; transform: translateY(4px) scale(.985); }
.sw-menu.on, .maq-menu.on { opacity: 1; transform: none; }
.sw-menu[hidden], .maq-menu[hidden] { display: none; }
.sw-q { width: 100%; margin-bottom: 2px; }
.sw-org { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); margin: 6px var(--s-2) 4px; }
.sw-org span { font-size: var(--t-12); font-weight: 560; color: var(--fg-2); }
.sw-org small { font-size: var(--t-12); color: var(--fg-3); }
.sw-l { display: flex; flex-direction: column; gap: 2px; max-height: 280px; overflow-y: auto; overscroll-behavior: contain; }
.sw-o {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 16px; align-items: center; gap: 10px;
  min-height: 48px; padding: 6px var(--s-2); border-radius: var(--r-md); cursor: pointer;
  transition: background var(--dur-hover) var(--ease);
}
.sw-o:hover, .sw-o.actif { background: var(--surface-2); }
.sw-ot { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.sw-ot b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-ot small { font-size: var(--t-12); color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-o .badge { white-space: nowrap; }
.sw-k { width: 16px; height: 16px; color: var(--accent-text); opacity: 0; }
.sw-o[aria-selected="true"] .sw-k, .sw-k.on { opacity: 1; }
.sw-vide { margin: var(--s-2); color: var(--fg-3); font-size: var(--t-13); }
.sw-vide[hidden] { display: none; }
.sw-sep { height: 1px; margin: 4px 0; background: var(--border); }
.sw-a {
  display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 var(--s-2); border-radius: var(--r-md);
  color: var(--fg-2); text-decoration: none; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.sw-a svg { width: 18px; height: 18px; flex: none; color: var(--fg-3); }
.sw-a .ic-f { fill: currentColor; stroke: none; opacity: .14; }
.sw-a:hover, .sw-a:focus-visible { background: var(--surface-2); color: var(--fg); outline: none; }
.sw-a:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sw-a .nav-tag, .sw-a .sw-k { margin-left: auto; }
.sw-a[aria-current="page"] { color: var(--fg); font-weight: 500; }

/* Retour au site (contexte du compte) */
.nav-retour {
  display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 var(--s-2); margin-bottom: var(--s-2);
  border-radius: var(--r-md); color: var(--fg-3); font-size: var(--t-13); text-decoration: none; white-space: nowrap;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.nav-retour svg { width: 16px; height: 16px; flex: none; }
.nav-retour span { overflow: hidden; text-overflow: ellipsis; }
.nav-retour:hover { background: var(--surface-2); color: var(--fg); }
.nav-retour:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Sections et pages */
#nav.nav-v3 { display: flex; flex-direction: column; gap: var(--s-3); }
#nav.nav-v3 .nav-g { margin-top: 0; gap: 0; }
#nav.nav-v3 .nav-plat { border-top: 1px solid var(--border); padding-top: var(--s-3); }
.nav-sec { margin: 0 0 4px; padding: 0 var(--s-2); font-size: var(--t-11); font-weight: 560; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.nav-liste { display: flex; flex-direction: column; gap: 1px; }
.nav-i { position: relative; }
#nav.nav-v3 .nav-a { height: 32px; gap: 10px; }
#nav.nav-v3 .nav-a svg { width: 18px; height: 18px; }
#nav.nav-v3 .nav-a span:first-of-type { overflow: hidden; text-overflow: ellipsis; }
.nav-i.a-sous > .nav-a { padding-right: 34px; }
.nav-i.a-sous > .nav-a .nav-n { margin-right: 2px; }
.nav-ouvrir {
  position: absolute; right: 2px; top: 2px; width: 28px; height: 28px; display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm); background: none; color: var(--fg-3); cursor: pointer;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.nav-ouvrir svg { width: 14px; height: 14px; transform: rotate(-90deg); transition: transform var(--dur-enter) var(--ease); }
.nav-i[data-ouvert] > .nav-ouvrir svg { transform: none; }
.nav-ouvrir:hover { background: var(--surface-3); color: var(--fg); }
.nav-ouvrir:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* Page ouverte qui a des sous-pages : le titre s'allume, la sous-page porte le fond. */
.nav-i.a-sous > .nav-a[aria-current="page"] { background: none; box-shadow: none; }
.nav-i.a-sous > .nav-a.liq::before { display: none; }
.nav-i.a-sous > .nav-a[aria-current="page"]::after { display: none; }
.nav-i.a-sous > .nav-a[aria-current="page"]:hover { background: var(--surface-2); }

/* Sous-pages : filet vertical aligné sur l'icône, ouverture en hauteur */
.nav-sous { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows var(--dur-enter) var(--ease), visibility 0s linear var(--dur-enter); }
.nav-i[data-ouvert] > .nav-sous { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows var(--dur-enter) var(--ease); }
.nav-i:not(.a-sous) > .nav-sous { display: none; }
.nav-sous-in { min-height: 0; overflow: hidden; display: flex; flex-direction: column; gap: 1px; margin-left: 16px; padding: 0 0 0 11px; border-left: 1px solid var(--border); }
.nav-sous-in > .nav-s:nth-child(2) { margin-top: 2px; }
.nav-sous-in > .nav-s:last-child { margin-bottom: 4px; }
.nav-vol-t { display: none; }
.nav-s {
  position: relative; display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 var(--s-2); border-radius: var(--r-sm);
  color: var(--fg-3); font-size: var(--t-13); text-decoration: none; white-space: nowrap;
  transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.nav-s span:first-child { overflow: hidden; text-overflow: ellipsis; }
.nav-s:hover { background: var(--surface-2); color: var(--fg); }
.nav-s:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.nav-s .nav-n { margin-left: auto; font-family: var(--mono); font-size: var(--t-11); color: var(--fg-3); }
.nav-s .nav-n.crit { color: var(--red); }
.nav-s[aria-current="true"] { background: var(--surface-2); color: var(--fg); font-weight: 500; }
.nav-s[aria-current="true"]::before { content: ""; position: absolute; left: -12px; top: 7px; bottom: 7px; width: 2px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 8px var(--glow); }

/* Section repliable (options) */
.nav-tete { display: flex; align-items: center; gap: 6px; width: 100%; height: 24px; margin-bottom: 4px; padding: 0 var(--s-2); border: 0; border-radius: var(--r-sm); background: none; color: var(--fg-3); font: inherit; font-size: var(--t-11); font-weight: 560; letter-spacing: .04em; text-transform: uppercase; text-align: left; cursor: pointer; transition: color var(--dur-hover) var(--ease); }
.nav-tete:hover { color: var(--fg); }
.nav-tete:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.nav-tete-n { font-family: var(--mono); font-size: var(--t-11); letter-spacing: 0; color: var(--fg-3); }
.nav-chev { width: 14px; height: 14px; margin-left: auto; transition: transform var(--dur-enter) var(--ease); }
.nav-g[data-ferme] .nav-chev { transform: rotate(-90deg); }
.nav-g[data-ferme] .nav-liste { display: none; }
.nav-a .nav-tag, .sw-a .nav-tag { margin-left: auto; padding: 0 6px; border: 1px solid var(--border); border-radius: var(--r-sm); font-size: 11px; line-height: 18px; color: var(--fg-3); }
.nav-a.nav-module { color: var(--fg-3); }
.nav-a.nav-module:hover { color: var(--fg); }

/* Outils de la maquette, au pied */
.maq { position: relative; }
.maq-b {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 var(--s-2);
  border: 1px dashed var(--border-strong); border-radius: var(--r-md); background: none; color: var(--fg-3);
  font: inherit; font-size: var(--t-12); cursor: pointer; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease);
}
.maq-b > svg:first-child { width: 16px; height: 16px; flex: none; }
.maq-b small { margin-left: auto; font-size: var(--t-11); color: var(--fg-3); }
.maq-b .sw-c { width: 14px; height: 14px; margin-left: 0; }
.maq-b:hover, .maq-b[aria-expanded="true"] { background: var(--surface-2); color: var(--fg); }
.maq-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.side-pied { border-top: 1px solid var(--border); padding-top: var(--s-3); }
.side-pied .maq { grid-column: 1 / -1; }

/* Menu réduit (bureau) : icônes seules, la page s'ouvre en volet au survol ou au clavier */
.app[data-replie="1"] .sw-t, .app[data-replie="1"] .sw-c, .app[data-replie="1"] .nav-sec,
.app[data-replie="1"] .nav-tete, .app[data-replie="1"] .nav-tag, .app[data-replie="1"] .nav-ouvrir,
.app[data-replie="1"] .nav-retour span, .app[data-replie="1"] .maq-b span, .app[data-replie="1"] .maq-b small { display: none; }
.app[data-replie="1"] .sw-b { justify-content: center; padding: 6px 0; border-color: transparent; background: none; min-height: 40px; }
.app[data-replie="1"] .nav-retour, .app[data-replie="1"] .maq-b { justify-content: center; padding: 0; }
.app[data-replie="1"] #nav.nav-v3 { gap: var(--s-2); }
.app[data-replie="1"] #nav.nav-v3 .nav-g + .nav-g { border-top: 1px solid var(--border); padding-top: var(--s-2); }
.app[data-replie="1"] .nav-g[data-ferme] .nav-liste { display: flex; }
.app[data-replie="1"] #nav.nav-v3 .nav-a { height: 36px; padding: 0; justify-content: center; }
.app[data-replie="1"] #nav.nav-v3 .nav-a svg { width: 20px; height: 20px; }
.app[data-replie="1"] .nav-i.a-sous > .nav-a[aria-current="page"] { background: var(--surface-2); }
.app[data-replie="1"] .nav-i > .nav-sous, .app[data-replie="1"] .nav-i:not(.a-sous) > .nav-sous {
  display: block; position: fixed; left: 56px; top: var(--vol-y, 0); z-index: 60; padding-left: 12px;
  visibility: hidden; opacity: 0; transform: translateX(-4px); transition: opacity var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease), visibility 0s linear var(--dur-hover);
}
.app[data-replie="1"] .nav-i[data-vol] > .nav-sous, .app[data-replie="1"] .nav-i:focus-within > .nav-sous {
  visibility: visible; opacity: 1; transform: none; transition: opacity var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease);
}
.app[data-replie="1"] .nav-sous-in {
  overflow: visible; min-width: 200px; margin: 0; padding: 6px; border: 1px solid var(--border-strong); border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--surface) 97%, transparent); box-shadow: var(--pop-shadow);
}
.app[data-replie="1"] .nav-vol-t { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding: 6px var(--s-2); font-size: var(--t-13); font-weight: 600; color: var(--fg); text-decoration: none; white-space: nowrap; }
.app[data-replie="1"] .nav-i.a-sous .nav-vol-t { margin-bottom: 2px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.nav-vol-t small { font-size: var(--t-11); font-weight: 400; color: var(--fg-3); }
.app[data-replie="1"] .nav-s[aria-current="true"]::before { display: none; }
.app[data-replie="1"] .nav-s .nav-n:not(:empty) { display: inline; position: static; width: auto; height: auto; margin-left: auto; font-size: var(--t-11); background: none; box-shadow: none; border-radius: 0; }
.app[data-replie="1"] .nav-s .nav-n.crit { background: none; }

/* Tiroir (étroit) : tout en clair, pas de volets */
@media (max-width: 1023px) {
  .app[data-tiroir="ouvert"] .side { transform: none; }
  .app[data-tiroir="ouvert"] .voile { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }
  .app[data-replie="1"] .sw-t, .app[data-replie="1"] .sw-c, .app[data-replie="1"] .nav-sec, .app[data-replie="1"] .nav-tete,
  .app[data-replie="1"] .nav-tag, .app[data-replie="1"] .nav-ouvrir, .app[data-replie="1"] .nav-retour span,
  .app[data-replie="1"] .maq-b span, .app[data-replie="1"] .maq-b small { display: revert; }
  .app[data-replie="1"] .nav-ouvrir { display: grid; }
  .app[data-replie="1"] .sw-b { justify-content: flex-start; padding: 6px 8px; border-color: var(--border); }
  .app[data-replie="1"] #nav.nav-v3 .nav-a { height: 32px; padding: 0 var(--s-2); justify-content: flex-start; }
  .app[data-replie="1"] .nav-g[data-ferme] .nav-liste { display: none; }
  .app[data-replie="1"] .nav-i > .nav-sous { position: static; display: grid; padding: 0; opacity: 1; transform: none; }
  .app[data-replie="1"] .nav-i:not(.a-sous) > .nav-sous { display: none; }
  .app[data-replie="1"] .nav-sous-in { min-width: 0; margin-left: 16px; padding: 0 0 0 11px; border: 0; border-left: 1px solid var(--border); border-radius: 0; background: none; box-shadow: none; overflow: hidden; }
  .app[data-replie="1"] .nav-vol-t { display: none; }
}
@media (pointer: coarse) {
  #nav.nav-v3 .nav-a, .nav-s { min-height: 44px; height: auto; }
  .nav-ouvrir { width: 40px; height: 40px; }
  .nav-tete { min-height: 40px; }
  .nav-i.a-sous > .nav-a { padding-right: 46px; }
}
@media (prefers-reduced-motion: reduce) { .nav-sous, .nav-i[data-ouvert] > .nav-sous, .nav-ouvrir svg { transition: none; } }

/* Menu du compte : l'usage du forfait a quitté la barre latérale */
.cq-usage { align-items: center; }
.cq-usage-t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cq-usage-t small { font-size: var(--t-12); color: var(--fg-3); }
.cq-usage-m { width: 36px; height: 4px; margin-left: auto; flex: none; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cq-usage-m i { display: block; height: 100%; background: var(--accent); }
.orli-b[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--border-strong)); background: var(--accent-soft); }

/* Fil d'Ariane : site › page › sous-page */
.espace[hidden] { display: none; }
.fil [hidden] { display: none; }
.fil-sous { font-size: var(--t-13); color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Page Compte : les rubriques sont les sous-pages du menu latéral ; la liste interne ne double plus le menu en bureau
   (elle reste lisible par les lecteurs d'écran et sert d'onglets en étroit). */
@media (min-width: 1024px) {
  .app:not([data-replie="1"]) .reglages { grid-template-columns: minmax(0, 1fr); }
  .app:not([data-replie="1"]) .reglages > nav { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
.fil-org { display: inline-flex; align-items: center; min-height: 28px; }
@media (max-width: 767px) {
  .fil .fil-org, .fil .fil-org + .sep, .fil .fil-sous-sep, .fil .fil-sous { display: none; }
}

/* ───────── Menu v3.1 : tête et pied fixes, menu qui défile seul, sélecteur épuré, tendances ───────── */
.side { overflow: hidden; gap: 0; }
.side-tete { flex: none; display: flex; flex-direction: column; gap: 6px; padding-bottom: var(--s-3); margin: 0 calc(-1 * var(--s-3)); padding-inline: var(--s-3); border-bottom: 1px solid transparent; transition: border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease); position: relative; z-index: 2; }
.side-tete.defile { border-bottom-color: var(--border); box-shadow: 0 8px 16px -12px rgba(0, 0, 0, .6); }
.side-tete .marque { margin-bottom: 0; }
.side-tete .sw { margin-bottom: 0; }
#nav.nav-v3 { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 0 calc(-1 * var(--s-3)); padding: var(--s-3) var(--s-3) var(--s-4); scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
#nav.nav-v3::-webkit-scrollbar { width: 6px; }
#nav.nav-v3::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 6px; }
.side-pied { flex: none; margin: 0 calc(-1 * var(--s-3)); padding: var(--s-3) var(--s-3) 0; border-top: 1px solid transparent; transition: border-color var(--dur-hover) var(--ease), box-shadow var(--dur-hover) var(--ease); position: relative; z-index: 2; }
.side-pied.defile { border-top-color: var(--border); box-shadow: 0 -8px 16px -12px rgba(0, 0, 0, .6); }
[data-theme="clair"] .side-tete.defile, [data-theme="clair"] .side-pied.defile { box-shadow: none; }

/* Mini-courbes à droite des entrées */
.sp { display: block; flex: none; overflow: visible; }
.sp-l { fill: none; stroke: currentColor; stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sp-a { fill: currentColor; opacity: .1; stroke: none; }
.sp-p { fill: currentColor; }
#nav.nav-v3 .nav-a > span:first-of-type { flex: 1 1 auto; min-width: 0; }
.nav-sp { width: 32px; height: 14px; color: var(--fg-3); opacity: .75; transition: opacity var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease); }
.nav-a:hover .nav-sp { opacity: 1; color: var(--fg-2); }
.nav-a[aria-current="page"] .nav-sp { color: var(--accent-text); opacity: 1; }
.nav-sp.crit, .nav-a:hover .nav-sp.crit { color: var(--red); opacity: 1; }
#nav.nav-v3 .nav-a.a-tend { padding-right: 34px; }
#nav.nav-v3 .nav-a.a-tend .nav-n { margin: 0 8px 0 0; }
#nav.nav-v3 .nav-a .nav-sp { margin-left: 0; }
.app[data-replie="1"] #nav.nav-v3 .nav-a.a-tend { padding-right: 0; }
.app[data-replie="1"] .nav-sp { display: none; }

/* Aperçu au survol */
.nav-apercu { position: fixed; z-index: 70; width: 232px; padding: var(--s-3); border-radius: var(--r-lg); pointer-events: none; background: color-mix(in srgb, var(--surface) 97%, transparent); color: var(--fg); opacity: 0; transform: translateX(-4px); transition: opacity var(--dur-hover) var(--ease), transform var(--dur-hover) var(--ease); }
.nav-apercu.on { opacity: 1; transform: none; }
.nav-apercu[hidden] { display: none; }
.nav-apercu p { margin: 0; }
.nav-ap-t { display: flex; justify-content: space-between; gap: var(--s-2); font-size: var(--t-12); color: var(--fg-3); }
.nav-ap-v { margin-top: 4px !important; font-size: var(--t-16); font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.nav-ap-d { font-size: var(--t-12); color: var(--fg-2); }
.nav-ap-sp { width: 100%; height: 44px; margin-top: var(--s-2); color: var(--accent-text); }
.nav-apercu.crit .nav-ap-sp, .nav-apercu.crit .nav-ap-v { color: var(--red); }

/* Volet du menu réduit : la tendance sous le titre */
.nav-vol-tend { display: none; }
.app[data-replie="1"] .nav-vol-tend { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: 2px var(--s-2) 8px; margin-bottom: 2px; border-bottom: 1px solid var(--border); color: var(--accent-text); }
.app[data-replie="1"] .nav-vol-tend.crit { color: var(--red); }
.nav-vol-tend span { display: flex; flex-direction: column; min-width: 0; }
.nav-vol-tend b { font-size: var(--t-13); font-weight: 560; color: var(--fg); white-space: nowrap; }
.nav-vol-tend small { font-size: var(--t-11); color: var(--fg-3); white-space: nowrap; }
.app[data-replie="1"] .nav-i:not(.a-sous) .nav-vol-tend { border-bottom: 0; margin-bottom: 0; }
.app[data-replie="1"] .nav-i .nav-vol-t + .nav-vol-tend { margin-top: -2px; }
.app[data-replie="1"] .nav-i.a-sous .nav-vol-t:has(+ .nav-vol-tend) { border-bottom: 0; margin-bottom: 0; padding-bottom: 4px; }

/* Sélecteur de site, épuré : recherche, sites, ajout */
.sw-menu { width: 300px; padding: 0; gap: 0; overflow: hidden; }
.sw-menu .sw-q { display: flex; align-items: center; gap: var(--s-2); height: 44px; margin: 0; padding: 0 var(--s-3); border-bottom: 1px solid var(--border); }
.sw-menu .sw-q svg { width: 16px; height: 16px; flex: none; color: var(--fg-3); }
.sw-menu .sw-q input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--fg); font: inherit; font-size: var(--t-13); }
.sw-menu .sw-q input::placeholder { color: var(--fg-3); }
.sw-g { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-2); padding: var(--s-3) var(--s-3) 4px; }
.sw-g span { font-size: var(--t-11); font-weight: 560; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.sw-g a { font-size: var(--t-12); color: var(--fg-2); text-decoration: none; border-radius: var(--r-sm); }
.sw-g a:hover { color: var(--fg); text-decoration: underline; text-underline-offset: 3px; }
.sw-g a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-menu .sw-l { padding: 0 6px; max-height: 264px; gap: 1px; }
.sw-menu .sw-o { grid-template-columns: 24px minmax(0, 1fr) 40px 16px; gap: 10px; min-height: 44px; padding: 6px 8px; border-radius: var(--r-md); box-shadow: none; }
.sw-menu .sw-o .sw-m { width: 24px; height: 24px; font-size: var(--t-11); }
.sw-menu .sw-o.actif { background: var(--surface-2); }
.sw-ot b mark { background: none; color: var(--accent-text); font-weight: 650; }
.sw-ot small { display: flex; align-items: center; gap: 5px; }
.sw-o.warn .sw-dot { background: var(--amber); box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 22%, transparent); }
.sw-o.warn small { color: color-mix(in srgb, var(--amber) 80%, var(--fg-3)); }
.sw-sp { width: 40px; height: 16px; color: var(--fg-3); }
.sw-o.actif .sw-sp { color: var(--accent-text); }
.sw-o.warn .sw-sp { color: var(--amber); }
.sw-menu .sw-k { width: 16px; height: 16px; opacity: 1; color: var(--accent-text); }
.sw-menu .sw-vide { padding: var(--s-2) var(--s-3); margin: 0; }
.sw-ajout { display: flex; align-items: center; gap: 10px; height: 40px; margin: 6px 6px 0; padding: 0 8px; border-radius: var(--r-md); color: var(--fg-2); font-size: var(--t-13); text-decoration: none; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease); }
.sw-ajout svg { width: 16px; height: 16px; flex: none; }
.sw-ajout:hover, .sw-ajout:focus-visible { background: var(--surface-2); color: var(--fg); outline: none; }
.sw-ajout:focus-visible { box-shadow: inset 0 0 0 2px var(--accent); }
.sw-pied { display: flex; gap: var(--s-3); margin: 6px 0 0; padding: 8px var(--s-3); border-top: 1px solid var(--border); font-size: var(--t-11); color: var(--fg-3); }
.sw-pied kbd { display: inline-grid; place-items: center; min-width: 16px; height: 16px; margin-right: 2px; padding: 0 3px; border: 1px solid var(--border); border-radius: 3px; font-family: var(--mono); font-size: 10px; color: var(--fg-2); background: var(--surface-2); }
@media (pointer: coarse) { .sw-pied { display: none; } .sw-menu .sw-o { min-height: 52px; } .sw-ajout { height: 48px; } }

/* ───────── Sélecteur v3 : espace puis service, panneau à deux colonnes ───────── */
.fav { flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.fav svg { width: 14px; height: 14px; }
.fav-sac { background: linear-gradient(160deg, #F59E0B, #C2410C); }
.fav-acc { background: linear-gradient(160deg, #8B5CF6, #5B21B6); }
.fav-plume { background: linear-gradient(160deg, #10B981, #047857); }
.fav-lune { background: linear-gradient(160deg, #64748B, #1E293B); }
.fav-reseau { background: var(--surface-3); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.fav-accueil { background: var(--surface-3); color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.fav-accueil svg { width: 14px; height: 14px; }
.fav-accueil .ic-f { fill: currentColor; stroke: none; opacity: .14; }

.sw-b { display: grid; grid-template-columns: minmax(0, 1fr) 16px; grid-template-rows: auto auto; align-items: center; column-gap: 8px; row-gap: 0; min-height: 0; padding: 0; overflow: hidden; }
.sw-b .sw-c { grid-column: 2; grid-row: 1 / 3; margin-right: 8px; }
.sw-l1, .sw-l2 { grid-column: 1; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 0 0 0 8px; }
.sw-l1 { height: 30px; font-size: var(--t-12); color: var(--fg-2); border-bottom: 1px solid var(--border); }
.sw-l2 { height: 38px; font-size: var(--t-13); }
.sw-av { flex: none; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 4px; background: var(--fg); color: var(--bg); font-size: 10px; font-weight: 700; line-height: 1; }
.sw-en { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.sw-offre { flex: none; padding: 0 5px; border: 1px solid var(--border-strong); border-radius: 4px; font-size: 10px; line-height: 15px; color: var(--fg-3); letter-spacing: .02em; }
.sw-l2 b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 560; }
.sw-l2 .sw-dot { margin-left: auto; }
.sw-dot.warn, .sw-o.warn .sw-dot { background: var(--amber); box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 22%, transparent); }
.sw-b:hover .sw-l1 { border-bottom-color: var(--border-strong); }
.app[data-replie="1"] .sw-b { display: flex; padding: 4px 0; }
.app[data-replie="1"] .sw-l1 { display: none; }
.app[data-replie="1"] .sw-l2 { padding: 0; justify-content: center; height: 32px; }
.app[data-replie="1"] .sw-l2 b, .app[data-replie="1"] .sw-l2 .sw-dot { display: none; }
.app[data-replie="1"] .sw-l2 .fav { width: 28px; height: 28px; border-radius: 8px; }
.app[data-replie="1"] .sw-l2 .fav svg { width: 16px; height: 16px; }

.sw-menu { width: 580px; max-width: calc(100vw - 16px); }
.sw-cols { display: grid; grid-template-columns: 200px minmax(0, 1fr); min-height: 300px; }
.sw-esp { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-right: 1px solid var(--border); background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.sw-h { margin: 6px 8px 4px; font-size: var(--t-11); font-weight: 560; letter-spacing: .04em; text-transform: uppercase; color: var(--fg-3); }
.sw-l .sw-h { margin: 10px 8px 4px; }
.sw-el { display: flex; flex-direction: column; gap: 2px; }
.sw-e { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 6px 8px; border: 0; border-radius: var(--r-md); background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; transition: background var(--dur-hover) var(--ease); }
.sw-e .sw-av { width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.sw-e:not([aria-selected="true"]) .sw-av { background: var(--surface-3); color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--border-strong); }
.sw-et { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.sw-et b { font-size: var(--t-13); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sw-et small { font-size: var(--t-11); color: var(--fg-3); }
.sw-e:hover { background: var(--surface-2); }
.sw-e[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.sw-e:focus-visible, .sw-e-plus:focus-visible, .sw-console:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sw-e-plus, .sw-console { display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 8px; border: 0; border-radius: var(--r-md); background: none; color: var(--fg-3); font: inherit; font-size: var(--t-12); text-decoration: none; cursor: pointer; transition: background var(--dur-hover) var(--ease), color var(--dur-hover) var(--ease); }
.sw-e-plus svg, .sw-console svg { width: 15px; height: 15px; flex: none; }
.sw-e-plus:hover, .sw-console:hover { background: var(--surface-2); color: var(--fg); }
.sw-console { margin-top: auto; border-top: 1px solid var(--border); border-radius: 0 0 var(--r-md) var(--r-md); padding-top: 2px; }
.sw-console .nav-tag { margin-left: auto; }
.sw-svc { display: flex; flex-direction: column; min-width: 0; }
.sw-menu .sw-svc .sw-q { height: 46px; }
.sw-menu .sw-l { flex: 1; max-height: 300px; padding: 0 6px 6px; }
.sw-menu .sw-o { grid-template-columns: 22px minmax(0, 1fr) 40px 16px; }
.sw-o-acc .sw-ot b { font-weight: 560; }
.sw-note { margin: 8px 8px 0; padding: 8px 10px; border: 1px dashed var(--border-strong); border-radius: var(--r-md); font-size: var(--t-12); color: var(--fg-3); }
.sw-ot b.mono { font-family: var(--mono); font-size: var(--t-12); }
.sw-ajout { flex-wrap: wrap; height: auto; min-height: 44px; margin: 0 6px 6px; padding: 6px 8px; border: 1px dashed var(--border-strong); column-gap: 10px; row-gap: 0; }
.sw-ajout small { flex-basis: 100%; padding-left: 26px; font-size: var(--t-11); color: var(--fg-3); }
.sw-ajout svg { color: var(--accent-text); }
.sw-menu.sw-etroit .sw-cols { grid-template-columns: minmax(0, 1fr); }
.sw-menu.sw-etroit .sw-esp { border-right: 0; border-bottom: 1px solid var(--border); flex-direction: row; flex-wrap: wrap; align-items: center; }
.sw-menu.sw-etroit .sw-esp > .sw-h, .sw-menu.sw-etroit .sw-e-plus, .sw-menu.sw-etroit .sw-console { display: none; }
.sw-menu.sw-etroit .sw-el { flex-direction: row; gap: 4px; width: 100%; }
.sw-menu.sw-etroit .sw-e { flex: 1; min-width: 0; }
.sw-menu.sw-etroit .sw-pied { display: none; }
.sw-menu.sw-etroit .sw-l { max-height: min(52dvh, 340px); }
#nav.nav-v3 .nav-plat:first-child { border-top: 0; padding-top: 0; }
