/*
 * Simulateur de situations professionnelles — feuille de style.
 *
 * CSS natif, sans bibliothèque ni ressource externe : polices du système uniquement.
 * Identité reprise du support de l'atelier : papier clair, bleu nuit, accent argile,
 * et une ligne fine qui sépare deux colonnes (conversation | repères).
 *
 * Trois conventions visuelles portent une information et ne sont pas décoratives :
 *   - hachures            = contenu simulé (mode démonstration) ;
 *   - bordure en tirets   = règle fictive de l'exercice ;
 *   - trait plein / tirets / pointillés = les trois types d'observation
 *     (action de l'apprenant / notion sollicitée par l'interlocuteur / rapprochement à confirmer),
 *     de sorte que la couleur ne soit jamais le seul signal.
 */

:root {
  --paper: #fcfaf6;
  --surface: #ffffff;
  --ink: #0f2440;
  --ink-soft: #33465f;
  --muted: #5a6a7e;
  --line: #d9dee5;
  --line-strong: #aeb8c5;
  --mist: #eef2f5;
  --clay: #b04e17;
  --clay-ink: #9a430f;
  --clay-tint: #fbeadf;
  --learner-tint: #e2e9f3;
  --confirm: #6f6226;
  --confirm-tint: #f5f0d8;
  --warn-tint: #fbf3dc;
  --warn-line: #cfa93c;
  --error: #a3261e;
  --error-tint: #fbeae8;

  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "Noto Serif", Georgia, serif;

  --topbar-h: 3.25rem;
  --radius: 10px;
  --radius-small: 6px;
  --gap: 1rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
}

/* Guillemets selon la langue de la session (allemand standard suisse : « » sans espace). */
:lang(fr) { quotes: "«\00a0" "\00a0»"; }
:lang(de) { quotes: "«" "»"; }
:lang(it) { quotes: "«" "»"; }
:lang(en) { quotes: "“" "”"; }

h1, h2, h3, h4 {
  margin: 0;
  line-height: 1.25;
  font-weight: 650;
  text-wrap: balance;
}

h1 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 1.9rem); letter-spacing: -0.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
h4 { font-size: 0.95rem; }

p, ul, ol, dl, figure, blockquote, fieldset, pre {
  margin: 0;
}

p, li, dd {
  max-width: 72ch;
}

ul, ol {
  padding-left: 1.25rem;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

textarea {
  resize: vertical;
}

fieldset {
  border: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
  font-weight: 650;
}

label {
  font-weight: 600;
}

:focus-visible {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
  border-radius: 3px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -4rem;
  z-index: 20;
  padding: 0.5rem 0.9rem;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius-small);
}

.skip-link:focus {
  top: 0.5rem;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
}

/* ------------------------------------------------------------------ barre supérieure */

.topbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--gap);
  min-height: var(--topbar-h);
  padding: 0.4rem clamp(0.9rem, 3vw, 1.75rem);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 650;
  max-width: none;
  white-space: nowrap;
}

/* Marque : deux moitiés accolées, rappel de la page bilingue du support. */
.brand-mark {
  width: 0.95rem;
  height: 0.95rem;
  flex: none;
  background: linear-gradient(90deg, var(--ink) 50%, var(--clay) 50%);
}

.topbar-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
  min-width: 0;
}

.topbar-tools .tag {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-tools .btn {
  min-height: 2.25rem;
  padding: 0.25rem 0.6rem;
}

/* ------------------------------------------------------------------ zone principale */

main {
  flex: 1;
  width: 100%;
  max-width: 74rem;
  margin: 0 auto;
  padding: clamp(1.1rem, 3vw, 2.25rem) clamp(0.9rem, 3vw, 1.75rem) 3rem;
}

main:focus {
  outline: none;
}

.boot-note {
  margin: 3rem auto;
  text-align: center;
  color: var(--muted);
}

.screen {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.screen-narrow {
  max-width: 30rem;
  margin: 2rem auto 0;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.stack-tight {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.row-tight {
  gap: 0.4rem;
}

.bullets {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

/* ------------------------------------------------------------------ boutons et champs */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
}

.btn:hover {
  border-color: var(--ink);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.btn-primary:hover {
  background: #1b3a63;
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
}

.btn-quiet:hover {
  background: var(--mist);
  border-color: transparent;
}

.btn-small {
  min-height: 2.25rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.9rem;
}

.btn-large {
  min-height: 3.25rem;
  padding: 0.7rem 1.4rem;
  font-size: 1.05rem;
}

/* Bouton « Parler » : la seule commande en couleur d'accent. */
.btn-talk {
  min-height: 3rem;
  padding: 0.55rem 1.3rem;
  border-color: var(--clay);
  border-radius: 999px;
  background: var(--clay);
  color: #fff;
}

.btn-talk:hover {
  border-color: var(--clay-ink);
  background: var(--clay-ink);
}

.btn-talk.is-recording {
  background: var(--error);
  border-color: var(--error);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(163, 38, 30, 0.45); }
  50% { box-shadow: 0 0 0 0.55rem rgba(163, 38, 30, 0); }
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  cursor: pointer;
}

.icon-btn:hover {
  background: var(--mist);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  cursor: pointer;
}

.link:hover {
  color: var(--clay-ink);
}

.icon {
  width: 1.15em;
  height: 1.15em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field {
  width: 100%;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  line-height: 1.45;
}

.field:hover {
  border-color: var(--ink-soft);
}

.field:disabled {
  background: var(--mist);
  color: var(--muted);
}

.form-status {
  min-height: 1.4em;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.form-status:empty {
  display: none;
}

/* ------------------------------------------------------------------ étiquettes */

.tag {
  display: inline-block;
  padding: 0.08rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

.tag-main {
  border-color: var(--clay);
  background: var(--clay);
  color: #fff;
}

.tag-support_case,
.tag-course_case,
.tag-read,
.tag-dialogue {
  border-color: var(--ink);
  color: var(--ink);
}

.tag-adaptation,
.tag-not_read {
  border-style: dashed;
}

.tag-learner {
  border-color: var(--learner-tint);
  background: var(--learner-tint);
  color: var(--ink);
}

.tag-design {
  border-color: var(--clay-tint);
  background: var(--clay-tint);
  color: var(--clay-ink);
}

.tag-check,
.tag-reference {
  background: var(--mist);
  border-color: var(--mist);
}

/* Règle fictive : bordure en tirets. */
.tag-fiction {
  border-style: dashed;
  border-color: var(--clay);
  color: var(--clay-ink);
}


/* ------------------------------------------------------------------ avis */

.notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-small);
  background: var(--mist);
}

.notice p {
  flex: 1 1 16rem;
}

.notice-warn {
  background: var(--warn-tint);
  border-color: var(--warn-line);
}

.notice-error {
  background: var(--error-tint);
  border-color: var(--error);
}

/* Contenu simulé : hachures (étiquette et avis). */
.tag-demo,
.notice-demo {
  background: var(--warn-tint) repeating-linear-gradient(-45deg, rgba(207, 169, 60, 0.26) 0 6px, transparent 6px 12px);
  border-color: var(--warn-line);
  color: var(--ink);
}

.notice-demo {
  border-left-width: 1px;
}

/* ------------------------------------------------------------------ choix de la langue */

.screen-language {
  gap: clamp(1.5rem, 4vw, 2.75rem);
  padding-top: clamp(0.5rem, 4vw, 3rem);
}

/* Quatre langues, quatre lignes de même poids. */
.language-title {
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  font-size: clamp(1.7rem, 1rem + 4vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13.5rem, 1fr));
  gap: 0;
  border-top: 1px solid var(--ink);
}

.lang-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  padding: 1.1rem 1rem 1.3rem 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  text-align: left;
  cursor: pointer;
}

.lang-name {
  font-size: 1.5rem;
  font-weight: 650;
}

.lang-cta {
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 0.2em;
}

.lang-card:hover .lang-name {
  color: var(--clay-ink);
}

.lang-card:hover .lang-cta {
  color: var(--ink);
  text-decoration-color: currentColor;
}

/* ------------------------------------------------------------------ catalogue */

.catalog {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
  gap: 0.9rem;
  padding: 0;
  list-style: none;
}

.catalog > li {
  display: flex;
  max-width: none;
}

.catalog > li:first-child {
  grid-column: 1 / -1;
}

.scenario-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.scenario-card:hover {
  border-color: var(--ink);
}

.scenario-card:disabled {
  opacity: 0.6;
  cursor: progress;
}

.scenario-card.is-main {
  padding: 1.2rem 1.3rem 1.3rem;
  border-color: var(--ink);
  border-left: 5px solid var(--clay);
}

.scenario-title {
  font-size: 1.1rem;
  font-weight: 650;
  line-height: 1.3;
}

.is-main .scenario-title {
  font-size: 1.3rem;
}

.scenario-summary {
  color: var(--ink-soft);
  max-width: 68ch;
}

.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.7rem;
  margin-top: auto;
  padding-top: 0.3rem;
}

/* ------------------------------------------------------------------ blocs, replis, tableaux */

.block {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.block-roles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1rem 1.5rem;
}

.block-roles > div {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.objective {
  font-size: 1.08rem;
}

.criteria {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sources {
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.85rem;
}

.sources li::before {
  content: "↳ ";
}

.documents {
  display: grid;
  gap: 0.7rem;
}

/* Pièce d'un dossier fictif : feuille blanche, texte en caractères à empattements. */
.document {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--line);
}

.document figcaption {
  margin-bottom: 0.35rem;
  font-weight: 650;
  font-size: 0.92rem;
}

.document-body {
  font-family: var(--serif);
  white-space: pre-line;
}

.fold {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.fold + .fold {
  border-top: 0;
}

.fold > summary,
.services > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.fold > summary::-webkit-details-marker,
.services > summary::-webkit-details-marker,
.trace summary::-webkit-details-marker {
  display: none;
}

.fold > summary::before,
.services > summary::before,
.trace summary::before {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: rotate(-45deg);
  transition: transform 0.15s ease;
}

.fold[open] > summary::before,
.services[open] > summary::before,
.trace details[open] > summary::before {
  transform: rotate(45deg);
}

.fold[open],
.services[open] {
  padding-bottom: 0.9rem;
}

.fold[open] > * + *,
.services[open] > * + * {
  margin-top: 0.6rem;
}

.fold-inner {
  border-bottom: 0;
}

.services {
  border-top: 1px solid var(--line);
}

.count {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.9rem;
}

.table-scroll {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.table th,
.table td {
  padding: 0.5rem 0.8rem 0.5rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.table thead th {
  border-bottom-color: var(--ink);
  font-size: 0.85rem;
}

.table tbody th {
  font-weight: 600;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.3rem 1rem;
}

.facts dt {
  font-weight: 600;
}

.facts dd {
  margin: 0;
}

/* ------------------------------------------------------------------ préparation */

.crumb {
  font-size: 0.92rem;
}

.crumb .link::before {
  content: "‹ ";
}

.brief-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 1.5rem clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.brief-main,
.brief-side {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

/* La colonne de droite porte les réglages : une ligne fine la sépare du texte, comme dans le support. */
.brief-side {
  padding-left: clamp(1.5rem, 4vw, 3rem);
  border-left: 1px solid var(--line);
}

.brief-side > .block:first-child,
.brief-main > .block:first-child {
  padding-top: 0;
  border-top: 0;
}

.choices {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.choices > legend {
  margin-bottom: 0.5rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  font-weight: 400;
  cursor: pointer;
}

.choice input {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  margin: 0.2rem 0 0;
  accent-color: var(--ink);
}

.choice:hover {
  border-color: var(--ink-soft);
}

.choice:has(input:checked) {
  border-color: var(--ink);
  box-shadow: inset 3px 0 0 var(--ink);
}

.choice.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.choice-body {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.choice-title {
  font-weight: 650;
}

.choice-text {
  color: var(--muted);
  font-size: 0.9rem;
}

.prep-body {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.prompt-view {
  max-height: 22rem;
  overflow: auto;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--surface);
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.start-box {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  padding-top: 0.4rem;
}

/* ------------------------------------------------------------------ conversation : deux colonnes */

body[data-view="chat"] {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

body[data-view="chat"] main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-width: none;
  padding: 0;
}

body[data-view="chat"] main > .notice {
  margin: 0.6rem clamp(0.9rem, 3vw, 1.75rem);
}

.workspace {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(20rem, 1fr);
  grid-template-rows: minmax(0, 1fr);
}

.workspace[data-panel="closed"] {
  grid-template-columns: minmax(0, 1fr);
}

.workspace[data-panel="closed"] .markers {
  display: none;
}

.tabs {
  display: none;
}

.conversation {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.conversation-head {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.8rem clamp(0.9rem, 2.5vw, 1.75rem) 0.6rem;
}

.head-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.head-top h1 {
  min-width: 0;
  font-size: 1.2rem;
}

.btn-finish {
  flex: none;
  min-height: 2.4rem;
  padding: 0.35rem 0.9rem;
}

.roles {
  color: var(--muted);
  font-size: 0.9rem;
  max-width: none;
}

.head-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem 1rem;
}

.head-sub .btn {
  min-height: 2rem;
  padding: 0.15rem 0.5rem;
}

.counter {
  color: var(--muted);
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.recap {
  flex: none;
  margin: 0 clamp(0.9rem, 2.5vw, 1.75rem);
}

.recap[open] {
  max-height: 42vh;
  overflow-y: auto;
}

.recap-notes {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin: 0;
  padding: 1rem clamp(0.9rem, 2.5vw, 1.75rem);
  list-style: none;
  overscroll-behavior: contain;
}

.msg {
  max-width: min(42rem, 88%);
  padding: 0.65rem 0.9rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-margin: 4rem;
}

.msg-interlocutor {
  align-self: flex-start;
  border-top-left-radius: 2px;
}

.msg-learner {
  align-self: flex-end;
  border-color: var(--learner-tint);
  border-top-right-radius: 2px;
  background: var(--learner-tint);
}

.msg.is-pending {
  opacity: 0.6;
}

.msg.is-failed {
  border: 1px dashed var(--error);
  background: var(--error-tint);
}

.msg.is-focus,
.quote.is-focus {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
}

.msg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 0.6rem;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
}

.msg-author {
  font-weight: 650;
}

.msg-role {
  color: var(--muted);
}

.msg-text {
  max-width: none;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-actions {
  margin-top: 0.35rem;
}

/* Passage cité par une observation : le style du soulignement indique le type. */
.quote {
  padding: 0.05em 0.1em;
  border-radius: 2px;
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.22em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.quote-learner {
  background: #cbd8ea;
  text-decoration-style: solid;
  text-decoration-color: var(--ink);
}

.quote-interlocutor {
  background: var(--clay-tint);
  text-decoration-style: dashed;
  text-decoration-color: var(--clay);
}

.quote-confirm {
  background: var(--confirm-tint);
  text-decoration-style: dotted;
  text-decoration-color: var(--confirm);
}

.notices {
  flex: none;
  padding: 0 clamp(0.9rem, 2.5vw, 1.75rem);
}

.notices:empty {
  display: none;
}

.notices + .notices {
  margin-top: 0.4rem;
}

.status {
  flex: none;
  min-height: 1.5rem;
  padding: 0.15rem clamp(0.9rem, 2.5vw, 1.75rem);
  color: var(--ink-soft);
  font-size: 0.9rem;
  max-width: none;
}

.composer {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.7rem clamp(0.9rem, 2.5vw, 1.75rem) calc(0.7rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--paper);
}

.composer-main {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
}

.composer-input {
  flex: 1;
  min-height: 3.2rem;
  max-height: 11rem;
}

.composer.is-closed .composer-main,
.composer.is-closed .composer-note {
  display: none;
}

.voice-row,
.composer-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.composer-note {
  font-size: 0.82rem;
  max-width: none;
}

.hint {
  padding: 0.55rem 0.8rem;
  border-left: 3px solid var(--ink);
  background: var(--mist);
  max-width: none;
}

/* Sélecteur écrit / oral / mixte. */
.segmented {
  display: inline-flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  background: var(--surface);
  overflow: hidden;
}

.segmented label {
  position: relative;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.segmented span {
  display: block;
  padding: 0.4rem 0.8rem;
  min-height: 2.25rem;
}

.segmented label + label span {
  border-left: 1px solid var(--line);
}

.segmented input:checked + span {
  background: var(--ink);
  color: #fff;
}

.segmented input:disabled + span {
  color: var(--line-strong);
  cursor: not-allowed;
}

.segmented input:focus-visible + span {
  outline: 3px solid var(--clay);
  outline-offset: -3px;
}

/* ------------------------------------------------------------------ panneau des repères */

.markers {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0.95rem clamp(0.9rem, 2.5vw, 1.5rem) 2rem;
  border-left: 1px solid var(--line);
  overscroll-behavior: contain;
}

.markers > h2 {
  font-size: 1.05rem;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.panel-sub {
  margin-top: 0.3rem;
  color: var(--ink-soft);
  font-weight: 600;
}

.panel-status {
  color: var(--ink-soft);
}

.panel-foot {
  font-size: 0.85rem;
}

.obs-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.obs {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.65rem 0.8rem 0.75rem 0.9rem;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius-small);
  background: var(--surface);
}

.obs-interlocutor {
  border-left: 4px dashed var(--clay);
}

.obs-confirm {
  border-left: 4px dotted var(--confirm);
}

.obs-type {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--ink);
}

.obs-interlocutor .obs-type {
  color: var(--clay-ink);
}

.obs-confirm .obs-type {
  color: var(--confirm);
}

.obs-notion {
  font-size: 1rem;
}

/* La citation exacte : seul texte en caractères à empattements du panneau. */
.obs-quote {
  font-family: var(--serif);
  font-size: 1.02rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.obs-quote::before {
  content: open-quote;
}

.obs-quote::after {
  content: close-quote;
}

.obs-explanation,
.obs-effect {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.obs-by {
  font-weight: 600;
  color: var(--ink);
}

.obs-source {
  font-size: 0.8rem;
  color: var(--muted);
}

.obs-link {
  align-self: flex-start;
  font-size: 0.88rem;
}

.traces {
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
}

.trace {
  max-width: none;
  border-bottom: 1px solid var(--line);
}

.trace-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  padding: 0.5rem 0;
  flex-wrap: wrap;
}

.trace summary {
  cursor: pointer;
  list-style: none;
  align-items: center;
  justify-content: flex-start;
}

.trace summary .trace-state {
  margin-left: auto;
}

.trace details[open] {
  padding-bottom: 0.7rem;
}

.trace-name {
  font-weight: 600;
}

.trace-state {
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
}

.trace-state.has-trace {
  color: var(--ink);
  font-weight: 650;
}

.trace-state.has-trace::before {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--ink);
}

.notion-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.group-title {
  color: var(--ink-soft);
}

.notion {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.6rem 0 0.7rem;
  border-top: 1px solid var(--line);
  font-size: 0.93rem;
}

.notion h4 {
  line-height: 1.5;
}

.notion-effect,
.notion-pitfall {
  color: var(--ink-soft);
}

.notion-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 0 1.5rem;
}

.doc-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

/* ------------------------------------------------------------------ référentiel (fenêtre) */

.sheet {
  width: min(60rem, calc(100vw - 1.5rem));
  max-width: none;
  height: min(52rem, calc(100vh - 1.5rem));
  height: min(52rem, calc(100dvh - 1.5rem));
  max-height: none;
  padding: 0;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.sheet[open] {
  display: flex;
  flex-direction: column;
}

.sheet::backdrop {
  background: rgba(15, 36, 64, 0.5);
}

.sheet-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0.6rem 0.6rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.sheet-body {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 1rem 1.25rem 2rem;
}

.sheet-body > .lead {
  margin-bottom: 0.8rem;
  font-size: 1rem;
}

.sheet-body > .muted {
  margin-top: 0.8rem;
}

/* ------------------------------------------------------------------ fin de session */

.screen-end {
  max-width: 54rem;
}

.self-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--line);
}

.self-item legend {
  float: left;
  width: 100%;
  margin-bottom: 0.4rem;
  font-weight: 600;
  max-width: 72ch;
}

.radio-row {
  clear: both;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pill {
  position: relative;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.pill input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.pill span {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: 0.3rem 0.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}

.pill:hover span {
  border-color: var(--ink);
}

.pill input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.pill input:focus-visible + span {
  outline: 3px solid var(--clay);
  outline-offset: 2px;
}

.debrief h3,
.aar h3 {
  margin-top: 0.7rem;
}

.axis {
  padding: 0.7rem 0.9rem;
  border-left: 3px solid var(--clay);
  background: var(--surface);
}

.variant-text {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--line);
  font-family: var(--serif);
  font-size: 1.05rem;
}

.messages-static {
  flex: none;
  overflow: visible;
  padding: 0.3rem 0 0;
}

.msg-obs {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
  padding: 0.45rem 0 0;
  border-top: 1px solid var(--line-strong);
  list-style: none;
  font-size: 0.88rem;
}

.msg-obs q {
  font-family: var(--serif);
}

/* ------------------------------------------------------------------ écrans étroits */

@media (max-width: 56rem) {
  .brief-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .brief-side {
    padding-left: 0;
    border-left: 0;
  }

  .brief-side > .block:first-child {
    padding-top: 1rem;
    border-top: 1px solid var(--line);
  }

  /* Téléphone : une colonne à la fois, par onglets ; l'état de chaque onglet est conservé. */
  .workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
  }

  .tab {
    flex: 1;
    min-height: 2.75rem;
    padding: 0.4rem 0.6rem;
    border: 0;
    border-bottom: 3px solid transparent;
    background: none;
    color: var(--muted);
    font-weight: 650;
    cursor: pointer;
  }

  .tab[aria-selected="true"] {
    border-bottom-color: var(--clay);
    color: var(--ink);
  }

  .workspace[data-tab="conversation"] .markers,
  .workspace[data-tab="markers"] .conversation {
    display: none;
  }

  .workspace[data-tab="markers"][data-panel="closed"] .markers {
    display: flex;
  }

  .markers {
    border-left: 0;
  }

  .panel-toggle {
    display: none;
  }

  /* Téléphone : la place va aux messages. */
  body[data-view="chat"] #brand-text {
    display: none;
  }

  .conversation-head {
    gap: 0.1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.3rem;
  }

  .head-top {
    align-items: center;
  }

  .head-top h1 {
    font-size: 1.02rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .roles,
  .composer-note {
    display: none;
  }

  .recap > summary {
    padding: 0.45rem 0;
    font-size: 0.95rem;
  }

  .composer {
    gap: 0.45rem;
    padding-top: 0.55rem;
  }

  .composer-input {
    min-height: 2.9rem;
  }

  .composer-tools .btn {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }

  .msg {
    max-width: 94%;
  }

  .composer-main .btn span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .composer-main .btn {
    position: relative;
    min-width: 3rem;
  }

  .btn-talk {
    flex: 1;
  }
}

@media (max-height: 40rem) {
  .composer-note,
  .roles {
    display: none;
  }

  .composer-input {
    min-height: 2.6rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  .btn-talk.is-recording {
    box-shadow: 0 0 0 4px rgba(163, 38, 30, 0.35);
  }
}

@media (forced-colors: active) {
  .quote,
  .obs,
  .choice:has(input:checked) {
    forced-color-adjust: auto;
    border-color: CanvasText;
  }

  .segmented input:checked + span,
  .pill input:checked + span {
    background: Highlight;
    color: HighlightText;
  }
}

@media print {
  .topbar,
  .composer,
  .tabs,
  .btn,
  .skip-link {
    display: none !important;
  }

  body[data-view="chat"] {
    height: auto;
    overflow: visible;
  }

  .workspace,
  .messages,
  .markers {
    display: block;
    overflow: visible;
  }
}
