/* Carnet de mission (iPhone). Une colonne, gros éléments tactiles, utilisable à une main.
 * Pas de color-mix ni de syntaxe récente : compatible Safari iOS plus anciens. */
:root {
  --c-bg: #0b1220; --c-surface: #111a2b; --c-surface-2: #172338; --c-text: #e6edf6; --c-text-muted: #8a9ab3;
  --c-accent: #3ec7e0; --c-accent-text: #04131a; --c-success: #4fc48a; --c-danger: #e5484d; --c-warning: #e8b04b;
  --c-border: #24324a; --c-paper: #e9edf2; --c-paper-text: #18202c;
  --radius: 10px; --bg-image: none; --overlay: transparent; --texture: none;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
}
html, body { background: var(--c-bg); }
body { color: var(--c-text); font-size: 17px; line-height: 1.5; min-height: 100vh; overflow-x: hidden; -webkit-tap-highlight-color: transparent; }

/* ---------- en-tête ---------- */
.head { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px;
  padding: calc(10px + var(--safe-t)) 16px 12px; background: var(--c-bg); border-bottom: 1px solid var(--c-border); }
.head__logo { width: 30px; height: 30px; }
.head__name { font-family: var(--font-display); font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.head__timer { font-size: 22px; font-weight: 700; padding: 2px 10px; border-radius: 8px; background: var(--c-surface); border: 1px solid var(--c-border); }
.head__timer.is-low { color: var(--c-danger); border-color: var(--c-danger); }
.head__timer.is-paused { color: var(--c-warning); }
.head__progress { grid-column: 1 / -1; height: 4px; background: var(--c-border); border-radius: 2px; overflow: hidden; }
.head__progress i { display: block; height: 100%; width: 0; background: var(--c-success); transition: width .6s; }
.head__offline { grid-column: 1 / -1; font-size: 13px; color: var(--c-warning); text-align: center; }

/* ---------- vues ---------- */
.views { padding: 18px 16px calc(96px + var(--safe-b)); }
.view { display: grid; gap: 16px; animation: up .25s ease-out; }
.kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .16em; color: var(--c-accent); font-weight: 700; }
.title { font-family: var(--font-display); font-size: 30px; line-height: 1.1; font-weight: 700; }
body[data-headings="uppercase"] .title { text-transform: uppercase; }
.place { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--c-text-muted); }
.intro { display: grid; gap: 10px; }
.speaker { display: flex; gap: 12px; align-items: center; }
.speaker img { width: 64px; height: 64px; border-radius: 50%; background: var(--c-surface-2); border: 2px solid var(--c-border); }
.speaker b { display: block; }
.speaker span { font-size: 14px; color: var(--c-text-muted); }

/* documents (cartes) */
.doc { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px; }
body[data-cards="paper"] .doc { background: var(--c-paper); background-image: var(--texture); color: var(--c-paper-text); border-color: transparent;
  box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 8px 20px -10px rgba(0,0,0,.6); }
.doc__title { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; opacity: .7; margin-bottom: 12px; }
.doc__body { display: grid; gap: 8px; }
.doc--note { border-left: 4px solid var(--c-warning); }
.doc--locked .doc__locked { display: grid; gap: 12px; justify-items: center; text-align: center; padding: 10px 0; }
.doc--locked .ico { font-size: 44px; color: var(--c-warning); }
.transcript { display: grid; gap: 14px; }
.transcript__line { display: grid; grid-template-columns: 46px 1fr; gap: 12px; align-items: start; }
.transcript__face { width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.08); border: 2px solid var(--who); }
.transcript__who { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--who); font-weight: 700; }
.transcript__text { quotes: "« " " »"; }
.symbols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.symbol { border: 1.5px solid rgba(127,127,127,.3); border-radius: var(--radius); padding: 14px 8px 10px; display: grid; justify-items: center; gap: 4px; }
.symbol img { width: 72px; height: 72px; }
.symbol figcaption { font-weight: 700; }
.symbol__value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; }
.symbol__value.is-unknown { opacity: .4; }
.colors { display: grid; gap: 12px; }
.color { display: grid; grid-template-columns: 52px 1fr auto auto; gap: 12px; align-items: center; font-size: 19px; }
.color__swatch { width: 52px; height: 34px; border-radius: 6px; }
.color__label { font-weight: 700; }
.color__value { font-family: var(--font-mono); font-size: 28px; font-weight: 700; }
.rules { counter-reset: r; display: grid; gap: 10px; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 30px 1fr; gap: 10px; }
.rules li::before { content: counter(r); width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; opacity: .7; }
.facts { display: grid; gap: 2px; }
.facts dt { font-size: 13px; opacity: .65; margin-top: 8px; }
.facts dd { font-weight: 700; }

/* saisie */
.entry { display: grid; gap: 12px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 18px; }
.entry label { font-size: 12px; text-transform: uppercase; letter-spacing: .14em; color: var(--c-text-muted); font-weight: 700; }
.entry input { width: 100%; height: 72px; border-radius: var(--radius); border: 2px solid var(--c-border); background: var(--c-bg); color: var(--c-text);
  font-family: var(--font-mono); font-size: 36px; text-align: center; letter-spacing: .4em; font-weight: 700; -webkit-appearance: none; }
.entry input:focus { outline: none; border-color: var(--c-accent); }
.entry.is-wrong input { border-color: var(--c-danger); animation: shake .4s; }
.fb { min-height: 22px; font-size: 15px; text-align: center; color: var(--c-text-muted); }
.fb.is-wrong { color: var(--c-danger); }
.fb.is-ok { color: var(--c-success); }

.btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 58px; padding: 0 20px; border-radius: var(--radius);
  border: 2px solid var(--c-accent); background: var(--c-accent); color: var(--c-accent-text); font-weight: 800; font-size: 18px; letter-spacing: .01em; }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; }
body[data-buttons="outline"] .btn { background: transparent; color: var(--c-accent); }
body[data-buttons="pill"] .btn { border-radius: 999px; }
body[data-buttons="stamp"] .btn { text-transform: uppercase; letter-spacing: .1em; border-style: double; border-width: 4px; }
.btn--ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); font-weight: 700; }
.btn--big { min-height: 72px; font-size: 21px; }

.hint { border: 1.5px dashed var(--c-warning); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.hint b { color: var(--c-warning); font-size: 13px; text-transform: uppercase; letter-spacing: .1em; }
.callout { border: 2px solid var(--c-accent); border-radius: var(--radius); padding: 22px 18px; text-align: center; display: grid; gap: 8px; }
.callout b { font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.callout span { color: var(--c-text-muted); font-size: 15px; }

/* messages */
.msgs { display: grid; gap: 12px; }
.msg { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); padding: 14px; display: grid; grid-template-columns: 44px 1fr; gap: 2px 12px; }
.msg__face { grid-row: 1 / span 3; width: 44px; height: 44px; border-radius: 50%; background: var(--c-surface-2); }
.msg__face--sys { display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; color: var(--c-accent); border: 1px solid var(--c-border); }
.msg__meta { font-size: 13px; color: var(--c-text-muted); display: flex; justify-content: space-between; }
.msg__title { font-weight: 800; }
.msg__text { white-space: pre-line; font-size: 16px; }
.msg--hint { border-color: var(--c-warning); }
.msg--success { border-color: var(--c-success); }
.msg--alert { border-color: var(--c-danger); }
.empty { color: var(--c-text-muted); text-align: center; padding: 40px 10px; }
.arch { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius); }
.arch summary { list-style: none; padding: 16px; display: grid; gap: 2px; cursor: pointer; }
.arch summary::-webkit-details-marker { display: none; }
.arch summary small { color: var(--c-success); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.arch summary b { font-size: 18px; }
.arch__body { padding: 0 12px 14px; display: grid; gap: 12px; }

/* barre d'onglets */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(6px + var(--safe-b)); background: var(--c-bg); border-top: 1px solid var(--c-border); }
.tab { background: none; border: 0; display: grid; justify-items: center; gap: 2px; padding: 8px 0; font-size: 12px; font-weight: 700; color: var(--c-text-muted);
  position: relative; min-height: 54px; }
.tab .ico { font-size: 24px; }
.tab.is-on { color: var(--c-accent); }
.tab__badge { position: absolute; top: 4px; left: 56%; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-danger); color: #fff;
  font-size: 11px; display: grid; place-items: center; }

/* feuilles plein écran */
.sheet { position: fixed; inset: 0; z-index: 20; background: var(--c-bg); display: grid; place-items: center; padding: 30px 24px calc(30px + var(--safe-b)); overflow-y: auto; }
.sheet--dim { background: rgba(5, 8, 14, .88); }
.wait { text-align: center; display: grid; gap: 12px; justify-items: center; }
.wait__emblem { width: 110px; height: 110px; }
.wait__eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: .2em; color: var(--c-accent); font-weight: 700; }
.wait h1 { font-family: var(--font-display); font-size: 32px; line-height: 1.15; }
.wait p { color: var(--c-text-muted); }
.end { text-align: center; display: grid; gap: 14px; justify-items: center; }
.end img { width: 150px; height: 150px; border-radius: 50%; border: 3px solid var(--c-accent); background: var(--c-surface); }
.end h1 { font-family: var(--font-display); font-size: 40px; line-height: 1.05; }
.end--timeout h1 { color: var(--c-danger); }
.end__text { display: grid; gap: 10px; }

.note-pop { position: fixed; left: 12px; right: 12px; top: calc(10px + var(--safe-t)); z-index: 30; background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: 14px; padding: 14px 16px; box-shadow: 0 16px 40px rgba(0,0,0,.5); display: grid; grid-template-columns: 40px 1fr; gap: 2px 12px; animation: drop .3s ease-out; }
.note-pop img, .note-pop .msg__face--sys { grid-row: 1 / span 2; width: 40px; height: 40px; border-radius: 50%; }
.note-pop b { font-size: 15px; }
.note-pop span { font-size: 14px; color: var(--c-text-muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

@keyframes up { from { opacity: 0; transform: translateY(6px); } }
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.symbols--3 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.symbols--3 .symbol img { width: 56px; height: 56px; }
.symbols--3 .symbol figcaption { font-size: 15px; }
