/* Charte « Stab Méthodes » — maquettes, version 1 (06/11/2026).
   Les JETONS d'abord (couleurs, typographie, rayons, ombres), les COMPOSANTS ensuite : le site React reprendra ce fichier tel quel.
   Principes : dense mais aéré (grille de 4 px), une seule couleur d'action, le code couleur des taux du bureau
   (rouge > 100 %, vert foncé 95–100 %, vert pâle en dessous), les dessins sur une « feuille » blanche dans les deux thèmes. */

:root {
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Inter Display", "Inter", ui-sans-serif, system-ui, sans-serif;

  --bg: #F4F5F8;
  --bg-sunken: #ECEEF2;
  --panel: #FFFFFF;
  --panel-2: #F9FAFB;
  --line: #E5E8ED;
  --line-strong: #D3D8E0;
  --ink: #0D1525;
  --ink-2: #4A5568;
  --ink-3: #8B95A7;
  --ink-4: #B7BFCB;

  --accent: #2B4BCF;
  --accent-hover: #2340B4;
  --accent-soft: #EEF1FE;
  --accent-line: #CDD6FD;
  --on-accent: #FFFFFF;

  /* le code couleur des taux — tranché par le bureau le 06/11/2026 */
  --nok: #DC2626;
  --att: #15803D;
  --ok-bg: #DCFCE7;
  --ok-ink: #166534;
  --ok-bar: #86EFAC;

  --beton: #C4532E;  --beton-soft: #FCEFE9;
  --acier: #2B4BCF;  --acier-soft: #EEF1FE;
  --autres: #7650D8; --autres-soft: #F2EEFD;

  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-2: 0 1px 2px rgba(16, 24, 40, .05), 0 8px 24px -10px rgba(16, 24, 40, .14);
  --shadow-pop: 0 28px 70px -18px rgba(13, 21, 37, .38), 0 4px 14px rgba(13, 21, 37, .08);

  --r-xs: 5px;
  --r-sm: 7px;
  --r: 10px;
  --r-lg: 14px;

  --paper: #FFFFFF;
  --frame: rgba(16, 24, 40, .10);
  --shadow-frame: 0 1px 2px rgba(16, 24, 40, .05), 0 16px 40px -18px rgba(16, 24, 40, .30);
  --dot: #D5DAE2;
  --nav-w: 236px;
  --rail-w: 60px;
  --top-h: 56px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0A0E16;
  --bg-sunken: #070A10;
  --panel: #111621;
  --panel-2: #0E131C;
  --line: #1D2531;
  --line-strong: #2A3343;
  --ink: #E8EBF1;
  --ink-2: #AAB3C3;
  --ink-3: #758197;
  --ink-4: #4A5568;
  --accent: #7088FF;
  --accent-hover: #8C9FFF;
  --accent-soft: #19213A;
  --accent-line: #2D3B69;
  --on-accent: #0A0E16;
  --nok: #EF4444;
  --att: #22A35A;
  --ok-bg: #123321;
  --ok-ink: #86EFAC;
  --ok-bar: #2F8F55;
  --beton: #F08B63;  --beton-soft: #2A1A13;
  --acier: #8C9FFF;  --acier-soft: #19213A;
  --autres: #B49CF6; --autres-soft: #201936;
  --shadow-1: none;
  --shadow-2: 0 0 0 1px rgba(255, 255, 255, .02), 0 14px 34px -14px rgba(0, 0, 0, .7);
  --shadow-pop: 0 34px 90px -22px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .05);
  --dot: #1A2230;
  --frame: rgba(255, 255, 255, .09);
  --shadow-frame: 0 0 0 1px rgba(0, 0, 0, .25), 0 22px 50px -20px rgba(0, 0, 0, .85);
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
svg.i { width: 16px; height: 16px; flex: none; stroke-width: 1.75; }
.num, .chip, td.n, .field input { font-variant-numeric: tabular-nums; }
sub { font-size: .72em; vertical-align: -.25em; line-height: 0; }
.muted { color: var(--ink-3); }
.ink2 { color: var(--ink-2); }

/* ---------------------------------------------------------------- l'application */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.app.rail { grid-template-columns: var(--rail-w) 1fr; }
.main { min-width: 0; display: flex; flex-direction: column; }

/* la navigation */
.nav {
  position: sticky; top: 0; height: 100vh; overflow: hidden;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 14px 12px 12px; gap: 2px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 14px; }
.logo {
  width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: linear-gradient(145deg, #3B5BE0, #2238A8); color: #fff;
  display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), 0 2px 6px rgba(43, 75, 207, .35);
}
.logo svg { width: 18px; height: 18px; }
.wordmark { font-family: var(--font-display); font-size: 15px; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; }
.wordmark span { display: block; font-size: 11px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; margin-top: 2px; }
.searchbtn {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px; margin: 0 2px 10px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--panel-2); color: var(--ink-3);
}
.searchbtn kbd, .kbd {
  margin-left: auto; font: 500 10.5px var(--font); color: var(--ink-3); border: 1px solid var(--line);
  border-radius: 4px; padding: 1px 5px; background: var(--panel);
}
.navlabel { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 10px 6px; }
.navitem {
  display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 500; white-space: nowrap;
}
.navitem:hover { background: var(--bg); color: var(--ink); }
.navitem.on { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
[data-theme="dark"] .navitem.on { color: var(--accent); }
.navitem .count { margin-left: auto; font-size: 11px; color: var(--ink-3); font-weight: 500; }
.navitem .fam { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; flex: none; }
.navitem .fam svg { width: 14px; height: 14px; }
.navsub { padding-left: 8px; }
.navsub .navitem { height: 29px; font-size: 12.5px; }
.navfoot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.storage { padding: 0 8px; font-size: 11.5px; color: var(--ink-3); }
.storage .bar { height: 4px; border-radius: 4px; background: var(--bg-sunken); margin-top: 6px; overflow: hidden; }
.storage .bar b { display: block; height: 100%; width: 4%; background: var(--accent); border-radius: 4px; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none;
  font-size: 11px; font-weight: 700; color: #fff; background: #2B4BCF; letter-spacing: .02em;
}
.avatar.sm { width: 22px; height: 22px; font-size: 9.5px; }
.avatar.a2 { background: #0E9384; } .avatar.a3 { background: #C4532E; } .avatar.a4 { background: #7650D8; }
.avstack { display: flex; }
.avstack .avatar { box-shadow: 0 0 0 2px var(--panel); margin-left: -4px; }
.avstack .avatar:first-child { margin-left: 0; }
.me .who { line-height: 1.2; min-width: 0; }
.me .who b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me .who span { display: block; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .btn.icon { margin-left: auto; width: 28px; height: 28px; }

/* la navigation repliée en rail, dans un module */
/* « > .nav » : ces règles ne visent QUE la barre ; le volet des modules et les onglets des paramètres ont aussi des
   .navitem, qui garderaient sinon la taille d'une icône et rogneraient leur nom des deux côtés */
.app.rail > .nav { padding: 12px 10px; align-items: center; }
.app.rail > .nav .brand { padding: 2px 0 12px; }
.app.rail > .nav .navitem { width: 40px; height: 40px; padding: 0; justify-content: center; }
.app.rail > .nav .navitem svg.i { width: 18px; height: 18px; }
.app.rail > .nav .sep { width: 24px; height: 1px; background: var(--line); margin: 8px 0; }
.app.rail > .nav { overflow: visible; z-index: 20; }
.app.rail > .nav .navitem { position: relative; }
.app.rail > .nav .navitem[data-tip]:hover::after { content: attr(data-tip); position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  white-space: nowrap; background: var(--ink); color: var(--panel); font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px;
  box-shadow: var(--shadow-2); pointer-events: none; z-index: 30; }
/* le volet des modules : la deuxième navigation, à côté de la barre, jamais mélangée à celle des projets */
.modpanel { position: fixed; top: 0; bottom: 0; left: var(--rail-w); width: 292px; z-index: 19; display: none; flex-direction: column; gap: 2px;
  padding: 16px 12px; overflow: auto; background: var(--panel); border-right: 1px solid var(--line); box-shadow: var(--shadow-pop); }
.show-modules .modpanel { display: flex; }
.modpanel .mp-h { display: flex; align-items: center; gap: 8px; padding: 2px 6px 8px; }
.modpanel .mp-h .h2 { margin-right: auto; }
.modpanel .navlabel { padding: 12px 8px 4px; }
.modpanel .navitem { height: 34px; }
.modpanel .navitem .modic { width: 24px; height: 24px; border-radius: 7px; }
.modpanel .navitem .modic svg { width: 15px; height: 15px; }
.modpanel .navitem .ok { margin-left: auto; color: var(--accent); display: grid; }
.modpanel .navitem .ok svg.i { width: 15px; height: 15px; }

/* ---------------------------------------------------------------- la barre du haut */
.top {
  height: var(--top-h); display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5;
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-weight: 500; min-width: 0; white-space: nowrap; }
.crumbs svg.i { width: 14px; height: 14px; color: var(--ink-4); }
.crumbs b { color: var(--ink); font-weight: 600; }
.indice {
  display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; color: var(--ink); background: var(--panel); border: 1px solid var(--line-strong);
}
.tag { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.tag.draft { background: var(--bg-sunken); color: var(--ink-2); }
.tag.pub { background: var(--accent-soft); color: var(--accent-hover); }
[data-theme="dark"] .tag.pub { color: var(--accent); }
.tag .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.saved { display: flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: 12px; }
.saved svg.i { color: var(--att); width: 15px; height: 15px; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- boutons et champs */
.btn {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); font-weight: 600; font-size: 12.5px;
  box-shadow: var(--shadow-1); white-space: nowrap;
}
.btn:hover { background: var(--panel-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 1px 2px rgba(43, 75, 207, .3), inset 0 1px 0 rgba(255, 255, 255, .12); }
.btn.primary:hover { background: var(--accent-hover); }
.btn.ghost { border-color: transparent; box-shadow: none; background: transparent; color: var(--ink-2); }
.btn.icon { width: 32px; padding: 0; justify-content: center; }
.btn.soft { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-hover); box-shadow: none; }
[data-theme="dark"] .btn.soft { color: var(--accent); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 12px; }

.seg {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--bg-sunken);
  border: 1px solid var(--line);
}
.seg button { height: 26px; padding: 0 10px; border-radius: 5px; font-size: 12px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .10), 0 0 0 1px var(--line); }
[data-theme="dark"] .seg button.on { background: var(--line-strong); box-shadow: none; }
.seg.full { display: flex; } .seg.full button { flex: 1; }

.field {
  display: flex; align-items: center; height: 30px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--panel); padding: 0 9px; gap: 6px; min-width: 0;
}
.field input { border: 0; outline: 0; background: transparent; width: 100%; text-align: right; font-weight: 500; font-size: 13px; }
.field .u { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.field.locked { background: var(--panel-2); }
.field.locked input { color: var(--ink-2); }
.field.focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.field.select { justify-content: space-between; cursor: pointer; }
.field.select .v { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field.select svg.i { color: var(--ink-3); width: 15px; height: 15px; }
.field.text input { text-align: left; }
.switch { width: 30px; height: 18px; border-radius: 999px; background: var(--line-strong); position: relative; flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch.on { background: var(--accent); } .switch.on::after { left: 14px; }

/* ---------------------------------------------------------------- les pastilles du code couleur */
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 46px; height: 22px; padding: 0 8px;
  border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap;
}
.chip.r { background: var(--nok); color: #fff; }
.chip.f { background: var(--att); color: #fff; }
.chip.p { background: var(--ok-bg); color: var(--ok-ink); }
.chip.xl { height: 46px; padding: 0 14px; font-size: 26px; border-radius: 11px; letter-spacing: -.03em; font-family: var(--font-display); }
.chip.xl small { font-size: 13px; font-weight: 600; opacity: .8; margin-right: 2px; letter-spacing: 0; }
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status.p { background: var(--ok-bg); color: var(--ok-ink); }
.status.f { background: var(--att); color: #fff; }
.status.r { background: var(--nok); color: #fff; }
.status.c { background: var(--bg-sunken); color: var(--ink-2); }
.chip.c { background: var(--bg-sunken); color: var(--ink-3); font-weight: 600; }
.pct.c { color: var(--ink-3); font-weight: 600; }
.status .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bar { height: 4px; border-radius: 4px; background: var(--bg-sunken); overflow: hidden; }
.bar b { display: block; height: 100%; border-radius: 4px; }
.bar b.r { background: var(--nok); } .bar b.f { background: var(--att); } .bar b.p { background: var(--ok-bar); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 11.5px; color: var(--ink-3); }
.legend .chip { min-width: 0; height: 18px; font-size: 10.5px; padding: 0 6px; border-radius: 5px; }

/* ---------------------------------------------------------------- cartes, titres, tableaux */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.h1 { font-family: var(--font-display); font-size: 26px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.h2 { font-family: var(--font-display); font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.h3 { font-size: 13px; font-weight: 650; }
.kicker { font-size: 10.5px; font-weight: 650; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--ink-3); padding: 0 12px; height: 34px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--panel-2); }
.table td { padding: 0 12px; height: 46px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td.n, .table th.n { text-align: right; }
.table tr.sel td { background: var(--accent-soft); }
.table tr.sel td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.mod { display: inline-flex; align-items: center; gap: 8px; }
.modic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; flex: none; }
.modic svg { width: 16px; height: 16px; }
.modic.beton { background: var(--beton-soft); color: var(--beton); }
.modic.acier { background: var(--acier-soft); color: var(--acier); }
.modic.autres { background: var(--autres-soft); color: var(--autres); }

/* ---------------------------------------------------------------- l'accueil */
.page { padding: 28px 36px 40px; display: grid; grid-template-columns: 1fr 312px; gap: 28px; align-items: start; max-width: 1440px; }
.hello { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; grid-column: 1 / -1; }
.hello .sub { color: var(--ink-3); margin-top: 6px; font-size: 13.5px; }
.bigsearch { display: flex; align-items: center; gap: 10px; height: 40px; width: 400px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); color: var(--ink-3); box-shadow: var(--shadow-1); white-space: nowrap; overflow: hidden; }
.bigsearch > span:not(.kbd) { overflow: hidden; text-overflow: ellipsis; }
.sechead { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.sechead .h2, .sechead .h3 { margin-right: auto; }
.resume { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 30px; }
.rcard { overflow: hidden; display: flex; flex-direction: column; }
.thumb {
  position: relative;
  height: 150px; background: var(--paper); border-bottom: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; padding: 10px;
}
.thumb svg { width: 100% !important; height: 100% !important; }
.rcard .body { padding: 12px 14px 13px; display: flex; flex-direction: column; gap: 4px; }
.rcard .t { font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb .chip { position: absolute; top: 10px; right: 10px; box-shadow: 0 1px 2px rgba(16, 24, 40, .12); }
.rcard .m { color: var(--ink-3); font-size: 12px; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; }
.rcard .m svg.i { width: 14px; height: 14px; }
.fam { margin-bottom: 22px; }
.famhead { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.famhead .pill { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; border-radius: 6px; }
.famhead .pill.beton { background: var(--beton-soft); color: var(--beton); }
.famhead .pill.acier { background: var(--acier-soft); color: var(--acier); }
.famhead .pill.autres { background: var(--autres-soft); color: var(--autres); }
.famhead .muted { font-size: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.tile { display: flex; gap: 10px; align-items: center; padding: 9px 12px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-1); min-height: 52px; }
.tile > div { flex: 1; min-width: 0; }
.tile .ok { display: grid; flex: none; color: var(--accent); }
.tile .ok svg.i { width: 17px; height: 17px; }
.okleg { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--ink-3); }
.okleg svg.i { width: 14px; height: 14px; color: var(--accent); }
.tile:hover { border-color: var(--accent-line); box-shadow: var(--shadow-2); }
.tile .modic { display: grid; width: 36px; height: 36px; border-radius: 10px; }
.tile .modic svg { width: 21px; height: 21px; }
.tile b { display: block; font-size: 13px; font-weight: 650; line-height: 1.3; }
.tile span { display: block; font-size: 11.5px; color: var(--ink-3); line-height: 1.35; }
.tile .new { margin-left: auto; font-size: 10px; font-weight: 700; color: var(--accent-hover); background: var(--accent-soft); border-radius: 5px; padding: 1px 6px; align-self: flex-start; }
.side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }
.side .card { padding: 16px; }
.site { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.site:first-of-type { border-top: 0; }
.site .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--bg); display: grid; place-items: center; color: var(--ink-2); flex: none; }
.site b { display: block; font-size: 12.5px; }
.site span { font-size: 11.5px; color: var(--ink-3); }
.site .nb { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.site .chips { margin-left: auto; display: flex; gap: 4px; }
.site .chips .chip { min-width: 24px; height: 20px; font-size: 11px; padding: 0 6px; }
.feed { display: flex; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.4; }
.feed:first-of-type { border-top: 0; }
.feed .when { color: var(--ink-3); font-size: 11.5px; display: block; margin-top: 2px; }
.btn.big { height: 40px; padding: 0 16px; }
/* au téléphone seulement : le choix de la famille et la flèche des tuiles */
.seg.mfam, .tile .chev { display: none; }

/* ---------------------------------------------------------------- les projets */
.proj { display: grid; grid-template-columns: 268px 1fr 360px; min-height: calc(100vh - var(--top-h)); }
.tree { border-right: 1px solid var(--line); background: var(--panel); padding: 14px 10px; display: flex; flex-direction: column; gap: 1px; }
.tree .field { margin: 0 4px 12px; height: 32px; }
.node { display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--r-sm); color: var(--ink-2); font-weight: 500; white-space: nowrap; }
.node svg.i { color: var(--ink-3); width: 15px; height: 15px; }
.node .count { margin-left: auto; font-size: 11px; color: var(--ink-3); }
.node.l1 { padding-left: 26px; }
.node.on { background: var(--accent-soft); color: var(--accent-hover); font-weight: 600; }
.node.on svg.i { color: var(--accent); }
[data-theme="dark"] .node.on { color: var(--accent); }
.node.chantier { color: var(--ink); font-weight: 600; }
.list { padding: 22px 26px; min-width: 0; }
.list .head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; }
.list .head .h1 { font-size: 22px; }
.list .card { overflow: hidden; }
.drawer { border-left: 1px solid var(--line); background: var(--panel); padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.drawer .thumb { height: 170px; border: 1px solid var(--line); border-radius: var(--r); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 12.5px; }
.facts dt { color: var(--ink-3); }
.facts dd { font-weight: 500; text-align: right; }
.timeline { display: flex; flex-direction: column; }
.ver { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; padding: 10px 0; position: relative; }
.ver::before { content: ""; position: absolute; left: 13px; top: 36px; bottom: -10px; width: 1px; background: var(--line); }
.ver:last-child::before { display: none; }
.ver .indice { width: 28px; height: 28px; border-radius: 8px; font-size: 12.5px; }
.ver.cur .indice { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.ver b { font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.ver p { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.ver .when { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.ver.old b, .ver.old p { color: var(--ink-3); }
.oldprev { position: relative; width: 150px; margin-top: 8px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #fff; }
.oldprev img { display: block; width: 100%; filter: grayscale(1); opacity: .5; }
.oldprev span { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-18deg); padding: 2px 10px; border: 2.5px solid rgba(220, 38, 38, .7);
  border-radius: 6px; color: rgba(220, 38, 38, .75); font: 800 22px/1.1 var(--font-display); letter-spacing: .14em; }
/* au téléphone seulement : la liste en cartes et la fiche qui monte du bas */
.mlist, .drawer .grab, .drawer .dclose, .fscrim { display: none; }
.mrow { display: flex; gap: 12px; align-items: flex-start; padding: 13px 14px; border-top: 1px solid var(--line); }
.mrow:first-child { border-top: 0; }
.mrow .modic { width: 34px; height: 34px; border-radius: 9px; }
.mrow .modic svg { width: 19px; height: 19px; }
.mrow .mt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.mrow .mt b { font-size: 14px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .mt > span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mrow .mm { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.mrow .mm .indice { height: 20px; min-width: 20px; font-size: 11px; }
.mrow .mm .tag { height: 20px; font-size: 11px; }

/* ---------------------------------------------------------------- l'équipe : qui entre, qui fait quoi, quels modules sont validés */
.team { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 22px; padding: 24px 28px 40px; max-width: 1340px; align-items: start; }
.tmain { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.team .card { padding: 16px 18px; }
.team .card.flush { padding: 0; overflow: hidden; }
.team .card.flush .sechead { padding: 14px 18px 0; }
.tscroll { overflow-x: auto; }
.invrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 8px; }
.invrow .field { flex: 1 1 260px; height: 36px; }
.invrow .btn { height: 36px; }
.who2 { display: flex; align-items: center; gap: 10px; }
.who2 > div b { display: block; font-size: 13px; font-weight: 650; }
.who2 > div span { display: block; font-size: 11.5px; color: var(--ink-3); }
.role { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 650; }
.role.admin { background: var(--accent-soft); color: var(--accent-hover); }
[data-theme="dark"] .role.admin { color: var(--accent); }
.role.membre { background: var(--bg-sunken); color: var(--ink-2); }
.role svg.i { width: 13px; height: 13px; }
.etat { font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.etat .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--att); }
.etat.inv { color: var(--ink-3); } .etat.inv .dot { background: var(--ink-4); }
.rights { display: flex; flex-direction: column; gap: 12px; margin-top: 10px; }
.rights > div { display: grid; grid-template-columns: 30px 1fr; gap: 10px; font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }
.rights .ic { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--bg); color: var(--ink-2); }
.rights b { display: block; color: var(--ink); font-size: 13px; margin-bottom: 1px; }

/* ---------------------------------------------------------------- les paramètres : ceux du bureau, puis ceux de chaque module */
.params { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; padding: 24px 28px 40px; max-width: 1260px; align-items: start; }
.ptabs { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--top-h) + 16px); }
.ptabs .navlabel { padding: 12px 10px 4px; }
.ptabs .navitem .modic { width: 22px; height: 22px; border-radius: 6px; }
.ptabs .navitem .modic svg { width: 14px; height: 14px; }
.pcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.pcard { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; }
.pcard .h3 { display: flex; align-items: center; gap: 8px; }
.pcard .rows { padding: 0; }
.pcard .row.full { grid-template-columns: 150px minmax(0, 1fr); }
.phint { font-size: 12px; color: var(--ink-2); line-height: 1.5; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--r); padding: 10px 12px; }

/* ---------------------------------------------------------------- « Nouvelle note » : le chantier, puis le module */
.modal { position: fixed; inset: 0; z-index: 40; display: none; place-items: center; padding: 24px; background: rgba(13, 21, 37, .38); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.show-nouvelle .modal { display: grid; }
.mcard { width: min(780px, 100%); max-height: calc(100vh - 48px); overflow: auto; background: var(--panel); border: 1px solid var(--frame); border-radius: 16px; box-shadow: var(--shadow-pop); }
.mcard .mh { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.mcard .mh .h2 { margin-right: auto; }
.mcard .mb { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; }
.mcard .mf { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.mrow3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mrow3 label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-2); font-weight: 500; }
.mgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.mopt { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 9px; font-weight: 600; font-size: 12.5px; cursor: pointer; }
.mopt .modic { width: 24px; height: 24px; border-radius: 7px; }
.mopt .modic svg { width: 15px; height: 15px; }
.mopt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.mlabel { grid-column: 1 / -1; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 6px 2px 0; }

/* ---------------------------------------------------------------- les sections d'une poutre (sollicitations) */
.secards { display: flex; flex-direction: column; gap: 8px; }
.secard { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; background: var(--panel); }
.secard.on { border-color: var(--accent-line); box-shadow: inset 3px 0 0 var(--accent); }
.secard .sh2 { display: flex; align-items: center; gap: 8px; font-weight: 650; font-size: 12.5px; }
.secard .sh2 .muted { font-weight: 500; }
.secard .sh2 .pct { margin-left: auto; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.trio label { display: flex; flex-direction: column; gap: 3px; font-size: 11px; color: var(--ink-3); font-weight: 600; }
.trio .field { height: 30px; padding: 0 7px; }
.trio .field input { font-size: 12.5px; }
.lit { display: grid; grid-template-columns: 74px minmax(0, 1fr) minmax(0, 1fr); gap: 6px; align-items: center; }
.lit > span { font-size: 12px; color: var(--ink-2); }
.addrow { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--accent-hover); cursor: pointer; padding: 2px 0; }
[data-theme="dark"] .addrow { color: var(--accent); }
.addrow svg.i { width: 14px; height: 14px; }

/* ---------------------------------------------------------------- l'établi d'un module
   La TOILE occupe toute la largeur ; les données et le résultat flottent dessus, dans deux cadres de verre dépoli
   qu'on replie pour rendre la place au dessin. Le dessin se centre dans l'espace libre entre les deux cadres. */
.bench { --pl: 340px; --pr: 336px; --g: 10px; position: relative; height: calc(100vh - var(--top-h)); min-height: 0; overflow: hidden; }
.bench.sans-g { --pl: 44px; }
.bench.sans-d { --pr: 44px; }
.panel { position: absolute; top: var(--g); bottom: var(--g); z-index: 4; display: flex; flex-direction: column; min-height: 0; overflow: hidden;
  background: color-mix(in srgb, var(--panel) 90%, transparent); -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--frame); border-radius: 16px; box-shadow: var(--shadow-frame); transition: width .22s ease; }
.panel.left { left: var(--g); width: var(--pl); }
.panel.right { right: var(--g); width: var(--pr); }
.pbody { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.phead { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.phead .h3 { margin-right: auto; font-size: 13.5px; }
.pcoll { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 7px; color: var(--ink-3); flex: none; }
.pcoll:hover { background: var(--bg); color: var(--ink); }
.pcoll svg.i { width: 16px; height: 16px; }
.bench.sans-g .panel.left, .bench.sans-d .panel.right { bottom: auto; }
.bench.sans-g .panel.left > :not(.phead), .bench.sans-d .panel.right > :not(.phead) { display: none; }
.bench.sans-g .panel.left .phead > :not(.pcoll), .bench.sans-d .panel.right .phead > :not(.pcoll) { display: none; }
.bench.sans-g .panel.left .phead, .bench.sans-d .panel.right .phead { padding: 0 7px; border-bottom: 0; }

/* plusieurs éléments dans une note : la liste en tête des données, comme des calques */
.notelist { padding: 10px 8px 10px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 1px; }
.notelist .nl-h { display: flex; align-items: center; padding: 0 8px 6px; }
.notelist .nl-h .kicker { margin-right: auto; }
.ni { display: flex; align-items: center; gap: 9px; height: 34px; padding: 0 8px; border-radius: 9px; cursor: pointer; }
.ni:hover { background: var(--bg); }
.ni.on { background: var(--accent-soft); }
.ni .modic { width: 22px; height: 22px; border-radius: 6px; }
.ni .modic svg { width: 14px; height: 14px; }
.ni .t { flex: 1; min-width: 0; font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ni .t span { font-weight: 500; color: var(--ink-3); }
.pct { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.pct.f { color: var(--att); } .pct.r { color: var(--nok); }
.nl-mod { font-size: 10.5px; font-weight: 650; color: var(--ink-3); padding: 6px 8px 2px; }
.nl-add { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 8px; border-radius: 9px; color: var(--accent-hover); font-weight: 600; font-size: 12.5px; cursor: pointer; }
.nl-add:hover { background: var(--accent-soft); }
[data-theme="dark"] .nl-add { color: var(--accent); }

.sec { border-bottom: 1px solid var(--line); }
.sec > summary, .sechd { list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; cursor: pointer; }
.sechd .n { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: var(--ink-2); background: var(--bg-sunken); flex: none; }
.sec.open .sechd .n { background: var(--accent); color: var(--on-accent); }
.sechd .tt { font-weight: 650; font-size: 13px; }
.sechd .sum { color: var(--ink-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; text-align: right; }
.sechd svg.i { color: var(--ink-3); width: 15px; height: 15px; }
.rows { padding: 0 16px 14px; display: flex; flex-direction: column; gap: 8px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) 132px; align-items: center; gap: 10px; }
.row.full { grid-template-columns: 84px minmax(0, 1fr); }
.row > label { color: var(--ink-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; }
.row > label > span:not(.sym) { overflow: hidden; text-overflow: ellipsis; }
.rows .grp { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 6px 0 0; }
.row > label .sym { color: var(--ink); font-weight: 600; }
.row > label svg.i { width: 13px; height: 13px; color: var(--ink-4); }
.src { font-size: 10px; font-weight: 650; letter-spacing: .02em; color: var(--ink-4); border: 1px solid var(--line); border-radius: 5px; padding: 0 5px; line-height: 15px; flex: none; }
.src.mod { color: var(--accent-hover); border-color: var(--accent-line); background: var(--accent-soft); }
[data-theme="dark"] .src.mod { color: var(--accent); }
/* un champ changé pour cette note : la valeur du bureau reste écrite en dessous */
.avec-bureau { display: flex; flex-direction: column; align-items: stretch; gap: 2px; min-width: 0; }
.avec-bureau .was { font-size: 10.5px; color: var(--ink-4); text-align: right; white-space: nowrap; }
.row .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.4; padding: 2px 0 0; }
.hint b { color: var(--ink-2); font-weight: 600; }

.canvas { position: absolute; inset: 0; display: flex; flex-direction: column; min-width: 0;
  padding: 0 calc(var(--pr) + 2 * var(--g)) 0 calc(var(--pl) + 2 * var(--g)); transition: padding .22s ease;
  background: var(--bg); }
.ctool { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 0 0; }
.ctool .seg { grid-column: 2; box-shadow: var(--shadow-1); background: var(--panel); }
.ctool .seg button.on { background: var(--ink); color: var(--panel); box-shadow: none; }
[data-theme="dark"] .ctool .seg button.on { background: var(--accent); color: var(--on-accent); }
.zoom { grid-column: 3; justify-self: end; display: flex; align-items: center; gap: 2px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 2px; box-shadow: var(--shadow-1); }
.zoom button { width: 28px; height: 26px; display: grid; place-items: center; border-radius: 5px; color: var(--ink-2); }
.zoom span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); padding: 0 4px; white-space: nowrap; }
.stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px 0 10px; }
.sheet { position: relative; background: var(--paper); border-radius: 12px; box-shadow: var(--shadow-2); border: 1px solid var(--line); width: 100%; height: 100%;
  display: flex; flex-direction: column; overflow: hidden; color: #0D1525; }
.sheet .stitle { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px 0; white-space: nowrap; min-width: 0; }
.sheet .stitle b { font-size: 11px; letter-spacing: .09em; font-weight: 700; }
.sheet .stitle span { font-size: 11.5px; color: #8B95A7; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.sheet .stitle .scale { margin-left: auto; font-size: 11px; color: #8B95A7; border: 1px solid #E5E8ED; border-radius: 5px; padding: 1px 6px; flex: none; }
.cart { display: flex; border-top: 1px solid #E5E8ED; font-size: 10.5px; color: #8B95A7; }
.cart > div { padding: 6px 12px; border-left: 1px solid #E5E8ED; display: flex; flex-direction: column; gap: 1px; white-space: nowrap; min-width: 0; }
.cart > div:first-child { border-left: 0; flex: 1; }
.cart b { color: #0D1525; font-size: 11.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.cart .mark { flex-direction: row; align-items: center; gap: 6px; color: #0D1525; font-weight: 700; font-size: 11px; }
.cart .mark i { width: 14px; height: 14px; border-radius: 4px; background: linear-gradient(145deg, #3B5BE0, #2238A8); display: inline-block; }
.sheet .draw { flex: 1; min-height: 0; display: grid; place-items: center; padding: 6px 18px 12px; }
.sheet .draw svg { width: 100% !important; height: 100% !important; max-height: 100%; }
.view { display: none; } .view.on { display: contents; }
.strip { display: flex; gap: 10px; padding: 0 0 14px; overflow-x: auto; }
.strip > :first-child { margin-left: auto; } .strip > :last-child { margin-right: auto; }
.mini { flex: none; width: 96px; display: flex; flex-direction: column; gap: 5px; align-items: center; cursor: pointer; }
.mini .pic { width: 96px; height: 58px; border-radius: 8px; background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: grid; place-items: center; overflow: hidden; padding: 4px; }
.mini .pic svg { width: 100% !important; height: 100% !important; }
.mini span { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.mini.on .pic { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-line); }
.mini.on span { color: var(--ink); }

/* le résultat : un verdict, puis une ligne par élément (nom, profilé, taux, jauge) ; le détail s'ouvre au clic */
.verdict { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.verdict .gov { font-size: 12.5px; line-height: 1.4; color: var(--ink-2); min-width: 0; }
.verdict .gov b { color: var(--ink); font-weight: 650; display: block; font-size: 13px; }
.els { display: flex; flex-direction: column; }
.el { padding: 10px 16px 11px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; cursor: pointer; }
.el:hover { background: color-mix(in srgb, var(--bg) 70%, transparent); }
.el.gov { box-shadow: inset 3px 0 0 var(--accent); }
.el.sel { background: var(--accent-soft); }
.el .l1 { display: flex; align-items: center; gap: 10px; min-width: 0; }
.el .l1 b { font-weight: 650; font-size: 13px; white-space: nowrap; flex: none; }
.el .l2 { display: flex; align-items: center; gap: 12px; }
.el .l2 .bar { flex: 1; height: 6px; }
.el .l2 .pct { flex: none; min-width: 40px; text-align: right; font-size: 13px; color: var(--ink); }
.el .l2 .pct.f { color: var(--att); } .el .l2 .pct.r { color: var(--nok); }
.prof { display: inline-flex; align-items: center; gap: 3px; min-width: 0; height: 22px; padding: 0 6px; margin-left: auto; margin-right: -6px; border-radius: 6px;
  color: var(--ink-3); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.prof span { overflow: hidden; text-overflow: ellipsis; }
.prof svg.i { width: 13px; height: 13px; flex: none; }
.prof .leger { color: #E0A100; display: inline-flex; flex: none; overflow: visible; }
button.prof:hover { background: var(--panel); color: var(--ink); box-shadow: 0 0 0 1px var(--line-strong); }
.elgrp { display: flex; align-items: center; gap: 8px; padding: 12px 16px 7px; border-bottom: 1px solid var(--line); background: var(--panel-2);
  font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.elgrp .pct { margin-left: auto; letter-spacing: 0; font-size: 12px; }
.pfoot { flex: none; padding: 12px 16px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 9px; }
.pfoot .mass { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-2); }
.pfoot .mass b { color: var(--ink); }

/* les volets qui s'ouvrent à côté du résultat : le sélecteur de profilés et le calcul */
.flyout { position: absolute; z-index: 6; top: 60px; right: calc(var(--pr) + 2 * var(--g)); width: 316px; display: none; flex-direction: column;
  background: var(--panel); border: 1px solid var(--frame); border-radius: 14px; box-shadow: var(--shadow-pop); overflow: hidden; }
.flyout.on { display: flex; }
.fl-h { display: flex; align-items: flex-start; gap: 8px; padding: 12px 8px 10px 14px; border-bottom: 1px solid var(--line); }
.fl-h > div { min-width: 0; margin-right: auto; }
.fl-h b { display: block; font-size: 13px; }
.fl-h span { display: block; font-size: 11.5px; color: var(--ink-3); }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.fchip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px; border-radius: 999px; border: 1px solid var(--line-strong); font-size: 11.5px; font-weight: 600; color: var(--ink-2); background: var(--panel); cursor: pointer; }
.fchip svg.i { width: 13px; height: 13px; }
.fchip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
[data-theme="dark"] .fchip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.pk-list { max-height: calc(12 * 34px + 8px); overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; scroll-snap-type: y proximity; }
.pk-row { display: grid; grid-template-columns: 16px minmax(0, 1fr) 42px 52px; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 12px; text-align: left; scroll-snap-align: start; }
.pk-row:hover { background: var(--bg); }
.pk-row .mk { display: grid; place-items: center; color: transparent; }
.pk-row .mk svg.i { width: 14px; height: 14px; }
.pk-row .nm { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-row .kg { text-align: right; color: var(--ink-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.pk-row .chip { min-width: 0; width: 52px; height: 22px; font-size: 11.5px; padding: 0 4px; }
.pk-row.opt .mk { color: #E0A100; }
.pk-row.cur { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.pk-row.cur .mk { color: var(--accent); }
.pk-prop { padding: 8px 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--ink-2); line-height: 1.45; min-height: 34px; }
.fl-foot { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 14px 10px; border-top: 1px solid var(--line); font-size: 11px; color: var(--ink-3); }
.fl-foot span { display: inline-flex; align-items: center; gap: 4px; }
.fl-foot svg.i { width: 12px; height: 12px; }
.flyout.calcul { width: min(1060px, calc(100% - var(--pr) - 4 * var(--g))); top: var(--g); max-height: calc(100% - 2 * var(--g)); }
.ck-hyp { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.ck-hyp span { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--bg); color: var(--ink-2); }
.ck-hyp b { color: var(--ink); font-weight: 650; }
.vtab { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.vtab th { text-align: left; font-size: 10.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); padding: 10px 10px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.vtab td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; font-variant-numeric: tabular-nums; }
.vtab th.n, .vtab td.n { text-align: right; white-space: nowrap; }
.vtab td.v { font-weight: 650; white-space: nowrap; }
.vtab td.fo { color: var(--ink-2); font-style: italic; }
.vtab td.nm { font-weight: 650; white-space: nowrap; }
.vtab td.nm span { display: block; font-weight: 500; font-size: 11.5px; color: var(--ink-3); }
.vtab tr.gov td { background: var(--accent-soft); }
.vtab tr.gov td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.vtab .chip { min-width: 58px; }
.ck-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.ck-sub { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); padding: 14px 0 2px; }
.ck-body { overflow: auto; max-height: calc(100vh - var(--top-h) - 150px); padding: 4px 16px 14px; }
.ck-g { padding: 10px 0 6px; border-top: 1px solid var(--line); }
.ck-g:first-child { border-top: 0; }
.ck-t { font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.fx { display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px; padding: 3px 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.fx .s { font-weight: 650; color: var(--ink); font-style: italic; }
.fx .eq { color: var(--ink-4); }
.fx .r { font-weight: 700; color: var(--ink); }
.fx .chip { height: 20px; min-width: 0; font-size: 11px; padding: 0 6px; }
.ck-autres { margin-top: 6px; font-size: 11.5px; color: var(--ink-3); }

/* la pastille de validation d'un module (accordée par un administrateur) et le statut d'un indice */
.valid { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; }
.valid svg.i { width: 13px; height: 13px; }
.valid.ok { color: var(--accent-hover); background: var(--accent-soft); }
[data-theme="dark"] .valid.ok { color: var(--accent); }
.valid.non { color: var(--ink-3); border: 1px dashed var(--line-strong); }
.tag.old { background: var(--bg-sunken); color: var(--ink-3); }
.tag.menu svg.i { width: 12px; height: 12px; margin-right: -2px; }

/* ---------------------------------------------------------------- tablette et téléphone */
@media (max-width: 1360px) {
  /* la colonne du résultat doit tenir « Armatures inférieures » et « 3Ø20 · 942 mm² » sur une ligne : 300 px laissaient
     ses points de suspension à « 942 m… » (débordement de 0,08 px, mesuré au texte près) */
  .bench { --pl: 304px; --pr: 316px; --g: 12px; }
  .el { padding-left: 14px; padding-right: 14px; }
  .row { grid-template-columns: minmax(0, 1fr) 118px; }
  .sheet .stitle span, .zoom, .saved .txt { display: none; }
  .ctool .seg button { padding: 0 8px; }
  .tiles { grid-template-columns: repeat(3, 1fr); }
  .page { grid-template-columns: 1fr 280px; padding: 24px 26px; }
  .proj { grid-template-columns: 236px 1fr 316px; }
  .bigsearch { width: 300px; }
}
.mtop, .mtabs, .mbar, .mhead, .mnav { display: none; }
[data-go], [data-fiche], [data-theme-toggle] { cursor: pointer; }
@media (max-width: 700px) {
  body { font-size: 14px; }
  .app, .app.rail { grid-template-columns: 1fr; }
  .nav, .top { display: none; }
  .mtop { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 6; }
  .mtop .t { min-width: 0; line-height: 1.2; }
  .mtop .t b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mtop .t span { font-size: 11.5px; color: var(--ink-3); }
  .mtop .chip { margin-left: auto; }
  .mtabs { display: block; padding: 10px 14px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 54px; z-index: 5; }
  .mtabs .seg button { height: 32px; font-size: 13px; }
  .mbar { display: flex; gap: 8px; position: sticky; left: 0; right: 0; bottom: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); z-index: 7; }
  .mbar .btn { flex: 1; height: 42px; justify-content: center; font-size: 14px; }
  /* l'onglet remplit l'écran : la barre du bas reste en bas même quand le contenu est court (onglet Dessin) */
  .bench { display: flex; flex-direction: column; flex: 1 0 auto; height: auto; overflow: visible; }
  .bench > .panel, .bench > .canvas { flex: 1 0 auto; }
  .panel, .canvas { display: none; }
  .panel { position: static; width: auto !important; border: 0; border-radius: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel); }
  .pbody { overflow: visible; }
  .canvas { position: static; padding: 0; }
  .bench[data-tab="donnees"] .panel.left, .bench[data-tab="resultat"] .panel.right { display: flex; }
  .bench[data-tab="dessin"] .canvas { display: flex; }
  .sheet .stitle span { display: none; }
  .cart > div:nth-child(n+3) { display: none; }
  .phead { display: none; }
  .row { grid-template-columns: minmax(0, 1fr) 148px; }
  .field { height: 36px; }
  .field input { font-size: 15px; }
  .chip { height: 24px; }
  /* les bandes qui défilent s'estompent à droite : on devine qu'il y a une suite */
  .ctool { display: flex; padding: 12px 12px 0; overflow-x: auto; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .zoom { display: none; }
  .stage { flex: none; padding: 12px 10px; }
  .strip { justify-content: flex-start; }
  .sheet { height: auto; min-height: 300px; }
  .strip { padding: 0 12px 14px; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .mini { width: 88px; } .mini .pic { width: 88px; height: 56px; }
  /* les volets (profilés, calcul) montent du bas, par-dessus l'onglet ouvert ; le fond s'assombrit */
  .flyout { position: fixed; top: 44px !important; left: 0; right: 0; bottom: 0; width: auto; border-radius: 18px 18px 0 0; z-index: 21; }
  .bench.fly::after { content: ""; position: fixed; inset: 0; background: rgba(13, 21, 37, .32); z-index: 20; }
  .pk-list, .ck-body { max-height: none; flex: 1; }
  /* la grande fenêtre de calcul devient, elle aussi, une feuille pleine largeur : sa largeur de PC (la toile moins la
     colonne de droite) ne laisserait au téléphone qu'une colonne de quelques pixels */
  .flyout.calcul { width: auto; max-height: none; }
  .vtab th.fo, .vtab td.fo { display: none; }
  .vtab th, .vtab td { padding-left: 4px; padding-right: 4px; }
  .vtab { font-size: 12px; table-layout: fixed; }
  .vtab th:nth-child(1) { width: 34%; } .vtab th:nth-child(5) { width: 54px; }
  .vtab td.nm, .vtab td.n, .vtab td.v, .vtab th.n { white-space: normal; overflow-wrap: anywhere; }
  .vtab .chip { min-width: 0; width: 50px; padding: 0 2px; font-size: 11px; }
  .ck-cols { grid-template-columns: minmax(0, 1fr); }
  .pcoll[data-coll] { display: none; }
  /* les paramètres : une colonne ; les onglets deviennent une bande qui défile */
  .params { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 12px 14px 24px; }
  .ptabs { flex-direction: row; position: static; overflow-x: auto; gap: 4px; padding-bottom: 2px;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .ptabs .navlabel { display: none; }
  .ptabs .navitem { flex: none; white-space: nowrap; }
  .pgrid { grid-template-columns: minmax(0, 1fr); }
  .pcard .row.full { grid-template-columns: 112px minmax(0, 1fr); }

  /* l'en-tête et les onglets du bas, pour l'accueil et les projets */
  .mhead { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 16px; position: sticky; top: 0; z-index: 6;
    background: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
  .mhead .logo { width: 28px; height: 28px; }
  .mhead .ttl { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.015em; white-space: nowrap; }
  .mhead .btn.icon { width: 38px; height: 38px; }
  .mhead .btn.icon svg.i { width: 19px; height: 19px; }
  .mnav { display: grid; grid-template-columns: repeat(5, 1fr); position: sticky; bottom: 0; margin-top: auto; z-index: 7;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(12px); }
  .mnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0 3px; font-size: 11px; font-weight: 600; color: var(--ink-3); }
  .mnav a svg.i { width: 22px; height: 22px; stroke-width: 1.7; }
  .mnav a.on { color: var(--accent); }

  /* l'accueil : une colonne, les rapports récents défilent de côté, une famille de modules à la fois */
  .page { grid-template-columns: minmax(0, 1fr); padding: 18px 16px 26px; gap: 26px; }
  .hello { flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 0; }
  .hello > div:first-child { flex: 1 0 100%; }
  .hello .h1 { font-size: 24px; }
  .hello .spacer, .bigsearch .kbd, .hello .btn .lbl { display: none; }
  .bigsearch { flex: 1 1 0; width: auto; min-width: 0; height: 44px; }
  .hello .btn.big { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .hello .btn.big svg.i { width: 20px; height: 20px; }
  .resume { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory;
    margin: 0 -16px 28px; padding: 0 16px 4px; scroll-padding: 0 16px; scrollbar-width: none; }
  .resume > * { scroll-snap-align: start; }
  .seg.mfam { display: flex; margin-bottom: 12px; }
  .mfam button { height: 34px; font-size: 13px; }
  .fams .fam { display: none; margin-bottom: 0; }
  .fams[data-fam="beton"] .fam.beton, .fams[data-fam="acier"] .fam.acier, .fams[data-fam="autres"] .fam.autres { display: block; }
  .famhead { display: none; }
  .tiles { grid-template-columns: minmax(0, 1fr); gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
  .tile { align-items: center; min-height: 0; padding: 11px 14px; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; }
  .tile:first-child { border-top: 0; }
  .tile > div { flex: 1; min-width: 0; }
  .tile b { font-size: 14px; }
  .tile span { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tile .chev { display: block; color: var(--ink-4); }
  .side { position: static; }
  .team { grid-template-columns: minmax(0, 1fr); padding: 16px; gap: 16px; }

  /* les projets : les dossiers en pastilles qui défilent, les rapports en cartes, la fiche monte du bas */
  .proj { display: block; min-height: 0; }
  .tree { flex-direction: row; align-items: center; gap: 6px; overflow-x: auto; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .tree .field, .tree .navlabel { display: none; }
  .node { flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
  .node.l1 { padding-left: 12px; }
  .node .count { margin-left: 2px; }
  .node.on { border-color: var(--accent-line); }
  .tree .btn { flex: none; margin: 0 !important; }
  .list { padding: 18px 16px 24px; }
  .list .head { margin-bottom: 14px; }
  .list .head .seg, .list .tablecard { display: none; }
  .mlist { display: block; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
  .fscrim { position: fixed; inset: 0; background: rgba(13, 21, 37, .32); z-index: 20; }
  .show-fiche .fscrim { display: block; }
  .drawer { position: fixed; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; z-index: 21; border-left: 0; border-radius: 18px 18px 0 0;
    padding: 8px 16px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-pop);
    transform: translateY(104%); visibility: hidden; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s linear .28s; }
  .show-fiche .drawer { transform: none; visibility: visible; transition: transform .28s cubic-bezier(.2, .8, .2, 1), visibility 0s; }
  .drawer .grab { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 2px auto 0; }
  .drawer > * { flex-shrink: 0; }
  .drawer .dclose { display: inline-flex; position: absolute; top: 6px; right: 8px; z-index: 2; }
  .drawer .thumb { height: 150px; margin-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { .drawer { transition: none !important; } }
