/* L'application de terrain — debout, à une main, dans une pièce sombre,
   parfois avec des gants (cahier La Gestion, §5 et §46). Les boutons restent
   des ronds à pictogramme (règle commune), mais de 64 px au lieu de 44, et
   la barre d'actions reste en bas de l'écran : on ne défile jamais pour
   l'atteindre. Couleur : le travail du jour, laurier. */
@font-face { font-family: "Philosopher"; font-weight: 400; font-display: swap; src: url("/polices/philosopher-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Philosopher"; font-weight: 700; font-display: swap; src: url("/polices/philosopher-latin-700-normal.woff2") format("woff2"); }
:root { --jour: #136e72; --jour-clair: #e3f0f0; --encre: #14232a; --papier: #ffffff; --ligne: #c9d6d6; --alerte: #8a5a12; --fait: #2f6b46; }
@media (prefers-color-scheme: dark) { :root { --jour: #5fb8b6; --jour-clair: #17393a; --encre: #e8f0f0; --papier: #0f1a1c; --ligne: #2c4446; --alerte: #e0a84a; --fait: #7cc596; } }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body.terrain { font-family: Philosopher, system-ui, sans-serif; font-size: 18px; background: var(--papier); color: var(--encre); display: flex; flex-direction: column; overscroll-behavior: none; }
p, li, dd { text-align: justify; }
.barre { display: flex; align-items: center; gap: 12px; padding: 8px 14px; background: var(--jour); color: #fff; padding-top: max(8px, env(safe-area-inset-top)); }
.barre .marque { color: #fff; font-weight: 700; text-decoration: none; font-size: 20px; }
.reseau.hors { background: var(--alerte); color: #fff; padding: 4px 10px; border-radius: 14px; }
.sync { margin-left: auto; font-size: 15px; opacity: .9; }
.sync.attente { opacity: 1; font-weight: 700; }
.sync a { color: #fff; }
main#ecran { flex: 1; overflow: auto; padding: 12px 14px 110px; -webkit-overflow-scrolling: touch; }
h1 { font-size: 24px; margin: 4px 0 8px; } h1 small { font-weight: 400; font-size: 16px; } h2 { font-size: 20px; margin: 8px 0; color: var(--jour); }
.aide { font-size: 15px; opacity: .85; }
.alerte { border-left: 6px solid var(--alerte); padding: 8px 12px; background: color-mix(in srgb, var(--alerte) 14%, transparent); }
/* Les ronds de terrain : 64 px, icône de 36. */
.terrain :is(button, a):has(> svg.ic) { width: 64px !important; height: 64px !important; min-width: 64px !important; }
.terrain :is(button, a):has(> svg.ic) > svg.ic { width: 36px !important; height: 36px !important; }
.terrain :is(button, a):has(> svg.ic) { color: var(--jour); background: var(--papier); }
.terrain .principal:has(> svg.ic) { background: var(--jour) !important; color: #fff !important; box-shadow: none !important; }
.terrain .principal > svg.ic { fill: #fff !important; }
.terrain .confirmer:has(> svg.ic) { background: var(--alerte) !important; }
.barre :is(button, a):has(> svg.ic) { width: 44px !important; height: 44px !important; min-width: 44px !important; color: #fff; background: transparent; }
.liste { list-style: none; padding: 0; margin: 0; }
.liste li a { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 12px; min-height: 64px; border-left: 6px solid var(--jour); background: var(--jour-clair); margin-bottom: 6px; color: inherit; text-decoration: none; }
.liste li a .adresse { grid-column: 1 / -1; font-weight: 700; }
.liste li a .statut { font-size: 15px; }
.liste li.vide { padding: 12px; }
.titre-edl { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.titre-edl h1 { margin: 0; } .titre-edl p { margin: 0; font-size: 15px; text-align: left; } .titre-edl .statut { margin-left: auto; font-size: 15px; font-weight: 700; color: var(--jour); text-align: right; }
.sommaire { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.tuile { display: flex; flex-direction: column; gap: 4px; padding: 14px; min-height: 84px; border: 2px solid var(--ligne); border-left: 6px solid var(--jour); border-radius: 6px; color: inherit; text-decoration: none; }
.tuile span { font-size: 15px; opacity: .85; }
.tuile.piece strong { font-size: 20px; }
.actions { display: flex; gap: 14px; align-items: center; justify-content: space-between; padding: 10px 0; }
.actions.fixe { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px max(10px, env(safe-area-inset-bottom)); background: var(--papier); border-top: 2px solid var(--ligne); z-index: 5; }
.element { border: 2px solid var(--ligne); border-left: 6px solid var(--jour); border-radius: 6px; margin-bottom: 6px; }
.ligne-element { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; min-height: 60px; padding: 8px 12px; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; }
.ligne-element span:nth-child(2) { grid-column: 1; font-size: 15px; opacity: .85; }
.ligne-element span:nth-child(3) { grid-row: 1 / span 2; grid-column: 2; font-size: 14px; }
.element .detail { display: none; padding: 0 12px 12px; }
.element.ouvert .detail { display: block; }
.element.ouvert { background: var(--jour-clair); }
.choix { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.choix button { min-height: 52px; min-width: 52px; padding: 0 14px; border: 2px solid var(--jour); border-radius: 26px; background: var(--papier); color: var(--jour); font: inherit; font-size: 16px; }
.choix button.actif { background: var(--jour); color: #fff; }
.deux { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
label.case { flex-direction: row; align-items: center; gap: 10px; font-size: 18px; min-height: 52px; }
label.case input { width: 30px; height: 30px; }
input, select, textarea { font: inherit; font-size: 18px; min-height: 52px; padding: 8px 10px; border: 2px solid var(--ligne); border-radius: 6px; background: var(--papier); color: var(--encre); width: 100%; }
textarea { min-height: 70px; }
.obs { margin-top: 8px; }
.entree { margin: 6px 0; padding: 6px 10px; border-left: 4px solid var(--ligne); font-size: 15px; text-align: left; }
.vignettes { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.vignettes img { width: 96px; height: 72px; object-fit: cover; border-radius: 4px; border: 1px solid var(--ligne); }
.outils { display: flex; gap: 12px; }
.carte { border: 2px solid var(--ligne); border-radius: 6px; padding: 10px 12px; margin-bottom: 8px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.carte .obs, .carte .vignettes, .carte .outils, .carte p { grid-column: 1 / -1; }
.nom-piece { margin-bottom: 8px; }
.signatures { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px; }
.cadre { border: 2px solid var(--ligne); border-radius: 6px; padding: 8px; }
.cadre canvas { width: 100%; height: 180px; background: #fff; border: 1px dashed var(--ligne); touch-action: none; display: block; }
.controle ul, .etapes { padding-left: 20px; }
.etapes { list-style: none; padding: 0; } .etapes li::before { content: "… "; color: var(--alerte); } .etapes li.fait::before { content: "✓ "; color: var(--fait); }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: var(--encre); color: var(--papier); padding: 10px 18px; border-radius: 22px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 9; }
.toast.vu { opacity: .95; }
.demande { position: fixed; inset: auto 0 0 0; background: var(--papier); border-top: 3px solid var(--jour); padding: 16px; z-index: 10; }
.demande p { display: flex; gap: 14px; }
.attente { opacity: .7; }
@media (max-width: 560px) { .deux { grid-template-columns: 1fr; } body.terrain { font-size: 17px; } }
.controle summary { font-size: 20px; color: var(--jour); font-weight: 700; min-height: 52px; display: flex; align-items: center; }
.signe { border: 2px solid var(--ligne); border-radius: 6px; padding: 10px 12px; }
.signe li { text-align: left; }
