/* App terrain (module Terrain) — compléments propres au module ; les composants partagés
   (.btn, .card, .visit, .seg, .badge, .tap…) viennent de src/styles/global.css. */

.t-icon-btn { display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 10px; cursor: pointer; position: relative; z-index: 2; }
.t-icon-btn:active { background: rgba(255,255,255,.25); }

/* Bouton flottant « Scanner » : LE bouton rouge des écrans tournée / intervention */
.t-fab { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 35;
  background: var(--color-red, #DB2232); color: #fff; border: 0; border-radius: 999px; padding: 0 26px; min-height: 56px;
  font-family: var(--font-head, sans-serif); text-transform: uppercase; font-size: 19px; font-weight: 600; letter-spacing: .04em;
  display: flex; gap: 10px; align-items: center; box-shadow: 0 8px 20px rgba(219,34,50,.4); cursor: pointer; }
.t-fab.hidden { display: none; }
.t-fab-space { height: 64px; }

/* Visites de la tournée */
.t-visit { border-left: 4px solid transparent; }
.t-visit.t-next { border-left-color: var(--color-red, #DB2232); }
.t-visit.t-done { opacity: .6; }
.t-visit .t-h { font-family: var(--font-head, sans-serif); font-size: 21px; color: var(--color-red, #DB2232); min-width: 52px; font-weight: 600; }
.t-visit b { display: block; font-size: 15px; line-height: 1.25; }
.t-visit .t-sub { font-size: 13px; color: var(--color-muted, #7A7A7D); display: block; }
.t-visit .t-go { margin-left: auto; color: var(--color-muted, #7A7A7D); flex: none; }
.cave .t-visit .t-sub { color: #bbb; }

/* Lignes d'équipement */
.t-eq { display: flex; gap: 10px; align-items: center; padding: 10px 12px; min-height: 64px; background: #fff; border-radius: 12px; text-decoration: none; color: inherit; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.t-eq .t-code { font-family: var(--font-head, sans-serif); font-size: 17px; font-weight: 600; }
.t-eq .t-sub { font-size: 13px; color: var(--color-muted, #7A7A7D); }
.t-eq .t-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.cave .t-eq { background: #333335; color: #fff; box-shadow: none; }
.cave .t-eq .t-sub { color: #bbb; }

/* Replis générés par terrain.js (classes du socle) : cibles tactiles de 48 px */
#terrain-app .section > summary { min-height: 48px; }
.t-groupe > .section-corps { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }

/* Check-list */
.t-ck { background: #fff; border-radius: 12px; padding: 2px 14px; }
.t-ck-row { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--color-grey-100, #F3F3F4); }
.t-ck-row:last-child { border-bottom: 0; }
.t-ck-row .t-lib { font-size: 15px; line-height: 1.25; }
.t-ck-row .t-aide { font-size: 12px; color: var(--color-muted, #7A7A7D); display: block; margin-top: 2px; }
.t-ck-row .t-crit { color: var(--color-red, #DB2232); font-weight: 700; }
.t-ck-row .seg > button { min-width: 48px; }
.cave .t-ck { background: #333335; color: #fff; }
.cave .t-ck-row { border-color: #444; }
.cave .t-ck-row .t-aide { color: #aaa; }

.t-photo-btn { border: 2px dashed var(--color-red, #DB2232); border-radius: 12px; padding: 14px; font-size: 15px; font-weight: 600; color: var(--color-red-600, #B81A28); background: var(--color-red-50, #FDECEE); text-align: center; display: flex; gap: 8px; align-items: center; justify-content: center; min-height: 56px; cursor: pointer; }
.t-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.t-thumbs figure { position: relative; margin: 0; }
.t-thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; display: block; }
/* Cible tactile de 48 px autour d'une pastille visible de 32 px */
.t-thumbs button { position: absolute; top: -16px; right: -16px; width: 48px; height: 48px; border: 0; padding: 0; color: #fff; display: grid; place-items: center; background: radial-gradient(circle, var(--color-anth-800, #3A3A3C) 16px, transparent 16.5px); cursor: pointer; }

.t-seg-wrap { flex-wrap: wrap; }
.t-seg-wrap > button { flex: 1 1 30%; padding: 0 8px; }

/* Signature */
.t-sig { position: relative; background: #fff; border-radius: 12px; border: 2px solid var(--color-grey-200, #E7E7E9); height: 200px; touch-action: none; }
.t-sig canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 10px; }
.t-sig::after { content: "Signez ici"; position: absolute; left: 14px; bottom: 34px; right: 14px; border-top: 1px dashed #ccc; font-size: 11px; color: #aaa; padding-top: 2px; pointer-events: none; }
.cave .t-sig { border-color: #555; }

.t-kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; }
.t-kv dt { color: var(--color-muted, #7A7A7D); }
.cave .t-kv dt { color: #aaa; }
.t-code-acces { font-family: var(--font-head, sans-serif); font-size: 22px; letter-spacing: .08em; font-weight: 700; }
.t-pending { font-size: 11px; font-weight: 700; color: var(--color-warn-700, #A86F00); display: inline-flex; gap: 4px; align-items: center; }
.cave .t-pending { color: var(--color-warn, #E8A317); }
.t-progress { height: 8px; border-radius: 99px; background: var(--color-grey-200, #E7E7E9); overflow: hidden; }
.t-progress > i { display: block; height: 100%; background: var(--color-ok, #1F9D55); }
.cave .t-progress { background: #444; }
.t-back { display: inline-flex; align-items: center; gap: 4px; font-size: 15px; font-weight: 600; color: var(--color-anth-800, #3A3A3C); text-decoration: none; min-height: 48px; }
#terrain-app .input, .t-scan-manual .input { min-height: 48px; }
.cave .t-back { color: #fff; }

/* Scanner plein écran */
.t-scanner { position: fixed; inset: 0; z-index: 70; background: #111; color: #fff; display: flex; flex-direction: column; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); gap: 12px; }
.t-scanner.hidden { display: none; }
.t-scanner-bar { display: flex; align-items: center; justify-content: space-between; }
.t-scan-region { flex: 1; min-height: 240px; border-radius: 14px; overflow: hidden; background: #000; position: relative; }
.t-scan-region video { width: 100% !important; height: 100% !important; object-fit: cover; }
.t-scan-msg { font-size: 14px; color: #ddd; text-align: center; }
.t-scan-manual { display: flex; flex-direction: column; gap: 6px; }
.t-scan-manual .input { background: #222; color: #fff; border-color: #444; text-transform: uppercase; font-size: 18px; }

/* Mode cave : le fond de page (utilitaire bg-grey-100 du layout) et les libellés de champ
   restent clairs avec le seul CSS Core → contournement local (signalé dans le rapport L2). */
html.cave body { background: var(--color-anth-900, #262628); }
.cave #terrain-app .field > label, .cave #terrain-app .label, .cave #terrain-app .sec-title { color: #e5e5e5; }
.cave #terrain-app .alert-warn { background: #4a3a10; color: #ffe2a0; }
html.cave .tabbar { background: #000; border-color: #333; }
