/* Entraînement à la prise de parole — mobile d'abord (375–430 px), utilisable d'un pouce. */
:root {
  --bg: #f7f2ea;
  --card: #ffffff;
  --ink: #1b2130;
  --muted: #5d6474;
  --line: #e4dccf;
  --night: #16233a;
  --accent: #c8791b;      /* ambre : la lumière du plateau */
  --accent-ink: #ffffff;
  --soft: #fbf0dc;
  --calm: #2f6f62;        /* vert profond : ce qui est acquis */
  --calm-soft: #e5f1ee;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22, 35, 58, .06), 0 8px 24px rgba(22, 35, 58, .06);
  --vu: 0;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  overflow-x: hidden;
}
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8em; overflow-wrap: anywhere; }
[hidden] { display: none !important; }

.top { background: var(--night); color: #fff; }
.top-in { max-width: 1080px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { font-weight: 700; letter-spacing: .01em; font-size: .95rem; }
.link-btn { background: none; border: 0; color: #d7deea; font: inherit; font-size: .9rem; padding: 8px 4px; text-decoration: underline; cursor: pointer; }

.page { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); }
.admin .page { max-width: 1080px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin: 0 0 16px; box-shadow: var(--shadow); }
.hero { margin-top: 8px; padding: 24px 20px; }
.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 700; color: var(--accent); margin-bottom: .5em; }
.lead { color: var(--ink); font-size: 1.05rem; }
.muted { color: var(--muted); font-weight: 400; }
.small { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.hello { font-weight: 700; margin: 4px 0 12px; }
.notice { background: var(--soft); border-left: 4px solid var(--accent); padding: 10px 12px; border-radius: 8px; }
.notice.ok { background: var(--calm-soft); border-left-color: var(--calm); }

.stack { display: grid; gap: 14px; margin-top: 14px; }
label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; }
input[type=text], input[type=password], input[type=date], input[type=number], textarea {
  width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: #fff;
  border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 50px;
}
textarea { resize: vertical; min-height: 96px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 18px; border-radius: 14px; border: 1.5px solid var(--night);
  background: #fff; color: var(--night); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.btn.primary { background: var(--night); color: #fff; }
.btn.ghost { border-color: var(--line); color: var(--ink); }
.btn.big { min-height: 58px; font-size: 1.1rem; width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.row.wrap { flex-wrap: wrap; }
.row.wrap > * { flex: 0 1 auto; }

/* Onglets */
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; background: #ebe4d8; border-radius: 16px; padding: 5px; margin-bottom: 14px; }
.tab { position: relative; min-height: 48px; border: 0; border-radius: 12px; background: transparent; font: inherit; font-size: .95rem; font-weight: 700; color: var(--muted); cursor: pointer; padding: 6px 8px; }
.tab.is-on { background: #fff; color: var(--night); box-shadow: 0 1px 3px rgba(22, 35, 58, .12); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-left: 6px; vertical-align: middle; }
.banner { display: block; width: 100%; text-align: left; background: var(--soft); border: 1.5px solid var(--accent); color: var(--ink); border-radius: 14px; padding: 12px 14px; font: inherit; font-weight: 600; margin-bottom: 14px; cursor: pointer; }

/* Consigne */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chip { border: 1.5px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 8px 14px; min-height: 40px; font: inherit; font-size: .88rem; font-weight: 600; cursor: pointer; }
.chip.is-on { border-color: var(--night); background: var(--night); color: #fff; }
.chip.is-done:not(.is-on) { border-color: var(--calm); color: var(--calm); }

/* Studio d'enregistrement */
.studio { text-align: center; padding: 22px 18px; }
.hint { color: var(--muted); margin-bottom: 14px; }
.mic-wrap { position: relative; width: 168px; height: 168px; margin: 0 auto 10px; display: grid; place-items: center; }
.vu { position: absolute; inset: 14px; border-radius: 50%; background: var(--accent); opacity: calc(.12 + var(--vu) * .38); transform: scale(calc(1 + var(--vu) * .32)); transition: transform .08s linear, opacity .08s linear; }
.mic { position: relative; width: 132px; height: 132px; border-radius: 50%; border: 0; background: var(--night); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 24px rgba(22, 35, 58, .28); -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.mic:active { transform: scale(.97); }
.mic .stop-square { display: none; width: 40px; height: 40px; border-radius: 9px; background: #fff; }
.is-recording .mic { background: var(--accent); }
.is-recording .mic svg { display: none; }
.is-recording .mic .stop-square { display: block; }
.is-recording .vu { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(200, 121, 27, .0); } 50% { box-shadow: 0 0 0 14px rgba(200, 121, 27, .14); } }
.chrono { font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 700; margin: 6px 0 4px; }
.chrono .muted { font-size: 1rem; }
.review { margin-top: 14px; display: grid; gap: 12px; }
.review audio, .rec audio { width: 100%; }
.status { min-height: 1.5em; color: var(--muted); margin: 10px 0 0; font-weight: 600; }
.is-busy .mic { opacity: .5; pointer-events: none; }

/* Retour */
.result { border-color: var(--calm); }
.fb { background: var(--calm-soft); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.fb.next { background: var(--soft); }
.fb h3 { color: var(--calm); }
.fb.next h3 { color: #8a5210; }
.fb p { margin: 0; font-size: 1.05rem; }
.measures { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; color: var(--muted); font-size: .92rem; }
.measures strong { color: var(--ink); }

/* Historique */
.history { margin-top: 24px; }
.history-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.history-list li { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.history-list .when { font-weight: 700; margin-bottom: 2px; }
.history-list .nums { color: var(--muted); font-size: .88rem; margin-bottom: 8px; }
.history-list p { margin-bottom: .4em; }

/* Entretien */
.chat { display: grid; gap: 10px; margin-bottom: 14px; }
.bubble { max-width: 88%; padding: 12px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.q { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 6px; justify-self: start; font-weight: 600; }
.bubble.a { background: var(--night); color: #fff; border-bottom-right-radius: 6px; justify-self: end; }
.composer { display: grid; gap: 10px; }
.anchor-card { border-color: var(--accent); }
.anchors { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 14px; }
.anchors li { display: flex; gap: 12px; align-items: flex-start; }
.anchors .n, .prompt .n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 800; display: inline-grid; place-items: center; }
.anchors h3 { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.anchors p { margin: 0; font-size: 1.1rem; font-weight: 600; }
.close-full { display: none; }
.anchor-card.is-full { position: fixed; inset: 0; z-index: 50; margin: 0; border-radius: 0; border: 0; background: var(--night); color: #fff; overflow: auto; padding: calc(28px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; justify-content: center; }
.anchor-card.is-full .row { display: none; }
.anchor-card.is-full .close-full { display: inline-flex; align-self: center; background: transparent; color: #fff; border-color: rgba(255, 255, 255, .4); }
.anchor-card.is-full .anchors { gap: 26px; }
.anchor-card.is-full .anchors h3 { color: #c9d2e2; }
.anchor-card.is-full .anchors p { font-size: 1.45rem; line-height: 1.3; }

/* Cockpit formateur */
.admin-title { margin: 8px 0 14px; }
.admin-grid { display: grid; gap: 16px; }
.cohort-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.cohort-list a { display: grid; gap: 2px; padding: 12px; border-radius: 12px; border: 1.5px solid var(--line); color: var(--ink); text-decoration: none; }
.cohort-list a.is-on { border-color: var(--night); background: #f1f4f9; }
.cohort-list .muted { font-size: .85rem; }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.copy-row input { flex: 1 1 220px; min-width: 0; font-size: .95rem; }
details { margin-top: 12px; }
summary { cursor: pointer; font-weight: 700; padding: 10px 0; min-height: 44px; display: flex; align-items: center; gap: 10px; }
.prompt { border-top: 1px solid var(--line); margin: 0; }
.prompt.is-off summary { color: var(--muted); }
.prompt .n { width: 28px; height: 28px; font-size: .85rem; background: var(--night); }
.two { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.learner { border-top: 1px solid var(--line); padding: 16px 0; }
.learner:first-of-type { border-top: 0; }
.learner header h3 { font-size: 1.1rem; margin-bottom: 2px; }
.brief { background: var(--calm-soft); border-radius: 14px; padding: 14px; margin: 12px 0; }
.brief.card3 { background: var(--soft); }
.brief p:last-child { margin-bottom: 0; }
.rec { border-top: 1px dashed var(--line); padding: 12px 0; }
.transcript { color: var(--muted); font-size: .95rem; }
.purge { margin: 8px 0 0; }

@media (min-width: 900px) {
  .admin-grid { grid-template-columns: 320px 1fr; align-items: start; }
}
@media (prefers-reduced-motion: reduce) {
  .vu { transition: none; animation: none !important; }
}
