/* =====================================================================
 * Style : pensé pour l'iPhone, gros boutons, fort contraste,
 * utilisable avec des gants.
 * ===================================================================== */
:root {
  /* Couleurs tirées du logo TAM / ARZ */
  --fond: #ece6df;           /* beige du logo */
  --carte: #fbf9f6;
  --texte: #2d2d2d;          /* anthracite des lettres */
  --doux: #6f675e;
  --trait: #d8d0c6;          /* gris du toit */
  --bois: #bc976c;           /* chêne */
  --principal: #7a5a36;      /* chêne foncé (textes et repères) */
  --principal-fonce: #7a5a36;
  --vert: #2d2d2d;
  --rouge: #a3271f;
  --sombre: #2d2d2d;
  --texture-bois: url(bois.jpg);
  /* Variables de thème (voir « Thèmes de couleurs » en bas du fichier) */
  --champ: #fff;
  --accent-fond: var(--bois) var(--texture-bois) center / auto 100% repeat-x;
  --accent-texte: #262320;
  --accent-ombre: #8d6a45;
  --accent-relief: 0 1px 0 rgba(255,255,255,.25);
  --actif-fond: var(--sombre);
  --actif-texte: #fff;
  --surligne: #f3ebe1;
  --focus: #e6d5bf;
  --bandeau-fond: #fbf3e8; --bandeau-trait: #e6d3b8; --bandeau-texte: #6b4a1f;
  --piece-fond: #f1eae1;
  --rayon: 16px;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  font-size: 19px;
  line-height: 1.35;
  -webkit-text-size-adjust: 100%;
}

/* ---------- En-tête ---------- */
#entete {
  position: sticky; top: 0; z-index: 10;
  background: var(--sombre); color: #fff;
  border-bottom: 5px solid var(--bois);
  border-image: var(--liseré, var(--texture-bois) 0 0 100% 0 / 0 0 5px 0 stretch);
  padding: calc(var(--haut) + 10px) 12px 12px;
  display: flex; align-items: center; gap: 10px;
  min-height: 64px;
}
#entete h1 { font-size: 22px; margin: 0; flex: 1; line-height: 1.2; }
#entete .retour {
  background: rgba(255,255,255,.14); color: #fff; border: 0;
  font-size: 34px; font-weight: 700; border-radius: 12px; line-height: 1;
  min-width: 60px; min-height: 52px; padding: 0 14px 4px;
}

main {
  padding: 16px 14px calc(var(--bas) + 120px);
  max-width: 720px; margin: 0 auto;
}

/* ---------- Barre du bas (onglets) ---------- */
#barre {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--carte); border-top: 1px solid var(--trait);
  padding: 6px 8px calc(var(--bas) + 6px);
  display: flex; gap: 6px;
}
#barre:empty { display: none; }
#barre .onglet {
  flex: 1; border: 0; background: none; color: var(--doux);
  font-size: 14px; font-weight: 600; padding: 6px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-height: 60px; border-radius: 12px;
}
#barre .onglet span.ico { font-size: 26px; line-height: 1; }
#barre .onglet.actif { color: var(--principal); background: var(--surligne); }

/* Barre d'actions de l'assistant de devis */
#barre.actions { padding-top: 10px; }
#barre.actions .bouton { flex: 1; margin: 0; }

/* ---------- Boutons ---------- */
.bouton {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 64px; margin: 10px 0;
  border: 0; border-radius: var(--rayon);
  font-size: 21px; font-weight: 800; font-family: inherit;
  /* Bouton principal : la vraie texture bois du logo */
  background: var(--accent-fond);
  color: var(--accent-texte); text-shadow: var(--accent-relief);
  padding: 12px 18px; text-decoration: none; text-align: center;
  box-shadow: 0 3px 0 var(--accent-ombre), 0 6px 14px rgba(60,40,20,.18);
}
.bouton:active { transform: translateY(2px); box-shadow: none; }
.bouton.secondaire { background: var(--carte); text-shadow: none; color: var(--texte); border: 2px solid var(--trait); box-shadow: none; }
.bouton.sombre { background: var(--sombre); color: #fff; text-shadow: none; box-shadow: 0 3px 0 #000; }
.bouton.vert { background: var(--sombre); color: #fff; text-shadow: none; box-shadow: 0 3px 0 #000; }
.bouton.danger { background: var(--carte); text-shadow: none; color: var(--rouge); border: 2px solid #fecaca; box-shadow: none; }
.bouton.petit { min-height: 52px; font-size: 18px; }
.bouton .ico { font-size: 26px; }
.rangee { display: flex; gap: 10px; }
.rangee > * { flex: 1; }

/* ---------- Grille des catégories ---------- */
.grille {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0;
}
.tuile {
  position: relative;
  background: var(--carte); border: 2px solid var(--trait); border-radius: 20px;
  padding: 14px 8px 12px; min-height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 700; text-align: center; color: var(--texte);
  font-family: inherit;
}
.tuile:active { transform: scale(.97); }
.tuile svg { width: 78px; height: 78px; color: var(--sombre); }
.tuile .pastille {
  position: absolute; top: 8px; right: 8px;
  background: var(--sombre); color: #fff; border-radius: 99px;
  min-width: 32px; height: 32px; font-size: 17px; line-height: 32px; padding: 0 8px;
}

/* ---------- Cartes et listes ---------- */
.carte {
  background: var(--carte); border-radius: var(--rayon); border: 2px solid var(--trait);
  padding: 14px 16px; margin: 10px 0;
}
.liste-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--carte); border: 2px solid var(--trait); border-radius: var(--rayon);
  padding: 14px 16px; margin: 10px 0; min-height: 76px;
  font-family: inherit; font-size: 19px; text-align: left; color: var(--texte);
}
.liste-item:active { background: var(--surligne); }
.liste-item .corps { flex: 1; min-width: 0; }
.liste-item .titre { font-weight: 700; }
.liste-item .sous { color: var(--doux); font-size: 16px; margin-top: 2px; }
.liste-item .droite { font-weight: 800; white-space: nowrap; text-align: right; }
.liste-item .fleche { font-size: 28px; color: var(--doux); }
.liste-item svg { width: 48px; height: 48px; flex: none; }

h3.groupe {
  font-size: 15px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--principal-fonce); margin: 24px 0 4px;
}
h2 { font-size: 24px; margin: 18px 0 8px; }
h3 { font-size: 20px; margin: 18px 0 6px; }
.aide { color: var(--doux); font-size: 16px; margin: 4px 0 10px; }
.vide { text-align: center; color: var(--doux); padding: 30px 10px; }

/* ---------- Formulaires ---------- */
label.champ { display: block; margin: 14px 0; font-weight: 700; font-size: 17px; }
label.champ .facultatif { font-weight: 400; color: var(--doux); }
input[type=text], input[type=tel], input[type=email], input[type=search], textarea, select {
  display: block; width: 100%; margin-top: 6px;
  font-size: 21px; font-family: inherit; color: var(--texte);
  padding: 14px; min-height: 60px;
  border: 2px solid var(--trait); border-radius: 14px; background: var(--champ);
  -webkit-appearance: none; appearance: none;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--principal); box-shadow: 0 0 0 3px var(--focus); }
input.erreur { border-color: var(--rouge); }
.message-erreur { color: var(--rouge); font-size: 16px; font-weight: 600; margin-top: 4px; }
.message-ok { color: var(--vert); font-size: 16px; font-weight: 600; margin-top: 4px; }

/* Choix à gros boutons (remplace les menus déroulants) */
.choix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.choix button {
  flex: 1 1 auto; min-height: 56px; min-width: 64px; padding: 8px 14px;
  border: 2px solid var(--trait); border-radius: 14px; background: var(--champ);
  font-size: 18px; font-weight: 700; font-family: inherit; color: var(--texte);
}
.choix button.actif { background: var(--actif-fond); border-color: var(--actif-fond); color: var(--actif-texte); }

/* Deux champs côte à côte (longueur × hauteur) */
.duo { display: flex; align-items: flex-end; gap: 10px; }
.duo label.champ { flex: 1; }
.duo .fois { font-size: 30px; font-weight: 800; padding-bottom: 26px; color: var(--doux); }

/* Ouvertures */
.ouverture { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--trait); }
.ouverture .corps { flex: 1; }
.compteur { display: flex; align-items: center; gap: 6px; }
.compteur button {
  width: 52px; height: 52px; border-radius: 12px; border: 2px solid var(--trait);
  background: var(--champ); font-size: 28px; font-weight: 800; color: var(--texte);
}
.compteur .val { min-width: 30px; text-align: center; font-size: 22px; font-weight: 800; }

/* Résultat de calcul bien visible */
.resultat {
  background: var(--sombre); color: #fff; border-radius: var(--rayon);
  padding: 16px; margin: 14px 0; text-align: center;
}
.resultat .grand { font-size: 36px; font-weight: 800; }
.resultat .petit { font-size: 16px; opacity: .8; }

/* Tableau des totaux */
.totaux { width: 100%; border-collapse: collapse; font-size: 19px; }
.totaux td { padding: 8px 0; }
.totaux td:last-child { text-align: right; font-weight: 700; white-space: nowrap; }
.totaux tr.ttc td { font-size: 24px; font-weight: 800; border-top: 2px solid var(--texte); padding-top: 12px; }
.mention { font-style: italic; color: var(--doux); font-size: 16px; }

/* Étapes de l'assistant */
.etapes { display: flex; gap: 6px; margin: 0 0 12px; }
.etapes div { flex: 1; height: 8px; border-radius: 4px; background: var(--trait); }
.etapes div.fait { background: var(--accent-fond); }

/* Logo */
.logo-apercu { max-width: 180px; max-height: 110px; display: block; margin: 10px 0; border-radius: 8px; background: #fff; }
input[type=file] { display: none; }

.statut { display: inline-block; font-size: 14px; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: #e5e7eb; }

.toast {
  position: fixed; left: 50%; top: calc(var(--haut) + 74px); transform: translateX(-50%);
  background: var(--sombre); color: #fff; padding: 14px 22px; border-radius: 14px;
  font-weight: 700; z-index: 50; max-width: 90%; text-align: center;
}

/* Tuiles de catégories : fond uni et chaud, comme le papier du logo */
.tuile { background: var(--carte) !important; border-color: var(--trait); box-shadow: 0 2px 6px rgba(60,40,20,.06); }
.tuile svg { color: var(--texte); }

/* Logo ARZ sur l'écran de bienvenue */
.logo-arz { display: block; width: 78%; max-width: 360px; margin: 4px auto 14px; border-radius: 22px;
  box-shadow: 0 6px 20px rgba(60,40,20,.15); }

/* ---------- Code d'accès ---------- */
#verrou {
  position: fixed; inset: 0; z-index: 100; background: var(--fond);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--haut) + 10px) 20px calc(var(--bas) + 10px);
}
.zone-code { display: flex; flex-direction: column; align-items: center; padding-top: 10px; }
.verrou-logo { width: 110px; height: auto; border-radius: 22px; margin-bottom: 14px; box-shadow: 0 4px 14px rgba(60,40,20,.15); }
.clavier-titre { font-size: 23px; font-weight: 800; text-align: center; }
.clavier-aide { min-height: 24px; color: var(--rouge); font-weight: 700; font-size: 16px; margin: 6px 0 2px; text-align: center; }
.points { display: flex; gap: 20px; margin: 10px 0 22px; }
.points span { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--texte); }
.points span.plein { background: var(--texte); }
.points.secoue { animation: secoue .4s; }
@keyframes secoue { 20%, 60% { transform: translateX(-12px); } 40%, 80% { transform: translateX(12px); } }
.touches { display: grid; grid-template-columns: repeat(3, 92px); gap: 14px; }
.touche {
  height: 76px; border-radius: 20px; border: 2px solid var(--trait); background: var(--carte);
  font-size: 34px; font-weight: 700; color: var(--texte); font-family: inherit;
  box-shadow: 0 3px 0 var(--trait);
}
.touche:active { transform: translateY(3px); box-shadow: none; background: var(--surligne); }
.lien-oubli { margin-top: 18px; background: none; border: 0; color: var(--principal); font-size: 17px; font-weight: 700; text-decoration: underline; min-height: 48px; font-family: inherit; }

/* ---------- Langues ---------- */
.centre { text-align: center; }
.bouton.langue { justify-content: flex-start; gap: 14px; font-size: 22px; margin-bottom: 10px; }
.bouton.langue .ico { font-size: 30px; }
.bouton.langue.actif { border-color: var(--bois); border-width: 3px; background: var(--surligne); }
.titre-traduit { color: var(--doux); font-size: 17px; margin: -4px 0 10px; }
.liste-item .sous.fr { font-size: 14px; opacity: .85; }

/* ---------- Ouvrages au détail (composition) ---------- */
.composant { background: var(--carte); border: 2px solid var(--trait); border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; }
.composant-tete { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.composant-nom { flex: 1; font-size: 18px; }
input.composant-nom { min-height: 48px; }
.suppr { width: 48px; height: 48px; flex: none; border: 2px solid #fecaca; background: #fff; color: var(--rouge); border-radius: 12px; font-size: 22px; }

/* ---------- Matériaux / feuille de débit ---------- */
.carte.metre { padding: 12px 14px; }
.carte.metre h3 { margin: 0 0 8px; }
.carte.metre .titre { margin-bottom: 6px; font-size: 18px; }
.mat { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--trait); }
.mat:first-of-type { border-top: 0; }
.mat-nom { font-size: 17px; flex: 1; }
.mat-q { text-align: right; font-size: 17px; flex: none; max-width: 48%; }
.mat-q b { display: block; }
.mat-q small { color: var(--doux); font-size: 14px; }
ul.debit { margin: 0 0 8px; padding-left: 22px; color: var(--texte); font-size: 16px; }
ul.debit li { margin: 3px 0; }

/* ---------- Facturation, suivi, licence ---------- */
.bandeau { display: block; width: 100%; text-align: left; margin: 0 0 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--bandeau-trait); background: var(--bandeau-fond); color: var(--bandeau-texte); font: inherit; font-size: 15px; font-weight: 600; }
.bandeau.alerte { background: #fdecea; border-color: #f2b8b2; color: #9b1c12; }
.carte.tdb { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; width: 100%; text-align: left; font: inherit; color: inherit; }
.carte.tdb > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.carte.tdb small { font-size: 12px; color: var(--doux); line-height: 1.2; }
.carte.tdb b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rouge { color: #c0261b !important; }
.suggestion { display: block; width: 100%; text-align: left; padding: 10px 12px; margin: 0 0 6px; border-radius: 10px;
  border: 1px dashed var(--trait); background: var(--champ); color: var(--texte); font: inherit; font-size: 15px; }
.pastille { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700;
  vertical-align: middle; background: #eceff3; color: #4a5568; }
h2 .pastille { margin: 0 0 0 6px; font-size: 13px; }
.p-accepte, .p-payee { background: #e3f4e6; color: #1f7a33; }
.p-refuse, .p-retard { background: #fdecea; color: #b3261e; }
.p-facture { background: #e6eefc; color: #1d4ea0; }
.p-partielle, .p-impayee { background: #fff4dc; color: #8a5a00; }
.p-annulee { background: #eee; color: #777; text-decoration: none; }
.zone-signature { display: block; width: 100%; height: 220px; margin: 8px 0; border: 2px dashed #b9a58a; border-radius: 14px;
  background: #fff; touch-action: none; }
.texte-long h3 { margin: 14px 0 4px; font-size: 16px; }
.texte-long h3:first-child { margin-top: 0; }
.texte-long p { margin: 0; line-height: 1.45; font-size: 15px; }
h3.piece { display: flex; justify-content: space-between; align-items: baseline; margin: 16px 0 6px; padding: 6px 10px;
  border-radius: 10px; background: var(--piece-fond); color: var(--principal); font-size: 16px; }
h3.piece span { font-size: 14px; color: var(--texte); }
.carte.pieces { padding: 12px 14px; }
.carte.pieces .choix { margin-top: 4px; gap: 6px; }
.carte.pieces .choix button { flex: 0 1 auto; min-height: 44px; padding: 6px 14px; font-size: 16px; border-radius: 22px; }
.carte.pieces #ajout-piece { width: auto; min-height: 44px; margin: 8px 0 0; padding: 6px 14px; font-size: 16px; border-radius: 22px; }
.sous.note { font-style: italic; }
.teinte { display: inline-block; width: 18px; height: 18px; border-radius: 50%; margin-right: 8px; vertical-align: -3px;
  border: 2px solid rgba(255, 255, 255, 0.7); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.15); }
[data-choix="couleur"] button { flex: 0 1 auto; min-height: 48px; font-size: 16px; }

/* ---------- Aide changement d'appareil ---------- */
.aide-appareil summary { font-weight: 700; cursor: pointer; padding: 4px 0; }
.aide-appareil ol { padding-left: 22px; margin: 10px 0; }
.aide-appareil li { margin-bottom: 8px; }

/* ---------- Ordinateur et tablette en paysage : menu à gauche ---------- */
@media (min-width: 900px) {
  html, body { font-size: 17px; }
  #barre:not(.actions):not(:empty) {
    top: 0; bottom: 0; right: auto; width: 210px; z-index: 9;
    flex-direction: column; gap: 4px;
    border-top: 0; border-right: 1px solid var(--trait);
    padding: 96px 10px 16px;
  }
  #barre:not(.actions) .onglet {
    flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    min-height: 50px; padding: 0 14px; font-size: 16px; text-align: left;
  }
  #barre:not(.actions) .onglet span.ico { font-size: 22px; }
  body:has(#barre:not(.actions):not(:empty)) main { margin-left: 210px; padding-bottom: 48px; }
  body:has(#barre:not(.actions):not(:empty)) #entete { padding-left: 222px; }
  main { max-width: 880px; padding-left: 28px; padding-right: 28px; }
  #barre.actions {
    max-width: 880px; margin: 0 auto; border: 1px solid var(--trait); border-bottom: 0;
    border-radius: 16px 16px 0 0; box-shadow: 0 -4px 18px rgba(0,0,0,.06);
  }
  .bouton, .liste-item, .onglet, summary { cursor: pointer; }
  .bouton:hover { filter: brightness(1.06); }
  .liste-item:hover { background: var(--surligne); }
}
@media (min-width: 1300px) {
  main { max-width: 980px; }
}

/* ---------- Annuaire des entreprises ---------- */
.carte.annuaire { border: 2px solid var(--principal); margin: 8px 0 14px; }
.carte.annuaire .titre { font-weight: 800; font-size: 19px; margin: 2px 0; }
.carte.annuaire .rangee { margin-top: 10px; }
#annuaire-ent .bouton, #annuaire-cli .bouton { margin-top: 0; }

/* ---------- Thèmes de couleurs de l'appli (Mon entreprise → Couleurs de l'appli) ---------- */
html[data-theme="ardoise"] {
  --fond: #e9edf2; --carte: #fbfcfd; --texte: #1f2933; --doux: #5b6876; --trait: #d0d8e2;
  --bois: #3b75ad; --principal: #2f5f8f; --sombre: #1f2d3d; --vert: #1f2d3d;
  --accent-fond: #3b75ad; --accent-texte: #fff; --accent-ombre: #285682; --accent-relief: none;
  --surligne: #e3ecf6; --focus: #c9dbef; --bandeau-fond: #eef4fb; --bandeau-trait: #c9dbef; --bandeau-texte: #244a70;
  --piece-fond: #e3ecf6; --liseré: none;
}
html[data-theme="sapin"] {
  --fond: #e8eee9; --carte: #fafcfa; --texte: #1f2a22; --doux: #5c6b60; --trait: #cfdcd2;
  --bois: #3d8a5a; --principal: #2f6b46; --sombre: #1e3326; --vert: #1e3326;
  --accent-fond: #3d8a5a; --accent-texte: #fff; --accent-ombre: #2b6642; --accent-relief: none;
  --surligne: #e2efe6; --focus: #c5e0cf; --bandeau-fond: #edf6f0; --bandeau-trait: #c5e0cf; --bandeau-texte: #24533a;
  --piece-fond: #e2efe6; --liseré: none;
}
html[data-theme="brique"] {
  --fond: #f2e9e4; --carte: #fdfaf8; --texte: #2e2522; --doux: #6e5d57; --trait: #e0d0c8;
  --bois: #c4552f; --principal: #a3442a; --sombre: #3a2722; --vert: #3a2722;
  --accent-fond: #c4552f; --accent-texte: #fff; --accent-ombre: #93391e; --accent-relief: none;
  --surligne: #f6e4dc; --focus: #efcab9; --bandeau-fond: #fbefe9; --bandeau-trait: #efcab9; --bandeau-texte: #7a3019;
  --piece-fond: #f6e4dc; --liseré: none;
}
html[data-theme="chantier"] {
  --fond: #efede6; --carte: #fcfbf7; --texte: #1d1d1b; --doux: #66645c; --trait: #dad6c8;
  --bois: #f2b705; --principal: #7a5c00; --sombre: #1d1d1b; --vert: #1d1d1b;
  --accent-fond: #f2b705; --accent-texte: #1d1d1b; --accent-ombre: #b88a00; --accent-relief: none;
  --surligne: #fbf1cf; --focus: #f6dd8a; --bandeau-fond: #fdf6dc; --bandeau-trait: #f0dc95; --bandeau-texte: #6b5200;
  --piece-fond: #fbf1cf; --liseré: none;
}
html[data-theme="nuit"] {
  --fond: #15171a; --carte: #1f2226; --texte: #ecebe8; --doux: #a5a29c; --trait: #353a40; --champ: #262a2f;
  --principal: #d9b386; --sombre: #0c0d0f; --vert: #8fd19e; --rouge: #ff8a80;
  --actif-fond: #d9b386; --actif-texte: #1d1d1b;
  --surligne: #2b2f35; --focus: #5a4a36; --bandeau-fond: #2a2520; --bandeau-trait: #4a3f33; --bandeau-texte: #e8cfa8;
  --piece-fond: #2b2f35;
  color-scheme: dark;
}
html[data-theme="nuit"] .resultat { background: #2b2f35; }
html[data-theme="nuit"] .bouton.danger { border-color: #6b2a25; }
html[data-theme="nuit"] .zone-signature { background: #fff; }

/* Sélecteur de thème */
.choix[data-choix="themeApp"] button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; min-width: 92px; flex: 1 1 28%; font-size: 15px; }
.apercu-theme { display: block; width: 100%; max-width: 86px; height: 46px; border-radius: 10px; overflow: hidden; border: 1px solid rgba(0,0,0,.15); position: relative; }
.apercu-theme i { position: absolute; left: 0; right: 0; top: 0; height: 14px; }
.apercu-theme b { position: absolute; left: 10px; right: 10px; bottom: 8px; height: 14px; border-radius: 5px; }

/* ---------- Photos du chantier ---------- */
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin: 6px 0 10px; }
.vignettes:empty { display: none; }
.vignette { padding: 0; border: 1px solid var(--trait); border-radius: 12px; overflow: hidden; aspect-ratio: 1; background: var(--champ); cursor: pointer; }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; }
.visionneuse { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.visionneuse .haut { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; font-size: 15px; }
.visionneuse .image { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.visionneuse .image img { max-width: 100%; max-height: 100%; object-fit: contain; }
.visionneuse .bas { display: flex; gap: 8px; padding: 10px 12px 16px; }
.visionneuse button { min-height: 52px; min-width: 52px; border: 0; border-radius: 14px; background: rgba(255,255,255,.16); color: #fff; font: inherit; font-size: 17px; font-weight: 700; }
.visionneuse #vi-partager { flex: 1; }
.visionneuse #vi-suppr { background: rgba(200,40,30,.55); }
.visionneuse .haut button { min-height: 44px; min-width: 44px; font-size: 22px; }

/* ---------- Tableau de bord ---------- */
.carte.tdb.deux { grid-template-columns: repeat(2, 1fr); }
.carte.tdb .tdb-lien { grid-column: 1 / -1; flex-direction: row; justify-content: flex-end; font-size: 14px; font-weight: 700; color: var(--principal); margin-top: 2px; }
.vert-texte { color: #2e7d4f; }
html[data-theme="nuit"] .vert-texte { color: #8fd19e; }
.tableau-mois td:first-child { text-transform: capitalize; }
.tableau-mois tr.trimestre td { font-weight: 800; border-bottom: 2px solid var(--trait); padding-bottom: 8px; }
a.liste-item { text-decoration: none; color: inherit; }

/* Planning */
.plan-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.plan-nav b { font-size: 18px; }
.plan-grille { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; padding: 8px; }
.plan-tete { text-align: center; font-size: 12px; color: var(--doux); text-transform: uppercase; }
.plan-jour { border: 0; background: transparent; color: inherit; font: inherit; border-radius: 8px; min-height: 42px; padding: 3px 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.plan-jour.occupe { background: rgba(127,127,127,.12); font-weight: 600; }
.plan-jour.auj span:first-child { outline: 2px solid currentColor; border-radius: 50%; padding: 0 5px; }
.plan-jour.choisi { background: rgba(37,99,235,.22); }
.pts { display: flex; gap: 2px; min-height: 7px; }
.pt { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #999; }
.pt-accepte { background: #16a34a; } .pt-attente { background: #f59e0b; } .pt-facture { background: #2563eb; } .pt-echeance { background: #dc2626; }
.plan-legende { line-height: 1.8; }
.plan-ligne { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.plan-nav .bouton { flex: 0 0 64px; width: 64px; margin: 0; font-size: 22px; }
.plan-nav b { flex: 1; text-align: center; }

/* Guide de démarrage */
.tuto-carte { display: flex; flex-direction: column; gap: 8px; }
.tuto { text-align: center; padding: 8px 4px; }
.tuto-ico { font-size: 64px; line-height: 1.2; }
.tuto p { text-align: left; font-size: 17px; line-height: 1.45; }
.tuto-pts { display: flex; justify-content: center; gap: 8px; margin: 14px 0; }
.tuto-pts i { width: 9px; height: 9px; border-radius: 50%; background: rgba(127,127,127,.35); }
.tuto-pts i.on { background: currentColor; }

/* Nouveautés */
.nouveaute h3 { margin: 6px 0 4px; }
.nouveaute p { margin: 0; line-height: 1.45; }
.nouveaute.non-lue { border-left: 4px solid #2563eb; }
.nv-tete { display: flex; align-items: center; gap: 8px; }
.nv-ico { font-size: 24px; }
.nv-tete small { margin-left: auto; color: var(--doux); }

/* Rentabilité et relances */
.orange-texte { color: #b45309; }
html[data-theme="nuit"] .orange-texte { color: #fbbf24; }
.carte.relance { border-left: 5px solid #f59e0b; }
.carte.relance.grave { border-left-color: #c0261b; }
.temps-total { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.temps-total b { font-size: 1.6em; }
.temps-total span { color: var(--doux); }
.pastille-fourn { display: inline-flex; align-items: center; gap: 4px; background: var(--carte, #fff); border: 1px solid var(--trait); border-radius: 20px; padding: 2px 4px 2px 12px; margin: 0 6px 6px 0; font-weight: 600; }
.pastille-fourn .suppr { width: 32px; height: 32px; }
.grille-prix { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.choix.vertical { flex-direction: column; }
.choix.vertical button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; }
.choix.vertical button b { white-space: nowrap; }
