:root {
  --bg: #f4f6f9; --panel: #ffffff; --ink: #111827; --muted: #5b6474; --line: #d5dae2;
  --accent: #0b5cad; --accent-ink: #fff; --ok: #138a36; --warn: #b45309; --bad: #c0262d;
  --i2c: #2563eb; --out: #7c3aed; --grid: #e6e9ee; --axis: #374151; --chip: #eef1f5;
  --plotbg: #ffffff; --shadow: 0 1px 3px rgba(0,0,0,.12);
  font-size: 16px;
}
:root[data-theme="dark"] {
  --bg: #0f1115; --panel: #181b21; --ink: #eef1f5; --muted: #9aa3b2; --line: #2c313a;
  --accent: #4c9bf0; --accent-ink: #06121f; --ok: #3ccf6a; --warn: #f0a33a; --bad: #ff6b6b;
  --i2c: #6aa2ff; --out: #b18cff; --grid: #252a33; --axis: #c7ccd6; --chip: #232833;
  --plotbg: #14171c; --shadow: none;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: system-ui, "Segoe UI", Roboto, sans-serif;
  display: flex; flex-direction: column; overflow: hidden; }
button, select, input { font: inherit; color: inherit; }
input, select { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
input[type=number] { width: 5em; }
kbd { border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; font-size: .85em; }

.top { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--panel);
  border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { font-weight: 800; font-size: 1.35rem; letter-spacing: -.02em; white-space: nowrap; }
.brand .logo { display: inline-grid; place-items: center; width: 1.6em; height: 1.6em; background: var(--accent);
  color: var(--accent-ink); border-radius: 8px; margin-right: 4px; }
.brand small { font-weight: 500; color: var(--muted); font-size: .7em; }
.pill { padding: 5px 12px; border-radius: 99px; font-weight: 600; font-size: .9rem; background: var(--chip); white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.pill.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.pill.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.pill button { margin-left: 8px; }
.acq { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 1; justify-content: center; }
.acq > span { display: contents; }
.fld { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.fld input, .fld select { color: var(--ink); }
.tools { display: flex; gap: 8px; }
a.btn { text-decoration: none; color: inherit; display: inline-block; }
.btn { background: var(--chip); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn.small { padding: 2px 8px; font-size: .85rem; }
.btn:disabled { opacity: .45; cursor: default; }
.go { background: var(--ok); color: #fff; border: 0; border-radius: 10px; padding: 9px 22px; font-size: 1.1rem;
  font-weight: 700; cursor: pointer; box-shadow: var(--shadow); min-width: 9.5em; }
.go.stop { background: var(--bad); }
.go.wait { background: var(--warn); }
.menu { position: relative; }
.menu-pop { display: none; position: absolute; right: 0; top: 110%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); z-index: 20; min-width: 300px; padding: 6px; }
.menu-pop.open { display: block; }
.menu-pop button { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; }
.menu-pop button:hover { background: var(--chip); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

#progress { height: 4px; background: transparent; }
#progress div { height: 100%; width: 0; background: var(--ok); transition: width .2s; }

main { flex: 1; display: flex; min-height: 0; }
#side { width: 310px; flex: none; overflow-y: auto; padding: 10px; border-right: 1px solid var(--line); }
#center { flex: 1; display: flex; flex-direction: column; min-width: 0; padding: 8px 12px 0; }

.group h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 2px 5px;
  display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; padding: 3px 4px; border-radius: 6px; }
.group h3:hover { background: var(--chip); }
.group h3 .fa { width: .9em; flex: none; }
.group h3 .gt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group h3 .cnt { flex: none; font-variant-numeric: tabular-nums; letter-spacing: 0; padding: 0 7px; border-radius: 99px; border: 1px solid var(--line); }
.group h3 .cnt:hover { border-color: var(--accent); color: var(--accent); }
.group h3 .btn.small { padding: 1px 6px; text-transform: none; }
.group .idle { font-size: .82rem; color: var(--muted); padding: 2px 8px 6px 22px; }
.ch { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 8px; background: var(--panel);
  border: 1px solid var(--line); border-left: 5px solid var(--c, var(--line)); border-radius: 10px; padding: 7px 10px; margin-bottom: 6px; cursor: pointer; }
.ch:hover { border-color: var(--accent); border-left-color: var(--c); }
.ch.off { opacity: .5; }
.ch.absent { opacity: .45; border-style: dashed; }
.ch input { width: 1.15em; height: 1.15em; margin: 0; }
.ch .nm { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch .sub { grid-column: 2 / 4; font-size: .78rem; color: var(--muted); }
.ch .val { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.15rem; text-align: right; white-space: nowrap; }
.ch .val small { font-weight: 500; color: var(--muted); font-size: .8rem; margin-left: 3px; }
.ch .tag { font-size: .7rem; padding: 1px 6px; border-radius: 99px; background: var(--chip); color: var(--muted); }
.ch .tag.new { background: var(--ok); color: #fff; }

.graphbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-bottom: 6px; }
.grow { flex: 1; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: var(--panel); border: 0; padding: 6px 12px; cursor: pointer; }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
#seriesChips { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 6px; min-height: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; background: var(--chip);
  border: 2px solid transparent; cursor: pointer; font-size: .88rem; user-select: none; }
.chip i { width: 14px; height: 4px; border-radius: 2px; background: var(--c); }
.chip.off { opacity: .45; text-decoration: line-through; }
.chip.model { border-style: dashed; border-color: var(--c); }
#plotWrap { flex: 1; position: relative; min-height: 220px; background: var(--plotbg); border: 1px solid var(--line); border-radius: 10px; }
#plot { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
#plotOv { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#tip { position: absolute; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 9px; font-size: .85rem; box-shadow: 0 4px 14px rgba(0,0,0,.15); display: none; white-space: nowrap; z-index: 5;
  font-variant-numeric: tabular-nums; }
#tip i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
#waitMsg { position: absolute; inset: 0; display: none; place-items: center; font-size: 1.6rem; font-weight: 700; color: var(--warn);
  pointer-events: none; text-align: center; }
#measure { min-height: 0; font-variant-numeric: tabular-nums; padding: 4px 2px; display: flex; gap: 18px; flex-wrap: wrap; font-size: .95rem; }
#measure:empty { display: none; }
#measure b { color: var(--accent); }

#bottom { display: flex; flex-direction: column; height: 280px; flex: none; margin-top: 8px; border-top: 1px solid var(--line); }
#bottom.min { height: 42px; }
.tabs { display: flex; gap: 2px; padding-top: 4px; overflow-x: auto; scrollbar-width: thin; }
.tabs button { flex: none; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; padding: 6px 12px; cursor: pointer; color: var(--muted); font-weight: 600; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tab { display: none; flex: 1; overflow: auto; padding: 8px 2px; }
.tab.on { display: block; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: .88rem; }
#tableWrap { overflow: auto; max-height: calc(100% - 84px); border: 1px solid var(--line); border-radius: 8px; }
table { border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: .9rem; width: max-content; min-width: 100%; }
th, td { padding: 3px 10px; border-bottom: 1px solid var(--line); text-align: right; }
th { position: sticky; top: 0; background: var(--panel); border-bottom: 2px solid var(--c, var(--line)); }
th .x { cursor: pointer; color: var(--bad); margin-left: 4px; }
#mResult table { margin-top: 6px; width: auto; min-width: 0; }
#mResult td:first-child { text-align: left; font-weight: 600; }
.outgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 10px; }
fieldset { border: 1px solid var(--line); border-radius: 10px; margin: 0; }
legend { font-weight: 700; padding: 0 6px; }
.icons .btn, .notes .btn { min-width: 2.6em; font-size: 1.1rem; }
.boardgrid { display: grid; grid-template-columns: minmax(300px, 1.5fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.boardgrid h4 { margin: 4px 0 6px; }
body.esp32 .boardgrid, body.jeulin .boardgrid { grid-template-columns: 1fr; }
.devcard { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 14px; background: var(--panel); min-width: 0; }
.devcard h4 { margin-top: 14px; }
.devtitle { margin: 0 0 10px; font-size: 1.02rem; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.devtitle .ico { font-size: 1.1rem; }
.devtitle small { font-weight: 500; color: var(--muted); font-size: .82rem; }
.wlcard { border-color: color-mix(in srgb, var(--i2c) 45%, var(--line)); }
#rboard { display: grid; grid-template-columns: repeat(5, minmax(56px, 76px)); gap: 4px; }
.wlstat { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 10px 12px; border-radius: 10px;
  background: var(--chip); border: 1px solid var(--line); margin-bottom: 8px; }
.wlstat .dot { grid-row: 1 / 3; font-size: 1.6rem; line-height: 1; }
.wlstat b { font-size: 1rem; }
.wlstat .meta { color: var(--muted); font-size: .85rem; display: flex; gap: 14px; flex-wrap: wrap; }
.wlstat.ok { background: color-mix(in srgb, var(--ok) 10%, var(--panel)); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.wlstat.ok .dot, .wlstat.ok b { color: var(--ok); }
.wlstat.warn { background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.wlstat.warn .dot, .wlstat.warn b { color: var(--warn); }
.bars { display: inline-flex; gap: 2px; align-items: flex-end; height: .9em; vertical-align: -1px; margin-right: 4px; }
.bars i { width: 4px; background: var(--line); border-radius: 1px; }
.bars i:nth-child(1) { height: 30%; } .bars i:nth-child(2) { height: 55%; } .bars i:nth-child(3) { height: 80%; } .bars i:nth-child(4) { height: 100%; }
.bars i.on { background: currentColor; }
#rdHow { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
#rdHow summary { cursor: pointer; }
#rdHow ol { margin: 6px 0; padding-left: 20px; font-size: .9rem; }
.group.wl { margin-top: 14px; padding-top: 2px; border-top: 1px dashed var(--line); }
.wlpill { text-transform: none; letter-spacing: 0; font-size: .75rem; font-weight: 600; padding: 1px 8px; border-radius: 99px; background: var(--chip); }
.wlpill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.wlpill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.boardgrid .chk, .boardgrid .fld { margin: 3px 12px 3px 0; }
#board { display: grid; grid-template-columns: repeat(11, minmax(40px, 1fr)); gap: 4px; }
.pin { border: 2px solid var(--line); border-radius: 8px; padding: 4px 2px; text-align: center; font-size: .78rem; cursor: pointer; background: var(--panel); line-height: 1.15; }
.pin b { display: block; font-size: .95rem; }
.pin.st-on, .legend .st-on { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--panel)); }
.pin.st-i2c, .legend .st-i2c { border-color: var(--i2c); background: color-mix(in srgb, var(--i2c) 12%, var(--panel)); cursor: default; }
.pin.st-res, .legend .st-res { border-color: var(--line); background: var(--chip); color: var(--muted); cursor: default; }
.pin.st-out, .legend .st-out { border-color: var(--out); background: color-mix(in srgb, var(--out) 14%, var(--panel)); }
.pin.pwr { border-color: var(--bad); color: var(--bad); cursor: default; }
.legend { margin-top: 8px; font-size: .82rem; color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.legend i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 2px solid var(--line); margin-right: -6px; }
.legend .st-free { background: var(--panel); }
.warn { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: color-mix(in srgb, var(--warn) 14%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--warn) 50%, transparent); font-size: .9rem; }
.help { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; font-size: .92rem; }
.help h4 { margin: 4px 0; }
.help p, .help ol { margin: 4px 0 10px; }

dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--ink); padding: 0;
  width: min(760px, 94vw); max-height: 90vh; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(0,0,0,.4); }
dialog form { padding: 16px 20px; }
dialog h2 { margin: 0 0 4px; font-size: 1.3rem; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin: 10px 0; }
.gal button { border: 2px solid var(--line); border-radius: 10px; background: var(--panel); padding: 8px 4px; cursor: pointer; font-size: .82rem; }
.gal button span { display: block; font-size: 1.6rem; }
.gal button.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--panel)); }
.params { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 8px 0; }
.params .fld { color: var(--ink); }
.dlg-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.live { font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }

#toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column;
  align-items: center; gap: 6px; max-width: 90vw; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-weight: 600; opacity: .95; pointer-events: auto;
  cursor: pointer; display: flex; align-items: center; gap: 12px; animation: toastIn .18s ease-out; box-shadow: 0 6px 18px rgba(0,0,0,.2); }
.toast.err { background: var(--bad); color: #fff; }
.toast button { background: none; border: 1px solid currentColor; color: inherit; border-radius: 6px; padding: 2px 10px; font-weight: 700; cursor: pointer; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
dialog.ask { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); padding: 16px 18px; max-width: min(460px, 92vw); }
dialog.ask::backdrop { background: rgba(0,0,0,.35); }
dialog.ask p { margin: 0 0 14px; font-size: 1rem; line-height: 1.4; }
.btn.danger.strong { background: var(--bad); color: #fff; border-color: var(--bad); }

/* grands afficheurs du mode projection : hauteur réglable (--bigH), le chiffre suit la hauteur et la largeur */
#bigvals { display: none; gap: 12px; padding: 4px 0 4px; height: var(--bigH, 150px); flex-shrink: 0; }
.big { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line);
  border-top: 6px solid var(--c); border-radius: 12px; padding: 6px 16px; container-type: size; overflow: hidden; }
.big .bhead { display: flex; align-items: center; gap: 10px; min-height: 1.6em; }
.big .n { color: var(--muted); font-weight: 600; font-size: clamp(1rem, 9cqh, 2.4rem); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.big .stab { font-weight: 700; font-size: clamp(.85rem, 6cqh, 1.6rem); white-space: nowrap; }
.big .stab.ok { color: var(--ok); }
.big .stab.move { color: #e67e22; }
.big .stab.held { color: var(--accent); }
/* réglages en superposition (visibles au survol) : invisibles, ils ne doivent pas tronquer le nom de la voie */
.big { position: relative; }
.big .bctl { position: absolute; top: 8px; right: 10px; display: flex; gap: 4px; opacity: 0; transition: opacity .2s; pointer-events: none;
  background: var(--panel); padding: 3px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.big:hover .bctl, .big.held .bctl { opacity: 1; pointer-events: auto; }
.big .bctl button { font: inherit; font-size: .85rem; padding: 2px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); cursor: pointer; }
.big .v { flex: 1; display: flex; align-items: center; min-height: 0; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1;
  font-size: min(48cqh, 15cqw); white-space: nowrap; }
.big .v small { font-size: .38em; color: var(--muted); font-weight: 600; margin-left: .25em; }
.big .bfoot { display: flex; align-items: center; gap: 10px; height: 18cqh; min-height: 18px; }
.big .spark { flex: 1; height: 100%; min-width: 0; }
.big .mm { color: var(--muted); font-size: clamp(.8rem, 6cqh, 1.4rem); white-space: nowrap; font-variant-numeric: tabular-nums; }
.big.held { background: repeating-linear-gradient(135deg, var(--panel) 0 14px, color-mix(in srgb, var(--accent) 7%, var(--panel)) 14px 28px); }
#bigResize { display: none; height: 9px; margin: 0 0 4px; cursor: ns-resize; border-radius: 4px; flex-shrink: 0;
  background: linear-gradient(var(--line), var(--line)) center / 48px 3px no-repeat; }
#bigResize:hover, #bigResize.drag { background-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* mode projection */
body.proj { font-size: 18px; }
body.proj #side, body.proj #bottom, body.proj .graphbar .fld, body.proj #runSel, body.proj .chk { display: none; }
body.proj #bigvals, body.proj #bigResize { display: flex; }
body.proj #plotWrap { min-height: 120px; }
body.proj .acq .m-step .fld, body.proj .acq .m-burst .fld { display: inline-flex; }

/* visibilité des champs selon le mode */
body:not(.mode-time) .m-time > *, body:not(.mode-step) .m-step > *, body:not(.mode-burst) .m-burst > * { display: none !important; }
.m-usr { display: none; }
.m-usr.show { display: inline-flex; }

@media (max-width: 900px) {
  body { overflow: auto; }
  main { flex-direction: column; }
  #side { width: auto; border-right: 0; max-height: 40vh; }
  #plotWrap { min-height: 300px; }
  #bottom { height: auto; min-height: 340px; }
  #bottomToggle { display: none; }
  .boardgrid, .help { grid-template-columns: 1fr; }
  #board { grid-template-columns: repeat(6, 1fr); }
  .top { padding: 8px 16px; }
}

/* spectre */
.specres { border-left: 5px solid var(--c, var(--line)); background: var(--panel); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; color: var(--ink); font-size: .92rem; }
.specres table { margin-top: 6px; width: auto; min-width: 0; }
.specres .big1 { font-size: 1.25rem; font-weight: 800; color: var(--accent); }
.warnx { color: var(--warn); font-weight: 600; }

/* incertitudes */
.modelgrid { display: grid; grid-template-columns: minmax(300px, 1fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.statsgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 12px; }
.minicv { width: 100%; height: 170px; display: block; background: var(--plotbg); border: 1px solid var(--line); border-radius: 8px; margin-top: 6px; }
.minicv[hidden] { display: none; }
.mctab { width: 100%; min-width: 0; }
.mctab input, .mctab select { width: 100%; }
.mctab td { padding: 2px 4px; }
.pmv { font-weight: 700; font-variant-numeric: tabular-nums; }
.verdict { display: inline-block; padding: 1px 8px; border-radius: 99px; font-weight: 700; }
.verdict.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.verdict.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }
.verdict.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
@media (max-width: 900px) { .modelgrid { grid-template-columns: 1fr; } }
.big1r { font-size: 1.15rem; margin: 6px 0; }
.mctab { table-layout: fixed; }
.mctab th:nth-child(1) { width: 22%; } .mctab th:nth-child(4) { width: 24%; } .mctab th:nth-child(5) { width: 42px; }
.mctab input, .mctab select { min-width: 0; padding: 3px 4px; }
.statsgrid { grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); }
.statsgrid fieldset { min-width: 0; }
fieldset.wide { grid-column: 1 / -1; }
.sy-mp { display: none; } .sy-mp.show { display: inline-flex; }
#syRuns table { width: auto; min-width: 0; }
#syRuns input { width: 6em; }
#mSliders .slider { display: grid; grid-template-columns: 3em 1fr 7em; gap: 8px; align-items: center; margin: 4px 0; }
#mSliders input[type=range] { width: 100%; }

/* ---- lot 4 : en-tête compact, panneaux ajustables ---- */
.top { gap: 10px; padding: 6px 12px; }
.acq { gap: 8px; }
.acq input[type=number] { width: 4.6em; }
.acq #stepName, .acq #stepUnit { width: 4em; }
.go { min-width: 7.5em; padding: 7px 16px; font-size: 1.05rem; }
.brand small { display: none; }
#runSel { max-width: 15em; }
.graphbar { gap: 8px; }
@media (min-width: 1360px) { .acq { flex-wrap: nowrap; } }
@media (max-width: 1900px) { .top .lbl, .graphbar .lbl { display: none; } }
body.noside #side { display: none; }
#bottomResize { height: 7px; margin: -4px 0 0; cursor: ns-resize; border-radius: 4px; }
#bottomResize:hover, #bottomResize.drag { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.ch[draggable=true] { cursor: grab; }
#plotWrap.dropping { outline: 3px dashed var(--accent); outline-offset: -6px; }
/* projection : contraste renforcé */
body.proj { --grid: #cfd4dc; --axis: #0b0f16; }
:root[data-theme="dark"] body.proj { --grid: #3a404b; --axis: #ffffff; }
/* visite guidée */
#tourMask { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
#tourHole { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(10, 14, 22, .55); transition: all .25s; z-index: 61; pointer-events: none; }
#tourBox { position: fixed; z-index: 62; background: var(--panel); color: var(--ink); border-radius: 12px; padding: 14px 16px; width: min(360px, 90vw);
  box-shadow: 0 12px 40px rgba(0,0,0,.35); border: 1px solid var(--line); }
#tourBox p { margin: 6px 0 10px; }
#tourBox .row { justify-content: flex-end; margin: 0; }
#bottom.min { height: 42px !important; }
/* une ligne si tout tient ; sinon les réglages passent à la ligne (jamais de chevauchement avec les boutons de droite) */
@media (min-width: 1360px) { .top { flex-wrap: wrap; } .acq { min-width: max-content; flex: 1 1 auto; } .tools { flex: none; } }
#recPill { max-width: 15em; overflow: hidden; text-overflow: ellipsis; }
.acq select { max-width: 11em; }
.acq .fld { font-size: .88rem; }
.go { flex: none; white-space: nowrap; }
.acq > * { flex: none; }
.acq #mode { max-width: 9em; }
.pill.rec { border: 0; cursor: pointer; background: color-mix(in srgb, var(--bad) 16%, transparent); color: var(--bad); animation: recblink 1.6s infinite; }
@keyframes recblink { 50% { opacity: .55; } }
#notify { position: fixed; right: 16px; bottom: 16px; z-index: 55; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, 92vw); }
#notify .nt { background: var(--panel); border: 1px solid var(--line); border-left: 5px solid var(--accent); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 26px rgba(0,0,0,.2); }
#notify .nt .row { margin: 6px 0 0; justify-content: flex-end; }
.loglist td, .loglist th { text-align: left; }

/* incertitudes v2 */
.useg { margin-bottom: 8px; flex-wrap: wrap; }
.upanel { display: none; }
.upanel.on { display: block; }
.ugrid { display: grid; grid-template-columns: minmax(300px, 1.1fr) minmax(260px, 1fr); gap: 12px; align-items: start; }
.ugrid .minicv { margin-top: 0; }
.ugrid + .ugrid { margin-top: 6px; }
.fld.col { flex-direction: column; align-items: stretch; }
.fld.col textarea { width: 100%; font: .9rem ui-monospace, monospace; background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 6px; padding: 6px; }
.uhelp { margin-top: 10px; background: var(--chip); border-radius: 8px; padding: 6px 12px; font-size: .9rem; }
.uhelp summary { cursor: pointer; font-weight: 700; }
.uhelp p { margin: 6px 0; }
.budtab { width: 100%; min-width: 0; table-layout: fixed; }
.budtab th:nth-child(1) { width: 24%; } .budtab th:nth-child(2) { width: 6%; } .budtab th:nth-child(3) { width: 22%; }
.budtab th:nth-child(10) { width: 34px; }
.budtab input, .budtab select { width: 100%; min-width: 0; padding: 2px 4px; }
.budtab td { padding: 2px 4px; }
.warnbox { border-left: 4px solid var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); padding: 4px 10px; border-radius: 6px; margin: 6px 0; }
.okbox { border-left: 4px solid var(--ok); background: color-mix(in srgb, var(--ok) 9%, var(--panel)); padding: 4px 10px; border-radius: 6px; margin: 6px 0; }
@media (max-width: 900px) { .ugrid { grid-template-columns: 1fr; } }
.uwiz { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; padding: 6px 10px; border-radius: 8px; background: color-mix(in srgb, var(--accent) 8%, var(--panel)); }
.uwiz b { margin-right: 6px; }
.badbox { border-left: 4px solid var(--bad); background: color-mix(in srgb, var(--bad) 8%, var(--panel)); padding: 4px 10px; border-radius: 6px; margin: 6px 0; }
.final { font-size: 1.2rem; margin: 8px 0; }
.final .pmv { color: var(--accent); }
.hintbox { border-left: 4px solid var(--accent); background: color-mix(in srgb, var(--accent) 7%, var(--panel)); padding: 4px 10px; border-radius: 6px; margin: 6px 0; font-size: .92rem; }
[hidden] { display: none !important; }

/* cartes : éléments propres au micro:bit / à l'ESP32, sélecteur de carte */
body.esp32 .mb-only { display: none !important; }
body:not(.esp32) .esp-only { display: none !important; }
body.jeulin .mb-only, body.jeulin .board-only { display: none !important; }   /* appareil Jeulin : ni broches, ni sorties, ni rafale */
#boardSel button { padding: 4px 10px; }
#tableWrap tr.excl td:not(.rn) { color: var(--muted); text-decoration: line-through; }
/* tableur : n° de ligne (sélection, actions au survol), lignes sélectionnées, cellules corrigées */
.sheet th.rn, .sheet td.rn { position: sticky; left: 0; z-index: 1; background: var(--panel); text-align: center; width: 4.2em; min-width: 4.2em;
  color: var(--muted); border-right: 1px solid var(--line); cursor: pointer; user-select: none; padding: 3px 4px; }
.sheet th.rn { z-index: 2; }
.sheet td.rn .ra { display: none; gap: 6px; justify-content: center; }
.sheet td.rn .ra b { cursor: pointer; font-weight: 700; padding: 0 2px; border-radius: 4px; }
.sheet td.rn .ra b[data-rd] { color: var(--bad); }
.sheet td.rn .ra b:hover { background: var(--chip); }
.sheet tr:hover td.rn .no { display: none; }
.sheet tr:hover td.rn .ra { display: inline-flex; }
.sheet tbody tr:hover td { background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.sheet tr.sel td, .sheet tr.sel td.rn { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.sheet tr.sel td.rn { color: var(--accent); font-weight: 700; }
.sheet td[data-c] { cursor: cell; }
.sheet td.ed { position: relative; }
.sheet td.ed::before { content: ""; position: absolute; left: 4px; top: 50%; width: 6px; height: 6px; margin-top: -3px; border-radius: 50%; background: var(--warn); }
.sheet input.cell { width: 7em; text-align: right; padding: 1px 4px; font: inherit; border-color: var(--accent); }
.tsbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; margin-bottom: 6px; border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); }
#wlTop { cursor: pointer; }
.rmods { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.rmod { display: inline-block; align-self: flex-start; padding: 4px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--chip); }
.rmod.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
/* infobulle unique (ux.js) et pictogrammes ⓘ */
#tipbox { position: fixed; z-index: 1000; max-width: min(360px, 90vw); padding: 7px 11px; border-radius: 8px; pointer-events: none;
  background: var(--ink); color: var(--bg); font-size: .9rem; line-height: 1.35; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
#tipbox kbd { background: var(--bg); color: var(--ink); border-color: transparent; margin-left: 4px; }
body.proj #tipbox { font-size: 1.15rem; max-width: min(520px, 90vw); }
.tip { display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; border-radius: 50%; cursor: help; vertical-align: 1px;
  color: var(--accent); font-size: .95em; font-weight: 700; user-select: none; }
.tip:hover, .tip:focus-visible { background: color-mix(in srgb, var(--accent) 14%, transparent); outline: none; }
.tshelp { margin: 6px 2px 0; font-size: .82rem; color: var(--muted); }
kbd.kp { font-size: .7em; margin-left: 6px; padding: 0 4px; opacity: .7; }
dialog.keys { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); padding: 14px 18px; min-width: 300px; }
dialog.keys::backdrop { background: rgba(0,0,0,.35); }
dialog.keys h3 { margin: 0 0 8px; }
dialog.keys table { width: 100%; margin-bottom: 10px; }
dialog.keys td { border: 0; padding: 4px 6px; text-align: left; }
dialog.keys td:first-child { white-space: nowrap; color: var(--muted); }
.empty { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px;
  color: var(--muted); font-size: .92rem; }
.empty .eico { font-size: 1.3rem; opacity: .8; }
details.adv { margin: 8px 0; }
details.adv > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 3px 0; }
details.adv[open] > summary { margin-bottom: 4px; }
