/* COMMON.CSS — Styles partagés par les 9 rapports BOSCH (PWA statique), chargés via <link rel="stylesheet" href="../../assets/css/common.css"> */

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --red: #c8102e;
  --red-dark: #a00d24;
  --gray-header: #b0b0b0;
  --gray-bg: #e8e8e8;
  --gray-cell: #f4f4f4;
  --gray-alt: #d4d4d4;
  --border: #bbb;
  --text: #1a1a1a;
  --white: #fff;
  --font: "Arial Narrow", Arial, sans-serif;
  --field-h: 20px; /* hauteur unique de tous les champs de saisie (texte, date, heure, select) */
}

body {
  font-family: var(--font);
  font-size: 11px;
  color: var(--text);
  background: #e0e0e0;
  line-height: 1.3;
}

.input-unit {
  display: inline-grid;
  grid-template-columns: 60px 35px 20px;
  align-items: center;
}

.double-flux-select {
  margin-left: 8px;
}

.input-unit input {
  width: 60px;
  text-align: right;
}

.intensite-charge-table .label-col {
  text-align: center;
}

.unite {
  margin-left: 2px;
  min-width: 10px;
  width: 35px;
  text-align: center;
}

.alerte-triangle {
  text-align: center;

  width: 20px; /* largeur fixe */

  color: #c8102e;
  font-size: 16px;

  visibility: hidden; /* invisible mais garde sa place */
}

.ligne-intensite-max td,
.ligne-intensite-max input,
.ligne-intensite-max span {
  color: #c8102e !important;
  font-weight: 700;
}

.p3-escl1,
.p3-escl2,
.p3-escl3 {
  display: none;
}

.p4-escl1,
.p4-escl2,
.p4-escl3 {
  display: none;
}

/* ===== PAGE CONTAINER ===== */
.page {
  background: var(--white);
  /* width: min(210mm, 100%) plutôt qu'une largeur fixe de 210mm : garantit
     que la page ne dépasse JAMAIS la largeur de l'écran, quelle qu'elle
     soit (fenêtre de navigateur PC/Mac réduite, iPad en split-screen,
     téléphone en paysage à une largeur non prévue par le point de rupture
     ci-dessous, etc.), plutôt que de dépendre d'un seuil fixe à faire
     coïncider avec la largeur réelle de 210mm. Sans effet à l'impression :
     @media print redéfinit explicitement "width: 210mm" plus bas. */
  width: min(210mm, 100%);
  min-height: 297mm;
  margin: 12px auto;
  padding: 8mm 8mm 15mm 8mm;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  page-break-after: always;
  position: relative;

  display: flex;
  flex-direction: column;
}

/* ===== HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
  border-bottom: 2px solid var(--red);
  padding-bottom: 4px;
}
.page-header-title {
  flex: 1;
}
.page-header-title h1 {
  font-size: 19px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.15;
  letter-spacing: -0.3px;
}
.hitachi-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.hitachi-logo .logo-text {
  font-size: 30px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: 1px;
  line-height: 1;
}
.hitachi-logo .logo-sub {
  font-size: 11px;
  color: var(--text);
  text-align: right;
  line-height: 1;
  letter-spacing: 0.5px;
  font-style: italic;
}

.page-footer-info {
  /* Ancré en bas via flex (au lieu d'un positionnement absolu) : reste collé au
     bas de la page tant que le contenu tient dans les 297mm, mais suit
     naturellement le contenu s'il déborde légèrement — au lieu de se
     superposer par-dessus (cas observé à l'impression sur certains rapports
     quand une page est chargée de justesse). */
  margin-top: auto;
  width: 100%;
  text-align: center;
  border-top: 1px solid var(--border);
  padding: 4px 8px 0;
  line-height: 1.2;
  font-size: 9px;
}

/* ===== ALERTES COMPATIBLES MOBILE / iOS ===== */
.status-alert-badge {
  display: none;
  align-items: center;
  justify-content: center;
  margin-left: 4px;
  padding: 2px 5px;
  border: 1px solid #c8102e;
  border-radius: 3px;
  background: #fff1f3;
  color: #c8102e;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}
.status-alert-badge.visible {
  display: inline-flex;
}
.status-select.nonconforme,
.status-select.select-alerte {
  color: #c8102e !important;
  font-weight: 700 !important;
  border-color: #c8102e !important;
}

/* ===== SECTION ALERTE ===== */
.select-alerte {
  color: #c8102e !important;
  font-weight: 700 !important;
}

/* ===== SECTION TITLE ===== */
.section-title {
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  padding: 4px 6px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.sub-section-title {
  background: var(--gray-header);
  color: var(--white);
  font-weight: 700;
  font-size: 10px;
  text-align: center;
  padding: 3px 6px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.pressostat-row {
  display: flex;
  align-items: stretch;
}
.pressostat-row .sub-section-title-inline {
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex: 1 1 0;
  background: transparent;
  color: var(--text);
  text-transform: none;
  padding-left: 0;
  margin-left: -1px;
}
.pressostat-row table {
  flex: 4 1 0;
  width: auto;
  border-collapse: collapse;
}
.pressostat-row table td {
  border: none;
  background: transparent;
  font-weight: 400;
}
.pressostat-cell {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 3px;
}
.pressostat-row.consigne-var-row {
  display: grid;
}
.consigne-var-row-6col {
  grid-template-columns: repeat(6, 1fr);
}
.consigne-var-row .pressostat-cell {
  padding: 2px 4px;
  justify-content: center;
}
.block {
  border: 1px solid var(--border);
  margin-bottom: 5px;
}

/* FORM FIELDS Style unique pour TOUS les champs de saisie de l'application (texte, date, heure, listes déroulantes) : même hauteur, même cadre, même fond gris clair, quel que soit… */
input[type="text"],
input[type="date"],
input[type="time"],
select {
  height: var(--field-h);
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: var(--gray-cell);
  font-family: var(--font);
  font-size: 11px;
  color: var(--text);
  padding: 1px 4px;
  outline: none;
  text-align: left;
}
input[type="text"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
select:focus {
  background: #fffde7;
}

/* Classe historique : ne gère plus que la largeur, le cadre/fond/hauteur viennent désormais de la règle ci-dessus. */
.form-input {
  width: 100%;
  min-width: 0;
}

/* Utilitaires d'alignement : à ajouter EN PLUS de la classe du champ (ex : class="form-input text-right") quand le texte doit être justifié à droite ou centré plutôt qu'à gauche (valeur par défaut). */
.text-left {
  text-align: left !important;
}
.text-center {
  text-align: center !important;
}
.text-right {
  text-align: right !important;
}

input[type="hidden"] {
  width: 11px;
  height: 11px;
  cursor: pointer;
  accent-color: var(--red);
  vertical-align: middle;
  margin-right: 2px;
}

/* ===== COORDONNÉES ===== */
.coord-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.coord-col {
  padding: 3px 5px;
}
.coord-col + .coord-col {
  border-left: 1px solid var(--border);
}
.coord-grid-no-divider .coord-col + .coord-col {
  border-left: none;
}
.coord-grid-3col {
  grid-template-columns: 1fr 1fr 1fr;
}
.coord-row .select-fit {
  flex: 0 0 auto;
  width: auto;
  min-width: 0;
}
.coord-row-tight {
  gap: 4px;
}
.coord-row-tight .coord-label {
  min-width: 0;
}
.coord-input-narrow {
  flex: 0 0 auto;
  width: 10ch;
  min-width: 10ch;
}
.coord-input-w6 {
  flex: 0 0 auto;
  width: 6ch;
  min-width: 6ch;
}
/* Champs courts (ex. tensions/intensités L1-L2-L3 du bloc "Relevés électriques en charge" de chiller-l) : place pour 4 caractères saisis.
   "calc(4ch + 10px)" et non "4ch" seul : box-sizing:border-box (input[type=text] plus haut) inclut le padding (4px de chaque côté) et la bordure (1px de
   chaque côté) DANS la largeur — sans ce complément de 10px, ces 4ch de marge seraient rognés par le padding/la bordure et 4 caractères ne tiendraient plus.
   Sélecteur "input.coord-input-w2" (et non ".coord-input-w2" seul) : la règle ".coord-input{flex:1}" plus bas dans ce fichier a la même spécificité qu'une classe seule et,
   étant déclarée après, l'emporterait sinon sur ce flex:0 0 auto (déjà le cas, sans conséquence visible, pour .coord-input-w6 dont la largeur "accidentellement" correcte ne
   tient qu'à la faible place laissée par des libellés longs — ça ne peut pas être laissé au hasard pour ce champ nettement plus étroit). */
input.coord-input-w2 {
  flex: 0 0 auto;
  width: calc(4ch + 10px);
  min-width: calc(4ch + 10px);
}
.coord-input-third {
  flex: 0 0 auto;
  width: calc(100% / 3);
  min-width: 0;
}
/* Priorité sur "td input[type=text]{width:100%}" quand ce champ est utilisé dans une cellule de tableau (Pressostat HP, Consigne variable, Intensité pompe...) : sans cette règle… */
td input.coord-input-w6[type="text"] {
  width: 6ch;
}
/* Les champs texte réorganisés en cellule (Pressostat HP, Consigne variable, Intensité pompe, Relevés de fonctionnement/électriques) doivent garder le même encadré + fond gris que… */
td input.coord-input-w6[type="text"],
td input.rf-input[type="text"] {
  border: 1px solid var(--border);
  background: var(--gray-cell);
}
td input.coord-input-w6[type="text"]:focus,
td input.rf-input[type="text"]:focus {
  background: #fffde7;
}
.coord-row {
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 0;
  border-bottom: 1px solid #e8e8e8;
}
.coord-row:last-child {
  border-bottom: none;
}
/* Ligne "Hauteur de refoulement / Débit / Pression..." (Relevés et réglages pompe) : pas de trait entre les 2 champs empilés dans une même colonne. */
.coord-row-pompe {
  border-bottom: none;
}
.coord-row-pompe .coord-label {
  min-width: 0;
}
.coord-grid-pompe .coord-col {
  display: grid;
  grid-template-columns: max-content max-content max-content;
  justify-content: start;
  align-items: center;
  column-gap: 4px;
  row-gap: 2px;
}
.coord-grid-pompe .coord-row-pompe {
  display: contents;
}
/* Variante générique : aligne verticalement les champs d'une colonne (label / champ / unité en 3 pistes de grille communes à toutes les lignes) sans imposer la structure figée de .coord-grid-pompe. */
.coord-grid-aligned {
  align-items: start;
}
.coord-grid-aligned .coord-col {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  align-items: center;
  align-content: start;
  column-gap: 4px;
  row-gap: 3px;
}
.coord-grid-aligned .coord-row,
.coord-grid-aligned .cl-row {
  display: contents;
}
/* Colonne "compacte" : le champ ne s'étire pas sur tout l'espace restant, sa piste de grille épouse la largeur réelle du contenu (champ étroit ou liste déroulante) pour que l'unité (ex. */
.coord-grid-aligned .coord-col.coord-col-fit {
  grid-template-columns: max-content max-content max-content;
  justify-items: end;
}
.coord-grid-aligned .coord-col.coord-col-fit .coord-label,
.coord-grid-aligned .coord-col.coord-col-fit .cl-label {
  justify-self: start;
}
/* Une ligne "cl-row" (label + une seule case cl-checks) n'a que 2 enfants, contre 3 pour une ligne "coord-row" (label / champ / unité). */
.coord-grid-aligned .coord-col.coord-col-fit .cl-checks {
  grid-column: 2 / 4;
}
.coord-label {
  font-weight: 700;
  white-space: nowrap;
  min-width: 72px;
}
.coord-input {
  flex: 1;
}

/* ===== INTERVENANT ===== */
.intervenant-grid {
  padding: 4px 6px;
}
.intervenant-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
  border-bottom: 1px solid #e8e8e8;
}
.intervenant-row:last-child {
  border-bottom: none;
}
.intervenant-row .label {
  font-weight: 700;
  min-width: 90px;
  white-space: nowrap;
}
.intervenant-check-row {
  display: flex;
  justify-content: center;
  padding: 4px 20px;
}
.intervenant-check-row label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

/* ===== TABLE GENERIC ===== */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
th,
td {
  border: 1px solid var(--border);
  padding: 2px 4px;
  text-align: center;
  vertical-align: middle;
}
th {
  background: var(--gray-header);
  color: var(--white);
  font-weight: 700;
  font-size: 10px;
}
td {
  background: var(--gray-cell);
}
td.label-col {
  text-align: left;
  background: var(--white);
  font-weight: 600;
}

/* ===== RELEVÉS DE FONCTIONNEMENT : champ + unité sur la même ligne ===== */
.rf-mesures-table .rf-mesure-th {
  background: var(--white);
  border: none;
}
.rf-field-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.rf-mesures-table td input.rf-input[type="text"] {
  width: 6ch;
  flex: 0 0 auto;
}
/* Les unités du tableau "Relevés de fonctionnement" (°C, Kpa, rpm, rps, Pas...) n'ont pas toutes la même largeur : comme le groupe champ+unité est centré dans la cellule, ça… */
.rf-unit {
  white-space: nowrap;
  min-width: 22px;
}

/* ===== RÉGLAGE FONCTIONS OPTIONNELLES UE ===== */
.opt-fn-table th:nth-child(1),
.opt-fn-table td:nth-child(1),
.opt-fn-table th:nth-child(3),
.opt-fn-table td:nth-child(3) {
  width: 15%;
}
.opt-fn-table td:nth-child(2) {
  text-align: center;
}
.opt-fn-table td.label-col {
  background: var(--gray-cell);
  text-align: center;
}

/* RELEVÉS DE FONCTIONNEMENT (mise en forme reprise du tableau "Entrée/sortie & sondes" : .hydro-table/.src-table) */
.rf-fonct-table .hydro-label-col {
  width: 90px;
  text-align: center;
}
.rf-fonct-table .src-field-row {
  grid-template-columns: 290px 1fr;
}
.rf-fonct-table .hydro-field-box {
  width: 60px;
}
td input[type="text"],
td input[type="date"],
td input[type="time"] {
  background: transparent;
  border: none;
  height: var(--field-h);
  box-sizing: border-box;
  width: 100%;
  text-align: center;
  font-size: 10px;
  font-family: var(--font);
  outline: none;
}
td input:focus {
  background: #fffde7;
}
/* Cellules d'en-tête contenant un champ (ex. */
th input[type="text"],
th input[type="date"],
th input[type="time"] {
  background: transparent;
  border: none;
  height: var(--field-h);
  box-sizing: border-box;
  width: 100%;
  text-align: center;
  font-size: 10px;
  font-family: var(--font);
  color: var(--white);
  outline: none;
}

/* ===== UE TABLE ===== */
.ue-header-row {
  display: flex;
  gap: 0;
}
.ue-check-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 3px 8px;
}
.ue-check-row label {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ===== CHECKLIST ===== */
.cl-row {
  display: flex;
  align-items: center;
  padding: 2px 6px;
  border-bottom: 1px solid #e8e8e8;
  gap: 6px;
}
.cl-row:last-child {
  border-bottom: none;
}
.cl-label {
  flex: 1;
  font-weight: 600;
}
.cl-row-center {
  justify-content: center;
}
.cl-row-center .cl-label {
  flex: none;
}
/* "Remarques générales" : rapproche les listes déroulantes de "L'installation est-elle conforme :" et "Travaux client à faire :" de leur intitulé (au lieu d'être poussées tout à… */
.cl-label-align {
  flex: 0 0 auto;
  min-width: 0;
}
.cl-checks {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cl-checks label {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

/* Tableau Check-List électrique UE */
.checklist-elec-ue {
  table-layout: auto;
}

.checklist-elec-ue .label-col {
  width: 180px;
  white-space: nowrap;
}

/* Champs limités à 3 caractères */
.checklist-elec-ue .input-unit {
  grid-template-columns: 35px 30px 20px;
}

.checklist-elec-ue .input-unit input {
  width: 45px;
  min-width: 45px;
  text-align: right;
}

/* ===== FRIGO ===== */
.frigo-row {
  display: flex;
  align-items: center;
  padding: 2px 6px;
  border-bottom: 1px solid #e8e8e8;
  gap: 6px;
  flex-wrap: wrap;
}
.frigo-row:last-child {
  border-bottom: none;
}
.frigo-cat {
  font-weight: 700;
  min-width: 120px;
}
.frigo-desc {
  flex: 1;
}
.frigo-checks {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.frigo-checks label {
  display: flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}
.frigo-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.frigo-field {
  display: flex;
  align-items: center;
  gap: 3px;
}
.frigo-field input {
  width: 50px;
}

/* Tableau combiné Réseau frigo / Charge fluide / Mise sous pression / Tirage au vide */
.frigo-multi-table th:first-child,
.frigo-multi-table th:nth-child(2),
.frigo-multi-table td.frigo-cat-col {
  border: none;
  background: transparent;
}
.frigo-multi-table td.frigo-cat-col {
  vertical-align: top;
  padding-top: 4px;
}
.frigo-multi-table td.label-col:not(.frigo-cat-col) {
  white-space: nowrap;
}

/* ===== ELEC CHECKLIST ===== */
.elec-block {
  padding: 7px 6px;
}

/* Grille 3 colonnes pour les blocs de champs texte (ex: Eau chaude sanitaire). */
.field-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 14px;
  row-gap: 2px;
  padding: 2px 6px;
  margin-top: 8px;
}

/* Grille 2 colonnes (ex: Piscine). */
.field-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 14px;
  row-gap: 2px;
  padding: 2px 6px;
  margin-top: 8px;
}

/* ===== PISCINE (2 colonnes) =====
   Même principe que l'ECS : grille [libellé | champ | unité] x 2 groupes séparés
   par un espace souple. Colonne de gauche calée à gauche, colonne de droite
   calée à droite ; le champ est collé à son libellé (4 px). */
.field-grid-2 {
  --fg-input: 60px;
  --fg-gap: 4px;
  grid-template-columns: auto auto auto minmax(8px, 1fr) auto auto auto;
  column-gap: 0;
  row-gap: 4px;
  align-items: center;
}
.field-grid-2 > div {
  display: contents !important;
}
.field-grid-2 > div > span:first-child {
  width: auto !important;
  min-width: 0;
  white-space: normal !important;
  text-align: left !important;
  line-height: 1.2;
}
.field-grid-2 > div > input,
.field-grid-2 > div > select {
  width: var(--fg-input) !important;
  flex: none !important;
  margin-left: var(--fg-gap) !important;
  min-width: 0;
  box-sizing: border-box;
}
.field-grid-2 > div > span:last-child:not(:first-child) {
  min-width: 0 !important;
  margin-left: var(--fg-gap);
}
.field-grid-2 > div:nth-child(2n + 1) > span:first-child { grid-column: 1; }
.field-grid-2 > div:nth-child(2n + 1) > input,
.field-grid-2 > div:nth-child(2n + 1) > select { grid-column: 2; }
.field-grid-2 > div:nth-child(2n + 1) > span:last-child:not(:first-child) { grid-column: 3; }
.field-grid-2 > div:nth-child(2n) > span:first-child { grid-column: 5; }
.field-grid-2 > div:nth-child(2n) > input,
.field-grid-2 > div:nth-child(2n) > select { grid-column: 6; }
.field-grid-2 > div:nth-child(2n) > span:last-child:not(:first-child) { grid-column: 7; }

/* ===== EAU CHAUDE SANITAIRE (3 colonnes) =====
   Une seule grille de 11 pistes : [libellé | champ | unité] x 3 groupes, séparés
   par 2 espaces souples. Les cellules sont "aplaties" (display: contents), donc
   les libellés d'une même colonne partagent la même piste : les champs restent
   alignés verticalement. Colonne de gauche calée à gauche, colonne du milieu
   centrée, colonne de droite calée à droite. Le libellé est collé à son champ
   (4 px, comme ailleurs dans le rapport) et reste sur une ligne tant que la
   largeur le permet (il ne revient à la ligne que faute de place). */
.field-grid-3 {
  --fg-input: 60px;
  --fg-gap: 4px;
  grid-template-columns: auto auto auto minmax(8px, 1fr) auto auto auto minmax(8px, 1fr) auto auto auto;
  column-gap: 0;
  row-gap: 4px;
  align-items: center;
}
.field-grid-3 > div {
  display: contents !important;
}
.field-grid-3 > div > span:first-child {
  width: auto !important;
  min-width: 0;
  white-space: normal !important;
  text-align: left !important;
  line-height: 1.2;
}
.field-grid-3 > div > input,
.field-grid-3 > div > select {
  width: var(--fg-input) !important;
  flex: none !important;
  margin-left: var(--fg-gap) !important;
  min-width: 0;
  box-sizing: border-box;
}
.field-grid-3 > div > span:last-child:not(:first-child) {
  min-width: 0 !important;
  margin-left: var(--fg-gap);
}
/* colonne (gauche / milieu / droite) */
.field-grid-3 > div:nth-child(3n + 1) > span:first-child { grid-column: 1; }
.field-grid-3 > div:nth-child(3n + 1) > input,
.field-grid-3 > div:nth-child(3n + 1) > select { grid-column: 2; }
.field-grid-3 > div:nth-child(3n + 1) > span:last-child:not(:first-child) { grid-column: 3; }
.field-grid-3 > div:nth-child(3n + 2) > span:first-child { grid-column: 5; }
.field-grid-3 > div:nth-child(3n + 2) > input,
.field-grid-3 > div:nth-child(3n + 2) > select { grid-column: 6; }
.field-grid-3 > div:nth-child(3n + 2) > span:last-child:not(:first-child) { grid-column: 7; }
.field-grid-3 > div:nth-child(3n) > span:first-child { grid-column: 9; }
.field-grid-3 > div:nth-child(3n) > input,
.field-grid-3 > div:nth-child(3n) > select { grid-column: 10; }
.field-grid-3 > div:nth-child(3n) > span:last-child:not(:first-child) { grid-column: 11; }
/* ligne */
.field-grid-3 > div:nth-child(-n + 3) > * { grid-row: 1; }
.field-grid-3 > div:nth-child(n + 4):nth-child(-n + 6) > * { grid-row: 2; }
.field-grid-3 > div:nth-child(n + 7):nth-child(-n + 9) > * { grid-row: 3; }
/* la colonne de droite est calée à droite (unités alignées sur le bord droit) */
.field-grid-3 > div:nth-child(3n) > span:last-child:not(:first-child) { justify-self: start; }

@media screen and (max-width: 600px) {
  .field-grid-2 {
    --fg-input: 36px;
    --fg-gap: 2px;
    grid-template-columns: auto auto auto minmax(4px, 1fr) auto auto auto;
    padding: 2px 0;
  }
  .field-grid-2 > div > span:first-child { font-size: 8px; }
  .field-grid-2 > div > span:last-child:not(:first-child) { font-size: 9px; }
  .field-grid-2 > div > input,
  .field-grid-2 > div > select { padding-left: 2px; padding-right: 2px; }
  .field-grid-3 {
    --fg-input: 36px;
    --fg-gap: 2px;
    grid-template-columns: auto auto auto minmax(4px, 1fr) auto auto auto minmax(4px, 1fr) auto auto auto;
    padding: 2px 0;
  }
  .field-grid-3 > div > span:first-child { font-size: 8px; }
  .field-grid-3 > div > span:last-child:not(:first-child) { font-size: 9px; }
  .field-grid-3 > div > input,
  .field-grid-3 > div > select { padding-left: 2px; padding-right: 2px; }
  .field-grid-3 > div > select {
    -webkit-appearance: none;
    appearance: none;
    text-align: center;
    text-align-last: center;
    background-image: none;
  }
}

/* LOI D'EAU (diagramme courbe/points/fixe) Un seul panneau visible à la fois, choisi par JS (voir initLoiEauChoices dans common.js) selon la case cochée dans "Choix de la loi d'eau". */
.loi-eau-diagram {
  position: relative;
  width: 360px;
  max-width: 100%;
  height: 150px;
  margin: 4px auto 10px;
}
.loi-eau-diagram svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.loi-eau-field {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 2px;
}
.loi-eau-field input {
  width: 42px;
  font-size: 10px;
}
.loi-eau-field span {
  font-size: 9px;
  color: var(--text);
}
.loi-eau-pente-label {
  position: absolute;
  font-weight: 700;
  font-size: 13px;
}

/* ===== RELEVÉS ELECTRICITÉ ===== */
.releves-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.releves-grid .label-col {
  text-align: center;
}
.releves-sub {
  border-right: 1px solid var(--border);
}
.releves-sub:last-child {
  border-right: none;
}
.releves-grid.releves-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ===== BUS COM ===== */
.bus-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 6px;
  border-bottom: 1px solid #e8e8e8;
  flex-wrap: wrap;
}
.bus-row:last-child {
  border-bottom: none;
}
.bus-row .label {
  font-weight: 700;
  white-space: nowrap;
}
.bus-row input {
  width: 55px;
}

/* ===== WARNING BOX ===== */
.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  border: 2px solid #e8a000;
  background: #fffbe6;
  padding: 6px 8px;
  margin-bottom: 5px;
  border-radius: 2px;
}
.warning-icon {
  font-size: 20px;
  line-height: 1;
}
.warning-text {
  font-size: 10px;
  font-weight: 700;
}

/* ===== SWITCH PHOTOS ===== */
.switch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1px;
  padding: 1px;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
.switch-grid:has(.switch-cell:nth-child(2):last-child) {
  grid-template-columns: 1fr 1fr;
}
.switch-cell {
  border: 1px solid var(--border);
  min-height: 185px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--gray-cell);
  padding: 4px;
  gap: 4px;
  position: relative;
}
.switch-cell-label {
  font-size: 9px;
  color: #666;
  text-align: center;
}
.switch-upload-btn {
  background: var(--gray-alt);
  border: 1px dashed var(--border);
  color: #555;
  font-size: 9px;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 2px;
}
/* Bouton de suppression d'une photo (jamais imprimé : classe no-print) */
.photo-delete-btn {
  background: #fff;
  border: 1px solid #c8102e;
  color: #c8102e;
  font-size: 9px;
  font-weight: 600;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 2px;
}
.photo-delete-btn:hover {
  background: #c8102e;
  color: #fff;
}
.photo-page-block {
  position: relative;
}
.photo-page-block > .photo-delete-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  font-size: 12px;
  padding: 6px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.switch-preview {
  width: 100%;
  height: 165px;
  object-fit: contain;
  display: none;
  border-radius: 2px;
}
/* "Réglages switchs" (chiller-m) : ce bloc occupe toute la largeur (une seule cellule) et il reste de la marge en bas de page en dessous ; on agrandit son cadre photo pour utiliser cet espace disponible. */
.switch-grid-tall .switch-cell {
  min-height: 330px;
}
.switch-grid-tall .switch-preview {
  height: 310px;
}
.switch-cell input[type="file"],
.photo-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* ===== OPTIONAL FUNCTIONS TABLE ===== */
.opt-table th,
.opt-table td {
  font-size: 10px;
}
#ui-opt-table th input {
  background: transparent;
  border: none;
  outline: none;
  text-align: center;
  color: white;
  font: inherit;
  width: auto;
  min-width: 1ch;
}
#ui-opt-table {
  table-layout: fixed;
  width: 100%;
}

/* ===== UI TABLE ===== */
.ui-sub {
  border-right: 1px solid var(--border);
}
.ui-sub:last-child {
  border-right: none;
}

/* ===== REMARKS ===== */
.remarks-area {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  resize: none;
  border: none;
  min-height: 90mm;
  font-family: var(--font);
  font-size: 11px;
  padding: 6px;
  background: var(--gray-cell);
  outline: none;
}
.remarks-area:focus {
  background: #fffde7;
}

/* ===== NATURE DE L'INTERVENTION (Procès Verbal) ===== */
.nature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
  padding: 6px 10px;
}
.nature-check-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  cursor: pointer;
}
.nature-check-row input[type="checkbox"] {
  width: 14px;
  height: 14px;
  min-width: 14px;
  accent-color: var(--red);
  cursor: pointer;
}
.nature-autre-input {
  flex: 1;
  min-width: 0;
}

/* ===== INSTALLATION CONCERNÉE (Procès Verbal) ===== */
.install-actions-bar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 4px 6px;
  background: var(--white);
}
.installation-table {
  margin-top: 0;
}
.installation-table + .installation-table {
  margin-top: 4px;
}
.installation-label-col {
  width: 1%;
  white-space: nowrap;
}
.num-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 10px;
  line-height: 1;
}
.installation-table th {
  background: var(--white);
}

/* ===== ARRIVÉE / DÉPART + SIGNATURES ===== */
.completion-block {
  border: 1px solid var(--border);
  margin-top: 6px;
  margin-bottom: 6px;
  background: var(--white);
}
.completion-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.completion-time-cell {
  padding: 5px 7px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.completion-time-cell + .completion-time-cell {
  border-left: 1px solid var(--border);
}
.completion-time-cell label {
  font-weight: 700;
  white-space: nowrap;
}
.completion-time-cell input {
  flex: 1;
  min-width: 0;
}
.signatures-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--border);
}
.signature-cell {
  padding: 5px 7px 7px;
}
.signature-cell + .signature-cell {
  border-left: 1px solid var(--border);
}
.signature-label {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
  background: var(--gray-header);
  color: var(--white);
  padding: 4px 6px;
  text-align: center;
  text-transform: uppercase;
}
.signature-pad-wrap {
  position: relative;
  height: 120px;
  border: 1px solid var(--border);
  background: #fff;
  touch-action: none;
  overflow: hidden;
}
.signature-pad {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}
.signature-clear {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.92);
  color: #333;
  font-family: var(--font);
  font-size: 9px;
  font-weight: 700;
  cursor: pointer;
}

/* ===== ACTION BUTTONS ===== */
.action-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--red);
  color: var(--white);
  border: none;
  padding: 7px 14px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 3px;
  font-family: var(--font);
  transition: background 0.15s;
}
.btn:hover {
  background: var(--red-dark);
}
.btn-icon {
  font-size: 16px;
}

/* ===== DATE FIELD TOP ===== */
.top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 3px;
}
.top-meta .date-field {
  display: flex;
  align-items: center;
  gap: 4px;
}
.top-meta input {
  width: 100px;
  font-size: 10px;
}
.reserved-text {
  font-size: 10px;
  color: #444;
  font-weight: 700;
}

/* ===== MODE TEST COLORS ===== */
.froid-col {
  background: #dce8f8 !important;
}
.chaud-col {
  background: #fde8dc !important;
}
.froid-header {
  background: #2a6fc9 !important;
  color: #fff;
}
.chaud-header {
  background: var(--red) !important;
  color: #fff;
}

/* ===== CHOIX SOURCE PHOTO ===== */
.photo-source-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.45);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.photo-source-modal.visible {
  display: flex;
}
.photo-source-card {
  width: min(360px, 100%);
  background: #fff;
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
}
.photo-source-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 14px;
}
.photo-source-btn {
  width: 100%;
  justify-content: center;
  margin: 7px 0;
  min-height: 44px;
}
.photo-source-cancel {
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  border: 1px solid var(--border);
  background: #f4f4f4;
  color: #333;
  border-radius: 3px;
  font-weight: 700;
}

/* ===== PRINT ===== */
@media print {
  @page {
    size: A4;
    margin: 0;
  }
  /* La page 7 est la version écran des remarques/signatures. */
  #page7 {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    page-break-after: avoid !important;
    break-after: avoid-page !important;
  }
  #remarks-render-pages:empty {
    display: none !important;
  }
  /* display:flex (colonne), pas display:block : .page-footer-info se cale en
     bas de page via "margin-top: auto", ce qui suppose un parent flex en
     colonne (comme .page hors impression). Avec display:block, le pied de
     page suivait simplement le contenu au lieu de rester collé en bas. */
  #remarks-render-pages .page {
    display: flex !important;
    flex-direction: column !important;
  }
  #remarks-render-pages .page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
  /* La dernière page de photos ne doit pas non plus forcer de saut. */
  #photo-pages .page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }

  /* Même logique pour la page 2 (Remarques/Validation) du Procès Verbal. */
  #pv-page2 {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    page-break-after: avoid !important;
    break-after: avoid-page !important;
  }
  #pv-remarks-render-pages:empty {
    display: none !important;
  }
  /* Même correction que pour #remarks-render-pages ci-dessus (pied de page
     collé en bas via flex, pas display:block). */
  #pv-remarks-render-pages .page {
    display: flex !important;
    flex-direction: column !important;
  }
  #pv-remarks-render-pages .page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
  #pv-photo-pages .page:last-child {
    page-break-after: auto !important;
    break-after: auto !important;
  }
  body {
    background: white;
    font-size: 10px;
  }
  .page {
    box-shadow: none;
    margin: 0;
    /* Marges haut/bas réduites (6/8mm → 4/4mm) pour redonner ~6mm de marge de
       sécurité : plusieurs rapports arrivaient tout juste à la limite des
       297mm réels d'une feuille A4, ce qui faisait basculer le pied de page
       seul sur une page quasi vierge dès que le contenu réel (valeurs
       saisies, options plus longues, etc.) dépassait de quelques millimètres
       le contenu vide utilisé pour calibrer la mise en page. */
    padding: 4mm 7mm 4mm 7mm;
    width: 210mm;
    /* Hauteur MINIMALE d'une page (au lieu d'une hauteur fixe + overflow:hidden) :
       si le contenu d'une page dépasse exceptionnellement les 297mm réels
       d'une feuille A4, il continue naturellement sur la page suivante
       plutôt que d'être tronqué/invisible. */
    min-height: 285mm;
    page-break-after: always;
    break-after: page;
  }
  .action-bar {
    display: none;
  }
  .photo-source-modal {
    display: none !important;
  }
  .no-print {
    display: none !important;
  }
  /* Comportement d'impression uniforme pour TOUS les champs : le cadre disparaît (papier plus net), mais le fond gris clair reste visible pour que le technicien retrouve facilement chaque champ à remplir. */
  input[type="text"],
  input[type="date"],
  input[type="time"],
  select {
    border: none !important;
    background: var(--gray-cell) !important;
    -webkit-appearance: none;
    appearance: none;
  }
  td input[type="text"],
  td input[type="date"],
  td input[type="time"],
  th input[type="text"],
  th input[type="date"],
  th input[type="time"] {
    background: transparent !important;
  }
  /* Exception : le tableau hydraulique garde son fond gris à l'impression comme tous les autres champs (seul le cadre disparaît). */
  .hydro-table .hydro-field-box {
    background: var(--gray-cell) !important;
  }
  .switch-upload-btn {
    display: none;
  }
  .switch-preview {
    display: block !important;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .page-header-title h1 {
    font-size: 17px;
  }
  .hitachi-logo .logo-text {
    font-size: 22px;
  }
}

/* ===== IMPRESSION iOS / iPadOS / Safari macOS =====
   Safari (Apple) ignore "@page { margin: 0 }" : il impose ses propres marges
   (~14 mm à gauche/droite) et y ajoute un en-tête/pied de page système (URL,
   date, "Page x sur y"). La page de 210 mm est alors réduite pour tenir en
   largeur (~87 %), mais la zone imprimable est proportionnellement moins
   haute qu'une feuille A4 : il ne reste qu'environ 289 mm "CSS" en hauteur au
   lieu de 297 mm, d'où le pied de page qui basculait seul sur la page
   suivante sur les pages les plus remplies.
   Correctif : sur Apple uniquement (classe "apple-print" posée par
   common.js), la page est mise en page un peu plus large (224 mm). Safari la
   réduit un peu plus pour la faire tenir en largeur, ce qui libère ~20 mm de
   hauteur utile (≈309 mm disponibles). Windows et Android ne sont pas
   concernés. */
@media print {
  html.apple-print .page {
    width: 224mm;
    min-height: 282mm;
  }
}

/* ===== RESPONSIVE (screen only — jamais appliqué à l'impression) ===== */
/* Seuil remonté de 720px à 860px : couvre la largeur en mode paysage de
   davantage de téléphones (ex. ~810-850px sur certains modèles), qui
   tombaient auparavant entre ce seuil et les ~794px de 210mm — juste assez
   larges pour sortir de cette mise en page compacte, mais pas assez pour
   la mise en page desktop en colonnes, ce qui donnait un rendu dense et
   peu lisible. Le risque de débordement horizontal lui-même est éliminé
   séparément par ".page { width: min(210mm, 100%) }" ci-dessus, quel que
   soit ce seuil. */
@media screen and (max-width: 860px) {
  body {
    background: #fff;
    font-size: 10px;
  }
  .page {
    width: 100%;
    margin: 0;
    padding: 4mm 4mm 5mm;
    box-shadow: none;
    min-height: auto;
  }
  /* Sur téléphone le pied de page ne doit jamais être superposé au contenu. */
  .page-footer-info {
    position: static;
    width: 100%;
    margin-top: 12px;
    padding: 6px 4px 0;
    font-size: 8px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .page-header-title h1 {
    font-size: 14px;
  }
  .hitachi-logo .logo-text {
    font-size: 20px;
  }
  .coord-grid,
  .releves-grid,
  .ui-grid,
  .nature-grid {
    grid-template-columns: 1fr;
  }
  .completion-times,
  .signatures-grid {
    grid-template-columns: 1fr;
  }
  .completion-time-cell + .completion-time-cell,
  .signature-cell + .signature-cell {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .coord-col + .coord-col {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .coord-grid-no-divider .coord-col + .coord-col {
    border-top: none;
  }
  .switch-grid {
    grid-template-columns: 1fr;
  }
  .switch-cell {
    min-height: 60px;
  }
  table {
    font-size: 9px;
  }
  th,
  td {
    padding: 1px 2px;
  }
  .btn {
    font-size: 11px;
  }
  .frigo-checks {
    margin-left: 0;
  }
  .status-alert-badge {
    font-size: 8px;
    padding: 2px 4px;
  }
}

/* Le cadre/fond/hauteur de .status-select viennent de la règle "select" ci-dessus (FORM FIELDS) */
.status-select {
  cursor: pointer;
}
.status-select.nonconforme {
  color: #c8102e;
  font-weight: 700;
}
.hidden {
  display: none;
}
.escl1,
.escl2,
.escl3 {
  display: none;
}

.add-esclave-btn {
  margin-left: 4px;
  background: #c8102e;
  color: #fff;
  border: none;
  border-radius: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  font-weight: 700;
}

#btnRemoveEsclave {
  display: none;
}

.ui-elec-ligne {
  display: flex;
  justify-content: center;
  align-items: center;
  column-gap: 50px;
  row-gap: 6px;
  flex-wrap: wrap;
  padding: 7px 6px;
}

.ui-elec-ligne .frigo-field {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Variante "Cascade" (check-list électrique cascade) : les intitulés "Calibre disjoncteur :"/"L1/N :" et "Calibre différentiel :"/"T/N :" n'ont pas la même longueur, donc pour que… */
.cascade-label-1 {
  display: inline-block;
  width: 112px;
  text-align: right;
}

.cascade-label-2 {
  display: inline-block;
  width: 108px;
  text-align: right;
}

/* .ui-elec-ligne centre normalement ses champs (justify-content:center), mais la ligne "Calibre disjoncteur / différentiel / Section" (3 champs) et la ligne "L1/N / T/N" (2 champs)… */
.ui-elec-ligne.cascade-align {
  justify-content: flex-start;
  padding-left: 60px;
}

/* Trait séparant les deux lignes de la Cascade : même style et même largeur (quasi toute la largeur du tableau) que les traits du bloc "Bus de Communication" (voir .bus-row). */
.ui-elec-ligne.cascade-align + .ui-elec-ligne.cascade-align {
  border-top: 1px solid #e8e8e8;
  margin-top: 2px;
}

/* Ligne "Calibre disjoncteur / Calibre différentiel / Section alimentation" :
   3 colonnes de largeur égale, avec le libellé aligné à gauche dans la
   colonne de gauche, au centre dans la colonne du milieu, et à droite dans
   la colonne de droite. */
.ui-elec-ligne.cascade-elec-3col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 20px;
  padding-left: 0;
  padding-right: 0;
  margin-left: 6px;
  margin-right: 6px;
}
.ui-elec-ligne.cascade-elec-3col .frigo-field {
  gap: 4px;
}
.ui-elec-ligne.cascade-elec-3col .frigo-field:nth-child(1) {
  justify-content: flex-start;
}
.ui-elec-ligne.cascade-elec-3col .frigo-field:nth-child(2) {
  justify-content: center;
}
.ui-elec-ligne.cascade-elec-3col .frigo-field:nth-child(3) {
  justify-content: flex-end;
}

/* "Bus de Communication" (Cascade PAC) : même inset des traits (7px, comme
   sur le rapport PAC) SANS décaler le texte, qui était déjà correctement
   positionné — on déplace donc la boîte de chaque .bus-row via une marge et
   on annule son padding gauche/droit (qui déplaçait le texte en plus). */
.cascade-bus-wrap .bus-row {
  margin-left: 6px;
  margin-right: 6px;
  padding-left: 0;
  padding-right: 0;
}

#alertDiffUI {
  margin-left: 4px;
}

/* ===== CHECK-LIST HYDRAULIQUE (tableau) ===== */
.hydro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.hydro-table td {
  border: 1px solid var(--border);
  padding: 3px 6px;
  text-align: left;
  vertical-align: middle;
  background: #fff;
}
.hydro-table td.hydro-label-col {
  width: 170px;
  font-weight: 700;
  white-space: normal;
}
.hydro-subrow {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.hydro-gap {
  margin-left: 10px;
}
.hydro-split {
  display: flex;
  align-items: stretch;
  gap: 10px;
}
.hydro-split-left {
  display: flex;
  align-items: center;
}
.hydro-split-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 1px solid var(--border);
  padding-left: 10px;
}
/* "Groupe de sécurité :" / "Volume ballon :" : intitulé de largeur fixe et aligné à droite, champ de largeur identique, pour que les deux champs de saisie (select + input) soient alignés verticalement. */
.hydro-eau-label {
  display: inline-block;
  width: 96px;
  text-align: right;
}
.hydro-eau-field {
  width: 55px;
}
/* "Modèle :"/"Type :" et "Pression max :"/"Volume :" (vase d'expansion) : même principe, un intitulé de largeur fixe et aligné à droite par colonne, pour que les champs de saisie… */
.hydro-vase-label-1 {
  display: inline-block;
  width: 42px;
  text-align: right;
}
.hydro-vase-label-2 {
  display: inline-block;
  width: 70px;
  text-align: right;
}
/* Les champs du tableau hydraulique sont dans des <td>, qui par défaut redonnent un style "transparent" aux champs (cf. */
.hydro-table .hydro-field-box {
  border: 1px solid var(--border);
  background: var(--gray-cell);
  width: 55px;
  text-align: center;
  font-size: 10px;
}
.hydro-table .hydro-field-box.hydro-field-wide {
  width: 140px;
  flex: 1;
}

/* ===== SOURCES CHAUFFAGE (tableau) ===== */
.src-table .hydro-label-col {
  text-align: right;
}
/* Grille à 2 colonnes de largeur fixe (plutôt que flex-wrap) : garantit que le 2e champ de chaque ligne démarre toujours à la même position, quelle que soit la largeur du texte du… */
.src-field-row {
  display: grid;
  grid-template-columns: 260px 1fr;
  align-items: center;
  column-gap: 24px;
}
.src-field {
  display: flex;
  align-items: center;
  gap: 4px;
}
.src-field > span:first-child {
  display: inline-block;
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}
.src-unit {
  min-width: 18px;
}

#ui-ch-print-pages .page {
  page-break-after: always;
}

.p2-escl1,
.p2-escl2,
.p2-escl3 {
  display: none;
}

/* ===== MENU PRINCIPAL ===== */
.app-view {
  display: none;
}
.app-view.active {
  display: block;
}

.menu-screen {
  min-height: 100vh;
  background: var(--gray-bg);
  padding: 24px 16px 40px;
  display: none;
}
.menu-screen.active {
  display: block;
}

.menu-header {
  max-width: 760px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--red);
  padding-bottom: 10px;
}
.menu-header h1 {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
}
.menu-header .hitachi-logo {
  position: static;
}

.menu-grid {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.menu-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 110px;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: 16px;
  font-family: var(--font);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  line-height: 1.25;
  padding: 14px 10px;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18);
  transition:
    background 0.15s,
    transform 0.1s;
  text-decoration: none;
}
.menu-tile:hover {
  background: var(--red-dark);
}
.menu-tile:active {
  transform: scale(0.97);
}
.menu-tile .menu-tile-icon {
  font-size: 26px;
  line-height: 1;
}
.menu-tile.disabled {
  background: #b8b8b8;
  cursor: default;
}
.menu-tile.disabled:hover {
  background: #b8b8b8;
}
.menu-tile .menu-tile-soon {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.9;
}

.btn-menu-retour {
  background: #555;
}
.btn-menu-retour:hover {
  background: #333;
}

@media print {
  .menu-screen {
    display: none !important;
  }
}

/* La page de configuration cascade reprend une fiche PDF très dense : ce réglage conserve toutes les rubriques sur une seule page A4. */
#cascade-page3 .block {
  margin-bottom: 3px;
}
#cascade-page3 .section-title {
  padding: 2px 6px;
}
#cascade-page3 .elec-block {
  padding: 2px 5px;
}
#cascade-page3 .coord-row,
#cascade-page3 .cl-row {
  padding-top: 0;
  padding-bottom: 0;
  min-height: 13px;
}
#cascade-page3 .coord-label,
#cascade-page3 .cl-label {
  font-size: 9px;
}

/* ===== IMPRESSION / EXPORT PDF : pas d'ombres portées (tous les rapports) =====
   Le navigateur ne sait pas écrire une ombre floue en vectoriel dans le PDF :
   il la convertit en image (≈ 2650 × 3540 px pour une page) pour CHAQUE page
   et CHAQUE bloc, ce qui alourdit fortement le PDF — surtout sur iPhone/iPad.
   Ces ombres sont de toute façon invisibles sur papier. Le !important est
   nécessaire car les feuilles propres à chaque rapport (chargées après
   common.css) redéfinissent box-shadow sur .page / .block. */
@media print {
  .page,
  .block,
  .completion-block {
    box-shadow: none !important;
  }
}
