/* Hélios — thèmes clair et sombre */
:root, [data-theme="light"] {
  color-scheme: light;
  --bg: #F4F5F2; --panel: #FFFFFF; --soft: #EEF0EC; --ink: #1B2226; --muted: #5B676E;
  --line: #E2E5E0; --line2: #D2D7D1; --dose: #C4520E; --dose-2: #9A3F09; --dose-bg: #FBE7D6;
  --geo: #A9532A; --geo-bg: #F6E3D8; --warn: #8A5A00; --warn-bg: #FFF4DC; --danger: #A82E2E;
  --dot: #D6DAD4; --field: #FFFFFF; --shadow: rgba(20,30,35,.14); --on-ink: #FFFFFF; --pill: #1B2226;
  --axis-x: #D2453A; --axis-y: #2E9E4F; --axis-z: #2F6FD6;
  --logo: #BD5D29; --logo-tip: #E49462;
  --val: var(--dose); --folder: var(--dose); --folder-bg: var(--dose-bg);
  --src3d: #D49574; --amb3d: 0.85;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0E1316; --panel: #151D22; --soft: #1C262C; --ink: #E6ECEA; --muted: #93A1A8;
  --line: #1F2A31; --line2: #2A3740; --dose: #EDE3D1; --dose-2: #FFFFFF; --dose-bg: #2B2A26;
  --geo: #4FD1C5; --geo-bg: #13262A; --warn: #F0C36A; --warn-bg: #2D2517; --danger: #F07A7A;
  --dot: #26313A; --field: #0E1316; --shadow: rgba(0,0,0,.45); --on-ink: #0E1316; --pill: #E6ECEA;
  --axis-x: #F06A5A; --axis-y: #5BD17A; --axis-z: #6AA6F0;
  --logo: #EDE3D1; --logo-tip: #FBF6EE;
  --val: var(--geo); --folder: var(--geo); --folder-bg: var(--geo-bg);
  --src3d: #4FD1C5; --amb3d: 0.6;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.45 "IBM Plex Sans", system-ui, "Segoe UI", sans-serif; display: flex; flex-direction: column; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
.mono, input[inputmode=decimal] { font-family: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; }
[hidden] { display: none !important; }

/* ---------- barre supérieure ---------- */
.top { height: 60px; flex-shrink: 0; display: flex; align-items: center; gap: 18px; padding: 0 18px; background: var(--panel); border-bottom: 1px solid var(--line); position: relative; z-index: 40; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.menu-wrap { position: relative; }
.ver { border: 0; background: none; font: 11px "IBM Plex Mono", monospace; color: var(--muted); cursor: pointer; padding: 4px 6px; border-radius: 4px; }
.ver:hover { background: var(--soft); color: var(--ink); }
.menu { position: absolute; top: 30px; left: 0; min-width: 240px; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; box-shadow: 0 8px 24px var(--shadow); display: flex; flex-direction: column; }
.menu button, .menu a { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 400; color: var(--ink); text-decoration: none; letter-spacing: 0; }
.menu button:hover, .menu a:hover { background: var(--soft); }
nav { display: flex; gap: 2px; }
.tab { border: 0; background: none; padding: 8px 12px; border-radius: 6px; color: var(--muted); cursor: pointer; font-size: 14px; }
.tab.on, .tab:hover { background: var(--soft); color: var(--ink); }
.icon-btn { width: 38px; height: 38px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover { border-color: var(--muted); }
[data-theme="light"] #ico-sun, [data-theme="dark"] #ico-moon, [data-theme="light"] .ico-sun, [data-theme="dark"] .ico-moon { display: none; }
button.primary { height: 38px; padding: 0 16px; border-radius: 8px; border: 0; background: var(--dose); color: var(--on-ink); font-weight: 600; cursor: pointer; }
button.primary:disabled { opacity: .45; cursor: default; }
button.ghost { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; }
button.ghost:hover { border-color: var(--muted); }
button.ghost:disabled { opacity: .45; cursor: default; }
button.danger, .danger { color: var(--danger); }

/* ---------- vues ---------- */
.view { display: none; flex: 1; min-height: 0; }
#view-calc.on { display: flex; flex-direction: column; }
#view-lib.on { display: flex; }

/* ---------- scène ---------- */
.scene { position: relative; flex: 1; min-height: 0; overflow: hidden; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1px, transparent 1px); background-size: 24px 24px; cursor: grab; }
.scene.panning { cursor: grabbing; }
.scene canvas, .scene > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene canvas { pointer-events: none; }
#svg text { font-family: "IBM Plex Mono", monospace; font-size: 12px; }
.hit { cursor: inherit; }
.drag { cursor: move; }
.zoombar { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: center; gap: 4px; }
.zoombar button { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; font-size: 17px; line-height: 1; }
.zoombar button:hover { border-color: var(--muted); }
.scalebar { margin-left: 10px; display: flex; align-items: center; gap: 8px; font: 12px "IBM Plex Mono", monospace; color: var(--muted); }
.scalebar i { display: block; height: 6px; border: 1px solid var(--muted); border-top: 0; }
.scene-hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); font-size: 12px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; pointer-events: none; transition: opacity .6s; }

/* tiroir radionucléides */
.drawer { position: fixed; right: 0; top: 60px; bottom: 0; width: 420px; z-index: 30; background: var(--panel); border-left: 1px solid var(--line2); box-shadow: -8px 0 24px var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; }
.nuc-list { display: flex; flex-wrap: wrap; gap: 4px; }
.nuc-list button { padding: 4px 10px; border: 1px solid var(--line2); background: var(--panel); border-radius: 14px; cursor: pointer; font-size: 12px; }
.nuc-list button.on { background: var(--geo); color: var(--on-ink); border-color: var(--geo); }
.nuc-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.nuc-head h2 { margin: 0; font-size: 24px; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 12px; background: var(--soft); font-size: 12px; }

/* enregistrement */
.savebox { position: fixed; right: 18px; top: 66px; z-index: 60; width: 340px; padding: 16px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; box-shadow: 0 10px 30px var(--shadow); display: flex; flex-direction: column; gap: 10px; }
.savebox h3 { margin: 0; font-size: 15px; display: flex; justify-content: space-between; }
.savebox textarea { height: 60px; padding: 6px 9px; resize: vertical; }

/* ---------- bibliothèque ---------- */
.folders { width: 250px; flex-shrink: 0; padding: 18px 14px; background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; overflow: auto; }
.side-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 0 8px 8px; }
.folder { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 6px; border: 0; background: none; cursor: pointer; text-align: left; }
.folder.on, .folder:hover { background: var(--soft); }
.folder span:last-child { font: 12px "IBM Plex Mono", monospace; color: var(--muted); }
.lib { flex: 1; min-width: 0; overflow: auto; padding: 22px 28px; display: flex; flex-direction: column; gap: 16px; }
.lib-head { display: flex; align-items: center; gap: 12px; }
.lib-head h1 { margin: 0; font-size: 22px; font-weight: 600; }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--field); color: var(--muted); }
.lib-head .search { margin-left: auto; width: 320px; }
.search input { flex: 1; border: 0; outline: none; background: transparent; color: var(--ink); min-width: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tagf { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line2); background: var(--panel); cursor: pointer; font-size: 13px; }
.tagf.on { background: var(--geo); border-color: var(--geo); color: var(--on-ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 9px; padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); }
.card.picked { border-color: var(--dose); box-shadow: 0 0 0 1px var(--dose); }
.card .thumb { height: 116px; border-radius: 8px; background: var(--bg); border: 0; padding: 0; cursor: pointer; }
.card .thumb svg { width: 100%; height: 100%; }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .dose { font: 600 15px "IBM Plex Mono", monospace; color: var(--val); white-space: nowrap; }
.card .meta { font-size: 12px; color: var(--muted); }
.card .foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.card .foot .sp { flex: 1; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; border: 1px solid var(--line2); color: var(--folder); }
.compare { padding: 16px; border-radius: 12px; background: var(--panel); border: 1px solid var(--dose); }
.compare h2 { margin: 0 0 10px; font-size: 15px; display: flex; justify-content: space-between; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line2); border-radius: 12px; }

/* pages annexes */
.card-plain { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.ok { color: var(--geo); } .mid { color: var(--warn); } .ko { color: var(--danger); }
.muted { color: var(--muted); } .small { font-size: 12px; }

/* ================= v0.4 ================= */
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.nav-sep { width: 1px; height: 18px; background: var(--line2); margin: 0 8px; align-self: center; }
.tab-quiet { font-size: 13px; padding: 6px 8px; }
#view-glossary.on { display: flex; }

/* sous-onglets */
.subtabs { flex-shrink: 0; height: 48px; display: flex; align-items: flex-end; gap: 4px; padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
.subtab { height: 48px; padding: 0 18px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px; white-space: nowrap; flex-shrink: 0; border-bottom: 2px solid transparent; }
.subtab:hover { color: var(--ink); }
.subtab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--dose); }
.subtab .knob { fill: var(--panel); }
.subtab-right { margin-left: auto; align-self: center; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.subtab-right strong { font: 600 16px "IBM Plex Mono", monospace; color: var(--val); }
.page { display: none; flex: 1; min-height: 0; }
#page-config.on { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; padding: 20px; overflow: auto; align-items: start; }
#page-carto.on { display: flex; }

/* cartes de configuration */
.config-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cfg { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; transition: box-shadow .4s, border-color .4s; }
.cfg.flash { border-color: var(--dose); box-shadow: 0 0 0 3px var(--dose-bg); }
.card-head { display: flex; align-items: baseline; gap: 10px; }
.cfg h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-head span, #options-sum { font-size: 12px; color: var(--muted); }
#options-sum { font-size: 13px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1250px) { .two-col { grid-template-columns: minmax(0, 1fr); } }
.cfg-options { padding: 12px 20px; }
.options-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
button.ghost.small { height: 32px; font-size: 13px; margin-left: auto; }
.row-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.row-fields .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 10px; }
.row-fields label, .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.row-fields input, .row-fields select, .shield-row input, .shield-row select, .nuc-row input, .nuc-row select, .field input, .field select, .field textarea, .savebox input, .savebox textarea, .zone-thr input {
  height: 34px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); min-width: 0; }
.row-fields input[inputmode=decimal] { width: 110px; }
.row-fields .check, .check { flex-direction: row; align-items: center; gap: 8px; height: 34px; font-size: 13px; color: var(--ink); }
.check input { height: auto; accent-color: var(--geo); }
.field-label { font-size: 12px; color: var(--muted); margin-bottom: -6px; }

/* pictogrammes de géométrie */
.geo-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.geo-tile { height: 74px; border-radius: 10px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
.geo-tile svg { color: var(--muted); }
.geo-tile svg .f { fill: var(--soft); }
.geo-tile:hover { border-color: var(--muted); }
.geo-tile.on { border: 1.5px solid var(--geo); background: var(--geo-bg); color: var(--geo); font-weight: 600; }
.geo-tile.on svg { color: var(--geo); }
.geo-tile.on svg .f { fill: var(--panel); }

/* radionucléides et liste déroulante */
.nuc-rows { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.nuc-row { display: flex; align-items: center; gap: 8px; padding: 3px 6px 3px 8px; border: 1px solid var(--line2); border-radius: 8px; background: var(--panel); }
.nuc-row input[inputmode=decimal] { width: 96px; }
.combo { position: relative; }
.combo input { width: 120px; font: 600 13px "IBM Plex Mono", monospace; }
.combo input:focus { outline: none; border: 1.5px solid var(--geo); }
.combo-list { position: absolute; left: 0; top: 38px; z-index: 20; width: 250px; max-height: 300px; overflow: auto; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 24px var(--shadow); display: flex; flex-direction: column; gap: 2px; }
.combo-list button { display: flex; justify-content: space-between; align-items: center; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; font: 13px "IBM Plex Mono", monospace; text-align: left; flex-shrink: 0; }
.combo-list button span { font: 12px "IBM Plex Sans", sans-serif; color: var(--muted); }
.combo-list button.act { background: var(--geo-bg); color: var(--geo); font-weight: 600; }
.combo-list .none { padding: 8px 10px; font-size: 12px; color: var(--muted); }
.add-dashed { height: 40px; padding: 0 14px; border-radius: 8px; border: 1px dashed var(--line2); background: var(--panel); cursor: pointer; }
.add-dashed:hover { border-color: var(--muted); }
.mini { width: 28px; height: 34px; border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.mini:hover { color: var(--ink); }
.mini.x:hover, .mini.danger { color: var(--danger); }
.mini:disabled { opacity: .35; cursor: default; }

/* écrans */
.shield-list { display: flex; flex-direction: column; gap: 8px; }
.shield-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 8px; background: var(--bg); }
.shield-row .num { font: 600 12px "IBM Plex Mono", monospace; color: var(--muted); align-self: center; }
.shield-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.shield-row select { width: 110px; }
.shield-row .mini { width: 24px; }
.shield-row input { width: 74px; }
.empty-box { padding: 18px; border: 1px dashed var(--line2); border-radius: 10px; color: var(--muted); font-size: 13px; text-align: center; }
#add-shield { align-self: flex-start; }

/* colonne résultat */
.config-side { position: sticky; top: 0; display: flex; flex-direction: column; gap: 12px; }
.result { padding: 18px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 4px 16px var(--shadow); }
.r-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.r-value { font: 600 44px/1.05 "IBM Plex Mono", monospace; color: var(--val); }
.r-value small, .m-value small { font-size: 18px; color: var(--ink); }
.result.busy .r-value, .mini-result.busy .m-value { opacity: .45; }
.zone-badge { display: inline-flex; align-items: center; padding: 5px 10px; border-radius: 6px; font-size: 13px; font-weight: 600; }
.subtab-right .zone-badge { padding: 3px 9px; font-size: 12px; }
.warn { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.warn:empty { display: none; }
.warn li { background: var(--warn-bg); color: var(--warn); border-radius: 6px; padding: 6px 9px; font-size: 12px; }
.bars { display: flex; flex-direction: column; gap: 7px; }
.bars:empty { display: none; }
.bar-row { display: grid; grid-template-columns: 62px 1fr auto; gap: 8px; align-items: center; font-size: 13px; }
.bar-row .track { height: 6px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bar-row .fill { height: 6px; background: var(--geo); }
.bar-row .num { font-family: "IBM Plex Mono", monospace; text-align: right; font-size: 12px; white-space: nowrap; min-width: 86px; }
.preview { height: 140px; padding: 0; border: 0; border-radius: 8px; background: var(--bg); cursor: pointer; }
.preview svg { width: 100%; height: 100%; display: block; }
.r-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.r-extra:empty { display: none; }
.r-extra { border-top: 1px solid var(--line); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.go-carto { align-self: flex-start; font-size: 13px; color: var(--dose); text-decoration: none; }
.linkbtn { border: 0; background: none; padding: 2px 4px; color: var(--muted); cursor: pointer; font-size: 12px; text-decoration: underline; }
.linkbtn:hover { color: var(--ink); }
.tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.tbl th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 4px 6px; }
.tbl td { border-bottom: 1px solid var(--line); padding: 4px 6px; font-family: "IBM Plex Mono", monospace; }
.tbl td.txt { font-family: inherit; }

/* cartographie */
.scene { flex: 1; }
.zone-panel { position: absolute; left: 16px; top: 16px; width: 240px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 12px var(--shadow); cursor: default; font-size: 12px; }
.zone-panel .check { height: auto; font-weight: 600; }
.zone-panel .lg { display: flex; align-items: center; gap: 8px; }
.zone-panel .lg i { width: 14px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.zone-panel .lg .mono { margin-left: auto; color: var(--muted); }
.zone-thr { display: flex; align-items: center; gap: 8px; }
.zone-thr input { width: 96px; height: 28px; margin-left: auto; font-size: 12px; }
.mini-result { position: absolute; right: 18px; top: 16px; width: 280px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; display: flex; flex-direction: column; gap: 8px; box-shadow: 0 4px 16px var(--shadow); cursor: default; }
.m-value { font: 600 34px/1 "IBM Plex Mono", monospace; color: var(--val); }
.m-value small { font-size: 16px; }

/* glossaire */
.gl-index { width: 270px; flex-shrink: 0; padding: 20px 14px; background: var(--panel); border-right: 1px solid var(--line); overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.gl-index .search { margin-bottom: 10px; height: 36px; }
.gl-cat { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; padding: 12px 10px 6px; }
.gl-link { display: block; width: 100%; text-align: left; padding: 7px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; font-size: 14px; }
.gl-link:hover { background: var(--soft); }
.gl-link.on { background: var(--geo-bg); color: var(--geo); font-weight: 600; }
.gl-body { flex: 1; min-width: 0; overflow: auto; padding: 28px 48px 60px; display: flex; flex-direction: column; gap: 14px; }
.gl-body h1 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.gl-item { max-width: 820px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 20px; }
.gl-item.on { border: 1.5px solid var(--geo); }
.gl-item h2 { margin: 0; font-size: 16px; }
.gl-item p { margin: 0; line-height: 1.55; }
.gl-item .formula { align-self: flex-start; padding: 8px 14px; border-radius: 8px; background: var(--bg); font: 14px "IBM Plex Mono", monospace; }
.gl-item .see { font-size: 12px; color: var(--muted); }
.gl-item .see button { border: 0; background: none; padding: 0 2px; color: var(--dose); cursor: pointer; font-size: 12px; text-decoration: underline; }

@media (max-width: 1100px) {
  #page-config.on { grid-template-columns: minmax(0, 1fr); }
  .config-side { position: static; }
  .geo-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.hint { font-size: 12px; color: var(--muted); }
.x { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: 16px; }
.x:hover { color: var(--danger); }

/* contrôles natifs aux couleurs du thème : barres de défilement, flèches des champs numériques */
* { scrollbar-color: var(--line2) transparent; scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }
input[inputmode=decimal]::-webkit-inner-spin-button { opacity: .55; }
input[inputmode=decimal]:hover::-webkit-inner-spin-button, input[inputmode=decimal]:focus::-webkit-inner-spin-button { opacity: 1; }

/* v0.5 : dimensionnement d'écran, calcul inverse */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
#dim-toggle[aria-expanded="true"] { border-color: var(--geo); background: var(--geo-bg); color: var(--geo); font-weight: 600; }
.dim-box { padding: 14px 16px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.chip-b { height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; font-size: 12px; }
.chip-b.on { border-color: var(--geo); background: var(--geo-bg); color: var(--geo); font-weight: 600; }
.out-box { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; padding: 12px 14px; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); min-height: 64px; }
.page .out-box { background: var(--bg); border-color: var(--line2); }
.out-box .lbl { font-size: 12px; color: var(--muted); }
.out-box .big { font: 600 22px "IBM Plex Mono", monospace; color: var(--ink); }
.out-box .big span { font: 14px "IBM Plex Sans", sans-serif; color: var(--muted); }
.out-box .sub { font: 12px "IBM Plex Mono", monospace; color: var(--muted); }
.out-box .primary { margin-left: auto; }
#page-inverse.on, #page-dim.on, #page-zones.on { display: block; overflow: auto; padding: 20px; }
.inv-wrap { display: flex; flex-direction: column; gap: 16px; max-width: 1400px; }
.inv-config { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.inv-sum { color: var(--ink); }
.inv-config .go-carto { margin-left: auto; }
.inv-grid { display: grid; grid-template-columns: minmax(380px, 1fr) minmax(420px, 1fr); gap: 16px; align-items: start; }
.cfg-intro { margin: 4px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
.zd-rows { display: flex; flex-direction: column; gap: 12px; }
.zd-row { display: grid; grid-template-columns: 14px 110px 1fr 96px; align-items: center; gap: 12px; font-size: 13px; }
.zd-row i { width: 14px; height: 14px; border-radius: 3px; }
.zd-row .trk { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; }
.zd-row .trk div { height: 8px; opacity: .8; }
.zd-row strong { font: 600 14px "IBM Plex Mono", monospace; text-align: right; }
.savebox .note-link { font-size: 13px; color: var(--dose); }

/* radionucléides : unité commune, lignes numérotées sur deux colonnes */
.nuc-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: -4px; }
.nuc-units { display: flex; gap: 8px; }
.nuc-decay { margin-left: auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.nuc-decay input, .nuc-decay select { height: 30px; padding: 0 6px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); font-size: 12px; }
.nuc-t { font: 12px "IBM Plex Mono", monospace; color: var(--dose); white-space: nowrap; padding: 0 4px; }
.nuc-row.fil { border-style: dashed; background: transparent; cursor: default; }
.nuc-row.fil .fil-n { font-weight: 600; padding: 0 6px 0 2px; }
.nuc-row.fil .hint { font-size: 12px; }
.nuc-units select { height: 30px; padding: 0 6px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); font-size: 12px; }
#nuc-rows { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 8px; }
#nuc-rows .nuc-row { padding: 6px 6px 6px 10px; }
.nuc-num { font: 600 12px "IBM Plex Mono", monospace; color: var(--muted); min-width: 14px; text-align: right; }
#nuc-rows .nuc-row { min-width: 0; }
#nuc-rows .combo { flex: 0 1 130px; min-width: 78px; }
#nuc-rows .combo input { width: 100%; }
#nuc-rows .nuc-row .act-field input[inputmode=decimal] { width: auto; min-width: 72px; }
/* décroissance affichée : colonne « → A(t) » en plus, nom du radionucléide plus étroit, deux colonnes seulement si la place suffit */
#nuc-rows.dec { grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); }   /* même seuil que sans décroissance */
#nuc-rows.dec .nuc-row { gap: 6px; padding-left: 8px; }
#nuc-rows.dec .combo { flex: 0 0 76px; min-width: 0; }
#nuc-rows.dec .combo input { padding-left: 8px; padding-right: 6px; }
#nuc-rows.dec .act-field span { padding: 0 6px; flex-shrink: 0; }
#nuc-rows.dec .act-field { min-width: 116px; }
#nuc-rows.dec .nuc-row .act-field input[inputmode=decimal] { min-width: 68px; padding: 0 8px; }
#nuc-rows.dec .nuc-t { padding: 0; }
#nuc-rows .nuc-row > button, #nuc-rows .nuc-t, .nuc-num { flex-shrink: 0; }
.act-field { flex: 1; min-width: 0; display: flex; align-items: stretch; height: 34px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); overflow: hidden; }
.act-field:focus-within { border-color: var(--geo); }
.act-field input { flex: 1; min-width: 0; height: 100%; border: 0 !important; border-radius: 0; background: transparent; outline: none; }
.act-field span { display: flex; align-items: center; padding: 0 10px; border-left: 1px solid var(--line); background: var(--soft); color: var(--muted); font-size: 12px; white-space: nowrap; }
#nuc-rows .add-dashed { height: auto; min-height: 48px; }

/* vue 3D de la configuration */
.v3d-card { padding: 14px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 16px var(--shadow); }
.v3d-head { display: flex; align-items: center; gap: 8px; }
.v3d-tools { margin-left: auto; display: flex; gap: 4px; }
.v3d-tools button { height: 28px; padding: 0 8px; border-radius: 6px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; font-size: 12px; }
.v3d-tools button:hover { border-color: var(--muted); }
.v3d { position: relative; height: 300px; border-radius: 10px; background: var(--bg); overflow: hidden; cursor: grab; }
.v3d.grabbing { cursor: grabbing; }
.v3d svg { width: 100%; height: 100%; }
.v3d-tag { position: absolute; transform: translate(-50%, -50%); font: 11px "IBM Plex Mono", monospace; color: var(--ink); background: var(--panel); border: 1px solid var(--line2); border-radius: 4px; padding: 1px 5px; white-space: nowrap; pointer-events: none; opacity: .92; }
.v3d-tag.muted { color: var(--muted); }
.v3d-tag.shield { border-color: var(--muted); }
.v3d-foot { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--muted); }
.v3d-foot i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.v3d-foot .lg-src { background: var(--geo); }
.v3d-foot .lg-sh { background: #8A97A3; }
.v3d-foot .hint { margin-left: auto; font-size: 11px; }
.shield-row select[data-skind] { width: 190px; }
.v3d-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--ink); }
.v3d-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.v3d-legend:empty { display: none; }
.v3d-foot .hint { margin-left: 0; }
.shield-row .num { display: flex; align-items: center; gap: 5px; }
.shield-row .num .sw { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.shield-row { gap: 6px; }
.shield-row select { width: 104px; }
.shield-row input { width: 64px; }
.shield-row select[data-skind] { width: 140px; }
.shield-row input[data-sthk] { width: 60px; }
.shield-row input[data-srho] { width: 72px; }

/* cartographie 2D / 3D */
.carto3d { position: absolute; inset: 0; cursor: grab; background: var(--bg); }
.carto3d.grabbing { cursor: grabbing; }
.mode-toggle { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 2px; padding: 3px; background: var(--panel); border: 1px solid var(--line2); border-radius: 9px; box-shadow: 0 4px 12px var(--shadow); z-index: 6; cursor: default; }
.mode-toggle > button { height: 30px; min-width: 46px; padding: 0 12px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-weight: 600; font-size: 13px; }
.mode-toggle > button.on { background: var(--geo); color: var(--on-ink); }
.mode-tools { display: flex; gap: 2px; margin-left: 6px; padding-left: 6px; border-left: 1px solid var(--line2); }
.mode-tools button { height: 30px; padding: 0 9px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; font-size: 12px; }
.mode-tools button:hover { background: var(--soft); }
.scene.mode3d #svg, .scene.mode3d #iso, .scene.mode3d .scalebar, .scene.mode3d .scene-hint { display: none; }
.scene.mode3d .zoombar { z-index: 6; }
.v3d-tag.point { background: var(--ink); color: var(--on-ink); border-color: var(--ink); font-weight: 600; }
.v3d-tag.point { transform: translate(-50%, calc(-50% - 26px)); }   /* au-dessus du marqueur P */
.scene .carto3d canvas { pointer-events: auto; }
.c3d-legend { position: absolute; right: 16px; bottom: 16px; max-width: 40%; z-index: 5; padding: 8px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 12px var(--shadow); }
.v3d-tag.num { width: 20px; height: 20px; padding: 0; border-radius: 50%; display: grid; place-items: center; font-weight: 600; color: #111; border: 1.5px solid rgba(0,0,0,.35); opacity: 1; }

/* ---------- v0.7 : grille, repère, cotes 3D ---------- */
.v3d-tag.dim { color: var(--dose); border-color: var(--dose); font-weight: 600; }
.v3d-tag.grid { background: none; border: 0; color: var(--muted); font-size: 10px; transform: translate(-50%, 6px); opacity: .9; }
.v3d-tag.grid.gl { transform: translate(calc(-100% - 6px), -50%); }
.v3d-tag.axis { background: none; border: 0; font: 700 15px "IBM Plex Sans", sans-serif; opacity: 1; }
.v3d-tag.axis.x { color: var(--axis-x); } .v3d-tag.axis.y { color: var(--axis-y); }
.v3d-tag.axis.o { color: var(--ink); font-size: 12px; transform: translate(-130%, 20%); }
.v3d-triad { position: absolute; right: 14px; bottom: 56px; width: 84px; height: 84px; pointer-events: none; font-family: "IBM Plex Sans", sans-serif; }
.mode-tools button.tog { color: var(--muted); }
.mode-tools button.tog[aria-pressed="true"] { color: var(--dose); font-weight: 600; background: var(--soft); }

/* ---------- v0.7 : cas courant dans l'en-tête ---------- */
.case-chip { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 5px 8px 5px 12px; border: 1px solid var(--line2); border-radius: 9px; background: var(--bg); color: var(--muted); }
.case-chip .cc-txt { min-width: 0; line-height: 1.2; }
.case-chip .cc-path { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-chip .cc-name { font-weight: 600; font-size: 14px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-chip .cc-edit { height: 28px; padding: 0 9px; font-size: 12px; flex-shrink: 0; }
.fico { flex-shrink: 0; }
button.primary.done { background: var(--geo); }

/* fenêtre Enregistrer / Modifier */
.modal-ovl { position: fixed; inset: 0; z-index: 80; background: rgba(5, 8, 10, .55); display: grid; place-items: start center; padding-top: 9vh; }
.modal-ovl[hidden] { display: none; }
.dlg { width: min(520px, calc(100vw - 32px)); max-height: 84vh; overflow: auto; padding: 20px 22px; background: var(--panel); border: 1px solid var(--line2); border-radius: 14px; box-shadow: 0 20px 50px var(--shadow); display: flex; flex-direction: column; gap: 12px; }
.dlg h3 { margin: 0; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.dlg .field input { height: 38px; font-size: 14px; }
.dlg-tree { border: 1px solid var(--line2); border-radius: 8px; padding: 6px; background: var(--field); max-height: 260px; overflow: auto; }
.dlg-foot { display: flex; align-items: center; gap: 8px; }
.dlg-foot .sp { flex: 1; }
.hint b { color: var(--ink); font-weight: 500; }

/* arborescence de dossiers */
.ftree { display: flex; flex-direction: column; gap: 1px; }
.frow { display: flex; align-items: center; gap: 6px; min-height: 34px; padding: 4px 6px 4px calc(4px + var(--lvl, 0) * 16px); border-radius: 6px; color: var(--ink); cursor: pointer; border: 1px solid transparent; background: none; font: inherit; text-align: left; width: 100%; }
.frow:hover { background: var(--soft); }
.frow.on { background: var(--soft); font-weight: 600; }
.frow.pick.on { background: var(--dose-bg); color: var(--dose); }
.frow .caret { width: 14px; flex-shrink: 0; border: 0; background: none; padding: 0; color: var(--muted); cursor: pointer; font-size: 11px; }
.frow .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .fcount { font: 12px "IBM Plex Mono", monospace; color: var(--muted); }
.frow .fmore { width: 24px; height: 24px; border: 0; border-radius: 5px; background: none; color: var(--muted); cursor: pointer; visibility: hidden; }
.frow:hover .fmore, .frow.on .fmore { visibility: visible; }
.frow .fmore:hover { background: var(--line2); color: var(--ink); }
.frow.drop { background: var(--dose-bg); border: 1.5px dashed var(--dose); color: var(--dose); }
.frow.dragging, .card.dragging { opacity: .4; }
.frow.editing { cursor: default; background: var(--soft); }
.frow.editing input { flex: 1; min-width: 0; height: 28px; padding: 0 7px; border: 1px solid var(--dose); border-radius: 5px; background: var(--field); color: var(--ink); }
.frow.confirm { flex-direction: column; align-items: stretch; gap: 6px; cursor: default; background: var(--soft); border-color: var(--danger); padding: 8px 10px; font-size: 13px; }
.frow.confirm .hint { display: block; margin-top: 2px; }
.confirm-btns { display: flex; gap: 6px; }
.frow.addrow { color: var(--geo); font-size: 13px; }
.fbtn { height: 28px; min-width: 28px; padding: 0 8px; flex-shrink: 0; border: 1px solid var(--line2); border-radius: 5px; background: var(--panel); color: var(--ink); cursor: pointer; font-size: 12px; }
.fbtn.ok { color: var(--geo); } .fbtn.danger { color: var(--danger); border-color: var(--danger); }
.fsep { height: 1px; background: var(--line); margin: 6px 4px; }
.fempty { padding: 6px 10px; }
.side-head { display: flex; align-items: center; padding: 0 0 8px 8px; }
.side-head .side-title { flex: 1; padding: 0; }
.mini-btn { height: 28px !important; padding: 0 9px !important; font-size: 12px; }
.side-hint { margin-top: auto; padding: 14px 8px 0; line-height: 1.5; }
.folders { width: 280px; }
.lib-titles { display: flex; flex-direction: column; gap: 2px; }
.crumb { font-size: 12px; color: var(--muted); min-height: 0; }
.lib-t { display: flex; align-items: baseline; gap: 10px; }
.card { cursor: grab; }
.card.current { border-color: var(--geo); }
.card .cpath { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.card .cmore { height: 28px; width: 32px; padding: 0; }
body.dnd .folders { box-shadow: inset -2px 0 0 var(--dose); }

/* menu flottant (dossier, cas) */
.fmenu { position: fixed; z-index: 90; min-width: 220px; padding: 6px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; box-shadow: 0 10px 24px var(--shadow); display: flex; flex-direction: column; }
.fmenu button { text-align: left; padding: 8px 10px; border: 0; border-radius: 6px; background: none; color: var(--ink); cursor: pointer; font-size: 13px; }
.fmenu button:hover { background: var(--soft); }
.fmenu button.danger { color: var(--danger); }
.fm-head { padding: 6px 10px 4px; font-size: 12px; color: var(--muted); }
.fm-sep { height: 1px; background: var(--line); margin: 4px 2px; }

/* page Notes */
#page-notes.on { display: block; overflow: auto; }
.notes-wrap { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
.notes-head { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-weight: 600; }
.notes-head .sp { flex: 1; }
.notes-free { grid-column: 1 / -1; }
.notes-free textarea { min-height: calc(100vh - 290px); resize: vertical; padding: 10px 12px; border: 1px solid var(--line2); border-radius: 8px; background: var(--field); color: var(--ink); font: 14px/1.55 "IBM Plex Sans", sans-serif; }
.ref-list { display: flex; flex-direction: column; gap: 6px; }
.ref-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 1px solid var(--line2); border-radius: 8px; color: var(--muted); }
.ref-id { font: 600 12px "IBM Plex Mono", monospace; color: var(--dose); min-width: 130px; }
.ref-t { flex: 1; color: var(--ink); }
.ref-p { flex: 1; min-width: 0; font: 12px "IBM Plex Mono", monospace; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ref-add { display: flex; gap: 8px; }
.ref-add input { flex: 1; min-width: 0; height: 34px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); }
.ref-add input.w-ref { flex: 0 0 150px; }
@media (max-width: 900px) { .notes-wrap { grid-template-columns: 1fr; } .case-chip { max-width: 200px; } .case-chip .cc-path { display: none; } }
.fmore-ph { width: 24px; flex-shrink: 0; }
.v3d-tag.grid.unit { transform: translate(8px, 20px); font-style: italic; }
.scene svg, .scene .v3d-tag { user-select: none; -webkit-user-select: none; }

/* ================= v0.8 : Accueil → Projet → Cas ================= */
.brand-home { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 14px; }
.crumb-back { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--line2); background: var(--soft); color: var(--dose); cursor: pointer; font-size: 18px; line-height: 1; margin-right: 4px; }
.crumb-back:hover { border-color: var(--dose); }
.crumb-a { border: 0; background: none; padding: 4px 4px; border-radius: 5px; color: var(--muted); cursor: pointer; font: inherit; }
.crumb-a.sub { font-size: 13px; }
.crumb-a:hover { color: var(--ink); background: var(--soft); }
.crumb-sep { color: var(--muted); opacity: .7; }
.crumb-cur { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.crumb-edit { height: 26px !important; padding: 0 8px !important; font-size: 12px; margin-left: 6px; }
.crumbs .hint { margin-left: 8px; }
.gloss-btn { height: 34px; font-size: 13px; color: var(--muted); }
#btn-save[hidden] { display: none; }
#view-home.on { display: block; overflow: auto; }
#view-project.on { display: flex; }

.home { max-width: 1320px; margin: 0 auto; padding: 26px 32px 40px; display: flex; flex-direction: column; gap: 20px; }
.home-resume { display: flex; align-items: center; gap: 16px; margin: 0; border-color: var(--line2); background: linear-gradient(90deg, var(--soft), var(--panel)); }
.home-resume[hidden] { display: none; }
.resume-ico { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--dose-bg); color: var(--dose); display: grid; place-items: center; font-size: 20px; }
.resume-txt { flex: 1; min-width: 0; }
.resume-txt b { font-size: 16px; }
.resume-dose { font: 600 15px "IBM Plex Mono", monospace; color: var(--val); white-space: nowrap; }
.home-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.home-head h1 { margin: 0; font-size: 22px; }
.home-head .search { margin-left: auto; width: 300px; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.pcard { display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line2); cursor: pointer; text-align: left; font: inherit; color: inherit; min-height: 150px; transition: border-color .2s, box-shadow .2s; }
.pcard:hover { border-color: var(--muted); }
.pcard.dragging { opacity: .45; }
.mrow.fresh { box-shadow: inset 0 0 0 2px var(--dose); background: var(--dose-bg); transition: box-shadow .4s, background .4s; }
.pcard.fresh { border-color: var(--dose); box-shadow: 0 0 0 3px var(--dose-bg); }
.pcard.confirm { cursor: default; border-color: var(--danger); gap: 8px; }
.pc-new { border: 1.5px dashed var(--line2); background: none; align-items: center; justify-content: center; color: var(--muted); font-size: 14px; }
.pc-new:hover { color: var(--ink); border-color: var(--muted); }
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-ico { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: var(--folder-bg); color: var(--folder); display: grid; place-items: center; }
.pc-t { flex: 1; min-width: 0; }
.pc-t b { font-size: 16px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-more { visibility: visible !important; }
.pc-desc { flex: 1; font-size: 13px; line-height: 1.45; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pc-foot { display: flex; align-items: center; gap: 10px; }
.pc-foot .sp { flex: 1; }
.pc-n { color: var(--ink); font-family: "IBM Plex Mono", monospace; }
.home-unfiled { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.home-unfiled .linkbtn { font-size: 13px; }

/* page projet */
.prj-info { display: flex; flex-direction: column; gap: 6px; padding: 0 8px 14px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.prj-info .side-title { padding: 0; }
.prj-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prj-desc { font-size: 13px; line-height: 1.45; color: var(--ink); }
.prj-info .linkbtn { align-self: flex-start; padding: 0; }
.lib-head .search { margin-left: auto; width: 240px; }
.prj-count { max-width: 380px; line-height: 1.35; }
.mtable { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; overflow: hidden; }
.mrow { display: grid; grid-template-columns: 44px minmax(160px, 1.5fr) minmax(200px, 2.2fr) minmax(110px, 1fr) 92px 170px 34px; gap: 12px; align-items: center; padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: var(--soft); }
.mrow.current { box-shadow: inset 3px 0 0 var(--geo); }
.mrow.picked { background: var(--dose-bg); }
.mrow.dragging { opacity: .4; }
.mrow.drop-before { box-shadow: inset 0 2px 0 var(--dose); }
.mrow.drop-after { box-shadow: inset 0 -2px 0 var(--dose); }
.mhead { cursor: default; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line2); }
.mhead:hover { background: none; }
.m-num { display: flex; align-items: center; gap: 6px; font: 12px "IBM Plex Mono", monospace; color: var(--muted); cursor: pointer; }
.m-num input { accent-color: var(--dose); margin: 0; opacity: 0; width: 14px; }
.mrow:hover .m-num input, .m-num input:checked, .mrow.picked .m-num input { opacity: 1; }
.m-name { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
/* liste des modélisations : nom sur une ligne, configuration en dessous (plus de colonne « Configuration ») */
#prj-rows .m-name { flex-direction: column; align-items: flex-start; gap: 3px; flex-wrap: nowrap; }
#prj-rows .m-nl { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
#prj-rows .m-cfg { max-width: 100%; font-size: 12.5px; }
.mtable:not(.nt-table) .mrow:not(.new) { grid-template-columns: 44px minmax(0, 3fr) minmax(110px, 1fr) 92px 170px 34px; }
.mtable.nodir:not(.nt-table) .mrow:not(.new) { grid-template-columns: 44px minmax(0, 1fr) 92px 170px 34px !important; }
.mtable:not(.nt-table) > .mrow.mhead > span:nth-child(3) { display: none; }
.m-name b { overflow: hidden; text-overflow: ellipsis; }
.m-cfg { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-dir { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-dose { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.m-dose .dose { font: 600 14px "IBM Plex Mono", monospace; color: var(--val); white-space: nowrap; }
.zb { min-width: 20px; height: 18px; padding: 0 5px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; color: #111; }
.zb.nr { background: var(--soft); color: var(--muted); }
.m-more { visibility: visible; }
.mrow.new { grid-template-columns: 44px 1fr auto auto; cursor: default; background: var(--soft); }
.mrow.new input { height: 34px; padding: 0 10px; border: 1px solid var(--dose); border-radius: 6px; background: var(--field); color: var(--ink); }
.nc-btns { display: flex; gap: 6px; }
.small-btn { height: 32px !important; font-size: 13px; }
.dlg-row { display: flex; gap: 10px; }
.dlg-row .field { flex: 1; }
.dlg textarea { min-height: 70px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); font: 13px/1.45 "IBM Plex Sans", sans-serif; resize: vertical; }
.pc-more, .m-more { width: 28px; height: 28px; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; font-size: 15px; }
.pc-more:hover, .m-more:hover { background: var(--line2); color: var(--ink); }
.autosave { font-size: 12px; color: var(--geo); opacity: 0; transition: opacity .3s; white-space: nowrap; }
.autosave.on { opacity: 1; }
.autosave.err { color: var(--danger); }
#home-quick { display: inline-flex; align-items: center; gap: 7px; }
.btn-ico { flex-shrink: 0; }

/* accueil — colonne « Calcul rapide / Récents » à gauche (v0.12.7), projets à droite, 3 par ligne */
#view-home.on { display: grid; grid-template-columns: 272px minmax(0, 1fr); overflow: hidden; }
#view-home .home { max-width: none; margin: 0; padding: 26px 30px 40px; overflow: auto; min-height: 0; }
.home-head .search { margin-left: auto; width: 280px; }
.home-head h1 { font-size: 24px; }
.home-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1150px) { .home-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.home-tip { font-size: 12px; }
.home-side { order: -1; background: var(--panel); border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 10px; overflow: auto; min-height: 0; }
.home-quick { height: 44px !important; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 14px; }
/* v0.12.9 : « Calcul rapide » mis en évidence, même style que le bouton principal */
button.ghost.home-quick { background: var(--dose); color: var(--on-ink); border-color: var(--dose); font-weight: 600; }
button.ghost.home-quick:hover { filter: brightness(1.06); border-color: var(--dose); }
.home-rec-t { padding: 10px 10px 2px; }
.home-recent { display: flex; flex-direction: column; gap: 2px; }
.rec-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.rec-row:hover, .rec-row.on { background: var(--soft); }
.rec-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rec-t b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-t b.nb { font-weight: 500; font-size: 14px; }
.rec-t .hint { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rec-r { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.rec-r .hint { font-size: 11px; }
.rec-d { font: 600 12px "IBM Plex Mono", monospace; color: var(--val); white-space: nowrap; display: flex; align-items: center; gap: 5px; }
.rec-empty { padding: 6px 10px; }
.home-unfiled { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 6px; display: block; }
.pc-zones { display: flex; gap: 3px; align-items: center; flex-wrap: wrap; }
@media (max-width: 1000px) { #view-home.on { grid-template-columns: 1fr; overflow: auto; } #view-home .home { overflow: visible; } .home-side { order: 0; border-right: 0; border-top: 1px solid var(--line); } }
/* en-tête : l'indicateur d'enregistrement ne prend de place que sur la page d'un cas */
.autosave:empty, body:not([data-view="calc"]) .autosave { display: none; }
.carto3d .v3d-triad { bottom: 64px; }
.scene-hint { bottom: 62px; }
.m-root { font-style: italic; opacity: .75; }
.mtable.nodir .mrow:not(.new) { grid-template-columns: 44px minmax(160px, 1.5fr) minmax(200px, 3fr) 92px 170px 34px; }
.mtable.nodir .m-dir { display: none; }
#prj-new-case, #home-new { white-space: nowrap; }
.m-date { font: 12px "IBM Plex Mono", monospace; color: var(--muted); white-space: nowrap; }
.mhead .m-date { font: inherit; }

/* v0.10 : retouches d'apparence */
.icon-mini { width: 28px; height: 28px; flex-shrink: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; opacity: .75; }
.icon-mini:hover { background: var(--soft); color: var(--ink); opacity: 1; }
.prj-title { display: flex; align-items: center; justify-content: space-between; margin: -4px 0 -2px; }
.r-head { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px -4px 0; }
.all-ico { color: var(--folder); display: grid; place-items: center; }
.sub-folders .frow { padding-left: calc(18px + var(--lvl, 0) * 16px); }
.prj-count { max-width: none; }
/* écrans : une ligne par écran, titres de colonnes une seule fois */
.shield-row { flex-wrap: nowrap; align-items: center; gap: 6px; padding: 6px 8px; }
.shield-row .num { width: 30px; flex-shrink: 0; }
.shield-row .mini.eye { width: 26px; display: grid; place-items: center; color: var(--muted); }
.shield-row .mini.eye:hover { color: var(--ink); }
.shield-row .mini.eye.on { color: var(--dose); }
.shield-row.off { border-style: dashed; background: transparent; }
.shield-row.off .sh-c, .shield-row.off .num { opacity: .45; }
.shield-row .sh-c { flex: 1 1 0; min-width: 0; display: block; }
.shield-row .sh-c.mat { flex-grow: 1.6; } .shield-row .sh-c.kind { flex-grow: 1.5; }
.shield-row .sh-c select, .shield-row .sh-c input { width: 100% !important; min-width: 0; }
.shield-row .sh-c input[inputmode=decimal] { -moz-appearance: textfield; }
.shield-row .sh-c input[inputmode=decimal]::-webkit-inner-spin-button, .shield-row .sh-c input[inputmode=decimal]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.shield-row .sh-btns { display: flex; gap: 4px; flex-shrink: 0; width: 82px; justify-content: flex-end; }
.shield-row .fbtn { width: 26px; min-width: 26px; padding: 0; height: 34px; }
.shield-row .mini { width: 22px; height: 34px; }
.shield-head { border: 0; background: none; padding: 0 9px 0 9px; font-size: 12px; color: var(--muted); }
.shield-head .sh-c { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* écrans : poignée de déplacement */
.sh-grip { width: 14px; flex-shrink: 0; display: grid; place-items: center; color: var(--muted); cursor: grab; opacity: .6; }
.sh-grip:hover { opacity: 1; color: var(--ink); }
.sh-grip.ph { cursor: default; }
.shield-row .sh-btns { width: 54px; gap: 2px; }   /* œil (masquer) + suppression */
.sh-grip { touch-action: none; user-select: none; }
.shield-row.dragging { opacity: 1; box-shadow: 0 6px 18px var(--shadow); border-color: var(--dose); position: relative; z-index: 2; }
body.sh-dragging, body.sh-dragging * { cursor: grabbing !important; user-select: none; }
.sh-msg { color: var(--warn); min-height: 0; }
.sh-msg:empty { display: none; }

/* v0.12 — logo : étoile 3D animée dans l'application, logo fixe (soleil + orbite) sur les pages annexes */
.brand-logo { width: 36px; height: 36px; margin: -2px 0; display: block; flex-shrink: 0; }
.brand-logo-s { width: 30px; height: 30px; display: block; flex-shrink: 0; color: var(--logo); }

/* v0.13 : accueil et projets façon Prisme — identité et commandes dans la colonne de gauche, plus de barre du haut */
body[data-view="home"] header.top, body[data-view="project"] header.top, body[data-view="note"] header.top, body[data-view="multi"] header.top, body[data-view="accounts"] header.top, body[data-view="library"] header.top { display: none; }
.sb-top { display: flex; flex-direction: column; gap: 22px; padding: 0 2px 6px; }
.sb-brand { display: flex; align-items: center; gap: 12px; }
/* v0.26.3 : trait estompé entre le logo et les icônes */
.sb-brand { position: relative; }
.sb-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: -11px; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, transparent, var(--line2) 20%, var(--line2) 80%, transparent); }
.sb-logo { width: 38px; height: 38px; display: block; flex-shrink: 0; }
.sb-name { border: 0; background: none; padding: 0; cursor: pointer; font: 700 17px "IBM Plex Sans", system-ui, sans-serif; letter-spacing: .32em; color: var(--ink); }
.sb-icons { display: flex; gap: 8px; }
.sb-ico { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line2); background: var(--soft); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.sb-ico:hover { border-color: var(--muted); }
.sb-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 4px 0; font-size: 11px; color: var(--muted); }
#view-project .folders { display: flex; flex-direction: column; gap: 10px; }
.res-menu { position: fixed; z-index: 80; min-width: 240px; }
.res-menu button, .res-menu a { display: flex; align-items: center; gap: 10px; }
.res-menu svg { color: var(--muted); flex-shrink: 0; }
.top .ver { cursor: default; }
.crumb-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; color: var(--muted); min-height: 32px; }
.crumb-row:empty { display: none; }
.pc-ref { margin-bottom: 1px; }
/* « Non classés » : carte à part, plus neutre que les projets */
.pcard.pc-inbox { background: transparent; }
.pc-inbox .pc-ico { background: var(--line2); color: var(--muted); }

/* ---------- calcul en cours ---------- */
.calc-spin { display: inline-flex; align-items: center; gap: 9px; font: 500 14px "IBM Plex Sans", sans-serif; color: var(--muted); white-space: nowrap; }
.calc-spin i { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--val); animation: hspin .8s linear infinite; flex-shrink: 0; }
.r-value .calc-spin { font-size: 15px; height: 46px; }
.m-value .calc-spin { font-size: 13px; height: 34px; }
.result.busy .r-value .calc-spin, .mini-result.busy .m-value .calc-spin { opacity: 1; }
.result.busy .r-value:has(.calc-spin), .mini-result.busy .m-value:has(.calc-spin) { opacity: 1; }
@keyframes hspin { to { transform: rotate(360deg); } }

/* ---------- calcul inverse ---------- */
.inv-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.step-h { display: flex; align-items: center; gap: 10px; }
.card-head { align-items: center; }
.options-line .step-n { margin-right: -4px; }
.step-h i, .step-n { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--soft); color: var(--val); font: 600 12px "IBM Plex Mono", monospace; display: grid; place-items: center; font-style: normal; }
.step-h .hint { margin-left: auto; }
.comp-rows { display: flex; flex-direction: column; gap: 8px; }
.comp-head { display: grid; grid-template-columns: 170px 1fr 28px; gap: 10px; font-size: 12px; color: var(--muted); padding: 0 2px; }
.comp-row { display: grid; grid-template-columns: 170px 1fr 28px; gap: 10px; align-items: center; }
.comp-row .combo input { width: 100%; height: 34px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); }
.comp-foot { display: flex; align-items: center; gap: 12px; }
.comp-foot .add-dashed { height: 34px; }
.comp-foot span:last-child { margin-left: auto; font-size: 12px; }
.tot-ok { color: var(--val); font-weight: 600; }
.tot-warn { color: var(--warn); }
.inv-res { gap: 12px; }
#inv-out, .dim-now { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.inv-res .lbl, .dim-now .lbl { font-size: 12px; color: var(--muted); }
.inv-big { font: 600 40px/1.05 "IBM Plex Mono", monospace; color: var(--val); }
.inv-big small { font: 500 15px "IBM Plex Sans", sans-serif; color: var(--muted); margin-left: 8px; }
.inv-subl { font-size: 12px; color: var(--muted); margin-top: -4px; }
.inv-tbl { margin: 6px 0 4px; font-size: 13px; }
.inv-tbl th:not(:first-child), .inv-tbl td:not(:first-child) { text-align: right; }
.inv-tbl td { padding: 7px 8px; }
.inv-tbl td.nm { font-weight: 600; }
.inv-decl { padding-top: 12px; border-top: 1px solid var(--line); align-self: stretch; }
.inv-ratio { font-size: 13px; color: var(--muted); min-height: 1em; }
.inv-ratio strong { color: var(--ink); font-family: "IBM Plex Mono", monospace; }
#inv-out .warn { align-self: stretch; }

/* ---------- dimensionnement ---------- */
.dim-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
.radio-col { display: flex; flex-direction: column; gap: 8px; }
.radio { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--ink); cursor: pointer; }
.radio input { accent-color: var(--geo); margin: 0; }
.radio.off { color: var(--muted); cursor: default; }
.dim-tbl-wrap { overflow-x: auto; min-height: 60px; }
.dim-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.dim-tbl th, .dim-tbl td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: center; }
.dim-tbl th { font-weight: 500; color: var(--muted); font-size: 12px; vertical-align: bottom; }
.dim-tbl th small { display: block; font-size: 11px; margin-top: 2px; }
.dim-tbl .obj { text-align: left; white-space: nowrap; color: var(--ink); }
.dim-tbl th.obj { color: var(--muted); }
.dim-tbl .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 8px; vertical-align: -1px; background: var(--soft); border: 1px solid var(--line2); }
.dim-tbl .sw[style*=background] { border: 0; }
.dim-tbl .okc { color: var(--muted); font: 12px "IBM Plex Mono", monospace; }
.dim-tbl .na { color: var(--muted); font-size: 12px; }
.dim-tbl select { height: 30px; max-width: 130px; padding: 0 6px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); font-size: 12px; }
.dim-cell { width: 100%; min-width: 86px; height: 34px; border: 1.5px solid transparent; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; font: 600 15px "IBM Plex Mono", monospace; }
.dim-cell small { font: 11px "IBM Plex Sans", sans-serif; color: var(--muted); }
.dim-cell:hover { background: var(--soft); }
.dim-cell.on { border-color: var(--geo); background: var(--geo-bg); }
.dim-sel { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.dim-sel:empty { display: none; }
.dim-sel-line { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dim-sel-line strong { color: var(--ink); }
.dim-sel-line > span { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-family: "IBM Plex Mono", monospace; }
.dim-sel .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 1100px) { .inv-grid, .dim-grid { grid-template-columns: 1fr; } }
.result.busy .bars { opacity: .45; }
.dim-tbl th.mh select { display: block; margin: 0 auto; }
.dim-point { display: flex; flex-direction: column; gap: 10px; }
.dim-point .row-fields input[inputmode=decimal] { width: 96px; }
.dp-state { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.dp-pill { padding: 2px 9px; border-radius: 10px; background: var(--geo-bg); color: var(--geo); font-size: 12px; font-weight: 600; }
.dp-warn { color: var(--warn); margin: 0; }
.quick-row { display: flex; gap: 8px; }
.quick-row .home-quick { flex: 1; }
button.ghost.home-quick-new { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; flex-shrink: 0; }
button.ghost.home-quick-new[hidden] { display: none; }
.zones-wrap { max-width: 1240px; }
@media (max-width: 1360px) { .subtab { padding: 0 11px; } .subtabs { gap: 0; } }
@media (max-width: 1180px) { .subtab-right .zone-badge { display: none; } }
.step-h .step-link { margin-left: auto; }
.zd-p { flex-direction: row; align-items: stretch; flex-wrap: wrap; gap: 0; padding: 12px 6px; }
.zd-p .it { display: flex; flex-direction: column; gap: 4px; padding: 0 20px; border-right: 1px solid var(--line); justify-content: center; }
.zd-p .it:last-child { border-right: 0; }
.zd-p .l { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.zd-p .v { font: 600 17px "IBM Plex Sans", system-ui, sans-serif; color: var(--ink); }
.zd-p .v.d { color: var(--val); }
.zd-p .v small { font-weight: 400; font-size: 13px; color: var(--muted); margin-left: 5px; }
.zd-p .zone-badge { align-self: flex-start; }
.zd-p .calc-spin { font-size: 13px; font-weight: 400; }
.trk-w { position: relative; }
.zd-pm { position: absolute; top: -7px; bottom: -7px; width: 0; border-left: 2px dashed var(--muted); margin-left: -1px; }
.zd-pm-top::before { content: "P"; position: absolute; top: -16px; left: -4px; font: 600 11px "IBM Plex Mono", monospace; color: var(--ink); }
.zd-rows { padding-top: 8px; }

/* titre de page avec le nombre d'éléments en dessous */
.h-stack { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.h-stack .hint { font-size: 12.5px; }
.lib-t.h-stack { align-items: flex-start; }
/* Non classés : ranger dans un projet par glisser-déposer */
.nc-side { display: flex; flex-direction: column; gap: 10px; }
.nc-side .home-quick { width: 100%; margin-bottom: 6px; }
.nc-prjs { display: flex; flex-direction: column; gap: 6px; }
.nc-prj { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; border: 1px dashed var(--line2); background: none; color: var(--ink); font-size: 13.5px; cursor: pointer; text-align: left; width: 100%; }
.nc-prj:hover { border-color: var(--muted); }
.nc-prj .fico { color: var(--folder); flex-shrink: 0; }
.nc-prj span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nc-prj em { font-style: normal; color: var(--muted); font-size: 12px; }
.nc-prj.drop { border-style: solid; border-color: var(--folder); background: var(--folder-bg); }
body.dnd .nc-prj { border-color: var(--folder); }
.nc-note { font-size: 12px; color: var(--muted); padding: 2px 4px; }

/* v0.18 — barre de gauche : navigation (Projets, Note de calcul, Multi-dimensionnement) et repli en rail */
.sb-nav { display: flex; flex-direction: column; gap: 2px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.nav-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 14px; text-align: left; width: 100%; cursor: pointer; }
.nav-item svg { flex-shrink: 0; }
.nav-item span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item:hover { background: var(--soft); }
.nav-item.on { background: var(--soft); font-weight: 600; }
.nav-item.on svg { color: var(--geo); }
.nav-item.soon { color: var(--muted); cursor: default; }
.nav-item.soon:hover { background: transparent; }
.home-unfiled { border-top: 0; padding-top: 0; margin-top: 0; }
#view-project .sb-nav { margin-bottom: 2px; }
body.sb-collapsed #view-home.on { grid-template-columns: 64px minmax(0, 1fr); }
body.sb-collapsed .home-side, body.sb-collapsed #view-project .folders { width: 64px; padding: 18px 10px; align-items: center; overflow-x: hidden; }
body.sb-collapsed .sb-top { align-items: center; padding: 0; }
body.sb-collapsed .sb-name, body.sb-collapsed .sb-foot, body.sb-collapsed #prj-info, body.sb-collapsed #prj-side-folders,
body.sb-collapsed .nav-item span, body.sb-collapsed .home-quick-new, body.sb-collapsed .home-unfiled .rec-t,
body.sb-collapsed .home-unfiled .fcount { display: none !important; }
body.sb-collapsed .sb-icons { flex-direction: column; }
body.sb-collapsed .quick-row { width: 44px; }
body.sb-collapsed .home-quick { width: 44px; padding: 0 !important; font-size: 0 !important; gap: 0; }
body.sb-collapsed .sb-nav { width: 44px; }
body.sb-collapsed .nav-item { justify-content: center; padding: 0; height: 40px; }
body.sb-collapsed .home-unfiled { width: 44px; }
body.sb-collapsed .home-unfiled .rec-row { justify-content: center; padding: 10px 0; position: relative; }
body.sb-collapsed .sb-coll .coll-band { width: 2px; }
body.sb-collapsed .sb-coll .coll-edge { transform: translateX(-2.5px); }
body.sb-collapsed #view-project .nc-side { display: none; }

/* v0.18 — note de calcul */
#view-home .nt { overflow: auto; padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.nt-head { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.nt-head > div { flex: 1; min-width: 200px; }
.nt-crumb { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.nt-head h1 { margin: 2px 0 0; font-size: 24px; }
.nt-gen { height: 40px; padding: 0 18px; font-weight: 600; }
button.ghost.nt-chg { height: 40px; }
.nt-msg { padding: 10px 14px; border-radius: 10px; background: var(--soft); border: 1px solid var(--line2); font-size: 13.5px; }
.nt-msg.err { border-color: var(--danger); color: var(--danger); }
.nt-msg a { color: var(--dose); font-weight: 600; }
.nt-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 1100px) { .nt-grid { grid-template-columns: 1fr; } }
.nt-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nt-card, .nt-mod { background: var(--panel); border: 1px solid var(--line2); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.nt-t { font-weight: 700; font-size: 14px; }
.nt-tall { display: flex; align-items: center; gap: 8px; cursor: pointer; margin-bottom: 4px; }
.nt-t2 { font-weight: 700; font-size: 15px; }
.nt-t2 span { font-weight: 400; font-size: 12px; color: var(--muted); margin-left: 8px; }
.nt-card label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.nt-card label > input:not([type=checkbox]) { height: 32px; border: 1px solid var(--line2); border-radius: 7px; padding: 0 9px; font-size: 13px; color: var(--ink); background: var(--panel); min-width: 0; width: 100%; box-sizing: border-box; }
.nt-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.nt-card label.ck { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); }
.nt-plan ol { margin: 0; padding-left: 18px; font-size: 12.5px; line-height: 1.6; }
.nt-plan ul { margin: 0; padding-left: 4px; color: var(--muted); list-style: none; }
.nt-mh { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.nt-mh b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-mod .grip { color: var(--muted); cursor: grab; letter-spacing: -2px; user-select: none; }
.nt-mod .mid { background: var(--dose-bg); color: var(--dose); font-weight: 700; border-radius: 6px; padding: 1px 8px; font-size: 12.5px; }
.nt-mod .mres { margin-left: auto; font-size: 12px; color: var(--muted); font-family: "IBM Plex Mono", monospace; white-space: nowrap; }
.nt-mod.off { opacity: .6; }
.nt-mod.dragging { opacity: .4; }
.nt-mod.drop { border-color: var(--dose); }
.nt-par { margin-left: 44px; font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); }
.nt-par label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.nt-par.lock { color: var(--muted); }
.nt-par em { font-size: 11.5px; margin-left: 4px; }
.nt-desc { flex: 1; height: 30px; border: 1px solid var(--line2); border-radius: 7px; padding: 0 9px; font-size: 13px; background: var(--panel); color: var(--ink); }
.nt-sub { flex-basis: 100%; margin-left: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.nt-sub .nt-ax { color: var(--ink); font-weight: 600; min-width: 168px; }
.nt-sub .nt-ax span { font-weight: 400; color: var(--muted); }
.nt-sub.nt-axhint { font-style: italic; font-size: 11.5px; margin-left: 24px; }
.nt-sub select { height: 26px; border: 1px solid var(--line2); border-radius: 6px; font-size: 12.5px; background: var(--panel); color: var(--ink); }
.nt-sub .pt { height: 26px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 13px; border: 1px solid var(--line2); color: var(--ink); font-size: 12px; background: var(--panel); cursor: pointer; }
.nt-sub .pt.on { border-color: var(--geo); background: var(--geo-bg); color: var(--geo); font-weight: 600; }
.nt input[type=checkbox] { accent-color: var(--geo); }
.nt-sub .pt.off { opacity: .45; cursor: not-allowed; }
.nt-sub .add { height: 26px; width: 120px; border: 1px dashed var(--line2); border-radius: 13px; padding: 0 10px; font-size: 12px; background: transparent; color: var(--ink); }
.nt-sub .num { height: 26px; width: 60px; border: 1px solid var(--line2); border-radius: 6px; padding: 0 6px; font-size: 12.5px; text-align: right; background: var(--panel); color: var(--ink); }
.nt-pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 8px; }
.nt-pcard { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px; border-radius: 12px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); cursor: pointer; text-align: left; font: inherit; }
.nt-pcard:hover { border-color: var(--muted); }
.nt-pcard b { font-size: 15px; }
.nt-pico { color: var(--folder); }
.nt-hl { display: flex; flex-direction: column; gap: 6px; }
.nt-h { display: flex; flex-direction: column; gap: 2px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 12.5px; }
.nt-h:first-child { border-top: 0; }
.nt-hd { font-weight: 600; }
.nt-ha { display: flex; gap: 10px; align-items: center; }
.nt-ha a { color: var(--dose); font-weight: 600; text-decoration: none; }
.nt-ha a:hover { text-decoration: underline; }
.nt-del { margin-left: auto; color: var(--muted); font-size: 15px; padding: 0 4px; }
.nt-stale { color: var(--dose); }
.prj-nt { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.prj-nt .prj-title { display: flex; align-items: center; }
.prj-nt .prj-title .side-title { flex: 1; }

/* v0.18.2 — point de calcul sur deux lignes : distance + origine, puis décalage / position / milieu */
.pt-grid { display: grid; grid-template-columns: auto auto minmax(0, 1fr); gap: 10px; align-items: end; }
.pt-grid > label:nth-child(2) { grid-column: 2 / span 2; }
.pt-grid input[inputmode=decimal] { width: 96px; }
.pt-grid select { max-width: 100%; }
#sec-point { min-width: 0; }
.two-col { grid-template-columns: minmax(0, 1.9fr) minmax(0, 1fr); }
@media (max-width: 1250px) { .two-col { grid-template-columns: minmax(0, 1fr); } }

.nt-sub .pt.bad { border-color: var(--danger); color: var(--danger); background: transparent; }
.nt-err { flex-basis: 100%; margin-left: 24px; color: var(--danger); font-size: 12px; }

/* v0.18.5 — notes de calcul d'un projet : ligne dans la barre, page dédiée */
.prj-nt-row { margin-top: 0; }
.nt-ico { color: var(--muted); display: inline-grid; place-items: center; }
.nt-ico svg { width: 16px; height: 16px; }
section.lib.notes-mode > .lib-head, section.lib.notes-mode > #lib-msg, section.lib.notes-mode > #compare, section.lib.notes-mode > .mtable { display: none !important; }
section.lib:not(.notes-mode) > #prj-notes-page { display: none; }
.prj-notes-page { display: flex; flex-direction: column; gap: 14px; }
.prj-notes-page .spacer { flex: 1; }
.nt-table .mrow { grid-template-columns: 44px 170px minmax(0, 1fr) 210px 150px; }
.nt-table .nt-ha { justify-content: flex-end; }
.nt-table .fmore { visibility: visible; }

/* v0.18.14 — barre d'un projet : sections « Documents » puis « Dossiers », sans traits intermédiaires */
.prj-docs { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.prj-docs .side-title { padding: 0 8px 6px; }
body.sb-collapsed .prj-docs { display: none !important; }

/* v0.18.15 — listes déroulantes aux couleurs d'Hélios (Chrome / Edge ≥ 135 ; ailleurs : liste native) */
:where(select) { border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); }
@supports (appearance: base-select) {
  select, ::picker(select) { appearance: base-select; }
  select { display: inline-flex; align-items: center; justify-content: space-between; gap: 6px; white-space: nowrap; overflow: hidden; cursor: pointer; }
  select::picker-icon { content: ""; flex-shrink: 0; width: 7px; height: 7px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
    transform: translateY(-2px) rotate(45deg); transition: transform .15s; margin: 0 2px 0 4px; }
  select:open::picker-icon { transform: translateY(2px) rotate(225deg); }
  select:disabled { cursor: default; opacity: .6; }
  ::picker(select) { border: 1px solid var(--line2); border-radius: 10px; background: var(--panel); color: var(--ink); padding: 5px;
    box-shadow: 0 10px 28px var(--shadow, rgba(0,0,0,.22)); margin-block: 4px; max-height: 340px; overflow-y: auto; }
  select option { padding: 7px 10px; border-radius: 7px; font-size: 13.5px; color: var(--ink); white-space: nowrap; }
  select option:hover, select option:focus-visible { background: var(--soft); outline: none; }
  select option:checked { background: var(--geo-bg); color: var(--geo); font-weight: 600; }
  select option::checkmark { display: none; }
  select option:disabled { color: var(--muted); }
  select optgroup { font-size: 11.5px; color: var(--muted); padding: 6px 6px 2px; }
}

/* v0.18.17 — limites de zone : épaisseur des protections hachurée au début de chaque barre */
.zd-row .trk { position: relative; display: flex; }
.zd-row .trk .zd-wall { position: absolute; left: 0; top: 0; bottom: 0; background: repeating-linear-gradient(135deg, var(--line2) 0 2px, transparent 2px 5px); }

/* v0.18.18 — chevron des listes dans la marge droite (toujours visible, net) ; un texte trop long est coupé avant lui */
:root, [data-theme="light"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1.5 1.5 5 5 8.5 1.5' fill='none' stroke='%235B676E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --chev-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1.5 5 5 1.5 8.5 5' fill='none' stroke='%235B676E' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
[data-theme="dark"] { --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1.5 1.5 5 5 8.5 1.5' fill='none' stroke='%2393A1A8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); --chev-up: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='7' viewBox='0 0 10 7'%3E%3Cpath d='M1.5 5 5 1.5 8.5 5' fill='none' stroke='%2393A1A8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
@supports (appearance: base-select) {
  select { padding-right: 24px !important; justify-content: flex-start; overflow: clip; overflow-clip-margin: content-box;
    background-image: var(--chev) !important; background-position: right 9px center !important;
    background-size: 10px 7px !important; background-repeat: no-repeat !important; }
  select:open { background-image: var(--chev-up) !important; }
  select::picker-icon { display: none; }
}
/* colonnes des écrans : un peu plus de place pour la forme (« Enveloppe ») */
.shield-row .sh-c.thk { flex-grow: .7; } .shield-row .sh-c.rho { flex-grow: 1; min-width: 64px; }
.shield-row .sh-c.kind { min-width: 108px; }

/* ------------------------------------------------------------------ multi-dimensionnement (v0.19) */
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: 8px; overflow: hidden; flex-shrink: 0; vertical-align: middle; }
.seg button { border: 0; border-right: 1px solid var(--line2); background: var(--panel); color: var(--muted); font: inherit; font-size: 13px; padding: 0 11px; height: 32px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--pill); color: var(--on-ink); font-weight: 600; }
.seg.sm button { height: 30px; padding: 0 10px; font-size: 12.5px; }
.linkbtn.armed { color: var(--danger); font-weight: 600; text-decoration: none; }
#view-home .nt.mu-edit { padding: 0; gap: 0; }
.mu-top { display: flex; align-items: flex-end; gap: 12px; padding: 18px 24px 10px; }
.mu-tt { flex: 1; min-width: 0; }
.mu input.mu-title { font: 700 22px "IBM Plex Sans", system-ui, sans-serif; color: var(--ink); border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 0 6px; margin: 2px 0 0 -7px; width: min(560px, 100%); }
.mu input.mu-title:hover { border-color: var(--line2); }
.mu input.mu-title:focus { border-color: var(--muted); background: var(--panel); outline: none; }
.mu-tabs { position: sticky; top: 0; z-index: 3; }
#mu-body { padding: 18px 20px 40px; }
.mu-cgrid { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 18px; align-items: start; }
@media (max-width: 1250px) { .mu-cgrid, .mu-vgrid { grid-template-columns: 1fr !important; } }
.mu-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.mu-side { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 66px; min-width: 0; }
.mu-r2 { display: grid; grid-template-columns: minmax(220px, 1.1fr) 1fr; gap: 16px; align-items: end; }
.mu-r2 .field select { height: 36px; }
.mu-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { border: 1px solid var(--line2); border-radius: 20px; padding: 2px 10px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.mu-open { text-decoration: none; color: var(--val); font-size: 13px; }
.mu-lbl { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.mu-pose { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mu-pose .geo-tile { height: 80px; }
.mu-ph { margin-top: 8px; }
/* v0.27 : remplissage depuis un spectre type, icône discrète en haut à droite du bloc Activité */
.card-ico { margin: -6px 0 -6px auto; width: 32px; height: 32px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line2); border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.card-ico:hover { color: var(--geo); border-color: color-mix(in srgb, var(--geo) 45%, transparent); }
.card-ico svg { width: 16px; height: 16px; }
.card-head .mu-hr { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.mu-tw { overflow-x: auto; }
table.mu-rows { border-collapse: separate; border-spacing: 0 6px; width: 100%; margin: -6px 0; }
.mu-rows th { font-weight: 500; color: var(--muted); font-size: 12px; text-align: left; padding: 0 5px; white-space: nowrap; }
.mu-rows td { padding: 6px 5px; border-top: 1px solid var(--line2); border-bottom: 1px solid var(--line2); background: var(--panel); }
.mu-rows td:first-child { border-left: 1px solid var(--line2); border-radius: 9px 0 0 9px; padding-left: 9px; }
.mu-rows td:last-child { border-right: 1px solid var(--line2); border-radius: 0 9px 9px 0; }
.mu-rows input, .mu-rowc input, .mu-pt input, .mu-sel { height: 32px; border: 1px solid var(--line2); border-radius: 7px; background-color: var(--field); color: var(--ink); padding: 0 8px; font-size: 13px; min-width: 0; box-sizing: border-box; }
.mu-rows input.w-n { width: 58px; }
.mu-in { display: inline-flex; align-items: center; height: 32px; border: 1px solid var(--line2); border-radius: 7px; background: var(--field); padding-right: 8px; min-width: 0; vertical-align: middle; }
.mu-in:focus-within { border-color: var(--muted); }
.mu-in input { border: 0 !important; background: transparent !important; height: 30px; width: 100%; min-width: 0; padding: 0 8px; outline: none; }
.mu-in small { color: var(--muted); font-size: 11px; }
.mu-in.off { opacity: .45; }
.mu-rows .mu-in { width: 92px; }
.mu-xyz { display: inline-flex; gap: 5px; }
.mu-xyz input { width: 70px; }
.mu-gl { width: 24px; height: 24px; border-radius: 7px; background: var(--geo-bg); color: var(--geo); font-weight: 700; display: grid; place-items: center; font-size: 13px; }
.mu-del { width: 26px; height: 26px; display: inline-grid; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; transition: color .12s; }
.mu-del:hover { color: var(--ink); }
.mu-del:focus-visible { outline: 2px solid var(--val); outline-offset: 1px; }
.mu-adds { display: flex; gap: 8px; flex-wrap: wrap; }
.mu-add { border: 1px dashed var(--line2); border-radius: 9px; height: 36px; padding: 0 14px; background: transparent; color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.mu-add:hover { border-color: var(--muted); }
.mu-pts { display: flex; flex-direction: column; gap: 8px; }
.mu-pt { border: 1px solid var(--line2); border-radius: 10px; padding: 9px 10px; display: grid; grid-template-columns: 58px 170px minmax(0, 1fr) auto 26px; grid-template-areas: "pn ty . pv x" ". ph ph ph ." ". in in in ."; gap: 6px 10px; align-items: center; cursor: default; }
.mu-pt > .mu-pn { grid-area: pn; } .mu-pt > .mu-ty { grid-area: ty; } .mu-pt > .mu-pv { grid-area: pv; } .mu-pt > .mu-x { grid-area: x; }
.mu-pt > .mu-phr { grid-area: ph; } .mu-pt > .mu-pinfo { grid-area: in; }
.mu-pt.on { border-color: var(--val); box-shadow: 0 0 0 1px var(--val) inset; }
.mu-pt input.mu-pn { width: 58px; font: 700 13px "IBM Plex Mono", monospace; color: #E0475B; text-align: center; padding: 0 4px; }
.mu-ty { background-color: var(--soft) !important; }
.mu-phr { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13.5px; min-width: 0; }
.mu-ax { font-weight: 600; font-family: "IBM Plex Mono", monospace; }
.mu-pv { text-align: right; font-family: "IBM Plex Mono", monospace; color: var(--val); font-size: 13px; line-height: 1.3; display: flex; align-items: baseline; gap: 8px; justify-content: flex-end; }
.mu-pv b { font-weight: 600; font-size: 14px; }
.mu-pv small { font: 11.5px "IBM Plex Sans", system-ui, sans-serif; color: var(--muted); }
/* .mu-pinfo : ligne sous la phrase */ .mu-pinfo { font: 12px "IBM Plex Mono", monospace; color: var(--muted); }
.mu-pinfo:empty { display: none; }
.mu-err { color: var(--danger); font-family: "IBM Plex Sans", system-ui, sans-serif; }
.mu-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.mu-ch { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: .1em; color: var(--muted); }
.mu-ch .sp, .mu-vt .sp { flex: 1; }
.mu-exp { height: 30px; width: 32px; padding: 0; }
.mu-mini { border-radius: 9px; overflow: hidden; background: var(--bg); position: relative; height: 340px; cursor: grab; }
.mu-mini .mu3-tag { font-size: 10.5px; padding: 0 5px; }
.mu-mini .v3d-triad { position: absolute; right: 6px; bottom: 6px; width: 56px; height: 56px; pointer-events: none; }
.mu-mini .hint { padding: 24px; text-align: center; }
.mu-big { font: 600 40px "IBM Plex Mono", monospace; color: var(--val); line-height: 1.05; display: flex; align-items: baseline; gap: 8px; }
.mu-big small { font: 500 16px "IBM Plex Mono", monospace; color: var(--ink); }
.mu-big.mu-wait { align-items: center; height: 42px; }
.mu-big.mu-wait .calc-spin { font-size: 15px; }
.mu-dim { opacity: .45; display: flex; flex-direction: column; gap: 9px; }
.mu-pv .calc-spin { font-size: 13px; }
.mu-pi .v .calc-spin i { width: 12px; height: 12px; }
.mu-maxl { font: 13px "IBM Plex Sans", system-ui, sans-serif; color: var(--muted); }
.mu-bar { display: grid; grid-template-columns: 96px 1fr 128px; gap: 10px; align-items: center; font-size: 12.5px; }
.mu-bars { display: flex; flex-direction: column; gap: 7px; }
.mu-bar .v small { display: inline-block; width: 42px; text-align: right; color: var(--muted); font-size: 11.5px; margin-left: 6px; }
.mu-bar > span:first-child { display: inline-flex; align-items: center; gap: 4px; }
.mu-bx, .mu-bx0 { width: 18px; height: 18px; flex-shrink: 0; }
.mu-bx { border: 0; background: transparent; color: var(--muted); cursor: pointer; padding: 0; font-size: 15px; line-height: 1; border-radius: 4px; transition: transform .15s; }
.mu-bx:hover { color: var(--ink); background: var(--soft); }
.mu-bx.open { transform: rotate(90deg); }
.mu-bsub { display: flex; flex-direction: column; gap: 5px; margin: -2px 0 2px; }
.mu-bsub[hidden] { display: none; }
.mu-bar.lv { color: var(--muted); font-size: 11.5px; }
.mu-bar.lv > span:first-child { padding-left: 22px; }
.mu-bar.lv .t { height: 4px; }
.mu-bar.lv .t i { opacity: .55; }
.mu-bar > span:first-child { font-family: "IBM Plex Mono", monospace; }
.mu-bar .t { height: 6px; background: var(--soft); border-radius: 3px; overflow: hidden; }
.mu-bar .t i { display: block; height: 100%; background: var(--val); }
.mu-bar .v { text-align: right; font-family: "IBM Plex Mono", monospace; }
.mu-bar.more { color: var(--muted); }
.mu-spark { width: 100%; height: 76px; display: block; }
.mu-sx { display: flex; justify-content: space-between; font: 11.5px "IBM Plex Mono", monospace; color: var(--muted); }
.mu-plist { display: flex; flex-direction: column; gap: 2px; }
.mu-pi { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 8px; border-radius: 8px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.mu-pi:hover { background: var(--soft); }
.mu-pi.on { background: var(--soft); }
.mu-pi .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.mu-pi .v { font: 600 13px "IBM Plex Mono", monospace; }
.mu-pn2 { font: 700 13px "IBM Plex Mono", monospace; color: #E0475B; }
.mu-vgrid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.mu-vcard { position: relative; }
.mu-vt { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mu-vt button.ghost { height: 30px; min-width: 32px; padding: 0 8px; }
.mu-big-plan { height: min(70vh, 760px); border-radius: 10px; background: var(--bg); border: 1px solid var(--line); overflow: hidden; cursor: grab; touch-action: none; }
.mu-big-plan:active { cursor: grabbing; }
.mu-big-plan .hint { padding: 40px; text-align: center; }
.mu-big-plan .mu-svg { width: 100%; height: 100%; }
.mu-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; box-shadow: 0 6px 18px var(--shadow); max-width: 240px; margin-top: 50px; }
.mu-svg { width: 100%; height: auto; display: block; }
.mu-svg.mini { aspect-ratio: 1; }
.mu-svg .gr { stroke: var(--line); } .mu-svg .gr.mj { stroke: var(--line2); }
.mu-svg .ground { stroke: var(--muted); }
.mu-svg .under { fill: var(--panel); }
.mu-svg .body { fill: var(--geo-bg); stroke: var(--geo); }
.mu-svg .env { fill: none; stroke: var(--geo); opacity: .85; }
.mu-svg .slab { stroke: var(--muted); }
.mu-svg .mu-c { cursor: pointer; }
.mu-svg .mu-c:hover .body, .mu-svg .mu-c.pick .body { stroke: var(--ink); }
.mu-svg .clab { font-family: "IBM Plex Mono", monospace; font-weight: 500; text-anchor: middle; dominant-baseline: middle; fill: var(--ink); pointer-events: none; paint-order: stroke; stroke: var(--panel); stroke-width: .18em; }
.mu-svg .csub { font-family: "IBM Plex Sans", system-ui, sans-serif; text-anchor: middle; dominant-baseline: middle; fill: var(--muted); pointer-events: none; }
.mu-svg .mu-p { cursor: pointer; color: #E0475B; }
.mu-svg .mu-p polyline { stroke: #E0475B; opacity: .7; }
.mu-svg .mu-p.on polyline { opacity: 1; }
.mu-svg .mu-p circle { fill: #E0475B; }
.mu-svg .mu-p circle.tg { fill: none; stroke: var(--ink); }
.mu-svg .mu-p circle.tgh { fill: none; stroke: var(--bg); opacity: .5; }
.mu-svg .mu-p circle.tgc { fill: var(--ink); }
.mu-svg .mu-p circle.hit { fill: transparent; }
.mu-svg .mu-p:not(.on) circle.tg, .mu-svg .mu-p:not(.on) circle.tgc { opacity: .8; }
.mu-svg .mu-p circle.mx { fill: none; stroke: #E0475B; }
.mu-svg .mu-p text { font-family: "IBM Plex Mono", monospace; font-weight: 500; fill: #E0475B; paint-order: stroke; stroke: var(--bg); stroke-width: .25em; }
.mu-svg .mu-axes text { font-family: "IBM Plex Mono", monospace; font-weight: 500; }
.mu-svg .mu-step { fill: var(--muted); font-family: "IBM Plex Mono", monospace; }
.mu-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); align-items: center; }
.mu-legend span { display: inline-flex; gap: 6px; align-items: center; }
.mu-legend .sw { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.mu-legend .sw.body { background: var(--geo-bg); border: 1px solid var(--geo); }
.mu-legend .sw.hot { background: var(--val); }
.mu-legend .sw.slab { background: repeating-linear-gradient(45deg, var(--muted) 0 1px, transparent 1px 4px); border: 1px solid var(--muted); }
.mu-legend .sw.env { border: 1px dashed var(--geo); }
.mu-legend .sw.pt { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--ink); background: radial-gradient(circle, var(--ink) 0 2px, transparent 2.5px); box-sizing: border-box; }
.mu-scard { position: relative; cursor: pointer; }
.mu-scard .mu-sdel { position: absolute; top: 8px; right: 8px; text-decoration: none; font-size: 15px; }
.nt-pcard.mu-new { align-items: center; justify-content: center; border-style: dashed; color: var(--muted); min-height: 110px; }
.nt-pcard.mu-new:disabled { cursor: default; opacity: .6; }
.mu-svg .mu-cote line { stroke: var(--muted); }
.mu-svg .mu-cote text { fill: var(--muted); font-family: "IBM Plex Mono", monospace; text-anchor: middle; paint-order: stroke; stroke: var(--bg); stroke-width: .3em; }
.mu-svg .mu-cote.pt line, .mu-svg .mu-cote.h line { stroke: #E0475B; opacity: .8; }
.mu-svg .mu-cote.pt text, .mu-svg .mu-cote.h text { fill: #E0475B; }
.mu-vt button.ghost.on { background: var(--pill); color: var(--on-ink); border-color: var(--pill); }
.mu-big-plan.is3d { position: relative; cursor: grab; }
.mu-big-plan.is3d canvas { display: block; }
.mu-big-plan .v3d-triad { position: absolute; right: 10px; bottom: 10px; width: 78px; height: 78px; pointer-events: none; }
.mu3-tag { position: absolute; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap; font: 600 11.5px "IBM Plex Mono", monospace; padding: 1px 6px; border-radius: 5px; }
.mu3-tag.lab { background: var(--panel); color: var(--ink); border: 1px solid var(--line2); }
.mu3-tag.pt { color: #fff; background: #E0475B; }
.mu3-tag.pt.oth { opacity: .72; }
.mu3-tag.dim { color: var(--ink); background: var(--soft); border: 1px solid var(--line2); font-weight: 500; }
/* vue du hangar en pleine page (comme la cartographie d'un cas) */
#view-home .nt.mu-vue { overflow: hidden; display: flex; flex-direction: column; }
.nt.mu-vue #mu-body { flex: 1; min-height: 0; padding: 0; position: relative; }
/* onglet Multi-colis de la modélisation */
#page-multi.on { display: flex; flex-direction: column; overflow: auto; }
#page-multi.mu-vue { overflow: hidden; }
#page-multi.mu-vue #mu-body { flex: 1; min-height: 0; padding: 0; position: relative; }
#page-multi #mu-body { padding: 4px 20px 30px; }
.mu-sbar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 20px 8px; }   /* scènes à gauche, bascule au milieu */
.mu-sl { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: thin; padding-bottom: 2px; }
.mu-sl > * { flex-shrink: 0; }
.mu-slab { color: var(--muted); font-size: 12.5px; margin-right: 4px; }
.mu-chip { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.mu-chip:hover { color: var(--ink); }
.mu-chip.on { background: var(--soft); color: var(--ink); border-color: var(--muted); padding: 0 2px 0 4px; cursor: default; }
.mu-chip.on input { border: 0; background: transparent; color: var(--ink); font: 600 13px "IBM Plex Sans", system-ui, sans-serif; padding: 0 4px; height: 26px; min-width: 0; width: auto; border-radius: 5px; }
.mu-chip.on input:focus { outline: none; background: var(--panel); }
.mu-chip.on .mu-del { width: 22px; height: 22px; }
.mu-chip .mu-del.armed { color: var(--danger); }
.mu-chip.add { border-style: dashed; }
.mu-none { padding: 8px 20px; margin: 0; }
.mu-tseg { flex-shrink: 0; }
.mu-full { position: absolute; inset: 0; }
.mu-full .mu-big-plan { position: absolute; inset: 0; height: auto; border: 0; border-radius: 0; }
.mu-fl { position: absolute; z-index: 4; }
.mu-fl.tc { top: 14px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; align-items: center; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 5px; box-shadow: 0 4px 14px var(--shadow); }
.mu-fl.tc .seg { border: 0; } .mu-fl.tc button.ghost { height: 30px; }
.mu-fl.tr { top: 14px; right: 14px; width: 310px; max-height: calc(100% - 80px); overflow: auto; position: absolute; }
.mu-fl.tr .mu-card { box-shadow: 0 4px 14px var(--shadow); border-color: var(--line2); }
.mu-fl.bl { left: 14px; bottom: 14px; display: flex; gap: 6px; align-items: center; }
.mu-fl.bl button.ghost { height: 34px; min-width: 36px; padding: 0 10px; background: var(--panel); }
.mu-fl.tl { top: 14px; left: 14px; max-width: calc(50% - 280px); }
.mu-fl.tl .hint { display: inline-block; background: var(--panel); border: 1px solid var(--line2); border-radius: 8px; padding: 4px 9px; font-size: 12px; }
.mu-fl.br { right: 14px; bottom: 14px; background: var(--panel); border: 1px solid var(--line2); border-radius: 10px; padding: 7px 12px; }
.mu-full .v3d-triad { right: 14px; bottom: 58px; }
.mu-rowsl { display: flex; flex-direction: column; gap: 8px; }
.mu-rowc { border: 1px solid var(--line2); border-radius: 10px; padding: 9px 10px; display: flex; flex-direction: column; gap: 8px; }
.mu-rl1 { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.mu-rl1 .mu-gl { align-self: center; }
.mu-rowc { position: relative; padding-right: 44px; }
.mu-rowc > .mu-del { position: absolute; top: 8px; right: 8px; }
.mu-rf { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.mu-rf input.w-n { width: 58px; }
.mu-rf .mu-in { width: 96px; }
.mu-rpos { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: 13.5px; padding-left: 34px; }
.mu-rpos .mu-in.w { width: 92px; }
.mu-rpos .linkbtn { margin-left: 4px; }
.mu-rpos .mu-nw { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }   /* « décalée de … le long de la rangée » passe à la ligne d'un bloc */
.mu-rnote { padding-left: 34px; font-size: 12px; color: var(--muted); margin-top: -4px; }
/* fil d'Ariane dans la page (note de calcul, multi-dimensionnement) */
.in-crumbs { font-size: 15px; height: 40px; }
.in-crumbs .crumb-cur { font-size: 15px; }
.mu-top { padding: 14px 24px 10px; }
.mu-top input.mu-cname { border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--ink); font: 600 15px "IBM Plex Sans", system-ui, sans-serif; padding: 3px 6px; margin-left: -2px; min-width: 0; max-width: 420px; }
.mu-top input.mu-cname:hover { border-color: var(--line2); }
.mu-top input.mu-cname:focus { border-color: var(--muted); background: var(--panel); outline: none; }
.mu-mrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 22px; align-items: start; }
.mu-mrow.mu-vB { grid-template-columns: 1fr; }
.mu-msel { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mu-msel select { height: 36px; width: 100%; padding: 0 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); }
.mu-mlab { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.mu-mlab .mu-open { border: 0; background: none; padding: 2px; border-radius: 4px; color: var(--muted); cursor: pointer; display: inline-grid; place-items: center; }
.mu-mlab .mu-open:hover { color: var(--ink); background: var(--soft); }
.mu-fA { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 18px 0 0; font-size: 13px; }
.mu-fA dt { color: var(--muted); font-size: 12px; }
.mu-fA dd { margin: 0; color: var(--ink); }
.mu-fB { font-size: 12.5px; color: var(--muted); margin-top: -2px; }
.mu-fC { display: flex; flex-direction: column; gap: 3px; margin-top: 16px; padding-left: 12px; border-left: 2px solid var(--line2); font-size: 13px; color: var(--muted); }
.mu-fC span:first-child { color: var(--ink); }

.mu-fl.bl .mu-flsep { width: 1px; height: 22px; background: var(--line2); margin: 0 4px; }
.mu-fl.bl button.ghost.on, .mu-cotes-tab.on { background: var(--pill); color: var(--on-ink); border-color: var(--pill); }
.mu-cotes-tab { height: 30px; padding: 0 12px; }
.mode-toggle.mu-mt { left: 14px; top: 14px; transform: none; }
.mu-legend .sw.b3 { background: #2f7f78; border-color: #3a958c; }
.mu-legend .sw.hot { width: 30px; background: linear-gradient(90deg, var(--geo-bg), var(--val)); border: 1px solid var(--line2); }
.mu-legend .sw.e3 { border: 1px solid var(--muted); background: color-mix(in srgb, var(--muted) 30%, transparent); }
.mu-legend .sw.s3 { background: color-mix(in srgb, var(--muted) 60%, transparent); border: 1px solid var(--muted); }
.mu-legend .sw.path { width: 18px; height: 0; border-radius: 0; border-top: 2px dashed #E0475B; }
.mu-legend .sw.cote { width: 18px; height: 0; border-radius: 0; border-top: 1.5px solid var(--muted); position: relative; }
.mu-legend .sw.cote::before, .mu-legend .sw.cote::after { content: ""; position: absolute; top: -5px; width: 1.5px; height: 8px; background: var(--muted); }
.mu-legend .sw.cote::before { left: 0; } .mu-legend .sw.cote::after { right: 0; }
.mu-mini.is2d { cursor: zoom-in; }
.mu-mini.is2d .mu-svg { width: 100%; height: 100%; }
.mu-mleg { font-size: 12px; gap: 12px; }
/* en-têtes de section du multi-dimensionnement : le choix Espacement passe à la ligne au lieu de déborder */
#mu-body .card-head { flex-wrap: wrap; align-items: center; row-gap: 8px; }
#mu-body .card-head > span:not(.mu-hr) { flex: 1 1 160px; min-width: 0; }
#mu-body .card-head .mu-hr { margin-left: auto; flex-shrink: 0; }
.mu3-tag.pin { transform: translate(-50%, calc(-50% - 30px)); }
.mu-mini .mu3-tag.pin { transform: translate(-50%, calc(-50% - 24px)); }
.mu-phr .mu-nw { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
/* Multi-colis, Vue du hangar : panneau du point remonté dans la barre des scènes (colonne de droite libre) */
#page-multi.mu-vue .mu-fl.tr { top: -40px; max-height: calc(100% + 26px); z-index: 6; }

/* valeur du point : zone à droite du débit */
.mu-bigrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- v0.25 : connexion, utilisateur connecté, comptes et accès ---------- */
.login-page { overflow: auto; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(900px 600px at 50% 30%, color-mix(in srgb, var(--geo) 10%, transparent), transparent 60%), var(--bg); }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 32px 32px 26px; box-shadow: 0 30px 80px var(--shadow); display: flex; flex-direction: column; }
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-brand canvas { width: 64px; height: 64px; }
.login-brand b { font-size: 22px; letter-spacing: .38em; padding-left: .38em; color: var(--ink); }
.login-brand span { color: var(--muted); font-size: 13px; font-weight: 500; }
.login-info { font-size: 13px; color: var(--muted); line-height: 1.5; margin: 0 0 4px; }
.login-l { font-size: 12.5px; color: var(--muted); margin: 14px 0 6px; }
.login-in { height: 42px; border: 1px solid var(--line2); border-radius: 9px; background: var(--field); padding: 0 12px; font-size: 14px; width: 100%; }
.login-in:focus { outline: none; border-color: var(--geo); box-shadow: 0 0 0 3px color-mix(in srgb, var(--geo) 18%, transparent); }
.login-pw { position: relative; }
.login-pw .login-in { padding-right: 42px; }
.login-eye { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.login-eye:hover { color: var(--ink); }
.login-rem { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--muted); cursor: pointer; }
.login-rem input { accent-color: var(--geo); width: 16px; height: 16px; }
.login-btn { margin-top: 20px; height: 44px; border-radius: 9px; border: 0; background: var(--dose); color: var(--on-ink); font-weight: 600; font-size: 15px; cursor: pointer; }
.login-btn:disabled { opacity: .6; cursor: default; }
.login-err { margin-top: 12px; font-size: 12.5px; color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); border: 1px solid color-mix(in srgb, var(--danger) 30%, transparent); border-radius: 8px; padding: 8px 10px; }
.login-foot { margin: 18px 0 0; font-size: 12px; color: var(--muted); text-align: center; line-height: 1.5; }
.login-link { margin-top: 14px; border: 0; background: none; color: var(--muted); font-size: 12.5px; cursor: pointer; text-decoration: underline; }
/* inscription à la bêta (v0.27) */
#login-body { display: flex; flex-direction: column; }
.login-card.login-wide { width: min(520px, 100%); }
.login-pill { font-style: normal; margin-left: 10px; font: 500 11.5px "IBM Plex Mono", monospace; color: var(--geo); border: 1px solid color-mix(in srgb, var(--geo) 45%, transparent); background: color-mix(in srgb, var(--geo) 10%, transparent); border-radius: 999px; padding: 3px 10px 3px 9px; vertical-align: 1px; }
.login-pill::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--geo); margin-right: 7px; vertical-align: 2px; }
.login-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.login-row > div { display: flex; flex-direction: column; min-width: 0; }
@media (max-width: 460px) { .login-row { grid-template-columns: 1fr; gap: 0; } }
.login-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.login-cgu { align-items: flex-start; line-height: 1.5; }
.login-cgu input { margin-top: 2px; flex: none; }
.login-a, .login-cgu a { color: var(--geo); text-decoration: none; }
.login-a:hover, .login-cgu a:hover { text-decoration: underline; }
.login-forgot { align-self: flex-end; font-size: 12.5px; margin-top: 8px; }
.login-forgot + .login-rem { margin-top: 6px; }
.login-center { text-align: center; }
.login-info b { color: var(--ink); }
.login-mail { width: 52px; height: 52px; margin: 2px auto 14px; border: 1px solid var(--line2); border-radius: 12px; display: grid; place-items: center; color: var(--geo); }
.login-btn-ghost { background: none; border: 1px solid var(--line2); color: var(--ink); }
.login-btn-ghost:hover { border-color: var(--muted); }
.login-btn-a { display: grid; place-items: center; text-decoration: none; }
.login-wrap { align-content: center; }
.login-legal { margin: 18px 0 0; font-size: 12px; color: var(--muted); text-align: center; }
.login-legal a { color: var(--muted); text-decoration: none; }
.login-legal a:hover { color: var(--ink); text-decoration: underline; }
/* pages légales (v0.27) */
.legal-wrap { min-height: 100vh; padding: 40px 16px 60px; background: radial-gradient(900px 600px at 50% 0%, color-mix(in srgb, var(--geo) 9%, transparent), transparent 60%), var(--bg); }
.legal-wrap > * { max-width: 780px; margin-left: auto; margin-right: auto; }
.legal-top { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.legal-top img { width: 32px; height: 32px; }
.legal-top b { letter-spacing: .38em; font-size: 16px; color: var(--ink); }
.legal-back { margin-left: auto; color: var(--muted); font-size: 13.5px; text-decoration: none; }
.legal-back:hover { color: var(--ink); }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.legal-tabs a { font-size: 13.5px; color: var(--muted); padding: 7px 13px; border: 1px solid var(--line2); border-radius: 999px; text-decoration: none; }
.legal-tabs a:hover { color: var(--ink); }
.legal-tabs a.on { color: var(--ink); border-color: var(--geo); background: color-mix(in srgb, var(--geo) 9%, transparent); }
.legal-card { background: var(--panel); border: 1px solid var(--line2); border-radius: 16px; padding: 40px 48px 34px; box-shadow: 0 30px 80px var(--shadow); }
.legal-card h1 { font-size: 30px; font-weight: 600; margin: 0 0 6px; letter-spacing: -.01em; color: var(--ink); }
.legal-ver { font: 12.5px "IBM Plex Mono", monospace; color: var(--muted); margin-bottom: 24px; }
.legal-card section { border-top: 1px solid var(--line); padding: 20px 0 4px; }
.legal-card h2 { font-size: 17px; font-weight: 600; margin: 0 0 10px; display: flex; gap: 12px; align-items: baseline; color: var(--ink); }
.legal-card h2 span { font: 500 12px "IBM Plex Mono", monospace; color: var(--geo); min-width: 18px; }
.legal-card p, .legal-card li, .legal-card td { font-size: 14.5px; line-height: 1.68; color: color-mix(in srgb, var(--ink) 82%, var(--muted)); }
.legal-card p { margin: 0 0 12px; }
.legal-card ul { margin: 0 0 12px; padding-left: 20px; }
.legal-card li { margin-bottom: 6px; }
.legal-card li::marker { color: var(--geo); }
.legal-card b { color: var(--ink); font-weight: 600; }
.legal-card table { width: 100%; border-collapse: collapse; margin: 4px 0 14px; }
.legal-card th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line2); }
.legal-card td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-card td:last-child { color: var(--muted); width: 38%; }
.legal-foot { margin-top: 24px; font-size: 12.5px; color: var(--muted); text-align: center; }
.legal-foot a { color: var(--muted); text-decoration: none; }
.legal-foot a:hover { color: var(--ink); text-decoration: underline; }
@media (max-width: 640px) { .legal-card { padding: 28px 20px 22px; } .legal-card h1 { font-size: 24px; } .legal-card td:last-child { width: 42%; } }
.login-err.login-ok { color: var(--geo); background: color-mix(in srgb, var(--geo) 9%, transparent); border-color: color-mix(in srgb, var(--geo) 30%, transparent); text-align: center; }
/* barre latérale : compte connecté */
.sb-foot { display: flex; flex-direction: column; gap: 8px; }
.sb-user:empty { display: none; }
.sb-user { display: flex; align-items: center; gap: 10px; }
.u-av { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: var(--geo-bg); color: var(--geo); display: grid; place-items: center; font-weight: 600; font-size: 12.5px;
  border: 1px solid color-mix(in srgb, var(--geo) 35%, transparent); }
.u-txt { display: flex; flex-direction: column; min-width: 0; }
.u-txt b { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.u-txt small { font-size: 11.5px; color: var(--muted); }
.u-out { margin-left: auto; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line2); background: var(--soft); color: var(--muted); display: grid; place-items: center; cursor: pointer; flex-shrink: 0; }
.u-out:hover { color: var(--ink); border-color: var(--muted); }
.sb-ico.on { color: var(--geo); border-color: color-mix(in srgb, var(--geo) 45%, transparent); }
.sb-ico[hidden] { display: none; }
/* écran Comptes et accès */
#view-home .ac { overflow: auto; padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 18px; min-height: 0; max-width: 1240px; }
#view-home .ac[hidden] { display: none; }
.ac-head { display: flex; align-items: flex-end; gap: 14px; }
.ac-head h1 { margin: 0 0 4px; font-size: 26px; }
.ac-head .sp { flex: 1; }
.ac-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; }
.ac-card h3 { margin: 0 0 4px; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.ac-dot { width: 8px; height: 8px; border-radius: 50%; background: #3FBF6A; }
.ac-url { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ac-url code { font: 500 16px "IBM Plex Mono", monospace; background: var(--field); border: 1px solid var(--line2); border-radius: 8px; padding: 8px 14px; color: var(--geo); }
.ac-url button.ghost.small, .ac-acts button.ghost.small { margin-left: 0; }
.ac-tbl { padding: 6px 8px; overflow-x: auto; }
.ac-tbl table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ac-tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ac-tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ac-tbl tr:last-child td { border-bottom: 0; }
.ac-tbl tr.dis td:not(:last-child) { opacity: .55; }
.ac-nm { display: flex; align-items: center; gap: 11px; }
.ac-nm small { display: block; color: var(--muted); font: 12px "IBM Plex Mono", monospace; }
.ac-org, .ac-nm small.ac-org { display: block; color: var(--muted); font: 11.5px "IBM Plex Sans", sans-serif; margin-top: 2px; }
.ac-role { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.ac-role.admin { background: var(--dose-bg); color: var(--dose); border: 1px solid color-mix(in srgb, var(--dose) 30%, transparent); }
.ac-role.user { background: var(--geo-bg); color: var(--geo); border: 1px solid color-mix(in srgb, var(--geo) 30%, transparent); }
.ac-st { white-space: nowrap; } .ac-st.ok { color: #3FBF6A; } .ac-st.pend { color: var(--warn); } .ac-st.off { color: var(--muted); }
.ac-when { font: 12.5px "IBM Plex Mono", monospace; color: var(--muted); white-space: nowrap; }
.ac-acts { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
button.ghost.dng { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
button.primary.danger { background: var(--danger); color: #fff; }
.ac-seg { display: flex; border: 1px solid var(--line2); border-radius: 9px; overflow: hidden; margin-top: 6px; }
.ac-seg button { flex: 1; height: 38px; border: 0; background: var(--field); color: var(--muted); cursor: pointer; font-size: 13.5px; }
.ac-seg button.on { background: var(--geo-bg); color: var(--geo); font-weight: 600; }
.ac-cred { display: grid; gap: 8px; }
.ac-cred div { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--soft); border-radius: 9px; padding: 9px 12px; }
.ac-cred small { color: var(--muted); font-size: 12.5px; }
.ac-cred code { font: 500 14px "IBM Plex Mono", monospace; }
.ac-cred code.pw { color: var(--geo); font-size: 16px; letter-spacing: .04em; }
.ac-note { background: var(--soft); border-radius: 10px; padding: 10px 12px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.ac-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line2); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.ac-opt input { margin-top: 3px; accent-color: var(--geo); }
.ac-opt span { display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.ac-opt small { color: var(--muted); font-size: 12px; }
.hint.err { color: var(--danger); }
.hint.err:empty { display: none; }
/* Edge ajoute son propre œil « afficher le mot de passe » : on garde seulement celui d'Hélios */
.login-in::-ms-reveal, .login-in::-ms-clear, input[type=password]::-ms-reveal, input[type=password]::-ms-clear { display: none; }
/* mots de passe : champs texte masqués (le navigateur ne propose pas de les enregistrer) */
.pwd { -webkit-text-security: disc; font-family: "IBM Plex Mono", monospace; letter-spacing: .08em; }
/* barre réduite : bouton Calcul rapide plus grand et centré */
body.sb-collapsed .quick-row { width: 44px; justify-content: center; align-self: center; }
body.sb-collapsed .home-quick { width: 44px; height: 44px !important; margin: 0 auto; justify-content: center; }
body.sb-collapsed .home-quick .btn-ico { width: 21px; height: 21px; }
/* rangée d'icônes (Accueil, Comptes, Thème, Réduire, Déconnexion) répartie sur toute la largeur ;
   menu Ressources en bas à droite, sur la ligne de la version */
.sb-icons { gap: 0; justify-content: space-between; }
.sb-ico { width: 40px; height: 40px; border-radius: 10px; }
.sb-ico svg { width: 18px; height: 18px; }
.sb-foot { flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; }
.sb-res { width: 32px; height: 32px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--line2); background: var(--soft); color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.sb-res:hover { color: var(--ink); border-color: var(--muted); }
body.sb-collapsed .sb-foot { display: flex !important; justify-content: center; padding-left: 0; padding-right: 0; }
body.sb-collapsed .sb-foot .sb-ver { display: none; }
body.sb-collapsed .sb-icons { gap: 8px; justify-content: flex-start; }
.sb-ico.sb-out { color: var(--muted); }
.sb-ico.sb-out:hover { color: var(--ink); }
/* barre réduite : l'éclair exactement au centre (le libellé masqué ne doit plus réserver d'écart) */
body.sb-collapsed #home-quick { gap: 0; padding: 0 !important; justify-content: center; }

/* ---------- v0.26 : bibliothèque (spectres types, matériaux), freinage des β ---------- */
#view-home .lb { overflow: auto; padding: 26px 30px 40px; display: flex; flex-direction: column; gap: 16px; min-height: 0; max-width: 1240px; }
#view-home .lb[hidden] { display: none; }
.lb-head { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.lb-head h1 { margin: 2px 0 4px; font-size: 26px; }
.lb-head .sp { flex: 1; }
.lb-head .linkbtn { padding: 0; font-size: 12.5px; }
a.ghost.lb-a { height: 34px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line2); background: var(--panel); color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; font-size: 14px; }
.lb-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.lb-tabs button { border: 0; background: none; padding: 10px 14px; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.lb-tabs button.on { color: var(--ink); font-weight: 600; border-color: var(--geo); }
.lb-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.lb-pad { padding: 16px 18px; }
.lb-pad b { font-size: 14px; }
.lb-pad .hint { margin: 6px 0 0; line-height: 1.5; }
.lb-tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.lb-tbl th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb-tbl td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.lb-tbl tr:last-child td { border-bottom: 0; }
.lb-tbl tbody tr[data-sid], .lb-tbl tbody tr[data-mid] { cursor: pointer; }
.lb-tbl tbody tr[data-sid]:hover, .lb-tbl tbody tr[data-mid]:hover { background: var(--soft); }
.lb-tbl .r { text-align: right; }
.lb-tbl.small td, .lb-tbl.small th { padding: 6px 10px; font-size: 12.5px; }
.lb-tbl tr.inconnu td { color: var(--danger); }
.lb-tbl tr.ignoré td { color: var(--muted); }
.lb-nm b { display: block; font-weight: 600; }
.lb-nm small { color: var(--muted); font-size: 12px; }
.lb-chips { display: flex; gap: 5px; flex-wrap: wrap; }
.lb-chip { font: 500 11.5px "IBM Plex Mono", monospace; padding: 2px 7px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line2); white-space: nowrap; }
.lb-chip.b { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.lb-empty { border: 1px dashed var(--line2); border-radius: 14px; padding: 28px; text-align: center; color: var(--muted); }
.lb-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(260px, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .lb-grid { grid-template-columns: 1fr; } }
.lb-side { display: flex; flex-direction: column; gap: 12px; }
.lb-f3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.lb-rows .combo { width: 130px; }
.lb-rows .combo input, .lb-rows input.pct { height: 34px; width: 100%; padding: 0 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); font: 500 13px "IBM Plex Mono", monospace; }
.lb-rows .combo input:focus, .lb-rows input.pct:focus { outline: none; border-color: var(--geo); }
.lb-rows input.pct { width: 90px; text-align: right; }
.lb-rows td.w { width: 30%; }
.lb-bar { height: 8px; border-radius: 4px; background: var(--geo); opacity: .8; min-width: 2px; }
.lb-bar.b { background: var(--warn); }
.lb-rows td.em { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.lb-rows td.em.b { color: var(--warn); }
.lb-add { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
.lb-sum { display: flex; justify-content: space-between; padding: 12px 14px; font-weight: 600; border-top: 1px solid var(--line2); }
.lb-sum .ok, .hint.ok { color: #3FBF6A; }
.lb-sum .warn, .mt-foot .warn { color: var(--warn); }
.mt-foot .ok { color: #3FBF6A; }
.lb-warn { background: var(--warn-bg); color: var(--warn); border-radius: 12px; padding: 11px 14px; font-size: 13px; line-height: 1.45; }
.lb-toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-size: 13.5px; box-shadow: 0 10px 30px var(--shadow); }
.dlg.wide { width: min(680px, calc(100vw - 32px)); }
.imp-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--line2); border-radius: 12px; padding: 22px; color: var(--muted); font-size: 13.5px; cursor: pointer; text-align: center; }
.imp-drop b { color: var(--ink); }
.imp-drop.over, .imp-drop:hover { border-color: var(--geo); }
.imp-sheet { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.mt-rows { display: flex; flex-direction: column; gap: 6px; max-height: 280px; overflow: auto; }
.mt-row { display: grid; grid-template-columns: 1fr 1fr 32px; gap: 8px; align-items: center; }
.mt-row select, .mt-row input { height: 36px; padding: 0 9px; border: 1px solid var(--line2); border-radius: 6px; background: var(--field); color: var(--ink); min-width: 0; }
.mt-row input { font: 500 13px "IBM Plex Mono", monospace; }
.mt-row select:focus, .mt-row input:focus { outline: none; border-color: var(--geo); }
.mt-foot { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.mt-foot .add-dashed { height: 34px; }
.sf-list { display: flex; flex-direction: column; border: 1px solid var(--line2); border-radius: 10px; overflow: hidden; max-height: 240px; overflow-y: auto; }
.sf-list button { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: var(--panel); color: var(--ink); text-align: left; cursor: pointer; font-size: 13.5px; }
.sf-list button:last-child { border-bottom: 0; }
.sf-list button b { font-weight: 500; }
.sf-list button.on { background: var(--geo-bg); color: var(--geo); }
.sf-list button.on b { font-weight: 600; }
.sf-list .mono { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); }
/* modélisation : ajout de radionucléides, spectre type utilisé */
.nuc-spec { display: flex; align-items: center; gap: 10px; background: var(--geo-bg); border: 1px solid color-mix(in srgb, var(--geo) 35%, transparent); border-radius: 10px; padding: 8px 12px; font-size: 13.5px; margin-bottom: 10px; }
.nuc-spec[hidden] { display: none; }
.nuc-spec svg { width: 16px; height: 16px; color: var(--geo); flex-shrink: 0; }
.nuc-spec b { color: var(--geo); }
.nuc-spec .sp { flex: 1; }
.nuc-spec .linkbtn { font-size: 12.5px; }
.br-tag { font: 600 10.5px "IBM Plex Sans", sans-serif; font-style: normal; padding: 1px 6px; border-radius: 999px; background: var(--warn-bg); color: var(--warn); margin-left: 6px; }
.bar-row.brems .fill { background: var(--warn); }
.bar-row .num .br-tag { margin: 0 8px 0 0; vertical-align: 1px; }
.opt-brems { grid-column: 1 / -1; width: 100%; display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.opt-brems .hint { flex-basis: 100%; margin: 0; }
.nuc-sub { font-size: 14px; margin: 18px 0 8px; }
