/* RailCap v2 — charte graphique (docs/v2/01_charte_ui.md). Progiciel moderne dans l'esprit d'Odoo, aux couleurs
   Railway Engineering : clair, dense, ergonomique ; jaune = action principale et sélection ; couleurs de
   signalisation = statuts, toujours accompagnées d'un mot. Ce fichier est la SEULE source de couleur : toute
   valeur littérale vit dans :root, le reste n'emploie que var(--…) (tests/test_ui_charte.py). */
:root {
  --bg: #f4f4f1;          /* fond de l'application */
  --sheet: #ffffff;       /* listes, fiches, panneaux */
  --line: #e4e4de;        /* séparateurs */
  --line-2: #d3d3cc;      /* bords des champs et boutons */
  --hover: #f6f6f3;
  --ink: #1e1e1c;         /* titres, texte fort */
  --text: #393936;        /* texte courant */
  --muted: #6c6c66;       /* texte secondaire (AA sur blanc et sur --bg) */
  --faint: #a2a29b;       /* désactivé, repères ; jamais du texte d'information */
  --brand: #f6d860;       /* jaune Railway Engineering : action principale */
  --brand-2: #e9c642;     /* bord et survol du jaune */
  --brand-tint: #fcf3cf;  /* ligne choisie, étape courante, comparaison retenue */
  --link: #17707a;        /* pétrole : liens, filtre actif, jauge normale, série de graphique */
  --link-tint: #e3eff0;
  /* signalisation : statuts seulement, toujours avec un mot */
  --ok: #22743a;   --ok-bg: #e3f2e6;   --ok-track: #cfe7d6;
  --warn: #8f5509; --warn-bg: #fcefd8; --warn-track: #f6dcb0;
  --bad: #ae271e;  --bad-bg: #fbe5e2;  --bad-track: #f4c8c2;
  --info: #235ea3; --info-bg: #e5eef9; --info-track: #c9dbf1;
  --neutral: #5b5b55; --neutral-bg: #ebebe6;
  /* nuances dérivées de la palette (nommées ici pour qu'aucun autre fichier ne porte une couleur) */
  --accent-track: #cfe3e5;   /* piste de la jauge (pétrole clair) */
  --menu-on: #eeeee9;        /* menu actif de la barre */
  --views-on: #e6e6e0;       /* vue active du sélecteur */
  --group-bg: #f7f7f4;       /* lignes de groupe d'une liste */
  --cbx: #b9b9b2;            /* bord des cases à cocher */
  --brand-ink: #6b5300;      /* texte sur jaune clair (badge) */
  --brand-ink-2: #4f3e00;    /* texte du bandeau jaune */
  --brand-line: #f0dc8c;     /* bord du bandeau jaune */
  --info-ink: #1d4b80;       /* texte du bandeau bleu */
  --warn-ink: #6d4006;       /* texte du bandeau orange */
  --warn-fill: #c9800f;      /* remplissage de la jauge orange */
  --scrim: rgba(30, 30, 28, .32);   /* fond assombri des fenêtres */
  --shadow: rgba(0, 0, 0, .22);     /* ombre des fenêtres et menus déroulants */
  --map-bg: #eeeeea;         /* fond de la carte sous les tuiles */
  --map-line: #55554f;       /* corridors */
  --marker-line: #c4c4bc;    /* bord des étiquettes de la carte */
  --marker-sel-line: #c9a92a;
  /* tuiles d'application (§3) */
  --app-fleet: #f6d860;        --app-fleet-ink: #1e1e1c;
  --app-maintenance: #2b2b28;  --app-maintenance-ink: #f6d860;
  --app-workshop: #17707a;     --app-partners: #c4673d;    --app-reports: #e4dccb;
  --app-settings: #8a8a84;     --app-prospects: #5f7f6c;   --on-dark: #ffffff;
  /* avatars : teintes sourdes (§3) */
  --av-teal: #17707a; --av-sage: #5f7f6c; --av-terra: #c4673d; --av-ochre: #9a7418; --av-grey: #8a8a84;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
svg.i { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
svg.i.fill { fill: currentColor; stroke: none; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 600; }
h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 8px; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; color: var(--ink); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.strong { color: var(--ink); font-weight: 600; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.link { color: var(--link); }
.nowrap { white-space: nowrap; }
.t-warn { color: var(--warn); } .t-bad { color: var(--bad); }
.sm { font-size: 13px; } .xs { font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.sep { width: 1px; align-self: stretch; background: var(--line); }
.wrap { flex-wrap: wrap; }
.mt { margin-top: 12px; } .mb { margin-bottom: 12px; }
.pad { padding: 12px 16px; }

/* ---------- coquille : barre de navigation (46 px, blanche) ---------- */
.app-shell { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; display: flex; align-items: stretch; min-height: 0; }
.main > .grow { min-width: 0; }
.nav { height: 46px; background: var(--sheet); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 10px 0 6px; gap: 2px; position: relative; z-index: 3; }
.nav.partners { height: 50px; }
.nav .apps { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); border-radius: 4px; cursor: pointer; list-style: none; }
.nav .apps::-webkit-details-marker { display: none; }
.nav .apps:hover, .dd[open] > .apps { background: var(--neutral-bg); color: var(--ink); }
.nav .app { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--ink); padding: 0 14px 0 4px; white-space: nowrap; }
.nav .app:hover { text-decoration: none; }
.nav .brand { font-size: 17px; letter-spacing: -.01em; }
.nav .brand b { font-weight: 700; }
.tile { width: 22px; height: 22px; border-radius: 5px; display: inline-grid; place-items: center; flex: none; background: var(--neutral-bg); color: var(--ink); }
.tile svg.i { width: 14px; height: 14px; stroke-width: 2; }
.tile.md { width: 28px; height: 28px; border-radius: 6px; } .tile.md svg.i { width: 17px; height: 17px; stroke-width: 2.2; }
.tile.lg { width: 34px; height: 34px; border-radius: 8px; } .tile.lg svg.i { width: 18px; height: 18px; }
.tile.xl { width: 76px; height: 76px; border-radius: 18px; } .tile.xl svg.i { width: 38px; height: 38px; stroke-width: 1.8; }
.tile.fleet { background: var(--app-fleet); color: var(--app-fleet-ink); }
.tile.maintenance { background: var(--app-maintenance); color: var(--app-maintenance-ink); }
.tile.workshop { background: var(--app-workshop); color: var(--on-dark); }
.tile.partners { background: var(--app-partners); color: var(--on-dark); }
.tile.reports { background: var(--app-reports); color: var(--ink); }
.tile.settings { background: var(--app-settings); color: var(--on-dark); }
.tile.prospects { background: var(--app-prospects); color: var(--on-dark); }
.tile.railcap { background: var(--brand); color: var(--ink); }
/* The menus are never clipped: they keep their width, the organisation gives way first (it shrinks with « … »,
   then hides under 1 280 px); under 1 180 px the bar keeps the first three menus and « ⋯ » (.more, shell.html)
   opens the whole list of the application. */
.nav .menu { display: flex; align-items: center; gap: 2px; flex: none; }
.nav .menu > a, .nav .menu > span { padding: 6px 10px; border-radius: 4px; color: var(--text); white-space: nowrap; }
.nav .menu > a:hover { background: var(--hover); text-decoration: none; }
.nav .menu > a.on, .nav .menu > span.on { background: var(--menu-on); color: var(--ink); font-weight: 600; }
.nav .more { display: none; }
.nav .more > summary { height: 32px; min-width: 36px; padding: 0 8px; border-radius: 4px; color: var(--text); font-size: 18px; line-height: 1; }
.nav .more > summary:hover, .nav .more[open] > summary { background: var(--hover); }
.nav .more.on > summary { background: var(--menu-on); color: var(--ink); font-weight: 600; }
.nav .right { margin-left: auto; display: flex; align-items: center; gap: 6px; flex: none; }
.nav > .company { flex: 0 1 auto; min-width: 0; margin-left: 4px; }
.nav > .company + .dd { margin-left: 4px; }
@media (max-width: 1279px) { .nav > .company { display: none; } }
@media (max-width: 1179px) {
  .nav .menu.folds > a:nth-child(n+4) { display: none; }
  .nav .menu.folds > .more { display: block; }
}
.sys { position: relative; width: 34px; height: 34px; display: grid; place-items: center; color: var(--muted); border-radius: 4px; }
.sys:hover { background: var(--hover); text-decoration: none; }
.sys .cnt { position: absolute; top: 3px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 4px; background: var(--ink); color: var(--sheet); font-size: 10.5px; font-weight: 700; line-height: 16px; text-align: center; }
.demo { font-size: 12px; font-weight: 600; color: var(--ink); background: var(--brand); border: 1px solid var(--brand-2); border-radius: 4px; padding: 2px 8px; letter-spacing: .01em; cursor: pointer; font-family: inherit; white-space: nowrap; }
.lang { display: flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; font-size: 12px; font-weight: 600; }
.lang a, .lang span { padding: 3px 7px; color: var(--muted); }
.lang a:hover { text-decoration: none; background: var(--hover); }
.lang .on { background: var(--ink); color: var(--sheet); }
.company { font-size: 13px; color: var(--text); padding: 0 6px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.av { width: 24px; height: 24px; border-radius: 4px; display: inline-grid; place-items: center; color: var(--on-dark); font-size: 10.5px; font-weight: 700; flex: none; letter-spacing: .02em; background: var(--av-grey); }
.av.lg { width: 34px; height: 34px; font-size: 12.5px; }
.av.xl { width: 40px; height: 40px; font-size: 14px; border-radius: 5px; }
.av.c-teal { background: var(--av-teal); } .av.c-sage { background: var(--av-sage); } .av.c-terra { background: var(--av-terra); }
.av.c-ochre { background: var(--av-ochre); } .av.c-grey { background: var(--av-grey); }

/* menus déroulants (lanceur d'applications, compte) : la seule ombre admise hors fenêtre */
.dd { position: relative; }
.dd > summary { list-style: none; cursor: pointer; display: grid; place-items: center; }
.dd > summary::-webkit-details-marker { display: none; }
.dd > summary.btn { display: inline-flex; }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; background: var(--sheet); border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 8px 24px var(--shadow); padding: 8px; min-width: 220px; }
.dd-menu.right { left: auto; right: 0; }
.dd-menu.apps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 330px; }
.dd-menu.apps-grid a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 4px; color: var(--ink); font-size: 13px; }
.dd-menu.apps-grid a:hover { background: var(--hover); text-decoration: none; }
.dd-menu .it { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 4px; color: var(--text); white-space: nowrap; }
.dd-menu .it:hover { background: var(--hover); text-decoration: none; }
.dd-menu .hd { padding: 6px 10px 4px; font-size: 12.5px; color: var(--muted); }

/* tiroir de démo (380 px, à droite) */
.drawer { position: fixed; top: 46px; right: 0; bottom: 0; width: 380px; max-width: 100vw; background: var(--sheet); border-left: 1px solid var(--line); z-index: 1200; overflow: auto; }  /* above the map panes (Leaflet: 400–1000) */
.drawer .dh { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-weight: 600; color: var(--ink); }
.drawer .dh .x { margin-left: auto; color: var(--muted); cursor: pointer; background: none; border: 0; padding: 4px; display: grid; place-items: center; }
.drawer .db { padding: 14px 16px; }

/* ---------- panneau de contrôle (52 px) ---------- */
.cp { background: var(--sheet); border-bottom: 1px solid var(--line); padding: 10px 16px; min-height: 52px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px) minmax(max-content, 1fr); align-items: center; gap: 16px; }  /* the controls on the right are never cut: the crumb gives way */
.cp.plain { grid-template-columns: minmax(0, 1fr) auto; }
.cp .left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cp .rt { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.crumb { font-size: 18px; color: var(--ink); font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 6px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.crumb .prev { color: var(--link); font-weight: 400; }
.crumb .slash { color: var(--faint); font-weight: 400; }
.gear { color: var(--muted); display: grid; place-items: center; }

/* ---------- boutons ---------- */
.btn { height: 32px; padding: 0 12px; border-radius: 4px; border: 1px solid transparent; display: inline-flex; align-items: center; gap: 6px; font: 500 14px/1 var(--font); white-space: nowrap; color: var(--ink); background: var(--neutral-bg); cursor: pointer; text-decoration: none; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand-2); font-weight: 600; }
.btn.light { background: var(--sheet); border-color: var(--line-2); }
.btn.link { background: transparent; color: var(--link); padding: 0 6px; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn.danger { background: var(--sheet); border-color: var(--bad-track); color: var(--bad); }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- recherche, facettes, pagination, vues ---------- */
.search { height: 32px; border: 1px solid var(--line-2); border-radius: 4px; background: var(--sheet); display: flex; align-items: center; gap: 6px; padding: 0 4px 0 9px; color: var(--muted); min-width: 0; }
.search input { flex: 1; min-width: 60px; height: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); padding: 0; }
.search input::placeholder { color: var(--faint); }
.search .tog { border-left: 1px solid var(--line); height: 100%; width: 30px; display: grid; place-items: center; }
.search.lg { height: 40px; }
.search.lg input, .search.lg .ph { font-size: 15px; }
.facet { display: inline-flex; align-items: stretch; height: 22px; border-radius: 3px; overflow: hidden; background: var(--neutral-bg); font-size: 13px; color: var(--ink); white-space: nowrap; }
.facet .k { background: var(--link); color: var(--sheet); display: grid; place-items: center; padding: 0 5px; }
.facet .k svg.i { width: 13px; height: 13px; }
.facet .v { padding: 0 6px; display: flex; align-items: center; }
.facet .x { padding: 0 6px 0 0; display: flex; align-items: center; color: var(--muted); }
.pager { display: flex; align-items: center; gap: 4px; font-size: 13.5px; color: var(--text); white-space: nowrap; }
.pager .arr { display: flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.pager .arr a, .pager .arr span { width: 28px; height: 28px; display: grid; place-items: center; color: var(--muted); background: var(--sheet); }
.pager .arr a + a, .pager .arr span + span, .pager .arr a + span, .pager .arr span + a { border-left: 1px solid var(--line-2); }
.views { display: flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.views a, .views span { width: 32px; height: 30px; display: grid; place-items: center; color: var(--muted); background: var(--sheet); }
.views a + a, .views span + span, .views a + span, .views span + a { border-left: 1px solid var(--line-2); }
.views .on { background: var(--views-on); color: var(--ink); }

/* ---------- étiquettes ---------- */
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12.5px; font-weight: 600; white-space: nowrap; line-height: 1; }
.b-ok { background: var(--ok-bg); color: var(--ok); }
.b-warn { background: var(--warn-bg); color: var(--warn); }
.b-bad { background: var(--bad-bg); color: var(--bad); }
.b-info { background: var(--info-bg); color: var(--info); }
.b-neutral { background: var(--neutral-bg); color: var(--neutral); }
.b-brand { background: var(--brand-tint); color: var(--brand-ink); }
.b-link { background: var(--link-tint); color: var(--link); }
.tag { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 10px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--neutral-bg); color: var(--text); }
.tag svg.i { width: 12px; height: 12px; }
.tag.link { background: var(--link-tint); color: var(--link); font-weight: 600; }
.tag.brand { background: var(--brand); color: var(--ink); font-weight: 600; }
button.tag { border: 0; cursor: pointer; font-family: inherit; }
button.tag:hover { background: var(--line); }

/* ---------- jauge (disponibilité) ---------- */
.meter { display: inline-flex; align-items: center; gap: 8px; }
.meter .trk { display: block; width: 60px; height: 6px; border-radius: 3px; background: var(--accent-track); overflow: hidden; }
.meter .fil { display: block; height: 100%; border-radius: 3px; background: var(--link); }
.meter.warn .trk { background: var(--warn-track); } .meter.warn .fil { background: var(--warn-fill); }
.meter.bad .trk { background: var(--bad-track); } .meter.bad .fil { background: var(--bad); }
.meter .v { font-variant-numeric: tabular-nums; color: var(--ink); min-width: 40px; text-align: right; }

/* ---------- vue liste ---------- */
.list { width: 100%; border-collapse: collapse; background: var(--sheet); table-layout: fixed; }
.list th { height: 36px; padding: 0 10px; text-align: left; font-weight: 600; color: var(--ink); border-bottom: 1px solid var(--line-2); white-space: nowrap; background: var(--sheet); overflow: hidden; text-overflow: ellipsis; }
.list th .so { color: var(--muted); font-weight: 400; margin-left: 4px; }
.list th a { color: inherit; }
.list td { height: 38px; padding: 0 10px; border-bottom: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list td.wrap { white-space: normal; height: auto; padding-top: 7px; padding-bottom: 7px; }  /* a line of badges stays 38 px */
.list.compact td.wrap { padding-top: 5px; padding-bottom: 5px; }
.list tbody tr:hover td { background: var(--hover); }
.list tr.sel td, .list tr.sel:hover td { background: var(--brand-tint); }
.list tr.grp td { background: var(--group-bg); font-weight: 600; color: var(--ink); height: 34px; }
.list .cb { width: 36px; padding: 0 0 0 12px; }
.cbx { width: 14px; height: 14px; border: 1.5px solid var(--cbx); border-radius: 3px; background: var(--sheet); display: inline-block; vertical-align: -2px; }
.cbx.on { background: var(--ink); border-color: var(--ink); }
.list td.num, .list th.num { text-align: right; }
.eng { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.list.compact td { height: 33px; }
.list.compact th { height: 32px; }
.list.auto { table-layout: auto; }
/* Declared widths (01 §6): a list never scrolls sideways. The sum of the fixed columns stays under the narrowest
   width they are shown at (scroll bar included); the text column takes the rest. Secondary columns give way on
   narrow screens (« largeurs » at the end of this file): .fold under 1 100 px, .fold-md under 1 200 px, .fold-lg
   under 1 366 px, .fold-aside from 1 200 to 1 365 px, while the journal of a sheet still stands beside it. */
.empty { padding: 28px 16px; color: var(--muted); text-align: center; }
.empty a { margin-left: 4px; }

/* ---------- panneau de filtres (gauche, 228 px) ---------- */
.sp { width: 228px; background: var(--sheet); border-right: 1px solid var(--line); padding: 12px 10px; flex: none; }
.sp h4 { margin: 4px 6px 6px; font-size: 13px; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.sp h4 svg.i { color: var(--muted); }
.sp .it { display: flex; justify-content: space-between; align-items: center; padding: 4px 8px; border-radius: 4px; color: var(--text); white-space: nowrap; }
.sp a.it:hover { background: var(--hover); text-decoration: none; }
.sp .it .c { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 13px; }
.sp .it.on { background: var(--neutral-bg); color: var(--ink); font-weight: 600; }
.sp .gap { height: 12px; }
.sp .note { margin: 8px 6px 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); line-height: 1.5; }
.sp .note b { color: var(--ink); font-weight: 600; }

/* panneau de décision (droite, 520 px) */
.dp { width: 520px; flex: none; background: var(--sheet); border-left: 1px solid var(--line); padding: 14px 18px; }

/* ---------- fiche (vue formulaire) ---------- */
.formbg { background: var(--bg); }
.stbar { background: var(--sheet); border-bottom: 1px solid var(--line); padding: 8px 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.status { margin-left: auto; display: flex; }
.status span { height: 30px; display: flex; align-items: center; padding: 0 14px 0 20px; font-size: 13px; color: var(--muted); background: var(--sheet); border: 1px solid var(--line-2); margin-left: -1px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); white-space: nowrap; }
.status span:first-child { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); border-radius: 4px 0 0 4px; padding-left: 14px; }
.status span.on { background: var(--brand-tint); color: var(--ink); font-weight: 600; border-color: var(--brand-2); }
.status span.done { color: var(--ink); }
.sheet { background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; }
.sheet .body { padding: 14px 24px 18px; }
.smart { display: flex; justify-content: flex-end; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.smart .sb { display: flex; align-items: center; gap: 10px; padding: 8px 16px; border-left: 1px solid var(--line); min-width: 128px; color: inherit; }
.smart a.sb:hover { background: var(--hover); text-decoration: none; }
.smart .sb svg.i { width: 20px; height: 20px; color: var(--muted); stroke-width: 1.6; }
.smart .sb .v { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.smart .sb .l { color: var(--muted); font-size: 12.5px; line-height: 1.2; }
.smart .sb.hl { background: var(--link-tint); }
.title { font-size: 26px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.fgrid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; }
.fld { display: grid; grid-template-columns: 158px minmax(0, 1fr); align-items: center; min-height: 31px; }
.fld .lb { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.fld .vl { color: var(--text); min-width: 0; }
.nb { display: flex; gap: 2px; border-bottom: 1px solid var(--line-2); padding: 0 2px; }
.nb a, .nb span { padding: 8px 14px; color: var(--muted); border: 1px solid transparent; border-bottom: 0; border-radius: 4px 4px 0 0; margin-bottom: -1px; white-space: nowrap; }
.nb a:hover { text-decoration: none; color: var(--ink); }
.nb .on { color: var(--ink); font-weight: 600; background: var(--sheet); border-color: var(--line-2); }
.nb .ct { font-size: 12px; color: var(--muted); background: var(--neutral-bg); border-radius: 8px; padding: 1px 6px; margin-left: 4px; font-weight: 600; }
.tabpane { padding: 14px 0 0; }

/* ---------- formulaires ---------- */
input, select, textarea { height: 32px; border: 1px solid var(--line-2); border-radius: 4px; padding: 0 9px; font: inherit; color: var(--ink); background: var(--sheet); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--link); }
input[type="checkbox"], input[type="radio"] { width: 14px; height: 14px; margin: 0; accent-color: var(--ink); }
input[type="file"] { padding: 5px 9px; }
textarea { height: auto; min-height: 88px; padding: 7px 9px; line-height: 1.45; }
select[multiple] { height: auto; min-height: 96px; padding: 4px; }
.frm { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px 24px; }
.f { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.f > label, .lbl { color: var(--ink); font-weight: 600; font-size: 13.5px; }
.f .help { color: var(--muted); font-size: 12.5px; }
.input { height: 32px; border: 0; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 6px; color: var(--ink); min-width: 0; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; }

/* sélecteur à cases (paquets) */
.picker .pl { max-height: 220px; overflow-y: auto; border: 1px solid var(--line-2); border-radius: 4px; background: var(--sheet); margin-top: 6px; }
.picker .pi { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.picker .pi:last-child { border-bottom: 0; }
.picker .pi:hover { background: var(--hover); }
.picker .pi input { width: auto; }
.picker .ps { margin-top: 8px; min-height: 24px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- journal (chatter, 450 px à droite) ---------- */
.chatter { background: var(--sheet); border-left: 1px solid var(--line); width: 450px; flex: none; }
.chatter .top { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; flex-wrap: wrap; }
.msg { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; padding: 10px 16px; }
.msg .h { display: flex; gap: 8px; align-items: baseline; }
.msg .who { color: var(--ink); font-weight: 600; }
.msg .when { color: var(--muted); font-size: 12.5px; }
.msg .body { color: var(--text); margin-top: 1px; }
.trk { color: var(--text); font-size: 13.5px; }
.trk .arr { color: var(--muted); margin: 0 4px; }
.daysep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; padding: 6px 16px 0; }
.daysep::before, .daysep::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- kanban ---------- */
.kb { display: flex; gap: 14px; padding: 14px 16px; align-items: flex-start; overflow-x: auto; }
.kcol { width: 300px; flex: none; }
.kcol .kh { display: flex; align-items: baseline; gap: 8px; padding: 0 2px 6px; }
.kcol .kh .t { font-size: 15px; font-weight: 600; color: var(--ink); }
.kcol .kh .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.kcol.folded { width: 34px; }
.kcol.folded .kh { writing-mode: vertical-rl; padding: 8px 0; height: 180px; background: var(--neutral-bg); border-radius: 4px; justify-content: flex-start; }
.kbar { display: flex; gap: 2px; height: 6px; margin: 0 2px 10px; }
.kbar i { display: block; height: 100%; border-radius: 3px; }
.kbar .ok { background: var(--ok); } .kbar .warn { background: var(--warn); } .kbar .bad { background: var(--bad); } .kbar .info { background: var(--info); } .kbar .neutral { background: var(--line-2); }
.kcard { background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px 10px 14px; margin-bottom: 10px; position: relative; }
.kcard::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; border-radius: 4px 0 0 4px; background: transparent; }
.kcard.ok::before { background: var(--ok); } .kcard.warn::before { background: var(--warn); } .kcard.bad::before { background: var(--bad); } .kcard.info::before { background: var(--info); }
.kcard .t { color: var(--ink); font-weight: 600; }
.kcard .ln { color: var(--text); font-size: 13.5px; margin-top: 2px; }
.kcard .ft { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
/* Suivi (M18, suivi.png): decisions in the card footer, À décider and Refusée stacked, Remplacées folded */
.kcard .ft { flex-wrap: wrap; }
.kcard .ft .btn { max-width: 100%; white-space: normal; height: auto; min-height: 28px; text-align: left;
  line-height: 1.25; padding-top: 4px; padding-bottom: 4px; }
form.inline { display: inline-flex; margin: 0; }
.row.between { justify-content: space-between; }
.kcard .row.between { align-items: baseline; }
.kcard a.t { color: var(--ink); }
.kcol .kh-next { margin-top: 16px; }
.kempty { margin: 0 2px 10px; }
a.kcol.folded { width: 44px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
a.kcol.folded:hover { text-decoration: none; }
a.kcol.folded .n { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
a.kcol.folded .kh { writing-mode: vertical-rl; height: 260px; width: 34px; padding: 10px 0; background: var(--neutral-bg); border-radius: 4px; display: flex; align-items: center; }
.tracking { min-width: 0; overflow-x: auto; }
.tracking .pad-x { padding: 12px 16px 0; }
.list tr.bad td { background: var(--bad-bg); }
.lineact { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#tracking-table td.wrap .badge { white-space: normal; height: auto; line-height: 1.25; padding-top: 3px;
  padding-bottom: 3px; border-radius: 8px; }
.sp .it span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp .it .c { flex: none; }
.lineact .btn { max-width: 100%; white-space: normal; height: auto; min-height: 28px; text-align: left;
  line-height: 1.25; padding-top: 4px; padding-bottom: 4px; }
.list tr.bad .badge.b-bad { background: var(--bad-track); }
.mt-xs { margin-top: 4px; }
/* the e-mail as a page (email.png): sender, recipient chip, subject, body, attachments, footer */
.mail { max-width: 900px; margin: 0 auto; }
.mail-h { display: flex; align-items: center; gap: 8px; padding: 12px 22px; border-bottom: 1px solid var(--line); font-size: 15px; flex-wrap: wrap; }
.mail-rows { padding: 6px 22px; }
.mail .mrow { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.mail .mrow .lbl { width: 70px; flex: none; color: var(--muted); }
.mail .tag.chip { height: 26px; border-radius: 13px; padding: 0 10px 0 3px; gap: 6px; }
.mail-body { padding: 12px 22px; line-height: 1.55; color: var(--text); }
.mail-body ul { margin: 6px 0 10px; padding-left: 20px; }
.mail-text { white-space: pre-wrap; font: inherit; margin: 0; }
.mail-att { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 22px 12px; }
.mail-att .tag { height: 26px; border-radius: 13px; }
.mail-f { display: flex; align-items: center; gap: 8px; padding: 12px 22px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.mail-f form { margin: 0; display: inline-flex; }
.status .ck { width: 12px; height: 12px; margin-left: 4px; }
.hist .it { align-items: baseline; }
.hist .it svg.i { margin-right: 4px; }
/* Présentation en atelier (presentation.png): the notifications sent, as cards with their colour on the left */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.notes-grid .card { padding: 10px 14px; border-left: 4px solid var(--line-2); }
.notes-grid .card.critical { border-left-color: var(--bad); }
.notes-grid .card.warning { border-left-color: var(--warn); }
.notes-grid .card.info { border-left-color: var(--ok); }

/* ---------- Gantt ---------- */
.gantt { display: grid; grid-template-columns: 196px repeat(var(--days, 28), minmax(36px, 45px)); background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; font-size: 12.5px; }
.gantt .gh { height: 32px; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line-2); border-left: 1px solid var(--line); color: var(--muted); font-variant-numeric: tabular-nums; }
.gantt .gh:first-child, .gantt .gr:first-child { justify-content: flex-start; padding-left: 12px; border-left: 0; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.gantt .gc { height: 38px; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); position: relative; }
.gantt .gr { height: 38px; display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.gantt .we { background: var(--hover); }
.gantt .today { background: var(--brand-tint); }
.gbar { position: absolute; top: 8px; left: 2px; height: 22px; border-radius: 4px; display: flex; align-items: center; padding: 0 6px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; z-index: 1; }
.gbar.ok { background: var(--ok-bg); color: var(--ok); }
.gbar.info { background: var(--info-bg); color: var(--info); }
.gbar.neutral { background: var(--sheet); color: var(--muted); border: 1px dashed var(--line-2); }
.gbar.warn { background: var(--warn-bg); color: var(--warn); border: 1px dashed var(--warn-track); }
.gbar.bad { background: var(--bad-bg); color: var(--bad); }
.gbar .place { font-weight: 400; color: var(--muted); margin-left: 6px; }
.gdue { position: absolute; top: 14px; left: calc(50% - 5px); width: 10px; height: 10px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); background: var(--warn); z-index: 2; }
.gdue.late { background: var(--bad); }
.glink { position: absolute; top: 18px; height: 2px; background: var(--link); z-index: 1; }

/* ---------- carte Leaflet (thème) ---------- */
.map { height: 100%; min-height: 360px; background: var(--map-bg); }
.leaflet-container { background: var(--map-bg); font-family: var(--font); isolation: isolate; }  /* its panes (z-index 400–1000) stay under the menus of the bar */
.leaflet-tile-pane { filter: grayscale(1) brightness(1.07) contrast(.86); opacity: .9; }
.leaflet-control-attribution { font-size: 10.5px; color: var(--muted); }
.mk { background: var(--sheet); border: 1px solid var(--marker-line); border-left: 4px solid var(--neutral); border-radius: 4px; padding: 1px 6px 1px 5px; font: 600 12px/18px var(--font); color: var(--ink); white-space: nowrap; display: inline-block; font-variant-numeric: tabular-nums; }
.mk.ok { border-left-color: var(--ok); } .mk.warn { border-left-color: var(--warn); } .mk.info { border-left-color: var(--info); } .mk.bad { border-left-color: var(--bad); }
.mk.sel { background: var(--brand); border-color: var(--marker-sel-line); }
.mk.sel.ok { border-left-color: var(--ok); } .mk.sel.warn { border-left-color: var(--warn); } .mk.sel.info { border-left-color: var(--info); } .mk.sel.bad { border-left-color: var(--bad); }
.cl { background: var(--ink); color: var(--sheet); border-radius: 5px; font: 700 12px/22px var(--font); text-align: center; min-width: 24px; padding: 0 6px; display: inline-block; }
.lbl { font: 600 11px/1 var(--font); color: var(--text); white-space: nowrap; background: var(--sheet); padding: 1px 3px; border-radius: 2px; }
.legend { display: flex; gap: 12px; align-items: center; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border-left: 4px solid var(--neutral); background: var(--sheet); border-top: 1px solid var(--marker-line); border-right: 1px solid var(--marker-line); border-bottom: 1px solid var(--marker-line); vertical-align: -2px; margin-right: 4px; }
.legend .sw.ok { border-left-color: var(--ok); } .legend .sw.warn { border-left-color: var(--warn); } .legend .sw.info { border-left-color: var(--info); } .legend .sw.bad { border-left-color: var(--bad); }

/* ---------- graphiques (uPlot) ---------- */
.chart { background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; }
.chart .ct { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.uplot, .uplot *, .uplot *::before, .uplot *::after { font-family: var(--font) !important; }
.u-legend { font-size: 12.5px; color: var(--ink); }
.facts { display: flex; align-items: center; flex-wrap: wrap; background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; padding: 10px 18px; gap: 0; font-size: 14px; white-space: nowrap; }
.facts > span { display: inline-flex; align-items: center; gap: 5px; }
.facts > span + span::before { content: ""; width: 1px; height: 18px; background: var(--line); margin: 0 14px; }
.facts b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; }
.bars .bar { width: 24px; border-radius: 4px 4px 0 0; background: var(--link); }
.bars .bar.ok { background: var(--ok); } .bars .bar.warn { background: var(--warn); } .bars .bar.bad { background: var(--bad); }

/* ---------- divers ---------- */
.alert { border-radius: 4px; padding: 9px 14px; display: flex; align-items: center; gap: 10px; font-size: 13.5px; margin: 12px 16px 0; }
.alert.info { background: var(--info-bg); color: var(--info-ink); border: 1px solid var(--info-track); }
.alert.brand { background: var(--brand-tint); color: var(--brand-ink-2); border: 1px solid var(--brand-line); }
.alert.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid var(--warn-track); }
.alert svg.i { flex: none; }
.alert a { color: inherit; text-decoration: underline; }
.card { background: var(--sheet); border: 1px solid var(--line); border-radius: 4px; }
.card .ch { padding: 10px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.card .cb2 { padding: 12px 14px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink); }
.modal-bg { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 30; }
.modal { position: relative; background: var(--sheet); border-radius: 6px; box-shadow: 0 14px 40px var(--shadow); overflow: hidden; width: min(640px, 94vw); }
.modal .mh { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; font-size: 17px; font-weight: 600; color: var(--ink); }
.modal .mh .x { margin-left: auto; color: var(--muted); background: none; border: 0; cursor: pointer; display: grid; place-items: center; }
.modal .mb { padding: 14px 18px; }
.wait-bg { position: fixed; inset: 0; background: var(--scrim); display: grid; place-items: center; z-index: 40; cursor: progress; }
.modal.wait { width: min(460px, 92vw); }
.modal.wait .mh { border-bottom: 0; padding-bottom: 4px; }
.modal.wait .mb { padding-top: 4px; color: var(--muted); }
.modal .mf { padding: 12px 18px; border-top: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
.explain { background: var(--hover); border-left: 3px solid var(--link); padding: 10px 14px; margin-top: 10px; }
.explain ul { margin: 4px 0 8px 18px; padding: 0; }
.explain p { margin: 0 0 6px; }
details.fold > summary { cursor: pointer; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; gap: 6px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold[open] > summary svg.i { transform: rotate(180deg); }

/* matrice réseau × capabilities */
.matrix { border-collapse: collapse; background: var(--sheet); font-size: 12px; }
.matrix td, .matrix th { padding: 2px 4px; text-align: center; border: 1px solid var(--sheet); height: 24px; }
.matrix th.vertical { writing-mode: vertical-rl; transform: rotate(180deg); height: 130px; white-space: nowrap; font-weight: 500; color: var(--text); }
.matrix th.risk { color: var(--bad); font-weight: 600; }
.matrix td.name { text-align: left; white-space: nowrap; padding: 0 8px; color: var(--ink); }
.l0 { background: var(--neutral-bg); color: var(--faint); } .l1 { background: var(--link-tint); } .l2 { background: var(--accent-track); } .l3 { background: var(--link); color: var(--sheet); }
.risk-cell { outline: 2px solid var(--bad); outline-offset: -2px; }
.lvl { display: inline-block; min-width: 22px; padding: 1px 6px; border-radius: 3px; font-size: 12px; text-align: center; }

/* ---------- accueil ---------- */
.home { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 0 16px 60px; position: relative; }
.home .nav { width: 100%; background: transparent; border-bottom: 0; height: 56px; padding: 0 20px; }
.home .hsearch { width: 560px; max-width: 100%; margin-top: 34px; }
.home .apps-row { display: flex; justify-content: center; gap: 34px; margin-top: 62px; flex-wrap: wrap; }
.home .apps-row a { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 110px; font-size: 15px; color: var(--ink); font-weight: 500; }
.home .apps-row a:hover { text-decoration: none; }
.home .todo { margin-top: 56px; display: flex; align-items: center; gap: 0; padding: 10px 18px; white-space: nowrap; flex-wrap: wrap; }
.home .todo .lead { color: var(--muted); margin-right: 14px; }
.home .todo a b { font-variant-numeric: tabular-nums; }
.home .todo .sep { margin: 2px 14px; }
.home .foot { position: absolute; left: 0; right: 0; bottom: 16px; text-align: center; }

/* ---------- connexion ---------- */
.login { flex: 1; display: grid; place-items: center; padding: 40px 16px; }
.login .card { width: 400px; max-width: 100%; padding: 26px 28px 24px; }
.login .logo { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login .logo .name { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.login .f + .f { margin-top: 12px; }

/* ---------- guide de style ---------- */
.sg { padding: 16px 24px 40px; max-width: 1400px; }
.sg section { margin-top: 28px; }
.sg h2 { padding-bottom: 6px; border-bottom: 1px solid var(--line-2); margin-bottom: 12px; }
.sg .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.sg .demo-box { background: var(--sheet); border: 1px dashed var(--line-2); border-radius: 4px; padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sg .demo-box.col { flex-direction: column; align-items: stretch; }
.sg img { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; }
.sg .cap { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- carte temps réel (Flotte › Carte) ---------- */
.main.map-page { flex: none; height: calc(100vh - 46px - 53px); min-height: 480px; overflow: hidden; }
.maplist { width: 320px; flex: none; background: var(--sheet); border-right: 1px solid var(--line); overflow-y: auto; }
.maplist .counts { padding: 10px 12px 8px; display: flex; flex-wrap: wrap; gap: 6px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--sheet); z-index: 2; }
.maplist .counts a.badge:hover { text-decoration: none; filter: brightness(.97); }
.badge .n { margin-left: 5px; font-variant-numeric: tabular-nums; }
.badge.on { outline: 1.5px solid currentColor; outline-offset: -1.5px; }
.mi { border-bottom: 1px solid var(--line); }
.mi .mh { display: flex; flex-direction: column; gap: 1px; padding: 7px 12px; color: inherit; }
.mi .mh:hover { background: var(--hover); text-decoration: none; }
.mi.sel { background: var(--brand-tint); border-bottom-color: var(--brand-line); }
.mi.sel .mh:hover { background: transparent; }
.mi.sel .eng { font-size: 16px; }
.mpanel { padding: 0 12px 12px; font-size: 13.5px; }
.mpanel .kv { grid-template-columns: 118px minmax(0, 1fr); row-gap: 3px; }
.mpanel .actions { margin-top: 10px; gap: 6px; }
.mpanel .signals { margin-top: 10px; border-top: 1px solid var(--brand-line); padding-top: 6px; }
.mpanel details.fold { padding: 4px 0; }
.mpanel details.fold .kv { margin: 4px 0 2px 22px; }
.mpanel details.fold p { margin: 2px 0 0 22px; }
.mapwrap { position: relative; min-width: 0; }
.mapwrap .map { position: absolute; inset: 0; min-height: 0; }
.maplegend { position: absolute; left: 12px; bottom: 12px; z-index: 900; padding: 6px 10px; display: flex; align-items: center; gap: 14px; }
.cl.sm { font-size: 10.5px; line-height: 16px; min-width: 18px; padding: 0 4px; }

/* ---------- état de la flotte (liste) ---------- */
.status-body { display: flex; align-items: stretch; min-width: 0; }
.status-body .sp { min-height: 100%; }
.listwrap { background: var(--sheet); min-width: 0; }
.list th a:hover { text-decoration: none; color: var(--link); }
.list a.eng:hover { text-decoration: underline; }
#fleet-list-table tbody tr { cursor: pointer; }

/* ---------- données : historique GPS, inspecteur, compteurs, journal ---------- */
.dviews { display: inline-flex; gap: 2px; margin-right: 12px; }
.dviews .dv { padding: 4px 12px; border-radius: 4px; color: var(--text); font-weight: 500; }
.dviews .dv:hover { background: var(--hover); text-decoration: none; }
.dviews .dv.on { background: var(--menu-on); color: var(--ink); font-weight: 600; }
.dform { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.dform select, .dform input { width: auto; height: 28px; font-size: 13px; }
.crumb .sub { color: var(--muted); font-size: 13px; font-weight: 400; margin-left: 8px; }
.views.ranges a, .views.ranges span { width: auto; padding: 0 12px; font-size: 13px; white-space: nowrap; }
.main.data-page { flex: none; height: calc(100vh - 46px - 53px - 49px); min-height: 520px; overflow: hidden; }
.dp.narrow { width: 300px; }
.gps-side { width: 744px; flex: none; background: var(--sheet); border-left: 1px solid var(--line); padding: 12px 18px; overflow-y: auto; min-width: 0; }
.gps-side .figs, .tabpane .figs { display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: baseline; }
.gps-side .stops { margin-top: 8px; }
.gps-side .stops td.muted { overflow: hidden; text-overflow: ellipsis; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 12px; gap: 12px; }
.chart-head .unit { font-weight: 400; }
.chart-head .stats { display: flex; gap: 14px; }
.chartbox { min-height: 40px; margin-top: 4px; }
.chartbox .u-legend { display: none; }
svg.arw { width: 14px; height: 14px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.insp-panel { overflow-y: auto; width: 288px; display: flex; flex-direction: column; gap: 10px; }
.insp-panel .ptxt { margin: 0 6px; }
.insp-panel .presets { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 6px; }
.insp-panel .presets a.tag:hover { background: var(--line); text-decoration: none; }
.insp-panel .f { margin: 0 6px; }
.insp-panel .picker { margin: 0 6px; }
.insp-panel .pl.signals { max-height: none; }
.insp-panel .grp-h { margin: 8px 0 2px; font-weight: 600; color: var(--ink); font-size: 13px; }
.insp-panel .actions { margin: 0 6px 6px; }
.insp-charts { background: var(--sheet); padding: 6px 18px 14px; overflow-y: auto; min-width: 0; }
.insp-one + .insp-one { border-top: 1px solid var(--line); margin-top: 8px; }
.pagesize { padding: 10px 14px; border-top: 1px solid var(--line); }
.composer { padding: 12px 16px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.composer textarea { min-height: 72px; }
.chatter .top .btn.on { background: var(--menu-on); }
.msg .act { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; background: var(--neutral-bg); color: var(--ink); }
.msg .h .tag { margin-left: 2px; }
.tile.chat { width: 34px; height: 34px; border-radius: 8px; } .tile.chat svg.i { width: 18px; height: 18px; }

/* ---------- planning (Gantt SVG) ---------- */
.gantt-wrap { background: var(--sheet); overflow: auto; min-width: 0; }
/* Drawn at its pixel size, never scaled: planning.html lays the days out again at the width of the page (the text
   keeps 12–14 px); without the script it keeps the width of the server and the frame scrolls. */
.gantt-svg { display: block; }
.gantt-svg text { font: 12.5px var(--font); fill: var(--muted); }
.gantt-svg a { cursor: pointer; }
.gantt-svg a:hover { text-decoration: none; }
.g-line { stroke: var(--line); stroke-width: 1; }
.g-line.mon, .g-line.head, .g-line.label { stroke: var(--line-2); }
.g-we { fill: var(--hover); }
.g-today { fill: var(--brand-tint); }
.g-today-bar { fill: var(--brand-2); }
.g-label-bg { fill: var(--sheet); }
.gantt-svg .g-head { font-weight: 600; font-size: 13.5px; fill: var(--ink); }
.gantt-svg .g-month { font-weight: 600; font-size: 13.5px; fill: var(--ink); }
.gantt-svg .g-day { font-size: 12px; }
.gantt-svg .g-day.today { font-weight: 700; fill: var(--ink); }
.gantt-svg .g-eng { font-weight: 600; font-size: 14px; fill: var(--ink); font-variant-numeric: tabular-nums; }
.gantt-svg a:hover .g-eng { text-decoration: underline; }
.gantt-svg .g-place { fill: var(--muted); font-size: 13px; }
.g-bar rect { stroke-width: 1; }
.gantt-svg .g-bar text { font-weight: 600; }
.g-bar.ok rect, .sw.g-bar.ok { fill: var(--ok-bg); stroke: var(--ok-track); background: var(--ok-bg); border-color: var(--ok-track); }
.g-bar.prog rect, .sw.g-bar.prog { fill: var(--info-bg); stroke: var(--info-track); background: var(--info-bg); border-color: var(--info-track); }
.g-bar.sent rect, .sw.g-bar.sent { fill: var(--neutral-bg); stroke: var(--line-2); stroke-dasharray: 4 3; background: var(--neutral-bg); border: 1px dashed var(--line-2); }
.g-bar.warn rect, .sw.g-bar.warn { fill: var(--warn-bg); stroke: var(--warn-track); stroke-dasharray: 4 3; background: var(--warn-bg); border: 1px dashed var(--warn-track); }
.g-bar.bad rect, .sw.g-bar.bad { fill: var(--bad-bg); stroke: var(--bad-track); background: var(--bad-bg); border-color: var(--bad-track); }
.gantt-svg .g-bar.ok text { fill: var(--ok); } .gantt-svg .g-bar.prog text { fill: var(--info); }
.gantt-svg .g-bar.sent text { fill: var(--neutral); } .gantt-svg .g-bar.warn text { fill: var(--warn-ink); }
.gantt-svg .g-bar.bad text { fill: var(--bad); }
.gantt-svg .g-after { fill: var(--muted); font-size: 12.5px; }
.g-mark polygon { stroke: var(--sheet); stroke-width: 2; }
.g-mark.due polygon, .sw.dia.due { fill: var(--warn-fill); background: var(--warn-fill); }
.g-mark.late polygon, .sw.dia.late { fill: var(--bad); background: var(--bad); }
.gantt-svg .g-mark text { font-weight: 600; font-size: 12px; }
.gantt-svg .g-mark.due text { fill: var(--warn); } .gantt-svg .g-mark.late text { fill: var(--bad); }
.g-link { stroke: var(--link); stroke-width: 2; }
.g-pill rect { fill: var(--brand); }
.gantt-svg .g-pill text { fill: var(--ink); font-weight: 600; font-size: 12px; }
.glegend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; padding: 8px 12px; font-size: 12.5px; color: var(--text); border-top: 1px solid var(--line); }
.glegend span { display: inline-flex; align-items: center; gap: 5px; }
.glegend .sw { display: inline-block; width: 22px; height: 12px; border-radius: 3px; border: 1px solid transparent; }
.glegend .sw.dia { width: 10px; height: 10px; border-radius: 0; transform: rotate(45deg); margin: 0 3px; }
.gfilters { width: 280px; display: flex; flex-direction: column; gap: 10px; padding: 12px; }
#plan-table td.wrap .tag { margin: 1px 2px 1px 0; }

/* ---------- maintenance (échéances, panneau de regroupement, cloche) ---------- */
.main.split-page { min-height: 0; }
.gpanel { display: flex; flex-direction: column; padding: 0; overflow: auto; }
.gp-head { padding: 14px 20px 12px; border-bottom: 1px solid var(--line); }
.gp-title { justify-content: space-between; font-size: 17px; font-weight: 600; color: var(--ink); }
.gp-text { margin: 6px 0 0; color: var(--text); }
.gp-table { margin: 10px 20px 0; width: calc(100% - 40px); }
.list.auto.gp-table { width: calc(100% - 40px); }
.gp-table td:first-child, .gp-table th:first-child { padding-left: 0; }
.gp-table .pick { background: var(--brand-tint); }
.gain { margin: 10px 20px 0; background: var(--ok-bg); color: var(--ok); border-radius: 4px; padding: 8px 12px; font-weight: 600; }
.gp-line { margin: 8px 20px 0; color: var(--text); }
.gpanel > .muted.sm { margin: 2px 20px 0; }
.gpanel .actions { padding: 0 20px; }
.gp-others { margin: 12px 20px 0; }
.gp-rule { margin: auto 20px 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.gnote { margin-left: 4px; }
.bell { position: relative; }
.bell-menu { width: 380px; padding: 6px; }
.bell-menu .it { align-items: flex-start; white-space: normal; }
.bell-menu .it .tx { display: flex; flex-direction: column; min-width: 0; }
.bell-menu .it .tt { color: var(--ink); }
.bell-menu .it.unread .tt { font-weight: 600; }
.bell-menu .it .mt2 { font-size: 12px; color: var(--muted); }
.bell-menu .ft { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.bell-menu .it, .notes-list .it { border-left: 3px solid var(--line-2); }
.it.sev-warning { border-left-color: var(--warn); } .it.sev-critical { border-left-color: var(--bad); } .it.sev-info { border-left-color: var(--info); }
.notes-list .it { display: flex; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.notes-list .it:hover { background: var(--hover); text-decoration: none; }
.notes-list .it.unread .tt { font-weight: 600; color: var(--ink); }

/* ---------- rapports de la flotte : disponibilité et fiabilité, alertes, export, configuration ---------- */
.reports { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.figures { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 10px 14px; }
.figures .sep { align-self: center; height: 16px; }
.rcols { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.rleg { margin-left: auto; display: inline-flex; gap: 12px; font-weight: 400; color: var(--muted); font-size: 13px; }
.rnote { padding: 4px 14px 10px; }
/* Stop days per vehicle: HTML bars on a scale in % of the track, so that the texts keep their size (01 §4: never
   under 12 px) whatever the width of the card; 52 px on the right for the value of the longest bar. */
.hbars { position: relative; padding: 10px 52px 28px 0; }
.hb-axis { position: absolute; left: 86px; right: 52px; top: 10px; bottom: 28px; pointer-events: none; }
.hb-tick { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--line); }
.hb-tick b { position: absolute; top: calc(100% + 5px); left: 0; transform: translateX(-50%); font-size: 12px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.hb-row { position: relative; display: grid; grid-template-columns: 86px minmax(0, 1fr); align-items: center; height: 19px; color: inherit; }
a.hb-row:hover { text-decoration: none; }
.hb-eng { padding-right: 10px; text-align: right; font-size: 12px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
a.hb-row:hover .hb-eng { text-decoration: underline; }
.hb-track { display: flex; align-items: center; height: 14px; }
.hb-seg { display: block; height: 14px; flex: none; }
.hb-seg + .hb-seg { margin-left: 2px; }
.hb-seg:last-of-type { border-radius: 0 3px 3px 0; }
.hb-seg.bad { background: var(--bad); } .hb-seg.info { background: var(--info); }
.hb-val { margin-left: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.r-grid { stroke: var(--line); stroke-width: 1; }
.r-tick { fill: var(--muted); font-size: 12px; }
.rside .chartbox { margin: 0 10px; }  /* a margin, not a padding: the chart takes the width of its box */
.rorgans { padding: 8px 14px 12px; border-top: 1px solid var(--line); margin-top: 6px; }
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 26px; margin-top: 4px; }
.rrow { display: flex; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; }
.rtable { overflow-x: auto; }
.rtable .ch .muted { margin-left: auto; font-weight: 400; }
.list.auto { table-layout: auto; width: 100%; }
.rules input, .rules select { height: 28px; font-size: 13px; }
.rules td { vertical-align: middle; }
.rules tr.new td { background: var(--group-bg); }
.expo { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; }
.main.export-page { flex-wrap: wrap; align-items: flex-start; }
.export-page > .dp { position: sticky; top: 0; align-self: stretch; }
.expo .ch .all { margin-left: auto; font-weight: 400; color: var(--text); display: inline-flex; gap: 6px; align-items: center; }
.vgroup { border: 0; margin: 0; padding: 0 0 10px; min-width: 0; }
.vgroup legend { padding: 0; }
.vlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 4px 12px; padding: 6px 0 0 22px; }
.chk { display: inline-flex; gap: 6px; align-items: center; }
.period { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.period input { width: auto; }
.period .shortcuts { display: inline-flex; gap: 6px; margin-left: 8px; }
.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px 24px; }
.type { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; }
.type input { margin-top: 3px; }
.type > span { display: flex; flex-direction: column; gap: 1px; }
.sumlist { display: grid; grid-template-columns: 1fr auto; gap: 8px 14px; margin: 10px 0; }
.sumlist dt { color: var(--muted); } .sumlist dd { margin: 0; text-align: right; }
.exhist { flex-basis: 100%; padding: 4px 16px 18px; }
.exhist h3 { margin-bottom: 8px; }
.cfg { max-width: 660px; }
.cfgbody { display: flex; flex-direction: column; gap: 16px; }
fieldset.f { border: 0; padding: 0; margin: 0; }
fieldset.f .type + .type { margin-top: 8px; }
.reliab .strip { position: relative; height: 16px; background: var(--neutral-bg); border-radius: 3px; overflow: hidden; margin-top: 10px; }
.reliab .strip .seg { position: absolute; top: 0; bottom: 0; min-width: 1px; }
.seg.s-ok { background: var(--ok); } .seg.s-warn { background: var(--warn-fill); } .seg.s-info { background: var(--info); }
.seg.s-bad { background: var(--bad); } .seg.s-neutral { background: var(--neutral); }
.strip-axis { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; gap: 12px; }
.strip-axis .legend { display: inline-flex; gap: 12px; }
.strip-axis .sw.ok { background: var(--ok); } .strip-axis .sw.warn { background: var(--warn-fill); } .strip-axis .sw.info { background: var(--info); } .strip-axis .sw.bad { background: var(--bad); }
.strip-axis .sw { border-color: transparent; border-left-width: 1px; }

/* ---------- Atelier : demande (M17) ---------- */
.pill { display: inline-block; padding: 1px 9px; border-radius: 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.chosen { display: inline-flex; gap: 4px; align-items: center; margin-right: 6px; }
#solutions-table td { white-space: normal; }
#solutions-table td.tab, #solutions-table td.num { white-space: nowrap; }  /* the actions may go one under the other */
#solutions-table .rowact { text-align: right; }
#solutions-table tr.excl td { background: var(--group-bg); color: var(--text); }
.assume { display: grid; grid-template-columns: 260px 1fr; gap: 6px 18px; margin: 0; max-width: 820px; }
.assume dt { color: var(--muted); } .assume dd { margin: 0; color: var(--ink); }
.eng-block { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin-top: 8px; }
.eng-block .muted { grid-column: 1 / -1; }
.sidecard { border: 1px solid var(--line); border-radius: 4px; padding: 12px 14px; margin-bottom: 14px; background: var(--sheet); }
.sidecard h4 { margin-bottom: 6px; }
.sidecard ul { margin: 6px 0 0; padding: 0; list-style: none; }
.sidecard li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.sidecard li:last-child { border-bottom: 0; }

/* ---------- capacités des partenaires (atelier × semaines) ---------- */
.list th.wrap2 { white-space: normal; line-height: 1.2; }  /* centered like the other headers, also when it holds on one line */
.capgrid { overflow-x: auto; }
.capgrid table { table-layout: auto; width: 100%; }
.capgrid th.wk { text-align: center; font-weight: 500; white-space: nowrap; }
.capgrid th.wk small { display: block; color: var(--muted); font-weight: 400; }
.capgrid td.c { text-align: center; font-variant-numeric: tabular-nums; min-width: 56px; }
.capgrid td.c.none { background: var(--neutral-bg); color: var(--faint); }
.capgrid td.c.zero { color: var(--bad); font-weight: 600; }
.capgrid td.c.closed { color: var(--muted); }
.capgrid td.when { white-space: nowrap; }
.capform { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-end; padding: 12px 14px; }
.capform .f { min-width: 160px; }
.capform .choices { display: flex; gap: 14px; align-items: center; height: 32px; }

/* ---------- prospects (clé propriétaire) ---------- */
.newkey { margin: 14px 16px 0; border-left: 4px solid var(--ok); }
.newkey code { font-size: 14px; user-select: all; }
.rowact { text-align: right; }
.rowact form, .ch form.inl { margin: 0; display: inline-flex; }
.ch form.inl { margin-left: auto; }
.card .ch2 { border-top: 1px solid var(--line); }
.frise-svg { width: 100%; height: auto; display: block; padding: 6px 8px 0; }
.r-link { fill: var(--link); }
.r-tick { text-anchor: middle; }
.hbar { display: block; height: 8px; background: var(--neutral-bg); border-radius: 4px; overflow: hidden; }
.hfil { display: block; height: 100%; background: var(--link); }
.barcell { width: 40%; }

/* ---------- largeurs ---------- */
/* A list with a side panel (Échéances, Journal, Restrictions): the panel goes under the list below 1 280 px, where
   it would leave the list too narrow, and is a little narrower up to 1 440 px. */
@media (max-width: 1279px) {
  .main.split-page { flex-direction: column; }
  .main.split-page .dp { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
}
@media (min-width: 1280px) and (max-width: 1439px) {  /* a form needs less than the grouping panel and its table */
  .main.split-page .dp { width: 400px; }
  .main.split-page .dp.gpanel { width: 480px; }
}
/* A sheet and its journal (450 px): the journal goes under the sheet below 1 200 px. */
@media (max-width: 1199px) {
  .chatter { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .main.sheet-page { flex-direction: column; }
}
@media (max-width: 1024px) {
  .cp { grid-template-columns: minmax(0, 1fr) auto; }
  .cp .search-slot { display: none; }
  .main.data-page { flex-direction: column; height: auto; }
  .gps-side { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .main.data-page .mapwrap { height: 420px; flex: none; }
  .fgrid { grid-template-columns: 1fr; }
  .rcols { grid-template-columns: minmax(0, 1fr); }
  .export-page > .dp { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
}
/* Columns that give way (« vue liste »). État de la flotte: its place folds under 1 366 px and takes its whole width
   from 1 600 px (the 140 px declared in status_body.html are the narrow width). */
@media (max-width: 1365px) { .list .fold-lg, #fleet-list-table .fold { display: none; } }
@media (min-width: 1200px) and (max-width: 1365px) { .list .fold-aside { display: none; } }
@media (max-width: 1200px) { .list .fold-md { display: none; } }
@media (max-width: 1100px) {
  .list .fold, .list col.fold { display: none; }
}
@media (min-width: 1600px) { #fleet-list-table col.fold { width: 280px !important; } }
.list .unfold { display: none; }  /* what a folded column said, shown in the cell that stays */
@media (max-width: 1200px) { .list .unfold { display: block; } }
/* A list between the filter panel and a side panel of 300 px (Compteurs › Relevé manuel): its .fold-dp columns fold
   while the panel stands beside it; under 1 280 px the panel goes under the list. */
@media (min-width: 1280px) { .status-body.with-dp .list .fold-dp { display: none; } }
@media (max-width: 1279px) {
  .status-body.with-dp { flex-wrap: wrap; }
  .status-body.with-dp > .dp { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- logo (accueil, connexion) ---------- */
.logo { display: flex; align-items: center; gap: 10px; }
.logo .name { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: -.01em; }
.logo .by { color: var(--muted); font-size: 13px; margin-left: 2px; }
.swatch { width: 64px; height: 40px; border-radius: 4px; border: 1px solid var(--line); }
.sw-item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); width: 84px; }
.sw-item code { font-size: 11px; }
.icons { display: flex; flex-wrap: wrap; gap: 6px; }
.icons span { display: flex; flex-direction: column; align-items: center; gap: 4px; width: 72px; padding: 8px 0; font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; background: var(--sheet); }

/* ---------- M19 : Railcap Partners (portail externe) ---------- */
.nav .menu .mcnt { margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 4px; background: var(--brand-tint); color: var(--ink); font-size: 12px; font-weight: 700; line-height: 18px; text-align: center; display: inline-block; }
.nav .clientsel { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border: 1px solid var(--line-2); border-radius: 4px; color: var(--ink); cursor: pointer; list-style: none; white-space: nowrap; }
.nav .clientsel::-webkit-details-marker { display: none; }
.dd-menu .it.on { background: var(--menu-on); font-weight: 600; }
.mt-s { margin-top: 6px; }
.hz { margin-left: 8px; }
.pgrid { display: flex; gap: 0; align-items: stretch; }
.pgrid > .sheet { flex: 1; min-width: 0; }
.pside { width: 400px; flex: none; background: var(--sheet); border: 1px solid var(--line); border-left: 0; padding: 14px 18px; }
.suggest { border: 1px solid var(--brand-line); background: var(--brand-tint); border-radius: 4px; padding: 12px 14px; }
.suggest p { margin: 6px 0 10px; color: var(--ink); }
.tag.attach { height: 26px; padding: 0 10px; }
.mailtext { padding: 8px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; margin-top: 6px; }
.mailtext pre { white-space: pre-wrap; font: inherit; margin: 6px 0 0; color: var(--text); }
.cap-main .alert { margin: 0 0 12px; }
.capgrid { overflow: hidden; }
.capgrid input.cell { width: 76px; height: 28px; text-align: right; }
.capgrid input.note { height: 28px; border-color: transparent; background: transparent; }
.capgrid input.note:focus, .capgrid input.note:hover { border-color: var(--line-2); background: var(--sheet); }
.capgrid tr.wk td { background: var(--bg); height: 30px; border-bottom: 1px solid var(--line); }
.capgrid tr.weekend td { color: var(--muted); }
.capgrid tr.pastrow td { color: var(--muted); }
.capside { border-left: 1px solid var(--line); }
.rnums { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 2px 10px; color: var(--text); }
.relwrap { display: flex; gap: 0; align-items: flex-start; }
.relwrap > .card { flex: 1; min-width: 0; overflow: hidden; }
.relside { width: 380px; flex: none; background: var(--sheet); border: 1px solid var(--line); border-left: 0; padding: 14px 20px; }
.relside .vtitle { font-size: 17px; font-weight: 600; color: var(--ink); }
.failbox { border: 1px solid var(--line); border-radius: 4px; }
.failbox .it { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.failbox .it:last-child { border-bottom: 0; }
@media (max-width: 1100px) {
  .pgrid, .relwrap { flex-direction: column; }
  .pside, .relside { width: 100%; border-left: 1px solid var(--line); border-top: 0; }
}
.needs .fld { grid-template-columns: 158px minmax(0, 1fr); align-items: start; padding: 4px 0; }
.needs .vl { display: flex; flex-wrap: wrap; gap: 6px; }
.capgrid tr.review td { background: var(--brand-tint); }
.capside textarea { height: auto; padding: 6px 9px; }
.draft-note { color: var(--ink); }
#partner-assistant textarea { height: auto; padding: 8px 10px; }

/* M21 — demo drawer controls and guided tour (01 §5–§6) */
.drawer .dsec { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.drawer .dsec .dt { font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.drawer .dreply { display: grid; gap: 6px; margin-bottom: 12px; }
.drawer .dreply .row { display: flex; gap: 6px; flex-wrap: wrap; }
.drawer .dreply .btn { border-left-width: 4px; }
.drawer .dreply .rp-ok { border-left-color: var(--ok); }
.drawer .dreply .rp-warn { border-left-color: var(--warn-fill); }
.drawer .dreply .rp-bad { border-left-color: var(--bad); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.tour-target { outline: 2px solid var(--brand-2); outline-offset: 2px; position: relative; z-index: 5; }
.tour-panel { border-color: var(--ink) !important; position: fixed; right: 16px; bottom: 16px; width: 340px; max-width: calc(100vw - 32px); background: var(--sheet); border: 1px solid var(--line-2); border-radius: 8px; z-index: 1300; padding: 14px 16px; }
.tour-panel .tp-step { font-size: 12px; color: var(--muted); }
.tour-panel .tp-title { font-weight: 600; color: var(--ink); margin: 2px 0 6px; font-size: 15px; }
.tour-panel .tp-text { color: var(--text); line-height: 1.45; }
.tour-panel .tp-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.tour-panel .tp-actions .tp-gap { flex: 1; }
.demo-tour-btn { margin-right: 8px; padding: 4px 7px; display: inline-grid; place-items: center; }
.journey { padding: 10px 16px 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.journey .status { margin: 0; }
.drawer .dsec .btn { max-width: 100%; white-space: normal; height: auto; min-height: 28px; text-align: left; }
