/* Polices : Barlow (texte) et Barlow Condensed (titres, chiffres), hébergées ici (licence OFL, voir fonts/OFL.txt). */
@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url(fonts/Barlow-Regular.woff2) format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url(fonts/Barlow-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 600; font-display: swap; src: url(fonts/BarlowCondensed-SemiBold.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; font-display: swap; src: url(fonts/BarlowCondensed-Bold.woff2) format("woff2"); }

/* Palette bleu marine ; le jaune ne sert qu'au curseur de progression du profil. Couleurs de zone : voir --z1 à --z6. */
:root {
  --bg: #f2f5f9; --surface: #ffffff; --surface-2: #f8fafc; --text: #0f172a; --muted: #64748b; --border: #e2e8f0;
  --accent: #0070d1; --accent-ink: #ffffff; --nav: #0b1f3a; --cursor: #f2c230;
  --err: #a8201a; --err-bg: #f6dcd9; --ok: #1e6b3d; --ok-bg: #d7ebdd; --danger: #b3261e;
  --z0: #8a9099; --z1: #8a9099; --z2: #3d8bd9; --z3: #3fae6c; --z4: #f2c230; --z5: #f08a24; --z6: #e0453a;
  --zi: #0b0d0f; --hatch: #9ea3aa;   /* encre sur les zones : au moins 4,5:1 sur les six couleurs */
  --display: "Barlow Condensed", "Roboto Condensed", "Arial Narrow", sans-serif-condensed, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #07111f; --surface: #0f1d33; --surface-2: #0b182b; --text: #e6ebf2; --muted: #93a1b5; --border: #1d2e48;
    --accent: #3aa0ff; --accent-ink: #0b1f3a;
    --err: #ff9d95; --err-bg: #4a2b2a; --ok: #86d6a4; --ok-bg: #2b4636; --danger: #c93a31;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body { font: 18px/1.5 "Barlow", system-ui, sans-serif; margin: 0; background: var(--bg); color: var(--text); }
main { max-width: 52rem; margin: 0 auto; padding: 1rem 1rem 2rem; }
h1, h2 { font-family: var(--display); font-weight: 700; line-height: 1.1; }
h1 { font-size: 2.4rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.6rem; margin: 2rem 0 .5rem; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
small, .muted { color: var(--muted); }
.small { font-size: .9rem; }
b, th { font-weight: 600; }
.defs { position: absolute; }
[hidden] { display: none !important; }

/* En-tête et menu */
.topbar { background: var(--nav); color: #fff; }
.topbar-inner { max-width: 52rem; margin: 0 auto; padding: .25rem 1rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; align-items: center; }
.brand { color: #fff; font: 700 1.7rem/1 var(--display); text-decoration: none; }
nav { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; margin-left: auto; }
nav a, nav button { display: inline-flex; align-items: center; color: #fff; background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; padding: .4rem .6rem; min-height: 48px; text-decoration: none; font: inherit; cursor: pointer; }
nav a:hover, nav button:hover { border-bottom-color: #ffffff80; }
nav a.on { font-weight: 600; border-bottom-color: #fff; }
nav form { margin: 0; }
body:has(#ride) .topbar-inner, body:has(#ride) footer { max-width: 72rem; }
.langs { display: inline-flex; gap: 1rem; }
footer { max-width: 52rem; margin: 0 auto; padding: 1rem; color: var(--muted); font-size: .9rem; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }

/* Formulaires, boutons, listes : des lignes, pas des cartes */
main > form, fieldset, .card { margin: 1rem 0; padding: 0; border: 0; }
fieldset, .card { border-top: 1px solid var(--border); padding-top: .5rem; }
legend { font: 700 1.3rem var(--display); padding: 0; }
label { display: block; margin: .8rem 0; font-weight: 600; }
input, select { font: inherit; display: block; width: 100%; max-width: 28rem; min-height: 48px; padding: .45rem .7rem; margin-top: .25rem; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 6px; font-weight: 400; }
input[type=checkbox] { display: inline-block; width: 1.4rem; min-height: 0; height: 1.4rem; margin: 0 .5rem 0 0; vertical-align: -.3rem; }
label small { display: block; font-weight: 400; }
button, .btn { font: 600 1.05rem "Barlow", system-ui, sans-serif; min-height: 48px; padding: .5rem 1.2rem; color: var(--text); background: var(--surface); border: 1px solid var(--muted); border-radius: 6px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .btn:hover { border-color: var(--text); }
button.primary, .btn.primary, main > form:only-of-type > button:last-child { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
button.danger, main > form.danger > button:last-child { color: #fff; background: var(--danger); border-color: var(--danger); }
input[type=file]::file-selector-button { font: 600 .95rem "Barlow", system-ui, sans-serif; margin-right: .75rem; padding: .3rem .8rem; color: var(--text); background: var(--bg); border: 1px solid var(--muted); border-radius: 6px; }
button.sm { min-height: 40px; padding: .2rem .8rem; font-size: .95rem; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.error, .notice { padding: .6rem .9rem; border-radius: 6px; font-weight: 600; margin: .5rem 0; }
.error { color: var(--err); background: var(--err-bg); }
.notice { color: var(--ok); background: var(--ok-bg); }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.tag { padding: .05rem .5rem; border: 1px solid var(--muted); border-radius: 6px; font-size: .85rem; color: var(--muted); }
.link { overflow-wrap: anywhere; font-size: .9rem; color: var(--muted); }
main > ul, ul.plain, .wlist { list-style: none; margin: 0 0 1rem; padding: 0; border-top: 1px solid var(--border); }
main > ul li, ul.plain li { padding: .55rem 0; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .25rem .75rem; align-items: center; }
li form { display: inline; margin: 0; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { border-bottom: 1px solid var(--border); padding: .5rem .75rem .5rem 0; text-align: left; white-space: nowrap; }
th { color: var(--muted); }
.card h2 { margin-top: .5rem; }

/* Accueil */
.hero { padding: 1.5rem 0 .5rem; }
.hero h1 { font-size: 3rem; max-width: 20ch; margin: 0 0 .5rem; }
.hero p { max-width: 36rem; color: var(--muted); }

/* Profils de séance : un polygone par bloc, coloré par zone */
.prof { display: block; }
.prof .z0 { fill: url(#hatch); }
.prof .z1 { fill: var(--z1); } .prof .z2 { fill: var(--z2); } .prof .z3 { fill: var(--z3); }
.prof .z4 { fill: var(--z4); } .prof .z5 { fill: var(--z5); } .prof .z6 { fill: var(--z6); }
.prof .done { fill: var(--surface); opacity: .65; }
.prof line { vector-effect: non-scaling-stroke; }
.prof .halo { stroke: var(--text); stroke-width: 8; }
.prof .cursor { stroke: var(--cursor); stroke-width: 4; }

/* Listes de séances : nom, durée, profil */
.wlist li { border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: .75rem; }
.wlist li > button, .wlist li > a, .wrow { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto 7.5rem; align-items: center; gap: 0 1rem; min-height: 56px; padding: .4rem 0; }
.wlist li > button { width: 100%; background: none; border: 0; border-radius: 0; text-align: left; font-weight: 400; }
.wlist li > button:hover, .wlist li > a:hover { background: var(--surface); }
.wlist li > a { text-decoration: none; }
.wname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.wdur { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wlist .prof { width: 100%; height: 2rem; }

/* Page de sortie : les chiffres restent gros, lisibles de loin sur la tablette */
main:has(#ride) { max-width: 72rem; }
main:has(#rouler) > h1 { position: absolute; left: -10000px; }
#status { margin: .5rem 0; color: var(--muted); }
#status:empty { display: none; }
.buttons { display: flex; flex-wrap: wrap; gap: .75rem; }
.buttons button { flex: 1 1 8rem; font-size: 1.25rem; min-height: 56px; }
#ride .buttons { margin: 1rem 0 0; }
.live { margin-top: .75rem; }
.live .buttons { align-items: center; margin: .5rem 0 0; }
.live .buttons button { flex: 1 1 4.5rem; padding-inline: .4rem; white-space: nowrap; font-size: 1.15rem; }
.live > .buttons:first-child b { flex: 1 1 5rem; text-align: center; font: 700 1.6rem var(--display); font-variant-numeric: tabular-nums; }
.live form label { flex: 1 1 8rem; margin: 0; font-size: .95rem; }
.live form input { max-width: none; margin-top: 0; }
.rhead { display: flex; align-items: baseline; gap: 1.25rem; font: 600 1.6rem/1.2 var(--display); }
.rhead h2 { flex: 1; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 2rem; }
.rhead b { font-size: 2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.big { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .5rem 0; }
.tile { container-type: inline-size; min-width: 0; padding: .5rem 1rem 0; border-radius: 6px; background: var(--surface); display: grid; grid-template-columns: auto 1fr; column-gap: .4em; align-items: end; overflow: hidden; }
.tile .lbl { grid-column: 1 / -1; align-self: start; font: 600 1.25rem var(--display); }
.tile b { font: 700 min(34cqw, 21vh)/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tile .unit { font: 600 min(11cqw, 7vh) var(--display); padding-bottom: .15em; }
.tile.z0 b { font-size: min(26cqw, 16vh); }
.tile.z0 .unit { display: none; }
.tile.z0, .tile.z1, .tile.z2, .tile.z3, .tile.z4, .tile.z5, .tile.z6 { color: var(--zi); }
.tile.z0 { background: repeating-linear-gradient(45deg, var(--z1) 0 9px, var(--hatch) 9px 13px); }
.tile.z1 { background: var(--z1); } .tile.z2 { background: var(--z2); } .tile.z3 { background: var(--z3); }
.tile.z4 { background: var(--z4); } .tile.z5 { background: var(--z5); } .tile.z6 { background: var(--z6); }
.meters { display: flex; flex-wrap: wrap; gap: .25rem 2rem; margin: .5rem 0; color: var(--muted); }
.meters b { color: var(--text); font: 700 2rem var(--display); font-variant-numeric: tabular-nums; }
#profile .prof { width: 100%; height: clamp(4.5rem, 15vh, 9rem); background: var(--surface); border-radius: 6px; }
#summary dl { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1.5rem; font-variant-numeric: tabular-nums; }
#summary dt { color: var(--muted); }
#summary dd { margin: 0; font-weight: 600; }
@media (orientation: portrait) {
  .big { grid-template-columns: 1fr; }
  .rhead { flex-wrap: wrap; gap: 0 1.25rem; }
  .rhead h2 { flex-basis: 100%; font-size: 1.6rem; }
  .tile b { font-size: min(34cqw, 10vh); }
  .tile .unit { font-size: min(11cqw, 3.4vh); }
  .tile.z0 b { font-size: min(26cqw, 7.5vh); }
  #profile .prof { height: 11vh; }
}

/* Appareils couplés : une grande tuile par fonction */
.devs { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .75rem; margin: 1rem 0; }
.dev { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "i l" "v v" "n n" "s s"; gap: .15rem .6rem; align-items: center; justify-items: start; min-height: 11rem; padding: 1rem; text-align: left; border-radius: 10px; background: var(--surface); border: 2px solid var(--border); }
.dev:hover { border-color: var(--muted); }
.dev.on { border-color: var(--accent); }
.dev svg { grid-area: i; width: 2rem; height: 2rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.dev.on svg { color: var(--accent); }
.dev .lbl { grid-area: l; font: 600 1.3rem var(--display); }
.dev .val { grid-area: v; align-self: end; font: 700 3.2rem/1 var(--display); font-variant-numeric: tabular-nums; }
.dev .val small { font-size: 1.2rem; margin-left: .3rem; font-weight: 600; }
.dev .dname { grid-area: n; font-weight: 600; min-height: 1.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.dev .dstat { grid-area: s; color: var(--muted); }
.dev.on .dstat { color: var(--ok); font-weight: 600; }
#go { font-size: 1.5rem; min-height: 64px; flex: 1 1 100%; }
.lost { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between; font-size: 1.2rem; }
#rouler .buttons button.sm { flex: 0 0 auto; min-height: 40px; font-size: .95rem; }
#rouler .buttons button.quiet { margin-left: auto; color: var(--muted); background: none; border-color: var(--border); }

/* Sortie en cours : plein écran, rien d'autre que la sortie */
body.riding .topbar, body.riding footer, body.riding .backlink, body.riding .install-pop { display: none; }
body.riding main { padding-top: .5rem; }

/* Notifications et installation */
.push-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.install-pop { position: fixed; left: .6rem; right: .6rem; bottom: .8rem; z-index: 40; max-width: 480px; margin: 0 auto; display: flex; gap: .75rem; align-items: flex-start; padding: .8rem .4rem .8rem .8rem; background: var(--surface); border: 1px solid var(--muted); border-radius: 6px; }
.install-pop img { flex: none; border-radius: 6px; }
.install-pop div { flex: 1; min-width: 0; }
.install-pop h2 { margin: 0; font-size: 1.3rem; }
.install-pop p { margin: .3rem 0 .5rem; }
.install-x { flex: none; width: 48px; padding: 0; border: 0; background: none; color: var(--muted); font-size: 1.6rem; }

@media (max-width: 520px) {
  .devs { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .dev { min-height: 9.5rem; padding: .75rem; }
  .dev .lbl { font-size: 1.1rem; }
  .dev .val { font-size: 2.6rem; }
  body { font-size: 17px; }
  .hero h1 { font-size: 2.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Sorties de groupe : liste dans « Rouler », salle d'attente, liste du groupe pendant la sortie */
#group-rides h3, #pick h3.sub { font: 700 1.2rem var(--display); margin: 1rem 0 .25rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#group-rides .wrow { cursor: default; }
#group-rides .wlist li > button.join { flex: 0 0 auto; display: block; width: auto; min-width: 9rem; min-height: 56px; padding: 0 1.25rem; font-size: 1.25rem; font-weight: 600; text-align: center; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 6px; }
.gr-when { color: var(--muted); margin: 0; }
.gr-count { font: 700 6rem/1.1 var(--display); font-variant-numeric: tabular-nums; margin: .25rem 0; }
#wait-riders li, #group-riders li { display: flex; align-items: center; gap: 1rem; min-height: 48px; padding: .25rem .5rem; border-bottom: 1px solid var(--border); }
#wait-riders .nm, #group-riders .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#wait-riders .ok { color: var(--ok); font-weight: 600; }
#group-riders { margin-top: .75rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); column-gap: 1rem; border-top: 0; }
#group-riders li { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
#group-riders b { font: 700 1.5rem var(--display); min-width: 4.5rem; text-align: right; }
#group-riders li > span:not(.nm) { min-width: 5.5rem; color: var(--muted); text-align: right; }
li.me { background: var(--surface); }
.dot { flex: none; width: 1rem; height: 1rem; border-radius: 50%; border: 2px solid var(--muted); background: var(--muted); display: inline-block; vertical-align: middle; margin-right: .4rem; }
li > .dot { margin: 0; }
.s-ok { background: var(--z3); border-color: var(--z3); } .s-high { background: var(--z5); border-color: var(--z5); }
.s-low { background: var(--z2); border-color: var(--z2); } .s-free { background: var(--surface); border-color: var(--muted); }
.s-off { background: none; }
.legend { margin: .5rem 0; color: var(--muted); }
.legend summary { cursor: pointer; text-decoration: underline; text-underline-offset: 3px; min-height: 44px; display: flex; align-items: center; }
.legend ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0 0 .5rem; padding: 0; list-style: none; }
@media (max-width: 700px) { .gr-count { font-size: 4rem; } #group-riders { grid-template-columns: 1fr; } #group-riders li { gap: .5rem; padding: .15rem .25rem; min-height: 40px; } #group-riders li > span:not(.nm) { min-width: 0; font-size: .95rem; } #group-rides .join { min-width: 7rem; } }

/* Sortie sur parcours : carte, profil d'altitude, classement. Mode « route » = pas de cible ni de blocs, vitesse à la place. */
#ride[data-mode="route"] .s-only, #ride:not([data-mode="route"]) .r-only { display: none; }
#ride[data-mode="route"] .tile b { font-size: min(34cqw, 12vh); }
#ride[data-mode="route"] .tile .unit { font-size: min(11cqw, 4vh); }
.badge { align-self: center; padding: .1rem .75rem; border-radius: 999px; background: var(--z3); color: var(--zi); font: 700 1.3rem var(--display); }
#routeview { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin: .5rem 0; }
#routeview svg { width: 100%; max-height: 38vh; background: var(--surface); border-radius: 6px; }
#map .track, #eprof .line { fill: none; stroke: var(--muted); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
#eprof .area { fill: var(--border); stroke: none; }
#routeview circle { fill: var(--accent); stroke: var(--text); stroke-width: 1.5; }
#routeview circle.me { fill: var(--cursor); stroke-width: 2.5; }
#routes .prof { width: 100%; height: 2rem; background: var(--surface); border-radius: 4px; }
#routes .prof path { fill: var(--border); stroke: var(--muted); stroke-width: 2; vector-effect: non-scaling-stroke; }
#ranking { margin: .75rem 0; padding: 0; counter-reset: rk; list-style: none; }
#ranking li { display: flex; align-items: center; gap: 1rem; min-height: 48px; padding: .25rem .5rem; border-bottom: 1px solid var(--border); font-size: 1.15rem; font-variant-numeric: tabular-nums; }
#ranking li::before { counter-increment: rk; content: counter(rk); min-width: 1.5rem; font: 700 1.5rem var(--display); color: var(--muted); }
#ranking .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#group-riders .gap { min-width: 7.5rem; }
@media (max-width: 700px), (orientation: portrait) { #routeview { grid-template-columns: 1fr; } #routeview svg { max-height: 30vh; } }

/* Vue 3D (static/world/view3d.js) : le canvas couvre l'écran, l'affichage de la sortie passe par-dessus (cases translucides) */
#view3d { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
body.v3d main { position: relative; z-index: 1; max-width: none; padding: .5rem; pointer-events: none; }
body.v3d main :is(button, input, summary, label, a) { pointer-events: auto; }
body.v3d #ride { position: relative; z-index: 1; display: grid; grid-template-rows: repeat(4, auto) 1fr repeat(5, auto); min-height: calc(100dvh - 1rem); }
body.v3d #ride > * { grid-column: 1; }
body.v3d #lost { grid-row: 1; } body.v3d .rhead { grid-row: 2; } body.v3d .big { grid-row: 3; } body.v3d .meters { grid-row: 4; }
body.v3d #routeview { grid-row: 6; } body.v3d #profile { grid-row: 7; } body.v3d #live-org { grid-row: 8; } body.v3d #ride > .buttons { grid-row: 9; }
body.v3d .rhead, body.v3d .meters, body.v3d #profile, body.v3d .live, body.v3d #status, body.v3d #routeview svg, body.v3d #group, body.v3d #ranking {
  background: color-mix(in srgb, var(--surface) 80%, transparent); border-radius: 6px; }
body.v3d .rhead, body.v3d .meters, body.v3d .big { justify-self: start; max-width: min(100%, 32rem); width: 100%; margin: 0 0 .4rem; }
body.v3d .rhead, body.v3d .meters { padding: .2rem .7rem; }
body.v3d .rhead h2 { font-size: 1.5rem; }
body.v3d .big { grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: .4rem; }
body.v3d .tile { padding: .2rem .7rem 0; background-color: color-mix(in srgb, var(--surface) 80%, transparent); }
body.v3d .tile .lbl { font-size: 1.05rem; }
body.v3d .tile b { font-size: min(30cqw, 9vh); }
body.v3d .tile .unit { font-size: min(10cqw, 3.5vh); }
body.v3d .meters b { font-size: 1.5rem; }
body.v3d #routeview { grid-template-columns: 10rem minmax(0, 1fr); max-width: 40rem; margin: 0 0 .4rem; }
body.v3d #routeview svg { max-height: 7rem; }
body.v3d #profile, body.v3d .live { max-width: 40rem; margin-bottom: .4rem; padding: .2rem; }
body.v3d #group, body.v3d #ranking { position: fixed; right: .5rem; width: 16rem; max-width: 45vw; max-height: 34vh; overflow: auto; padding: .3rem .6rem; margin: 0; font-size: .95rem; }
body.v3d #group { top: .5rem; }
body.v3d #ranking { bottom: 5.5rem; }
body.v3d #ride > .buttons { margin: 0; gap: .5rem; }
body.v3d #ride > .buttons button { min-height: 48px; font-size: 1.1rem; }
body.v3d #status { position: fixed; top: .5rem; left: 50%; transform: translateX(-50%); max-width: 40vw; padding: .2rem .8rem; margin: 0; z-index: 2; }
@media (max-width: 700px), (orientation: portrait) {
  body.v3d #routeview { grid-template-columns: 1fr; } body.v3d #routeview #map { display: none; }
  body.v3d #group { display: none; }
  body.v3d #status { position: static; transform: none; grid-row: 5; align-self: end; justify-self: center; max-width: 90vw; margin-bottom: .4rem; }   /* dans le flux : ne recouvre plus le profil */
}
body.v3d #profile:empty { display: none; }

/* Statistiques et journaux (super-administrateur, /admin/journal ; static/journal.js) */
main:has(.journal) { max-width: 72rem; }
.journal { --warn: #92400e; --warn-bg: #fffbeb; --radius: 10px; }
@media (prefers-color-scheme: dark) { .journal { --warn: #fbbf24; --warn-bg: #2a2110; } }
.journal .head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.journal .head h1 { margin-bottom: .25rem; }
.journal .head p { margin: 0; }
.journal nav { margin-left: 0; }
.journal nav.jump a { color: var(--text); min-height: 0; font-size: .9rem; padding: .3rem .7rem; border: 1px solid var(--border); border-radius: 99px; background: var(--surface); text-decoration: none; }
.journal nav.seg a { min-height: 0; border-bottom: 0; }
.journal nav.seg a.on { color: var(--text); }
.journal .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .5rem 1.1rem 1rem; margin: 0 0 1rem; min-width: 0; }
.journal .card.flush { padding: 0; overflow: hidden; }
.journal .card.empty { text-align: center; padding: 2.5rem 1rem; }
.journal .card h2 { font-size: 1.3rem; margin: .5rem 0; }
.journal .pad { padding: .5rem 1.1rem; margin: 0; }
.journal h2.pad { padding-bottom: .25rem; }
.journal .grid-2 { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.journal .grid-2 > .card { margin-bottom: 0; }
@media (max-width: 860px) { .journal .grid-2 { grid-template-columns: 1fr; } .journal .hide-sm { display: none; } }
.journal .table th, .journal .table td { padding: .5rem .7rem; vertical-align: top; white-space: normal; }
.journal .table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); white-space: nowrap; }
.journal .table .num { text-align: right; white-space: nowrap; }
.journal .table.compact td { padding: .35rem .2rem; }
.journal .table tbody tr:last-child td { border-bottom: 0; }
.journal tr.gone td { opacity: .55; }
.journal .nowrap { white-space: nowrap; }
.journal .strong { font-weight: 600; }
.journal .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .8rem; }
.journal .ok-text { color: var(--ok); }
.journal .err-text { color: var(--err); }
.journal .btn.sm { min-height: 40px; padding: .2rem .8rem; font-size: .95rem; }
.journal .btn.ghost { background: none; }
.journal .seg { display: inline-flex; gap: .2rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: .2rem; }
.journal .seg a { font-weight: 600; font-size: .95rem; color: var(--muted); padding: .35rem .8rem; border-radius: 7px; text-decoration: none; white-space: nowrap; }
.journal .seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .12); }
.jtabs { display: flex; flex-wrap: wrap; margin-bottom: 1rem; }
.journal .jfilters { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.journal .jfilters select, .journal .jfilters input { width: auto; max-width: none; margin: 0; min-height: 40px; }
.journal .jfilters input[type="search"] { flex: 1 1 180px; }
.journal .jfilters input[type="checkbox"] { min-height: 0; }
.journal .jfilters .check { display: inline-flex; align-items: center; margin: 0; font-weight: 400; }
.journal .stats-row { display: flex; gap: .6rem; flex-wrap: wrap; }
.journal .stat { flex: 1 1 140px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .8rem; min-width: 96px; }
.journal .stat b { display: block; font: 700 1.6rem/1.2 var(--display); }
.journal .stat span { color: var(--muted); font-size: .85rem; }
.journal .stat.accent { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.journal .stat.accent b { color: var(--accent); }
.journal .stat.warnbox { border-color: var(--warn); background: var(--warn-bg); }
.journal .stat.warnbox b { color: var(--warn); }
.journal .stat.errbox { border-color: var(--err); background: var(--err-bg); }
.journal .stat.errbox b { color: var(--err); }
.jkpi { margin-bottom: 1rem; }
.jgap { margin-top: 1rem; margin-bottom: 1rem; }
.jh3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: .9rem 0 .2rem; }
.journal ul.list { list-style: none; margin: 0; padding: 0; border: 0; }
.journal ul.list li { display: grid; padding: .35rem 0; border: 0; }
.jshares li { grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 3.2rem; gap: .6rem; align-items: center; }
.jshares li > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.journal .bar { height: 6px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; overflow: hidden; }
.journal .bar span { display: block; height: 100%; background: var(--accent); }
.jbar { margin-top: .3rem; max-width: 22rem; }
.jshares .jbar { margin-top: 0; }
.jlog td { font-size: .9rem; }
.jpath { max-width: 38rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jevent { min-width: 16rem; }
.jdetail { white-space: pre-line; color: var(--muted); font-size: .86rem; margin-top: .15rem; }
.jchips { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin: -.4rem 0 1rem; }
.journal .chip-team { font-size: .85rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: 99px; padding: .1rem .55rem; white-space: nowrap; }
.journal details.more summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
pre.trace { font-size: .75rem; line-height: 1.35; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; padding: .6rem .7rem; overflow-x: auto; max-height: 24rem; white-space: pre; margin: .4rem 0 0; }
.journal .code { display: inline-block; min-width: 2.6rem; text-align: center; font-size: .75rem; font-weight: 700; border-radius: 6px; padding: .05rem .35rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); }
.journal .code.c4xx { color: var(--warn); background: var(--warn-bg); border-color: currentColor; }
.journal .code.c5xx { color: var(--err); background: var(--err-bg); border-color: currentColor; }
.journal .cat { display: inline-block; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: .1rem .45rem; border-radius: 99px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.journal .cat-erreur { color: var(--err); background: var(--err-bg); border-color: currentColor; }
.journal .cat-connexion { color: var(--text); }
.journal tr.lvl-warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.journal tr.lvl-err td:first-child { box-shadow: inset 3px 0 0 var(--err); }
.jchart { position: relative; width: 100%; min-height: 220px; margin: .4rem 0 .2rem; }
.jchart.short { min-height: 170px; }
.jchart svg { display: block; overflow: visible; }
.jchart .grid { stroke: var(--border); stroke-width: 1; }
.jchart .axis { fill: var(--muted); font-size: 11px; }
.jchart .bar { fill: var(--accent); }
.jchart .bar.on { filter: brightness(.82); }
.jchart .hit { fill: transparent; cursor: default; }
.jtip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 4px 14px rgba(15, 23, 42, .14); padding: .4rem .6rem; font-size: .85rem; white-space: nowrap; z-index: 2; }
.jtip b { display: block; margin-bottom: .1rem; }
