/* ==========================================================================
   Fiche mesures atmosphériques, SDIS 71
   Charte : bleu et rouge du logo SDIS 71, fond clair (lisible en plein jour),
   angles nets, hiérarchie stricte, cibles tactiles de 44 px minimum.
   ========================================================================== */

:root {
  --navy: #273474;          /* bleu du logo */
  --navy-dark: #1C2659;
  --navy-soft: #E8EAF4;
  --red: #E3112F;           /* rouge du logo */
  --red-dark: #B80D25;
  --ink: #161B2E;
  --ink-soft: #4F5768;
  --ink-faint: #7D8494;
  --bg: #F2F3F5;
  --surface: #FFFFFF;
  --surface-2: #F7F8FA;
  --surface-3: #ECEEF2;
  --line: #D9DDE3;
  --line-strong: #AEB4BF;
  --focus: #3A55C9;
  --ok: #1E7B3A;
  --ok-soft: #E4F2E8;
  --warn: #9A5B00;
  --warn-soft: #FFF3DC;

  --aegl1: #C6E0B4; --aegl1-b: #6E9F52;
  --aegl2: #FFD966; --aegl2-b: #C49A1C;
  --aegl3: #FF6B6B; --aegl3-b: #C23B3B;
  --aegl-ink: #161B2E;

  --r: 4px;
  --r-sm: 3px;
  --shadow: 0 1px 2px rgba(22, 27, 46, .06);
  --shadow-lg: 0 12px 32px rgba(22, 27, 46, .22);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --bar-h: 66px;
  --head-h: 76px;
  color-scheme: light;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 16px; line-height: 1.45;
  min-height: 100vh;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; letter-spacing: -.005em; }
p { margin: 0; }
a { color: var(--navy); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.page { padding-top: 22px; padding-bottom: 40px; }

/* Icônes */
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -3px; }

/* ---------- En-tête ---------- */
.sticky-head { position: sticky; top: 0; z-index: 1000; }
.page-list .hdr { position: sticky; top: 0; z-index: 1000; }
.hdr {
  background: var(--surface);
  border-top: 4px solid var(--red);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
}
.hdr-inner { display: flex; align-items: center; gap: 18px; min-height: 72px; padding-top: 8px; padding-bottom: 8px; }
.hdr-logo { flex: none; display: flex; padding-right: 18px; border-right: 1px solid var(--line); }
.hdr-logo img { height: 50px; width: auto; display: block; }
.hdr-title { flex: 1; min-width: 0; }
.hdr-kicker { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--red); }
.hdr h1 { font-size: 1.3rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.25; }
.hdr-back { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; color: var(--ink-soft); text-decoration: none; text-transform: uppercase; letter-spacing: .05em; }
.hdr-back .ic { width: 15px; height: 15px; }
.hdr-back:hover { color: var(--navy); }
.hdr-right { display: flex; align-items: center; gap: 8px; flex: none; }
.inline-form { margin: 0; }

/* Indicateur d'enregistrement */
.sync {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r);
  padding: 7px 12px; font-size: .82rem; font-weight: 700; color: var(--ink-soft);
}
.sync .ic { width: 16px; height: 16px; }
.sync-ic { display: none; }
.sync[data-state="saved"] .sync-ok, .sync[data-state="dirty"] .sync-busy, .sync[data-state="saving"] .sync-busy,
.sync[data-state="offline"] .sync-off, .sync[data-state="error"] .sync-err, .sync[data-state="readonly"] .sync-ro { display: inline-flex; }
.sync[data-state="saved"] { color: var(--ok); border-color: #B9DCC4; background: var(--ok-soft); }
.sync[data-state="saving"] .sync-busy .ic { animation: spin 1s linear infinite; }
.sync[data-state="offline"] { color: var(--warn); border-color: #EBCB8B; background: var(--warn-soft); }
.sync[data-state="error"] { color: var(--red-dark); border-color: #F0B3BC; background: #FDECEE; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .sync .ic { animation: none !important; } }

/* ---------- Boutons ---------- */
button { font-family: inherit; cursor: pointer; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border-radius: var(--r); border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: 700 .92rem var(--font); min-height: 46px;
  text-decoration: none; transition: background .12s, border-color .12s, color .12s; white-space: nowrap;
}
.btn:hover { border-color: var(--ink-soft); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-dark); border-color: var(--navy-dark); }
.btn-secondary { background: var(--navy-soft); border-color: var(--navy-soft); color: var(--navy); }
.btn-secondary:hover { border-color: var(--navy); }
.btn-danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: transparent; }
.btn-sm { min-height: 38px; padding: 7px 12px; font-size: .84rem; }
.btn-lg { min-height: 52px; font-size: 1rem; padding: 12px 22px; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-add {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px;
  background: var(--surface); border: 1px dashed var(--line-strong); color: var(--navy);
  border-radius: var(--r); padding: 10px 12px; font: 700 .9rem var(--font); min-height: 48px;
}
.btn-add:hover { border-style: solid; border-color: var(--navy); background: var(--navy-soft); }
.icon-btn {
  background: none; border: 1px solid transparent; color: var(--ink-soft); width: 40px; height: 40px;
  border-radius: var(--r); flex: none; display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); }
.icon-btn-danger:hover { color: var(--red); background: #FDECEE; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; background: none; border: none; padding: 8px 10px;
  font: 700 .82rem var(--font); color: var(--ink-soft); border-radius: var(--r);
}
.link-btn .ic { width: 16px; height: 16px; }
.link-btn:hover { background: var(--surface-3); color: var(--ink); }
.link-btn.danger:hover { color: var(--red); background: #FDECEE; }

/* ---------- Champs ---------- */
label { display: block; font-size: .84rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.hint { font-weight: 400; color: var(--ink-faint); }
input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="time"], textarea, select {
  width: 100%; padding: 10px 12px; font: 16px/1.3 var(--font); color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r);
  -webkit-appearance: none; appearance: none; min-height: 46px; transition: border-color .12s, box-shadow .12s;
}
input:hover, textarea:hover { border-color: var(--ink-faint); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(58, 85, 201, .2); }
input[readonly] { background: var(--surface-2); color: var(--ink-soft); }
input::placeholder, textarea::placeholder { color: #9BA1AD; }
textarea { min-height: 100px; resize: vertical; }
textarea.ta-sm { min-height: 66px; }
.field { margin-bottom: 16px; min-width: 0; }
.field:last-child { margin-bottom: 0; }
.grid-2, .grid-3, .grid-4 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
.grid-2 > .field, .grid-3 > .field, .grid-4 > .field { margin-bottom: 16px; }
@media (min-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .grid-3 { grid-template-columns: 1.2fr 1.2fr 1fr; }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
.inline-field { display: flex; gap: 8px; align-items: center; }
.inline-field input { flex: 1; }
.help { font-size: .84rem; color: var(--ink-soft); margin: 8px 0 12px; }

/* ---------- Messages ---------- */
.flash {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; font-weight: 700; font-size: .92rem;
  background: var(--ok-soft); color: var(--ok); border: 1px solid #B9DCC4; border-left: 4px solid var(--ok); transition: opacity .4s;
}
.flash-err { background: #FDECEE; color: var(--red-dark); border-color: #F0B3BC; border-left-color: var(--red); }
.flash.is-hiding { opacity: 0; }
.banner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; font-size: .9rem; border: 1px solid; border-left-width: 4px;
}
.banner > .ic { width: 20px; height: 20px; }
.banner-text { flex: 1; min-width: 200px; }
.banner form { margin: 0; }
.banner-closed { background: var(--surface-3); border-color: var(--line-strong); border-left-color: var(--ink); }
.banner-warn { background: var(--warn-soft); color: #5E3A00; border-color: #EBCB8B; border-left-color: var(--warn); }
.notice { display: flex; gap: 12px; padding: 14px; background: var(--navy-soft); border-left: 4px solid var(--navy); border-radius: var(--r); font-size: .9rem; margin-bottom: 18px; color: var(--ink); }
.notice .ic { width: 22px; height: 22px; color: var(--navy); margin-top: 1px; }
.empty {
  display: flex; align-items: center; gap: 10px; color: var(--ink-soft); background: var(--surface);
  border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 20px; margin: 0;
}
.empty .ic { color: var(--ink-faint); }

/* ---------- Panneaux (accueil) ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); margin-bottom: 20px; box-shadow: var(--shadow); }
.panel-head { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-head h2 { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; color: var(--navy); }
.panel-head h2 .ic { width: 20px; height: 20px; }
.panel-head p { font-size: .86rem; color: var(--ink-soft); margin-top: 4px; }
.panel-body { padding: 18px 20px 20px; }
.panel-body > .btn { margin-top: 4px; }

.search-box { position: relative; margin: 6px 0 22px; }
.search-box .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-faint); }
.search-box input[type="search"] { padding-left: 42px; min-height: 50px; }
.section-label {
  display: flex; align-items: center; gap: 10px; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-soft); margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink);
}
.count { background: var(--ink); color: #fff; border-radius: var(--r-sm); padding: 1px 7px; font-size: .74rem; letter-spacing: 0; }
.list-section { margin-bottom: 28px; }
.inter-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inter { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--r); box-shadow: var(--shadow); }
.inter.is-closed { border-left-color: var(--line-strong); }
.inter:hover { border-color: var(--line-strong); border-left-color: var(--navy); }
.inter.is-closed:hover { border-left-color: var(--ink-faint); }
.inter-link { display: flex; align-items: center; gap: 16px; padding: 14px 16px; color: inherit; text-decoration: none; }
.inter-date { flex: none; width: 60px; text-align: center; border-right: 1px solid var(--line); padding-right: 14px; line-height: 1.05; }
.inter-date strong { display: block; font-size: 1.6rem; color: var(--navy); }
.inter-date span { display: block; font-size: .72rem; font-weight: 800; color: var(--ink); margin-top: 2px; }
.inter-date small { display: block; font-size: .7rem; color: var(--ink-faint); margin-top: 2px; }
.inter-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.inter-title { font-weight: 800; font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inter-site { font-size: .9rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.inter-site em { color: var(--ink-faint); }
.inter-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 4px; }
.meta-item { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--ink-faint); }
.meta-item .ic { width: 14px; height: 14px; }
.inter-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.inter-chev { color: var(--ink-faint); flex: none; }
.aegl-tag { font-size: .74rem; font-weight: 800; padding: 4px 9px; border-radius: var(--r-sm); color: var(--aegl-ink); white-space: nowrap; }
.aegl-tag.l1 { background: var(--aegl1); } .aegl-tag.l2 { background: var(--aegl2); } .aegl-tag.l3 { background: var(--aegl3); }
.aegl-tag.l0 { background: var(--ok-soft); color: var(--ok); }
.aegl-tag.empty { background: var(--surface-3); color: var(--ink-faint); font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .04em; }
.status .ic { width: 13px; height: 13px; }
.status.is-open { color: var(--navy); }
.inter-actions { display: flex; justify-content: flex-end; gap: 4px; padding: 4px 8px; border-top: 1px solid var(--line); background: var(--surface-2); }
.inter-actions form { margin: 0; }
.foot { text-align: center; color: var(--ink-faint); font-size: .78rem; padding: 18px 14px 4px; }

/* ---------- Fiche : structure ---------- */
.page-fiche { padding-bottom: calc(var(--bar-h) + var(--safe-b)); }
.layout { display: grid; grid-template-columns: 1fr; gap: 24px; padding-top: 20px; padding-bottom: 32px; }
.content { min-width: 0; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: 260px minmax(0, 1fr); }
}

/* Étapes : barre latérale (ordinateur) */
.sidebar { display: none; }
@media (min-width: 1000px) {
  .sidebar { display: block; position: sticky; top: calc(var(--head-h) + 20px); align-self: start; }
}
.steps { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.step {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  background: none; border: none; border-left: 4px solid transparent; border-bottom: 1px solid var(--line);
  padding: 12px 12px 12px 10px; min-height: 58px; color: var(--ink);
}
.step:last-child { border-bottom: none; }
.step:hover { background: var(--surface-2); }
.step.active { background: var(--navy-soft); border-left-color: var(--navy); }
.step-n {
  width: 30px; height: 30px; flex: none; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .92rem; background: var(--surface-3); color: var(--ink-soft);
}
.step-n .ic { width: 16px; height: 16px; }
.step.active .step-n { background: var(--navy); color: #fff; }
.step.is-done .step-n { background: var(--ok); color: #fff; }
.step-label { flex: 1; min-width: 0; font-weight: 700; font-size: .9rem; line-height: 1.25; }
.step-label small { display: block; font-weight: 500; font-size: .76rem; color: var(--ink-faint); margin-top: 1px; }
.step-state { flex: none; display: inline-flex; align-items: center; justify-content: center; }
.step-state .ic { width: 16px; height: 16px; color: var(--ok); }
.step-state.is-aegl { min-width: 24px; height: 22px; padding: 0 6px; border-radius: var(--r-sm); font-size: .74rem; font-weight: 800; color: var(--aegl-ink); }
.step-state.is-aegl.l1 { background: var(--aegl1); } .step-state.is-aegl.l2 { background: var(--aegl2); } .step-state.is-aegl.l3 { background: var(--aegl3); }
.steps-sep { height: 6px; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.side-legend { margin-top: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.side-legend-title { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 8px; }
.side-legend-row { display: flex; align-items: center; gap: 10px; font-size: .84rem; padding: 3px 0; }
.sw { width: 16px; height: 16px; border-radius: var(--r-sm); flex: none; border: 1px solid rgba(0,0,0,.15); }
.sw.l1 { background: var(--aegl1); } .sw.l2 { background: var(--aegl2); } .sw.l3 { background: var(--aegl3); }

/* Étapes : barre défilante (tablette, mobile) */
.steps-mobile { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
@media (min-width: 1000px) { .steps-mobile { display: none; } }
.steps-mobile-inner { display: flex; gap: 6px; padding: 8px 14px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.steps-mobile-inner::-webkit-scrollbar { display: none; }
.step-chip {
  flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); border-radius: var(--r);
  padding: 6px 12px 6px 6px; font: 700 .86rem var(--font);
}
.step-chip .step-n { width: 26px; height: 26px; font-size: .82rem; }
.step-chip > .ic { width: 16px; height: 16px; margin-left: 4px; color: var(--ink-soft); }
.step-chip.active { border-color: var(--navy); background: var(--navy-soft); color: var(--navy); }
.step-chip.active .step-n { background: var(--navy); color: #fff; }
.step-chip.is-done .step-n { background: var(--ok); color: #fff; }
.step-chip .step-state:empty { display: none; }

/* Sections */
.pane { display: none; }
.pane.is-active { display: block; }
.pane-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
.pane-num {
  width: 40px; height: 40px; flex: none; border-radius: var(--r); background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem; font-weight: 800;
}
.pane-num-ref { background: var(--ink); }
.pane-num .ic { width: 20px; height: 20px; }
.pane-head h2 { font-size: 1.35rem; color: var(--ink); line-height: 1.2; }
.pane-head p { font-size: .9rem; color: var(--ink-soft); margin-top: 4px; max-width: 760px; }
.pane-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; box-shadow: var(--shadow); }
.box-flush { padding: 0; overflow: hidden; }
.block-title { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 26px 0 12px; color: var(--navy); }
.block-title .ic { width: 20px; height: 20px; }

/* Lignes dynamiques */
.row-list { display: flex; flex-direction: column; gap: 12px; }
.table-row { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: var(--r); padding: 6px 16px 16px; box-shadow: var(--shadow); }
.row-head { display: flex; align-items: center; justify-content: space-between; margin: 0 -10px 6px 0; min-height: 40px; }
.row-num { font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--navy); }

/* Parc d'appareils */
details.catalogue { background: var(--surface); border: 1px solid var(--navy); border-radius: var(--r); margin-bottom: 14px; }
details.catalogue > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; font-weight: 800; color: var(--navy); min-height: 50px; background: var(--navy-soft);
}
details.catalogue > summary > span:first-of-type { flex: 1; }
details.catalogue[open] > summary { border-bottom: 1px solid var(--navy); }
.catalogue-body { padding: 14px 16px 16px; }
.device-grid { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 760px) { .device-grid { grid-template-columns: 1fr 1fr; } }
.device-group { border: 1px solid var(--line); border-radius: var(--r); padding: 4px 12px 2px; }
.device-group-title { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin: 8px 0 2px; }
.device-chk { display: flex; align-items: center; gap: 12px; padding: 9px 0; font-size: .92rem; font-weight: 600; color: var(--ink); margin: 0; min-height: 44px; cursor: pointer; }
.device-chk + .device-chk { border-top: 1px solid var(--line); }
.device-chk input { width: 20px; height: 20px; flex: none; accent-color: var(--navy); }

/* Repliables */
summary { -webkit-tap-highlight-color: transparent; }
summary::-webkit-details-marker { display: none; }
.chev { flex: none; color: var(--ink-faint); display: inline-flex; transition: transform .15s ease; }
details[open] > summary > .chev { transform: rotate(180deg); }

/* Points de mesure */
.points-list { display: flex; flex-direction: column; gap: 12px; }
details.point { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; }
details.point.has-data { border-left-color: var(--navy); }
details.point[open] { border-color: var(--line-strong); border-left-color: var(--navy); }
details.point > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 14px; min-height: 70px; }
details.point > summary:hover { background: var(--surface-2); }
details.point[open] > summary { border-bottom: 1px solid var(--line); background: var(--surface-2); }
.point-badge {
  width: 42px; height: 42px; border-radius: var(--r); flex: none; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.2rem; background: var(--navy); color: #fff;
}
details.point[data-extra] .point-badge { background: var(--surface); color: var(--navy); border: 2px solid var(--navy); }
.point-titles { flex: 1; min-width: 0; display: block; }
.point-titles .t1 { display: block; font-weight: 800; font-size: 1.02rem; }
.point-titles .t2 { display: block; font-size: .86rem; color: var(--ink-soft); }
.point-titles .t3 { display: block; font-size: .78rem; color: var(--ink-faint); margin-top: 3px; }
.point-titles .t3:empty { display: none; }
.lvl-pill { display: inline-block; font-size: .74rem; font-weight: 800; padding: 3px 8px; border-radius: var(--r-sm); color: var(--aegl-ink); flex: none; white-space: nowrap; }
.lvl-pill.l1 { background: var(--aegl1); } .lvl-pill.l2 { background: var(--aegl2); } .lvl-pill.l3 { background: var(--aegl3); }
.point-body { padding: 4px 18px 20px; }
.sub-block { padding-top: 18px; }
.sub-block + .sub-block { margin-top: 18px; border-top: 1px solid var(--line); }
.sub-title { display: flex; align-items: center; gap: 10px; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink); margin-bottom: 12px; }
.sub-num { width: 22px; height: 22px; border-radius: var(--r-sm); background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .76rem; letter-spacing: 0; }

/* Carte */
.map-wrap { position: relative; height: 300px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line-strong); background: #DDE2E6; isolation: isolate; margin-top: 4px; }
.map { position: absolute; inset: 0; }
.map.leaflet-container { font: inherit; background: #DDE2E6; }
.map-msg { position: absolute; left: 8px; right: 8px; top: 8px; z-index: 900; background: rgba(255,255,255,.97); color: var(--ink); font-size: .8rem; padding: 8px 10px; border-radius: var(--r); border: 1px solid var(--line-strong); }
.map-zoom { position: absolute; left: 8px; bottom: 26px; z-index: 900; display: flex; flex-direction: column; gap: 6px; }
.map-zoom button { width: 42px; height: 42px; border-radius: var(--r); border: 1px solid var(--line-strong); background: #fff; color: var(--ink); display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.map-zoom .ic { width: 20px; height: 20px; }
.map-attr { position: absolute; right: 0; bottom: 0; z-index: 900; background: rgba(255,255,255,.85); font-size: .66rem; padding: 1px 5px; }
.map-attr a { color: var(--ink); }
.map-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gps-status { font-size: .84rem; color: var(--ink-soft); margin-top: 8px; min-height: 1.2em; }
.gps-status.is-ok { color: var(--ok); font-weight: 700; }
.gps-status.is-err { color: var(--red-dark); font-weight: 700; }
.coords { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 6px; }
.coords label { font-size: .76rem; color: var(--ink-soft); }
.coords input { font-family: var(--mono); font-size: .88rem; min-height: 40px; }
.ext-link { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: .86rem; font-weight: 700; text-decoration: none; }
.ext-link .ic { width: 15px; height: 15px; }
.pin span { display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #273474; color: #fff; font-weight: 800; font-size: .95rem; border: 3px solid #fff; box-shadow: 0 1px 5px rgba(0,0,0,.5); }
.pin-ghost span { width: 24px; height: 24px; font-size: .72rem; background: rgba(39, 52, 116, .5); border-width: 2px; box-shadow: none; }
.leaflet-div-icon.pin { background: transparent; border: none; }

/* Relevés */
.time-list { display: flex; flex-direction: column; gap: 8px; }
details.timepoint { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
details.timepoint > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); min-height: 52px; flex-wrap: wrap; }
details.timepoint[open] > summary { border-bottom: 1px solid var(--line); }
.tp-name { font-weight: 800; font-size: .92rem; background: var(--ink); color: #fff; border-radius: var(--r-sm); padding: 3px 8px; }
.tp-label { font-weight: 700; font-size: .9rem; }
.tp-info { flex: 1; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-soft); }
.tp-time { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-weight: 700; color: var(--ink); }
.tp-time .ic { width: 14px; height: 14px; }
.tp-count { background: var(--surface-3); border-radius: var(--r-sm); padding: 2px 7px; font-weight: 700; }
.tp-empty { color: var(--ink-faint); font-style: italic; }
.time-body { padding: 14px; }
.heure-field { max-width: 320px; }
.param-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 4px; }
@media (min-width: 600px) { .param-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1200px) { .param-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.param-row label { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.p-name { font-size: .92rem; }
.param-row .unit { color: var(--ink-faint); font-weight: 600; font-size: .74rem; }
.param-row input { text-align: center; font-family: var(--mono); font-size: 1.08rem; font-weight: 700; }
.param-row input::placeholder { font-family: var(--font); font-size: .82rem; font-weight: 400; }
.p-hint { display: block; font-size: .72rem; color: var(--ink-faint); margin-top: 3px; text-align: center; }
.p-hint.is-err { color: var(--red-dark); font-weight: 700; }
input.lvl-1 { background: var(--aegl1) !important; color: var(--aegl-ink) !important; border-color: var(--aegl1-b) !important; }
input.lvl-2 { background: var(--aegl2) !important; color: var(--aegl-ink) !important; border-color: var(--aegl2-b) !important; }
input.lvl-3 { background: var(--aegl3) !important; color: var(--aegl-ink) !important; border-color: var(--aegl3-b) !important; }
input.is-invalid { border-color: var(--red) !important; box-shadow: 0 0 0 3px rgba(227, 17, 47, .15); }

/* Synthèse */
.syn-head { display: grid; grid-template-columns: 1fr; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
@media (min-width: 700px) { .syn-head { grid-template-columns: 260px 1fr; } }
.syn-level { padding: 18px 20px; background: var(--ok-soft); color: var(--ok); }
.syn-head.l1 .syn-level { background: var(--aegl1); color: var(--aegl-ink); }
.syn-head.l2 .syn-level { background: var(--aegl2); color: var(--aegl-ink); }
.syn-head.l3 .syn-level { background: var(--aegl3); color: var(--aegl-ink); }
.syn-level span { display: block; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.syn-level strong { display: block; font-size: 1.8rem; line-height: 1.15; margin-top: 4px; }
.syn-def { padding: 18px 20px; font-size: .95rem; align-self: center; }
.syn-kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 12px; }
@media (min-width: 760px) { .syn-kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.kpi span { display: block; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.kpi strong { display: block; font-size: 1.3rem; margin-top: 2px; }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tbl th, .tbl td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.tbl thead th { background: var(--ink); color: #fff; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.tbl thead th small { display: block; font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .75; }
.tbl tbody tr:last-child > * { border-bottom: none; }
.tbl td.num { font-family: var(--mono); font-weight: 700; white-space: nowrap; }
.tbl-grid th, .tbl-grid td { border-right: 1px solid var(--line); text-align: center; }
.tbl-grid tbody th { text-align: left; font-weight: 500; white-space: nowrap; background: var(--surface-2); }
.tbl td.c1 { background: var(--aegl1); } .tbl td.c2 { background: var(--aegl2); } .tbl td.c3 { background: var(--aegl3); }
.tbl .na { color: var(--ink-faint); white-space: nowrap; }
.ok-tag { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 700; font-size: .8rem; white-space: nowrap; }
.ok-tag .ic { width: 14px; height: 14px; }

/* Référentiel */
.aegl-defs { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 16px; }
@media (min-width: 760px) { .aegl-defs { grid-template-columns: repeat(3, 1fr); } }
.aegl-def { border-radius: var(--r); padding: 14px 16px; color: var(--aegl-ink); border: 1px solid rgba(0,0,0,.12); }
.aegl-def.l1 { background: var(--aegl1); } .aegl-def.l2 { background: var(--aegl2); } .aegl-def.l3 { background: var(--aegl3); }
.aegl-def-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.aegl-def-head strong { font-size: 1.1rem; }
.aegl-def-head span { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.aegl-def p { font-size: .88rem; }
.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.seuils { border-collapse: collapse; width: 100%; font-size: .88rem; min-width: 640px; }
table.seuils th, table.seuils td { border: 1px solid rgba(0,0,0,.14); padding: 9px; text-align: center; color: var(--aegl-ink); }
table.seuils thead th { background: var(--ink); color: #fff; }
table.seuils tbody th { text-align: left; white-space: nowrap; }
table.seuils tr.c1 > * { background: var(--aegl1); }
table.seuils tr.c2 > * { background: var(--aegl2); }
table.seuils tr.c3 > * { background: var(--aegl3); }

/* Clôture */
.close-box { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 28px; padding: 18px; background: var(--surface); border: 1px solid var(--line-strong); border-left: 4px solid var(--ink); border-radius: var(--r); }
.close-box h3 { display: flex; align-items: center; gap: 8px; font-size: 1rem; }
.close-box p { font-size: .88rem; color: var(--ink-soft); margin-top: 4px; max-width: 560px; }
.close-box form { margin: 0; }

/* ---------- Barre d'actions ---------- */
.actions-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  background: var(--surface); border-top: 1px solid var(--line-strong);
  padding: 10px 0 calc(10px + var(--safe-b)); box-shadow: 0 -2px 10px rgba(22, 27, 46, .06);
}
.actions-inner { display: flex; gap: 8px; }
.actions-inner .btn { flex: 1; }
@media (min-width: 760px) { .actions-inner { justify-content: flex-end; } .actions-inner .btn { flex: 0 0 auto; min-width: 160px; } }

/* ---------- Boîte de dialogue, message bref ---------- */
.modal { position: fixed; inset: 0; z-index: 1300; background: rgba(22, 27, 46, .55); display: flex; align-items: flex-end; justify-content: center; padding: 14px; }
@media (min-width: 640px) { .modal { align-items: center; } }
.modal-card { background: var(--surface); color: var(--ink); border-radius: var(--r); width: 100%; max-width: 480px; box-shadow: var(--shadow-lg); border-top: 4px solid var(--navy); margin-bottom: var(--safe-b); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 0; }
.modal-head h2 { font-size: 1.1rem; }
.modal-icon { width: 38px; height: 38px; flex: none; border-radius: var(--r); background: var(--navy-soft); color: var(--navy); display: flex; align-items: center; justify-content: center; }
.modal-icon .ic { width: 20px; height: 20px; }
.modal-icon.is-danger { background: #FDECEE; color: var(--red); }
.modal-text { padding: 12px 20px 0; font-size: .94rem; color: var(--ink-soft); }
.modal-field { padding: 14px 20px 0; }
.modal-extra:empty { display: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 20px; }
.modal-stack { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--bar-h) + var(--safe-b) + 14px); transform: translateX(-50%) translateY(8px);
  display: flex; align-items: center; gap: 8px;
  background: var(--ink); color: #fff; padding: 11px 16px; border-radius: var(--r); font-size: .88rem; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 1400; max-width: 92%; box-shadow: var(--shadow-lg);
}
.toast .ic { color: #7FD69A; }
.toast.is-err .ic { color: #FF9AA8; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.page-list .toast { bottom: 20px; }

/* Mention de l'hébergeur */
.credit { text-align: center; font-size: .78rem; color: var(--ink-faint); padding: 14px 16px 22px; }
.credit a { color: var(--navy); font-weight: 700; text-decoration: none; }
.credit a:hover { text-decoration: underline; }
.page-fiche .credit { padding-bottom: 18px; }
.page-login .credit { position: fixed; left: 0; right: 0; bottom: calc(10px + var(--safe-b)); padding: 0; }

/* ---------- Lecture seule ---------- */
.is-readonly .editable-only { display: none !important; }
.is-readonly input, .is-readonly textarea { background: var(--surface-2); }

/* ---------- Connexion ---------- */
.page-login { background: var(--bg); }
.login-shell { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; border-top: 4px solid var(--red); }
.login-card { background: var(--surface); width: 100%; max-width: 440px; border: 1px solid var(--line); border-radius: var(--r); padding: 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; justify-content: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.login-brand img { height: 84px; width: auto; }
.login-title { text-align: center; padding: 18px 0 20px; }
.login-title h1 { font-size: 1.35rem; color: var(--navy); }
.login-title p { font-size: .88rem; color: var(--ink-soft); margin-top: 4px; }
.login-form .btn { margin-top: 6px; }
.login-foot { margin-top: 16px; font-size: .78rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .1em; }

/* ---------- Correctifs généraux ---------- */
/* iOS centre la date et l'heure : on les aligne comme les autres champs */
input[type="date"], input[type="time"] { text-align: left; }
input[type="date"]::-webkit-date-and-time-value, input[type="time"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: .6; }
/* Une grille ne doit jamais s'élargir au-delà de l'écran à cause d'un texte sur une ligne */
.inter-list { grid-template-columns: minmax(0, 1fr); }
.inter, .inter-main, .content, .pane, .box, .table-row, details.point { min-width: 0; }
.l-short { display: none; }

/* Création d'intervention (repliable) */
.create-panel > summary.create-summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; min-height: 64px;
}
.create-panel > summary:hover { background: var(--surface-2); }
.create-panel[open] > summary { border-bottom: 1px solid var(--line); }
.create-ic { width: 40px; height: 40px; flex: none; border-radius: var(--r); background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; }
.create-ic .ic { width: 22px; height: 22px; }
.create-txt { flex: 1; min-width: 0; }
.create-txt strong { display: block; font-size: 1.05rem; color: var(--navy); }
.create-txt small { display: block; font-size: .84rem; color: var(--ink-soft); }
.help-top { margin-top: 0; }

/* Tableau des dépassements : version cartes compactes sur téléphone */
@media (max-width: 640px) {
  .tbl-cards thead { display: none; }
  .tbl-cards, .tbl-cards tbody { display: block; width: 100%; }
  .tbl-cards tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px 10px;
    padding: 10px 12px; border-bottom: 1px solid var(--line); border-left: 4px solid var(--line-strong);
  }
  .tbl-cards tr.r1 { border-left-color: var(--aegl1-b); } .tbl-cards tr.r2 { border-left-color: var(--aegl2-b); } .tbl-cards tr.r3 { border-left-color: var(--aegl3-b); }
  .tbl-cards tr:last-child { border-bottom: none; }
  .tbl.tbl-cards td { display: block; padding: 0; border: none; text-align: left; min-width: 0; }
  .tbl-cards td[data-label="Niveau"] { grid-column: 1; grid-row: 1; }
  .tbl-cards td[data-label="Paramètre"] { grid-column: 2; grid-row: 1; font-weight: 800; font-size: .96rem; }
  .tbl-cards td[data-label="Valeur"] { grid-column: 3; grid-row: 1; font-size: 1rem; text-align: right; }
  .tbl-cards td[data-label="Point"] { grid-column: 1 / -1; grid-row: 2; font-size: .84rem; color: var(--ink-soft); }
  .tbl-cards td[data-label="Relevé"] { grid-column: 1 / -1; grid-row: 3; font-size: .8rem; color: var(--ink-faint); }
  .tbl-cards td[data-label="Relevé"]::before { content: "Relevé "; }
}
/* Matrice des maxima : première colonne figée pendant le défilement horizontal */
.tbl-sticky tbody th, .tbl-sticky thead th:first-child { position: sticky; left: 0; z-index: 1; }
.tbl-sticky thead th:first-child { background: var(--ink); }
.tbl-sticky tbody th { box-shadow: 1px 0 0 var(--line); }

/* ---------- Tablettes et téléphones ---------- */
@media (max-width: 999px) {
  .layout { padding-top: 26px; gap: 0; }
  /* Défilement automatique : ne jamais cacher un bloc sous l'en-tête fixe */
  details.point, .table-row, .pane, .box, details.catalogue { scroll-margin-top: 130px; }
}

/* ---------- Téléphones ---------- */
@media (max-width: 640px) {
  :root { --bar-h: 74px; }
  body { font-size: 15px; }
  .wrap { padding-left: 12px; padding-right: 12px; }
  .page { padding-top: 20px; }

  /* En-tête compact */
  .hdr { border-top-width: 3px; }
  .hdr-inner { gap: 10px; min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
  .hdr-logo { padding-right: 10px; }
  .hdr-logo img { height: 34px; }
  .hdr h1 { font-size: 1.02rem; }
  .hide-s { display: none; }
  .page-list .hdr-kicker { display: none; }
  .page-list .hdr h1 { white-space: normal; line-height: 1.2; }
  .hdr-right .btn-sm { min-height: 40px; width: 42px; padding: 0; }

  /* Fiche : en-tête réduit à retour + titre + état */
  .page-fiche .hdr-logo { display: none; }
  .page-fiche .hdr-title { display: flex; align-items: center; gap: 10px; }
  .page-fiche .hdr-back {
    flex: none; width: 40px; height: 40px; justify-content: center; border: 1px solid var(--line-strong);
    border-radius: var(--r); color: var(--ink);
  }
  .page-fiche .hdr-back span { display: none; }
  .page-fiche .hdr-back .ic { width: 20px; height: 20px; }
  .sync { padding: 0; width: 40px; height: 40px; justify-content: center; }
  .sync .sync-text { display: none; }
  .sync .ic { width: 18px; height: 18px; }

  /* Barre d'étapes compacte */
  .steps-mobile-inner { gap: 6px; padding: 7px 12px; }
  .step-chip { min-height: 36px; padding: 4px 10px 4px 4px; gap: 6px; font-size: .82rem; }
  .step-chip .step-n { width: 26px; height: 26px; font-size: .8rem; }
  .step-chip .step-state.is-aegl { height: 20px; font-size: .68rem; padding: 0 5px; }
  .step-chip > .ic { margin-left: 2px; }

  /* Sections */
  .pane-head { gap: 12px; margin-bottom: 18px; padding-bottom: 14px; align-items: flex-start; }
  .pane-head h2 { margin-top: 2px; }
  .pane-num { width: 32px; height: 32px; font-size: .98rem; }
  .pane-num .ic { width: 17px; height: 17px; }
  .pane-head h2 { font-size: 1.12rem; }
  .pane-head p { font-size: .84rem; margin-top: 2px; }
  .pane-nav { flex-direction: column-reverse; margin-top: 20px; padding-top: 14px; }
  .pane-nav .btn { width: 100%; }
  .pane-nav > span:empty { display: none; }
  .box { padding: 14px 12px; }
  .box-flush { padding: 0; }
  .block-title { margin: 22px 0 10px; font-size: .96rem; }

  /* Champs */
  label { font-size: .82rem; margin-bottom: 5px; }
  .field, .grid-2 > .field, .grid-3 > .field, .grid-4 > .field { margin-bottom: 12px; }
  input[type="text"], input[type="search"], input[type="password"], input[type="date"], input[type="time"], textarea { padding: 10px 11px; min-height: 46px; }
  .help { font-size: .82rem; }

  /* Lignes dynamiques */
  .table-row { padding: 4px 12px 12px; }
  .row-head { min-height: 38px; }
  .row-list { gap: 10px; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-4 > .field:nth-child(n) { min-width: 0; }

  /* Parc d'appareils */
  details.catalogue > summary { padding: 10px 12px; min-height: 48px; font-size: .92rem; }
  .catalogue-body { padding: 10px 12px 12px; }
  .catalogue-body > .btn { width: 100%; }
  .device-chk { font-size: .88rem; gap: 10px; min-height: 44px; }

  /* Points de mesure */
  details.point > summary { gap: 10px; padding: 12px 10px 12px 12px; min-height: 64px; }
  .point-badge { width: 36px; height: 36px; font-size: 1.05rem; }
  .point-titles .t1 { font-size: .96rem; }
  .point-titles .t2 { font-size: .8rem; line-height: 1.3; }
  .point-titles .t3 { font-size: .74rem; }
  details.point > summary .icon-btn { width: 36px; height: 36px; }
  .lvl-pill { font-size: .68rem; padding: 3px 6px; }
  .point-body { padding: 0 12px 16px; }
  .sub-block { padding-top: 14px; }
  .sub-block + .sub-block { margin-top: 14px; }
  .map-wrap { height: 240px; }
  .map-actions { grid-template-columns: 1fr; }
  .coords { grid-template-columns: 1fr 1fr; gap: 6px; }
  .coords > div:last-child { grid-column: 1 / -1; }

  /* Relevés */
  details.timepoint > summary { gap: 8px; padding: 9px 10px; min-height: 50px; }
  .tp-label { font-size: .84rem; }
  details.timepoint > summary > .chev { order: 2; margin-left: auto; }
  .tp-info { order: 3; flex-basis: 100%; justify-content: flex-start; padding-left: 0; }
  .tp-info:empty { display: none; }
  .tp-empty { display: none; }
  .time-body { padding: 12px 10px; }
  .heure-field { max-width: none; }
  .param-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; }
  .param-row label { margin-bottom: 3px; }
  .p-name { font-size: .88rem; }
  .param-row input { font-size: 1.05rem; min-height: 48px; padding: 8px 6px; }
  .p-hint { font-size: .68rem; }

  /* Synthèse */
  .syn-level { padding: 14px 16px; }
  .syn-level strong { font-size: 1.5rem; }
  .syn-def { padding: 12px 16px; font-size: .88rem; }
  .syn-kpis { gap: 8px; margin-top: 10px; }
  .kpi { padding: 10px 12px; }
  .kpi strong { font-size: 1.15rem; }
  .tbl { font-size: .84rem; }
  .tbl th, .tbl td { padding: 8px 9px; }
  .tbl-grid .pt-name { display: none; }

  /* Référentiel */
  .aegl-def { padding: 12px 14px; }

  /* Clôture */
  .close-box { padding: 14px; gap: 12px; }
  .close-box form, .close-box .btn { width: 100%; }

  /* Barre d'actions : icône au-dessus du libellé */
  .actions-bar { padding: 8px 0 calc(8px + var(--safe-b)); }
  .actions-inner { gap: 6px; }
  .actions-inner .btn { flex-direction: column; gap: 3px; min-height: 54px; padding: 6px 4px; font-size: .76rem; }
  .actions-inner .btn .ic { width: 20px; height: 20px; }
  .l-long { display: none; }
  .l-short { display: inline; }

  /* Accueil */
  .create-panel > summary.create-summary { padding: 12px 14px; min-height: 60px; gap: 12px; }
  .create-ic { width: 36px; height: 36px; }
  .panel-head, .panel-body { padding-left: 14px; padding-right: 14px; }
  .panel-body { padding-top: 14px; padding-bottom: 16px; }
  .btn-create { width: 100%; }
  .create-panel .grid-4 { grid-template-columns: 1fr; }
  .search-box { margin: 4px 0 18px; }
  .section-label { font-size: .72rem; letter-spacing: .08em; }
  .inter-link { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 4px 12px; padding: 12px; align-items: start; }
  .inter-date { width: auto; padding-right: 10px; grid-row: span 2; }
  .inter-date strong { font-size: 1.35rem; }
  .inter-title { white-space: normal; font-size: .98rem; line-height: 1.25; }
  .inter-site { white-space: normal; font-size: .86rem; }
  .inter-meta { flex-direction: column; gap: 2px; margin-top: 2px; }
  .inter-side { grid-column: 2; flex-direction: row; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
  .status { display: inline-flex; }
  .inter-chev { display: none; }
  .inter-actions { justify-content: stretch; padding: 0; }
  .inter-actions form { flex: 1; }
  .inter-actions .link-btn { width: 100%; justify-content: center; min-height: 44px; border-radius: 0; }
  .inter-actions form + form { border-left: 1px solid var(--line); }
  .empty { padding: 16px; font-size: .9rem; }

  /* Connexion */
  .login-card { padding: 22px 18px; }
  .login-brand img { height: 70px; }

  /* Dialogues */
  .modal { padding: 10px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions .btn { width: 100%; }
  .toast { left: 12px; right: 12px; transform: translateY(8px); max-width: none; }
  .toast.show { transform: translateY(0); }
}

/* Très petits écrans (iPhone SE, anciens Android) */
@media (max-width: 360px) {
  .param-grid { gap: 8px 6px; }
  .param-row input { font-size: .98rem; }
  .grid-4 { grid-template-columns: 1fr; }
  .actions-inner .btn { font-size: .7rem; }
}

/* ---------- Impression ---------- */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; color: #000; font-size: 11.5px; padding-bottom: 0 !important; }
  .sticky-head, .hdr { position: static; }
  .hdr { border-top: 3px solid var(--red); }
  .no-print, .map-wrap, .sidebar, .steps-mobile, .actions-bar, .toast, .modal, .btn, .btn-add, .icon-btn, .editable-only, .banner, .foot, .pane-nav, .help { display: none !important; }
  .layout { display: block; padding: 8px 0 0; }
  .pane, .pane.is-active { display: block !important; break-before: auto; margin-bottom: 18px; }
  .pane-head { break-after: avoid; }
  .box, details.point, details.timepoint, .table-row, .syn-head, .kpi { box-shadow: none; break-inside: avoid; }
  .chev { display: none; }
  input, textarea { border: 1px solid #999 !important; min-height: 0; padding: 4px 6px; }
  input:not(.lvl-1):not(.lvl-2):not(.lvl-3), textarea { background: #fff !important; color: #000 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
